Commit 18f83016b15a1ad388ccb85a6e0878e7f5f14527

Authored by randx
1 parent c27105f8

Fixed persmission issue in doc. Added validation of hooks in gitlab:app:status

app/assets/stylesheets/gitlab_bootstrap.scss
@@ -74,10 +74,6 @@ h5 { @@ -74,10 +74,6 @@ h5 {
74 font-size:14px; 74 font-size:14px;
75 } 75 }
76 76
77 -code {  
78 - background:#FCEEC1;  
79 - color:$style_color;  
80 -}  
81 77
82 table { 78 table {
83 width:100%; 79 width:100%;
app/assets/stylesheets/sections/commits.scss
@@ -194,4 +194,9 @@ @@ -194,4 +194,9 @@
194 float:right; 194 float:right;
195 @extend .cgray; 195 @extend .cgray;
196 } 196 }
  197 +
  198 + code {
  199 + background:#FCEEC1;
  200 + color:$style_color;
  201 + }
197 } 202 }
app/views/errors/gitolite.html.haml
1 .alert-message.block-message.error 1 .alert-message.block-message.error
2 %h3 Gitolite Error 2 %h3 Gitolite Error
3 - %hr  
4 %h4 Application cant get access to your gitolite system. 3 %h4 Application cant get access to your gitolite system.
5 - %ol  
6 - %li  
7 - %p  
8 - Check 'config/gitlab.yml' for correct settings.  
9 - %li  
10 - %p  
11 - Make sure web server user has access to gitolite.  
12 - %a{:href => "https://github.com/gitlabhq/gitlabhq/wiki/Gitolite"} Setup tutorial  
13 - %li  
14 - %p  
15 - Try: 4 +
  5 +
  6 +
  7 +
  8 +%h4 Tips for Administrator:
  9 +
  10 +%ul
  11 + %li
  12 + %p
  13 + Check git logs in admin area
  14 + %li
  15 + %p
  16 + Check config/gitlab.yml for correct settings.
  17 + %li
  18 + %p
  19 + Diagnostic tool:
16 %pre 20 %pre
17 - = preserve do  
18 - sudo chmod -R 770 /home/git/repositories/  
19 - sudo chown -R git:git /home/git/repositories/ 21 + bundle exec rake gitlab:app:status RAILS_ENV=production
  22 + %li
  23 + %p
  24 + Permissions:
  25 + %pre
  26 + = preserve do
  27 + sudo chmod -R 770 /home/git/repositories/
  28 + sudo chown -R git:git /home/git/repositories/
  29 + sudo chown gitlab:gitlab /home/git/repositories/**/hooks/post-receive
  30 +
doc/installation.md
@@ -119,6 +119,7 @@ Permissions: @@ -119,6 +119,7 @@ Permissions:
119 119
120 sudo chmod -R g+rwX /home/git/repositories/ 120 sudo chmod -R g+rwX /home/git/repositories/
121 sudo chown -R git:git /home/git/repositories/ 121 sudo chown -R git:git /home/git/repositories/
  122 + sudo chown gitlab:gitlab /home/git/repositories/**/hooks/post-receive
122 123
123 #### CHECK: Logout & login again to apply git group to your user 124 #### CHECK: Logout & login again to apply git group to your user
124 125
lib/tasks/gitlab/status.rake
@@ -2,7 +2,7 @@ namespace :gitlab do @@ -2,7 +2,7 @@ namespace :gitlab do
2 namespace :app do 2 namespace :app do
3 desc "GITLAB | Check gitlab installation status" 3 desc "GITLAB | Check gitlab installation status"
4 task :status => :environment do 4 task :status => :environment do
5 - puts "Starting diagnostic" 5 + puts "Starting diagnostic".yellow
6 git_base_path = Gitlab.config.git_base_path 6 git_base_path = Gitlab.config.git_base_path
7 7
8 print "config/database.yml............" 8 print "config/database.yml............"
@@ -56,7 +56,28 @@ namespace :gitlab do @@ -56,7 +56,28 @@ namespace :gitlab do
56 return 56 return
57 end 57 end
58 58
59 - puts "\nFinished" 59 + if Project.count > 0
  60 + puts "Validating projects repositories:".yellow
  61 + Project.find_each(:batch_size => 100) do |project|
  62 + print "#{project.name}....."
  63 + hook_file = File.join(project.path_to_repo, 'hooks','post-receive')
  64 +
  65 + unless File.exists?(hook_file)
  66 + puts "post-receive file missing".red
  67 + next
  68 + end
  69 +
  70 +
  71 + unless File.owned?(hook_file)
  72 + puts "post-receive file is not owner by gitlab".red
  73 + next
  74 + end
  75 +
  76 + puts "post-reveice file ok".green
  77 + end
  78 + end
  79 +
  80 + puts "\nFinished".blue
60 end 81 end
61 end 82 end
62 end 83 end