diff options
author | Jaakko Kantojärvi <jaakko@n-1.fi> | 2013-09-13 13:56:10 +0300 |
---|---|---|
committer | Jaakko Kantojärvi <jaakko@n-1.fi> | 2013-09-13 13:56:10 +0300 |
commit | 3f5136454dce6663d281f53121242de04b137c2a (patch) | |
tree | 1a5e53af4558d30f5aa0881b42edce91884c2cf9 | |
parent | 2c238b717e86069aca485fae7a733135970b56a2 (diff) | |
download | gitlab-shell-3f5136454dce6663d281f53121242de04b137c2a.tar.gz |
Replace build in home folder with environment
You can't ever assume that user's home is /home/$USERNAME or /home/git
Preferable is to assume that user running gitlab-shell has repositories in his home (get from the environment).
-rw-r--r-- | lib/gitlab_config.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab_config.rb b/lib/gitlab_config.rb index 9dc5c66..6d43ca9 100644 --- a/lib/gitlab_config.rb +++ b/lib/gitlab_config.rb @@ -7,12 +7,16 @@ class GitlabConfig @config = YAML.load_file(File.join(ROOT_PATH, 'config.yml')) end + def home + ENV['HOME'] + end + def repos_path - @config['repos_path'] ||= "/home/git/repositories" + @config['repos_path'] ||= File.join(home, "repositories") end def auth_file - @config['auth_file'] ||= "/home/git/.ssh/authorized_keys" + @config['auth_file'] ||= File.join(home, ".ssh/authorized_keys") end def gitlab_url |