Finished with configs

This commit is contained in:
randx 2012-07-02 21:59:48 +03:00
parent 9b337b8328
commit 1d543e6430
5 changed files with 32 additions and 11 deletions

View file

@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController
def new def new
@admin_user = User.new(:projects_limit => GITLAB_OPTS["default_projects_limit"]) @admin_user = User.new(:projects_limit => Gitlab.config.default_projects_limit)
end end
def edit def edit

View file

@ -2,6 +2,10 @@
# Gitlab application config file # # Gitlab application config file #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# 1. Common settings
# ==========================
# Web application specific settings # Web application specific settings
web: web:
host: localhost host: localhost
@ -13,11 +17,21 @@ web:
email: email:
from: notify@localhost from: notify@localhost
# Application specific settings
# Like default project limit for user etc
app:
default_projects_limit: 10
#
# 2. Advanced settings:
# ==========================
# Git Hosting configuration # Git Hosting configuration
git_host: git_host:
admin_uri: git@localhost:gitolite-admin admin_uri: git@localhost:gitolite-admin
base_path: /home/git/repositories/ base_path: /home/git/repositories/
host: localhost # host: localhost
git_user: git git_user: git
upload_pack: true upload_pack: true
receive_pack: true receive_pack: true
@ -33,7 +47,3 @@ git:
git_max_size: 5242880 # 5.megabytes git_max_size: 5242880 # 5.megabytes
# Git timeout to read commit, in seconds # Git timeout to read commit, in seconds
git_timeout: 10 git_timeout: 10
# Gitlab settings
gitlab:
default_projects_limit: 10

View file

@ -33,7 +33,7 @@ class Settings < Settingslogic
end end
def ssh_host def ssh_host
git_host['host'] || 'localhost' git_host['host'] || web_host || 'localhost'
end end
def ssh_path def ssh_path
@ -49,11 +49,19 @@ class Settings < Settingslogic
end end
def git_upload_pack def git_upload_pack
git_host['upload_pack'] || true if git_host['upload_pack'] == false
false
else
true
end
end end
def git_receive_pack def git_receive_pack
git_host['receive_pack'] || true if git_host['receive_pack'] == false
false
else
true
end
end end
def git_bin_path def git_bin_path
@ -71,5 +79,9 @@ class Settings < Settingslogic
def gitolite_admin_uri def gitolite_admin_uri
git['admin_uri'] || 'git@localhost:gitolite-admin' git['admin_uri'] || 'git@localhost:gitolite-admin'
end end
def default_projects_limit
app['default_projects_limit'] || 10
end
end end
end end

View file

@ -33,7 +33,7 @@ module Gitlab
end end
def configure def configure
Timeout::timeout(20) do Timeout::timeout(30) do
File.open(File.join(Rails.root, 'tmp', "gitlabhq-gitolite.lock"), "w+") do |f| File.open(File.join(Rails.root, 'tmp', "gitlabhq-gitolite.lock"), "w+") do |f|
begin begin
f.flock(File::LOCK_EX) f.flock(File::LOCK_EX)

View file

@ -21,7 +21,6 @@ namespace :gitlab do
return return
end end
GIT_HOST = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git_host"]
print "#{git_base_path}............" print "#{git_base_path}............"
if File.exists?(git_base_path) if File.exists?(git_base_path)
puts "exists".green puts "exists".green