Commit 2c947647be5e4876b725112235eb70c415d76161

Authored by Mitch Tishmack
1 parent c5de01f8

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.
Showing 1 changed file with 3 additions and 2 deletions   Show diff stats
config/initializers/1_settings.rb
... ... @@ -58,6 +58,7 @@ Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
58 58 Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
59 59 Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
60 60 Settings.gitlab['user'] ||= 'git'
  61 +Settings.gitlab['user_home'] ||= Etc.getpwnam(Settings.gitlab['user']).dir
61 62 Settings.gitlab['signup_enabled'] ||= false
62 63 Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
63 64 Settings.gitlab['default_projects_features'] ||= {}
... ... @@ -79,10 +80,10 @@ Settings.gravatar['ssl_url'] ||= 'https://secure.gravatar.com/avatar/%{hash}?
79 80 # GitLab Shell
80 81 #
81 82 Settings['gitlab_shell'] ||= Settingslogic.new({})
82   -Settings.gitlab_shell['hooks_path'] ||= '/home/git/gitlab-shell/hooks/'
  83 +Settings.gitlab_shell['hooks_path'] ||= Settings.gitlab['user_home'] + '/gitlab-shell/hooks/'
83 84 Settings.gitlab_shell['receive_pack'] = true if Settings.gitlab_shell['receive_pack'].nil?
84 85 Settings.gitlab_shell['upload_pack'] = true if Settings.gitlab_shell['upload_pack'].nil?
85   -Settings.gitlab_shell['repos_path'] ||= '/home/git/repositories/'
  86 +Settings.gitlab_shell['repos_path'] ||= Settings.gitlab['user_home'] + '/repositories/'
86 87 Settings.gitlab_shell['ssh_host'] ||= (Settings.gitlab.host || 'localhost')
87 88 Settings.gitlab_shell['ssh_port'] ||= 22
88 89 Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user
... ...