Commit b5f116f08bfd02f87b819411f89d93c711411c90
1 parent
b7314a16
Exists in
master
and in
4 other branches
Add a check whether repos_path is a symlink
Showing
2 changed files
with
22 additions
and
0 deletions
Show diff stats
config/gitlab.yml.example
lib/tasks/gitlab/check.rake
| ... | ... | @@ -398,6 +398,7 @@ namespace :gitlab do |
| 398 | 398 | check_dot_gitolite_user_and_group |
| 399 | 399 | check_dot_gitolite_permissions |
| 400 | 400 | check_repo_base_exists |
| 401 | + check_repo_base_is_not_symlink | |
| 401 | 402 | check_repo_base_user_and_group |
| 402 | 403 | check_repo_base_permissions |
| 403 | 404 | check_can_clone_gitolite_admin |
| ... | ... | @@ -692,6 +693,26 @@ namespace :gitlab do |
| 692 | 693 | end |
| 693 | 694 | end |
| 694 | 695 | |
| 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 | + | |
| 695 | 716 | def check_repo_base_permissions |
| 696 | 717 | print "Repo base access is drwsrws---? ... " |
| 697 | 718 | ... | ... |