summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-16 01:10:36 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-16 01:10:36 -0800
commite65cc4f849174e2767f2121120ea8f1880c3d6d2 (patch)
tree1e514a1e7b19195c4ed644335744701cb386f2bd /lib/tasks
parentd6394a00f320cf2cba2b80f8c950e7686ab02bc5 (diff)
parent4bc7d98d65a84d037d6d8ddc807cdf0ceeb5a456 (diff)
downloadgitlab-ce-e65cc4f849174e2767f2121120ea8f1880c3d6d2.tar.gz
Merge pull request #2994 from dasbh/master
Fix gitlab:setup task on fresh installation
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/setup.rake4
-rw-r--r--lib/tasks/gitlab/shell.rake5
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake
index bc0742564d0..8d4950cf396 100644
--- a/lib/tasks/gitlab/setup.rake
+++ b/lib/tasks/gitlab/setup.rake
@@ -1,10 +1,10 @@
namespace :gitlab do
desc "GITLAB | Setup production application"
task :setup => :environment do
- setup
+ setup_db
end
- def setup
+ def setup_db
warn_user_is_not_gitlab
puts "This will create the necessary database tables and seed the database."
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake
index 0ab8df1d094..ec5451dd47c 100644
--- a/lib/tasks/gitlab/shell.rake
+++ b/lib/tasks/gitlab/shell.rake
@@ -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)