summaryrefslogtreecommitdiff
path: root/bin/install
blob: d7cb257c3a084c5e17cc5bb16dd2c1987997c99b (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
#!/usr/bin/env ruby

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 #{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|
  puts "#{cmd}: #{system(cmd)}"
end

exit