Commit 4d0af232da7df8c4a33b9f2e44933f1f3d2527bc
1 parent
a213d4b9
Exists in
master
and in
4 other branches
Make method names clearer in check.rake
Showing
1 changed file
with
8 additions
and
9 deletions
Show diff stats
lib/tasks/gitlab/check.rake
| @@ -317,7 +317,7 @@ namespace :gitlab do | @@ -317,7 +317,7 @@ namespace :gitlab do | ||
| 317 | gitolite_ssh_user = Gitlab.config.gitolite.ssh_user | 317 | gitolite_ssh_user = Gitlab.config.gitolite.ssh_user |
| 318 | print "Has no \"-e\" in ~#{gitolite_ssh_user}/.profile ... " | 318 | print "Has no \"-e\" in ~#{gitolite_ssh_user}/.profile ... " |
| 319 | 319 | ||
| 320 | - profile_file = File.join(gitolite_home, ".profile") | 320 | + profile_file = File.join(gitolite_user_home, ".profile") |
| 321 | 321 | ||
| 322 | unless File.read(profile_file) =~ /^-e PATH/ | 322 | unless File.read(profile_file) =~ /^-e PATH/ |
| 323 | puts "yes".green | 323 | puts "yes".green |
| @@ -475,7 +475,7 @@ namespace :gitlab do | @@ -475,7 +475,7 @@ namespace :gitlab do | ||
| 475 | def check_dot_gitolite_exists | 475 | def check_dot_gitolite_exists |
| 476 | print "Config directory exists? ... " | 476 | print "Config directory exists? ... " |
| 477 | 477 | ||
| 478 | - gitolite_config_path = File.join(gitolite_home, ".gitolite") | 478 | + gitolite_config_path = File.join(gitolite_user_home, ".gitolite") |
| 479 | 479 | ||
| 480 | if File.directory?(gitolite_config_path) | 480 | if File.directory?(gitolite_config_path) |
| 481 | puts "yes".green | 481 | puts "yes".green |
| @@ -496,7 +496,7 @@ namespace :gitlab do | @@ -496,7 +496,7 @@ namespace :gitlab do | ||
| 496 | def check_dot_gitolite_permissions | 496 | def check_dot_gitolite_permissions |
| 497 | print "Config directory access is drwxr-x---? ... " | 497 | print "Config directory access is drwxr-x---? ... " |
| 498 | 498 | ||
| 499 | - gitolite_config_path = File.join(gitolite_home, ".gitolite") | 499 | + gitolite_config_path = File.join(gitolite_user_home, ".gitolite") |
| 500 | unless File.exists?(gitolite_config_path) | 500 | unless File.exists?(gitolite_config_path) |
| 501 | puts "can't check because of previous errors".magenta | 501 | puts "can't check because of previous errors".magenta |
| 502 | return | 502 | return |
| @@ -520,7 +520,7 @@ namespace :gitlab do | @@ -520,7 +520,7 @@ namespace :gitlab do | ||
| 520 | gitolite_ssh_user = Gitlab.config.gitolite.ssh_user | 520 | gitolite_ssh_user = Gitlab.config.gitolite.ssh_user |
| 521 | print "Config directory owned by #{gitolite_ssh_user}:#{gitolite_ssh_user} ... " | 521 | print "Config directory owned by #{gitolite_ssh_user}:#{gitolite_ssh_user} ... " |
| 522 | 522 | ||
| 523 | - gitolite_config_path = File.join(gitolite_home, ".gitolite") | 523 | + gitolite_config_path = File.join(gitolite_user_home, ".gitolite") |
| 524 | unless File.exists?(gitolite_config_path) | 524 | unless File.exists?(gitolite_config_path) |
| 525 | puts "can't check because of previous errors".magenta | 525 | puts "can't check because of previous errors".magenta |
| 526 | return | 526 | return |
| @@ -559,7 +559,7 @@ namespace :gitlab do | @@ -559,7 +559,7 @@ namespace :gitlab do | ||
| 559 | end | 559 | end |
| 560 | 560 | ||
| 561 | def check_gitoliterc_git_config_keys | 561 | def check_gitoliterc_git_config_keys |
| 562 | - gitoliterc_path = File.join(gitolite_home, ".gitolite.rc") | 562 | + gitoliterc_path = File.join(gitolite_user_home, ".gitolite.rc") |
| 563 | 563 | ||
| 564 | print "Allow all Git config keys in .gitolite.rc ... " | 564 | print "Allow all Git config keys in .gitolite.rc ... " |
| 565 | option_name = if has_gitolite3? | 565 | option_name = if has_gitolite3? |
| @@ -588,7 +588,7 @@ namespace :gitlab do | @@ -588,7 +588,7 @@ namespace :gitlab do | ||
| 588 | end | 588 | end |
| 589 | 589 | ||
| 590 | def check_gitoliterc_repo_umask | 590 | def check_gitoliterc_repo_umask |
| 591 | - gitoliterc_path = File.join(gitolite_home, ".gitolite.rc") | 591 | + gitoliterc_path = File.join(gitolite_user_home, ".gitolite.rc") |
| 592 | 592 | ||
| 593 | print "Repo umask is 0007 in .gitolite.rc? ... " | 593 | print "Repo umask is 0007 in .gitolite.rc? ... " |
| 594 | option_name = if has_gitolite3? | 594 | option_name = if has_gitolite3? |
| @@ -726,7 +726,6 @@ namespace :gitlab do | @@ -726,7 +726,6 @@ namespace :gitlab do | ||
| 726 | puts "yes".green | 726 | puts "yes".green |
| 727 | else | 727 | else |
| 728 | puts "no".red | 728 | puts "no".red |
| 729 | - puts "#{repo_base_path} is not writable".red | ||
| 730 | try_fixing_it( | 729 | try_fixing_it( |
| 731 | "sudo chmod -R ug+rwXs,o-rwx #{repo_base_path}" | 730 | "sudo chmod -R ug+rwXs,o-rwx #{repo_base_path}" |
| 732 | ) | 731 | ) |
| @@ -852,12 +851,12 @@ namespace :gitlab do | @@ -852,12 +851,12 @@ namespace :gitlab do | ||
| 852 | # Helper methods | 851 | # Helper methods |
| 853 | ######################## | 852 | ######################## |
| 854 | 853 | ||
| 855 | - def gitolite_home | 854 | + def gitolite_user_home |
| 856 | File.expand_path("~#{Gitlab.config.gitolite.ssh_user}") | 855 | File.expand_path("~#{Gitlab.config.gitolite.ssh_user}") |
| 857 | end | 856 | end |
| 858 | 857 | ||
| 859 | def gitolite_version | 858 | def gitolite_version |
| 860 | - gitolite_version_file = "#{gitolite_home}/gitolite/src/VERSION" | 859 | + gitolite_version_file = "#{gitolite_user_home}/gitolite/src/VERSION" |
| 861 | if File.readable?(gitolite_version_file) | 860 | if File.readable?(gitolite_version_file) |
| 862 | File.read(gitolite_version_file) | 861 | File.read(gitolite_version_file) |
| 863 | end | 862 | end |