summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2013-01-07 19:39:15 +0100
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2013-01-07 21:20:20 +0100
commitb5f116f08bfd02f87b819411f89d93c711411c90 (patch)
tree28c007f32c604470233646d19900ba08d4807dd2
parentb7314a1687cf67bc8b74f652e44d9b0cb92d4826 (diff)
downloadgitlab-ce-b5f116f08bfd02f87b819411f89d93c711411c90.tar.gz
Add a check whether repos_path is a symlink
-rw-r--r--config/gitlab.yml.example1
-rw-r--r--lib/tasks/gitlab/check.rake21
2 files changed, 22 insertions, 0 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 5546632cb7f..76dc6214088 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -92,6 +92,7 @@ backup:
## Gitolite settings
gitolite:
admin_uri: git@localhost:gitolite-admin
+ # repos_path must not be a symlink
repos_path: /home/git/repositories/
hooks_path: /home/git/.gitolite/hooks/
admin_key: gitlab
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake
index 72330440dbf..494d756b794 100644
--- a/lib/tasks/gitlab/check.rake
+++ b/lib/tasks/gitlab/check.rake
@@ -398,6 +398,7 @@ namespace :gitlab do
check_dot_gitolite_user_and_group
check_dot_gitolite_permissions
check_repo_base_exists
+ check_repo_base_is_not_symlink
check_repo_base_user_and_group
check_repo_base_permissions
check_can_clone_gitolite_admin
@@ -692,6 +693,26 @@ namespace :gitlab do
end
end
+ def check_repo_base_is_not_symlink
+ print "Repo base directory is a symlink? ... "
+
+ repo_base_path = Gitlab.config.gitolite.repos_path
+ unless File.exists?(repo_base_path)
+ puts "can't check because of previous errors".magenta
+ return
+ end
+
+ unless File.symlink?(repo_base_path)
+ puts "no".green
+ else
+ puts "yes".red
+ try_fixing_it(
+ "Make sure it's set to the real directory in config/gitlab.yml"
+ )
+ fix_and_rerun
+ end
+ end
+
def check_repo_base_permissions
print "Repo base access is drwsrws---? ... "