Commit 58231f31 authored by Andrey Kumanyaev's avatar Andrey Kumanyaev

Replace hardcoded commands with data from config.yml

parent 491d3cee
...@@ -6,12 +6,15 @@ require_relative '../lib/gitlab_init' ...@@ -6,12 +6,15 @@ require_relative '../lib/gitlab_init'
# GitLab shell, invoked from ~/.ssh/authorized_keys # GitLab shell, invoked from ~/.ssh/authorized_keys
# #
config = GitlabConfig.new
key_dir = config.auth_file.delete "authorized_keys"
commands = [ commands = [
"mkdir -p /home/git/repositories", "mkdir -p #{config.repos_path}",
"mkdir -p /home/git/.ssh", "mkdir -p #{key_dir}",
"touch /home/git/.ssh/authorized_keys", "touch #{config.auth_file}",
"chmod -R ug+rwX,o-rwx /home/git/repositories/", "chmod -R ug+rwX,o-rwx #{config.repos_path}",
"find /home/git/repositories -type d -print0 | xargs -0 chmod g+s" "find #{config.repos_path} -type d -print0 | xargs -0 chmod g+s"
] ]
commands.each do |cmd| commands.each do |cmd|
......
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