Remove hardcoded refernce to gitlab-shell home. so that gitlab can be installed on any unix account other than git

This commit is contained in:
Bhagavan Das 2013-02-14 23:10:18 +00:00
parent 08dfbc962b
commit 4bc7d98d65
2 changed files with 13 additions and 7 deletions

View file

@ -25,12 +25,13 @@ namespace :gitlab do
def setup
warn_user_is_not_gitlab
gitlab_shell_authorized_keys = File.join(File.expand_path("~#{Gitlab.config.gitlab_shell.ssh_user}"),'.ssh/authorized_keys')
puts "This will rebuild an authorized_keys file."
puts "You will lose any data stored in /home/git/.ssh/authorized_keys."
puts "You will lose any data stored in #{gitlab_shell_authorized_keys}."
ask_to_continue
puts ""
system("echo '# Managed by gitlab-shell' > /home/git/.ssh/authorized_keys")
system("echo '# Managed by gitlab-shell' > #{gitlab_shell_authorized_keys}")
Key.find_each(batch_size: 1000) do |key|
if Gitlab::Shell.new.add_key(key.shell_id, key.key)