Commit cdb91575971af5c1ed3188a2bbbaa12ef7958065
1 parent
321360f5
Exists in
master
and in
17 other branches
Create directories and files as the git group
Showing
2 changed files
with
6 additions
and
0 deletions
Show diff stats
files/gitlab-cookbooks/gitlab/attributes/default.rb
... | ... | @@ -22,6 +22,7 @@ default['gitlab']['bootstrap']['enable'] = true |
22 | 22 | #### |
23 | 23 | # The username for the chef services user |
24 | 24 | default['gitlab']['user']['username'] = "git" |
25 | +default['gitlab']['user']['group'] = "git" | |
25 | 26 | # The shell for the chef services user |
26 | 27 | default['gitlab']['user']['shell'] = "/bin/sh" |
27 | 28 | # The home directory for the chef services user | ... | ... |
files/gitlab-cookbooks/gitlab/recipes/gitlab-shell.rb
1 | 1 | git_user = node['gitlab']['user']['username'] |
2 | +git_group = node['gitlab']['user']['group'] | |
2 | 3 | gitlab_shell_dir = "/opt/gitlab/embedded/service/gitlab-shell" |
3 | 4 | repositories_path = node['gitlab']['gitlab-core']['repositories_path'] |
4 | 5 | ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh") |
... | ... | @@ -6,16 +7,19 @@ ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh") |
6 | 7 | # Create directories because the git_user does not own its home directory |
7 | 8 | directory repositories_path do |
8 | 9 | owner git_user |
10 | + group git_group | |
9 | 11 | end |
10 | 12 | |
11 | 13 | directory ssh_dir do |
12 | 14 | owner git_user |
15 | + group git_group | |
13 | 16 | mode "0700" |
14 | 17 | end |
15 | 18 | |
16 | 19 | template File.join(gitlab_shell_dir, "config.yml") do |
17 | 20 | source "gitlab-shell-config.yml.erb" |
18 | 21 | owner git_user |
22 | + group git_group | |
19 | 23 | variables( |
20 | 24 | :user => git_user, |
21 | 25 | :api_url => node['gitlab']['gitlab-core']['internal_api_url'], |
... | ... | @@ -30,5 +34,6 @@ end |
30 | 34 | execute "bin/install" do |
31 | 35 | cwd gitlab_shell_dir |
32 | 36 | user git_user |
37 | + group git_group | |
33 | 38 | action :nothing |
34 | 39 | end | ... | ... |