Merge branch 'change_owner_on_hook_dir' into 'master'

Manage gitlab-shell hooks directory, set ownership to git user.

Allow git user to have access to hooks directory which is symlinked into each project.

Default location of this dir is `/opt/gitlab/embedded/service/gitlab-shell/hooks` and was previously owned by root.

See merge request !495
This commit is contained in:
Marin Jankovski 2015-10-05 13:30:34 +00:00
commit a6fe61e7e1
1 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,7 @@ repositories_path = node['gitlab']['gitlab-rails']['gitlab_shell_repos_path']
ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh")
authorized_keys = File.join(ssh_dir, "authorized_keys")
log_directory = node['gitlab']['gitlab-shell']['log_directory']
hooks_directory = node['gitlab']['gitlab-rails']['gitlab_shell_hooks_path']
# Create directories because the git_user does not own its home directory
directory repositories_path do
@ -47,6 +48,12 @@ file authorized_keys do
mode "0600"
end
directory hooks_directory do
owner git_user
group git_group
mode "0755"
end
# gitlab-shell 1.9.4 uses a lock file in the gitlab-shell root
file File.join(gitlab_shell_dir, "authorized_keys.lock") do
owner git_user