Commit 3f513645 authored by Jaakko Kantojärvi's avatar Jaakko Kantojärvi

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).
parent 2c238b71
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment