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,7 +34,7 @@ class Admin::UsersController < ApplicationController | ||
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | def new | 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 | end | 38 | end |
| 39 | 39 | ||
| 40 | def edit | 40 | def edit |
config/gitlab.yml.example
| @@ -2,6 +2,10 @@ | @@ -2,6 +2,10 @@ | ||
| 2 | # Gitlab application config file # | 2 | # Gitlab application config file # |
| 3 | # # # # # # # # # # # # # # # # # # | 3 | # # # # # # # # # # # # # # # # # # |
| 4 | 4 | ||
| 5 | +# | ||
| 6 | +# 1. Common settings | ||
| 7 | +# ========================== | ||
| 8 | + | ||
| 5 | # Web application specific settings | 9 | # Web application specific settings |
| 6 | web: | 10 | web: |
| 7 | host: localhost | 11 | host: localhost |
| @@ -13,11 +17,21 @@ web: | @@ -13,11 +17,21 @@ web: | ||
| 13 | email: | 17 | email: |
| 14 | from: notify@localhost | 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 | # Git Hosting configuration | 30 | # Git Hosting configuration |
| 17 | git_host: | 31 | git_host: |
| 18 | admin_uri: git@localhost:gitolite-admin | 32 | admin_uri: git@localhost:gitolite-admin |
| 19 | base_path: /home/git/repositories/ | 33 | base_path: /home/git/repositories/ |
| 20 | - host: localhost | 34 | + # host: localhost |
| 21 | git_user: git | 35 | git_user: git |
| 22 | upload_pack: true | 36 | upload_pack: true |
| 23 | receive_pack: true | 37 | receive_pack: true |
| @@ -33,7 +47,3 @@ git: | @@ -33,7 +47,3 @@ git: | ||
| 33 | git_max_size: 5242880 # 5.megabytes | 47 | git_max_size: 5242880 # 5.megabytes |
| 34 | # Git timeout to read commit, in seconds | 48 | # Git timeout to read commit, in seconds |
| 35 | git_timeout: 10 | 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,7 +33,7 @@ class Settings < Settingslogic | ||
| 33 | end | 33 | end |
| 34 | 34 | ||
| 35 | def ssh_host | 35 | def ssh_host |
| 36 | - git_host['host'] || 'localhost' | 36 | + git_host['host'] || web_host || 'localhost' |
| 37 | end | 37 | end |
| 38 | 38 | ||
| 39 | def ssh_path | 39 | def ssh_path |
| @@ -49,11 +49,19 @@ class Settings < Settingslogic | @@ -49,11 +49,19 @@ class Settings < Settingslogic | ||
| 49 | end | 49 | end |
| 50 | 50 | ||
| 51 | def git_upload_pack | 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 | end | 57 | end |
| 54 | 58 | ||
| 55 | def git_receive_pack | 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 | end | 65 | end |
| 58 | 66 | ||
| 59 | def git_bin_path | 67 | def git_bin_path |
| @@ -71,5 +79,9 @@ class Settings < Settingslogic | @@ -71,5 +79,9 @@ class Settings < Settingslogic | ||
| 71 | def gitolite_admin_uri | 79 | def gitolite_admin_uri |
| 72 | git['admin_uri'] || 'git@localhost:gitolite-admin' | 80 | git['admin_uri'] || 'git@localhost:gitolite-admin' |
| 73 | end | 81 | end |
| 82 | + | ||
| 83 | + def default_projects_limit | ||
| 84 | + app['default_projects_limit'] || 10 | ||
| 85 | + end | ||
| 74 | end | 86 | end |
| 75 | end | 87 | end |
lib/gitlab/gitolite.rb
| @@ -33,7 +33,7 @@ module Gitlab | @@ -33,7 +33,7 @@ module Gitlab | ||
| 33 | end | 33 | end |
| 34 | 34 | ||
| 35 | def configure | 35 | def configure |
| 36 | - Timeout::timeout(20) do | 36 | + Timeout::timeout(30) do |
| 37 | File.open(File.join(Rails.root, 'tmp', "gitlabhq-gitolite.lock"), "w+") do |f| | 37 | File.open(File.join(Rails.root, 'tmp', "gitlabhq-gitolite.lock"), "w+") do |f| |
| 38 | begin | 38 | begin |
| 39 | f.flock(File::LOCK_EX) | 39 | f.flock(File::LOCK_EX) |
lib/tasks/gitlab/status.rake
| @@ -21,7 +21,6 @@ namespace :gitlab do | @@ -21,7 +21,6 @@ namespace :gitlab do | ||
| 21 | return | 21 | return |
| 22 | end | 22 | end |
| 23 | 23 | ||
| 24 | - GIT_HOST = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git_host"] | ||
| 25 | print "#{git_base_path}............" | 24 | print "#{git_base_path}............" |
| 26 | if File.exists?(git_base_path) | 25 | if File.exists?(git_base_path) |
| 27 | puts "exists".green | 26 | puts "exists".green |