diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-29 23:28:17 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-29 23:28:17 -0700 |
commit | c698bc7d9e27c2fcf2f9b01b50ee35fed33fd564 (patch) | |
tree | e88fd00df668ff50d8a0847a5c6f8ab9576fee05 /config | |
parent | cd5685ca8ce14ff4dbff6ada5e5a8b90808ae3d1 (diff) | |
parent | 719f72315f6242a71d8b1fb3eeffc233034a9643 (diff) | |
download | gitlab-ce-c698bc7d9e27c2fcf2f9b01b50ee35fed33fd564.tar.gz |
Merge pull request #4037 from mitchty/master
Remove user directory path assumptions
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/1_settings.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index f85b80f5b79..4afe50f1814 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -60,6 +60,11 @@ 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'] ||= begin + Etc.getpwnam(Settings.gitlab['user']).dir +rescue ArgumentError # no user configured + '/home/' + Settings.gitlab['user'] +end Settings.gitlab['signup_enabled'] ||= false Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil? Settings.gitlab['default_projects_features'] ||= {} @@ -81,10 +86,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 |