summaryrefslogtreecommitdiff
path: root/bin/install
blob: f8c12f8cb6a7c44ccfc54ea80ad321fc1aa9e2a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env ruby

require_relative '../lib/gitlab_init'

#
# GitLab shell, invoked from ~/.ssh/authorized_keys
#

config = GitlabConfig.new
key_dir = File.dirname("#{config.auth_file}")

commands = [
  "mkdir -p #{config.repos_path}",
  "mkdir -p #{key_dir}",
  "chmod 700 #{key_dir}",
  "touch #{config.auth_file}",
  "chmod 600 #{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|
  puts "#{cmd}: #{system(cmd)}"
end

exit