Commit 1d543e64300666e2abc5cc8562e6b55458878801
1 parent
9b337b83
Exists in
master
and in
4 other branches
Finished with configs
Showing
5 changed files
with
32 additions
and
11 deletions
Show diff stats
app/controllers/admin/users_controller.rb
| ... | ... | @@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController |
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | def new |
| 37 | - @admin_user = User.new(:projects_limit => GITLAB_OPTS["default_projects_limit"]) | |
| 37 | + @admin_user = User.new(:projects_limit => Gitlab.config.default_projects_limit) | |
| 38 | 38 | end |
| 39 | 39 | |
| 40 | 40 | def edit | ... | ... |
config/gitlab.yml.example
| ... | ... | @@ -2,6 +2,10 @@ |
| 2 | 2 | # Gitlab application config file # |
| 3 | 3 | # # # # # # # # # # # # # # # # # # |
| 4 | 4 | |
| 5 | +# | |
| 6 | +# 1. Common settings | |
| 7 | +# ========================== | |
| 8 | + | |
| 5 | 9 | # Web application specific settings |
| 6 | 10 | web: |
| 7 | 11 | host: localhost |
| ... | ... | @@ -13,11 +17,21 @@ web: |
| 13 | 17 | email: |
| 14 | 18 | from: notify@localhost |
| 15 | 19 | |
| 20 | +# Application specific settings | |
| 21 | +# Like default project limit for user etc | |
| 22 | +app: | |
| 23 | + default_projects_limit: 10 | |
| 24 | + | |
| 25 | + | |
| 26 | +# | |
| 27 | +# 2. Advanced settings: | |
| 28 | +# ========================== | |
| 29 | + | |
| 16 | 30 | # Git Hosting configuration |
| 17 | 31 | git_host: |
| 18 | 32 | admin_uri: git@localhost:gitolite-admin |
| 19 | 33 | base_path: /home/git/repositories/ |
| 20 | - host: localhost | |
| 34 | + # host: localhost | |
| 21 | 35 | git_user: git |
| 22 | 36 | upload_pack: true |
| 23 | 37 | receive_pack: true |
| ... | ... | @@ -33,7 +47,3 @@ git: |
| 33 | 47 | git_max_size: 5242880 # 5.megabytes |
| 34 | 48 | # Git timeout to read commit, in seconds |
| 35 | 49 | git_timeout: 10 |
| 36 | - | |
| 37 | -# Gitlab settings | |
| 38 | -gitlab: | |
| 39 | - default_projects_limit: 10 | ... | ... |
config/initializers/1_settings.rb
| ... | ... | @@ -33,7 +33,7 @@ class Settings < Settingslogic |
| 33 | 33 | end |
| 34 | 34 | |
| 35 | 35 | def ssh_host |
| 36 | - git_host['host'] || 'localhost' | |
| 36 | + git_host['host'] || web_host || 'localhost' | |
| 37 | 37 | end |
| 38 | 38 | |
| 39 | 39 | def ssh_path |
| ... | ... | @@ -49,11 +49,19 @@ class Settings < Settingslogic |
| 49 | 49 | end |
| 50 | 50 | |
| 51 | 51 | def git_upload_pack |
| 52 | - git_host['upload_pack'] || true | |
| 52 | + if git_host['upload_pack'] == false | |
| 53 | + false | |
| 54 | + else | |
| 55 | + true | |
| 56 | + end | |
| 53 | 57 | end |
| 54 | 58 | |
| 55 | 59 | def git_receive_pack |
| 56 | - git_host['receive_pack'] || true | |
| 60 | + if git_host['receive_pack'] == false | |
| 61 | + false | |
| 62 | + else | |
| 63 | + true | |
| 64 | + end | |
| 57 | 65 | end |
| 58 | 66 | |
| 59 | 67 | def git_bin_path |
| ... | ... | @@ -71,5 +79,9 @@ class Settings < Settingslogic |
| 71 | 79 | def gitolite_admin_uri |
| 72 | 80 | git['admin_uri'] || 'git@localhost:gitolite-admin' |
| 73 | 81 | end |
| 82 | + | |
| 83 | + def default_projects_limit | |
| 84 | + app['default_projects_limit'] || 10 | |
| 85 | + end | |
| 74 | 86 | end |
| 75 | 87 | end | ... | ... |
lib/gitlab/gitolite.rb
lib/tasks/gitlab/status.rake