diff options
Diffstat (limited to 'lib/tasks/gitlab/shell.rake')
-rw-r--r-- | lib/tasks/gitlab/shell.rake | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index 11d4eacaa69..0d7a390bc92 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -25,15 +25,14 @@ 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') unless ENV['force'] == 'yes' puts "This will rebuild an authorized_keys file." - puts "You will lose any data stored in #{gitlab_shell_authorized_keys}." + puts "You will lose any data stored in authorized_keys file." ask_to_continue puts "" end - system("echo '# Managed by gitlab-shell' > #{gitlab_shell_authorized_keys}") + Gitlab::Shell.new.remove_all_keys Key.find_each(batch_size: 1000) do |key| if Gitlab::Shell.new.add_key(key.shell_id, key.key) |