Commit bd5c9c9078b91658e290c4c2296680f82edfb8cc

Authored by Jacob Vosmaer
1 parent 42097267

Get rid of gitlab-shell/bin/install

We are already creating all the necessary directories using Chef.
files/gitlab-cookbooks/gitlab/recipes/gitlab-shell.rb
@@ -22,6 +22,7 @@ gitlab_shell_dir = "/opt/gitlab/embedded/service/gitlab-shell" @@ -22,6 +22,7 @@ gitlab_shell_dir = "/opt/gitlab/embedded/service/gitlab-shell"
22 gitlab_shell_var_dir = "/var/opt/gitlab/gitlab-shell" 22 gitlab_shell_var_dir = "/var/opt/gitlab/gitlab-shell"
23 repositories_path = node['gitlab']['gitlab-rails']['gitlab_shell_repos_path'] 23 repositories_path = node['gitlab']['gitlab-rails']['gitlab_shell_repos_path']
24 ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh") 24 ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh")
  25 +authorized_keys = File.join(ssh_dir, "authorized_keys")
25 log_directory = node['gitlab']['gitlab-shell']['log_directory'] 26 log_directory = node['gitlab']['gitlab-shell']['log_directory']
26 27
27 # Create directories because the git_user does not own its home directory 28 # Create directories because the git_user does not own its home directory
@@ -38,6 +39,12 @@ directory ssh_dir do @@ -38,6 +39,12 @@ directory ssh_dir do
38 recursive true 39 recursive true
39 end 40 end
40 41
  42 +file authorized_keys do
  43 + owner git_user
  44 + group git_group
  45 + mode "0600"
  46 +end
  47 +
41 # If SELinux is enabled, make sure that OpenSSH thinks the .ssh directory of the 48 # If SELinux is enabled, make sure that OpenSSH thinks the .ssh directory of the
42 # git_user is valid. 49 # git_user is valid.
43 execute "chcon -t ssh_home_t #{ssh_dir}" do 50 execute "chcon -t ssh_home_t #{ssh_dir}" do
@@ -63,16 +70,8 @@ template_symlink File.join(gitlab_shell_var_dir, "config.yml") do @@ -63,16 +70,8 @@ template_symlink File.join(gitlab_shell_var_dir, "config.yml") do
63 :user => git_user, 70 :user => git_user,
64 :api_url => node['gitlab']['gitlab-rails']['internal_api_url'], 71 :api_url => node['gitlab']['gitlab-rails']['internal_api_url'],
65 :repositories_path => repositories_path, 72 :repositories_path => repositories_path,
66 - :authorized_keys => File.join(ssh_dir, "authorized_keys"), 73 + :authorized_keys => authorized_keys,
67 :redis_port => node['gitlab']['redis']['port'], 74 :redis_port => node['gitlab']['redis']['port'],
68 :log_file => File.join(log_directory, "gitlab-shell.log") 75 :log_file => File.join(log_directory, "gitlab-shell.log")
69 ) 76 )
70 - notifies :run, "execute[bin/install]"  
71 -end  
72 -  
73 -execute "bin/install" do  
74 - cwd gitlab_shell_dir  
75 - user git_user  
76 - group git_group  
77 - action :nothing  
78 end 77 end