summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kumanyaev <me@zzet.org>2013-02-08 04:09:17 +0400
committerAndrey Kumanyaev <me@zzet.org>2013-02-08 04:09:17 +0400
commit58231f31711666c04a7c960f5bc8671dce56479a (patch)
tree715d3b62dfe38e3127bd6bf6701402595c3dec65
parent491d3cee86fa6e7a544443c1400d60ecfc1451f7 (diff)
downloadgitlab-shell-58231f31711666c04a7c960f5bc8671dce56479a.tar.gz
Replace hardcoded commands with data from config.yml
-rwxr-xr-xbin/install13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/install b/bin/install
index f6b0974..d7cb257 100755
--- a/bin/install
+++ b/bin/install
@@ -6,12 +6,15 @@ require_relative '../lib/gitlab_init'
# GitLab shell, invoked from ~/.ssh/authorized_keys
#
+config = GitlabConfig.new
+key_dir = config.auth_file.delete "authorized_keys"
+
commands = [
- "mkdir -p /home/git/repositories",
- "mkdir -p /home/git/.ssh",
- "touch /home/git/.ssh/authorized_keys",
- "chmod -R ug+rwX,o-rwx /home/git/repositories/",
- "find /home/git/repositories -type d -print0 | xargs -0 chmod g+s"
+ "mkdir -p #{config.repos_path}",
+ "mkdir -p #{key_dir}",
+ "touch #{config.auth_file}",
+ "chmod -R ug+rwX,o-rwx #{config.repos_path}",
+ "find #{config.repos_path} -type d -print0 | xargs -0 chmod g+s"
]
commands.each do |cmd|