Skip to content

Commit b5f116f

Browse files
committed
Add a check whether repos_path is a symlink
1 parent b7314a1 commit b5f116f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

config/gitlab.yml.example

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ backup:
9292
## Gitolite settings
9393
gitolite:
9494
admin_uri: git@localhost:gitolite-admin
95+
# repos_path must not be a symlink
9596
repos_path: /home/git/repositories/
9697
hooks_path: /home/git/.gitolite/hooks/
9798
admin_key: gitlab

lib/tasks/gitlab/check.rake

+21
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ namespace :gitlab do
398398
check_dot_gitolite_user_and_group
399399
check_dot_gitolite_permissions
400400
check_repo_base_exists
401+
check_repo_base_is_not_symlink
401402
check_repo_base_user_and_group
402403
check_repo_base_permissions
403404
check_can_clone_gitolite_admin
@@ -692,6 +693,26 @@ namespace :gitlab do
692693
end
693694
end
694695

696+
def check_repo_base_is_not_symlink
697+
print "Repo base directory is a symlink? ... "
698+
699+
repo_base_path = Gitlab.config.gitolite.repos_path
700+
unless File.exists?(repo_base_path)
701+
puts "can't check because of previous errors".magenta
702+
return
703+
end
704+
705+
unless File.symlink?(repo_base_path)
706+
puts "no".green
707+
else
708+
puts "yes".red
709+
try_fixing_it(
710+
"Make sure it's set to the real directory in config/gitlab.yml"
711+
)
712+
fix_and_rerun
713+
end
714+
end
715+
695716
def check_repo_base_permissions
696717
print "Repo base access is drwsrws---? ... "
697718

0 commit comments

Comments
 (0)