Commit a56cec113204130385e0fbc3f2223d81101357ef
1 parent
ad3a88cf
Exists in
master
and in
4 other branches
specify gitolite-admin owner in config
Showing
3 changed files
with
6 additions
and
12 deletions
Show diff stats
config/gitlab.yml.example
@@ -34,6 +34,7 @@ git_host: | @@ -34,6 +34,7 @@ git_host: | ||
34 | admin_uri: git@localhost:gitolite-admin | 34 | admin_uri: git@localhost:gitolite-admin |
35 | base_path: /home/git/repositories/ | 35 | base_path: /home/git/repositories/ |
36 | hooks_path: /home/git/.gitolite/hooks/ | 36 | hooks_path: /home/git/.gitolite/hooks/ |
37 | + gitolite_admin_key: gitlab | ||
37 | git_user: git | 38 | git_user: git |
38 | upload_pack: true | 39 | upload_pack: true |
39 | receive_pack: true | 40 | receive_pack: true |
config/initializers/1_settings.rb
@@ -102,6 +102,10 @@ class Settings < Settingslogic | @@ -102,6 +102,10 @@ class Settings < Settingslogic | ||
102 | git_host['admin_uri'] || 'git@localhost:gitolite-admin' | 102 | git_host['admin_uri'] || 'git@localhost:gitolite-admin' |
103 | end | 103 | end |
104 | 104 | ||
105 | + def gitolite_admin_key | ||
106 | + git_host['gitolite_admin_key'] || 'gitlab' | ||
107 | + end | ||
108 | + | ||
105 | def default_projects_limit | 109 | def default_projects_limit |
106 | app['default_projects_limit'] || 10 | 110 | app['default_projects_limit'] || 10 |
107 | end | 111 | end |
lib/gitlab/backend/gitolite_config.rb
@@ -148,18 +148,7 @@ module Gitlab | @@ -148,18 +148,7 @@ module Gitlab | ||
148 | # Enable access to all repos for gitolite admin. | 148 | # Enable access to all repos for gitolite admin. |
149 | # We use it for accept merge request feature | 149 | # We use it for accept merge request feature |
150 | def admin_all_repo | 150 | def admin_all_repo |
151 | - owner_name = "" | ||
152 | - | ||
153 | - # Read gitolite-admin user | ||
154 | - # | ||
155 | - begin | ||
156 | - repo = conf.get_repo("gitolite-admin") | ||
157 | - owner_name = repo.permissions[0]["RW+"][""][0] | ||
158 | - raise StandardError if owner_name.blank? | ||
159 | - rescue => ex | ||
160 | - puts "Can't determine gitolite-admin owner".red | ||
161 | - raise StandardError | ||
162 | - end | 151 | + owner_name = Gitlab.settings.gitolite_admin_key |
163 | 152 | ||
164 | # @ALL repos premission for gitolite owner | 153 | # @ALL repos premission for gitolite owner |
165 | repo_name = "@all" | 154 | repo_name = "@all" |