summaryrefslogtreecommitdiff
path: root/config/initializers
diff options
context:
space:
mode:
authorMitch Tishmack <mitch.tishmack@gmail.com>2013-05-22 13:51:08 -0500
committerMitch Tishmack <mitch.tishmack@gmail.com>2013-05-22 13:51:08 -0500
commit2c947647be5e4876b725112235eb70c415d76161 (patch)
treec96a3f4db5c5a062eb2b913b46e08a9c610f4a89 /config/initializers
parentc5de01f824ff640e1aebdf8b5058434766948a94 (diff)
downloadgitlab-ce-2c947647be5e4876b725112235eb70c415d76161.tar.gz
Add a new Settings.gitlab value "user_home".
Instead of assuming that the Settings.gitlab['user'] home directory is: /home/git Obtain the default value from Etc and use that if not set in config.yml.
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/1_settings.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 27605efddfe..664ca5c784a 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -58,6 +58,7 @@ Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'
+Settings.gitlab['user_home'] ||= Etc.getpwnam(Settings.gitlab['user']).dir
Settings.gitlab['signup_enabled'] ||= false
Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
Settings.gitlab['default_projects_features'] ||= {}
@@ -79,10 +80,10 @@ Settings.gravatar['ssl_url'] ||= 'https://secure.gravatar.com/avatar/%{hash}?
# GitLab Shell
#
Settings['gitlab_shell'] ||= Settingslogic.new({})
-Settings.gitlab_shell['hooks_path'] ||= '/home/git/gitlab-shell/hooks/'
+Settings.gitlab_shell['hooks_path'] ||= Settings.gitlab['user_home'] + '/gitlab-shell/hooks/'
Settings.gitlab_shell['receive_pack'] = true if Settings.gitlab_shell['receive_pack'].nil?
Settings.gitlab_shell['upload_pack'] = true if Settings.gitlab_shell['upload_pack'].nil?
-Settings.gitlab_shell['repos_path'] ||= '/home/git/repositories/'
+Settings.gitlab_shell['repos_path'] ||= Settings.gitlab['user_home'] + '/repositories/'
Settings.gitlab_shell['ssh_host'] ||= (Settings.gitlab.host || 'localhost')
Settings.gitlab_shell['ssh_port'] ||= 22
Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user