Commit e5745902feb61b002165abaee9765407478f498f

Authored by Jacob Vosmaer
2 parents 15283ee2 0f6037c9

Merge branch 'gitlab_shell_api_port' into 'master'

Respect Unicorn port setting in gitlab-shell
@@ -24,6 +24,7 @@ omnibus-gitlab repository. @@ -24,6 +24,7 @@ omnibus-gitlab repository.
24 - Automatically create /etc/gitlab/gitlab.rb after the package is installed 24 - Automatically create /etc/gitlab/gitlab.rb after the package is installed
25 - Security: Use sockets and peer authentication for Postgres 25 - Security: Use sockets and peer authentication for Postgres
26 - Avoid empty Piwik or Google Analytics settings 26 - Avoid empty Piwik or Google Analytics settings
  27 +- Respect custom Unicorn port setting in gitlab-shell
27 28
28 6.9.4-ee.omnibus.1 29 6.9.4-ee.omnibus.1
29 - Security: Use sockets and peer authentication for Postgres 30 - Security: Use sockets and peer authentication for Postgres
@@ -88,12 +88,7 @@ The ports for Redis, PostgreSQL and Unicorn can be overriden in @@ -88,12 +88,7 @@ The ports for Redis, PostgreSQL and Unicorn can be overriden in
88 ```ruby 88 ```ruby
89 redis['port'] = 1234 89 redis['port'] = 1234
90 postgresql['port'] = 2345 90 postgresql['port'] = 2345
91 -  
92 -# due to a bug https://gitlab.com/gitlab-org/omnibus-gitlab/issues/141  
93 -# you have to provide the port for gitlab shell as well,  
94 -# so the 2 following lines have to point to the same port  
95 unicorn['port'] = 3456 91 unicorn['port'] = 3456
96 -gitlab_rails['internal_api_url'] = 'http://localhost:3456'  
97 ``` 92 ```
98 93
99 For Nginx port changes please see the section on enabling HTTPS below. 94 For Nginx port changes please see the section on enabling HTTPS below.
files/gitlab-cookbooks/gitlab/attributes/default.rb
@@ -45,7 +45,7 @@ default['gitlab']['gitlab-rails']['dir'] = "/var/opt/gitlab/gitlab-rails" @@ -45,7 +45,7 @@ default['gitlab']['gitlab-rails']['dir'] = "/var/opt/gitlab/gitlab-rails"
45 default['gitlab']['gitlab-rails']['log_directory'] = "/var/log/gitlab/gitlab-rails" 45 default['gitlab']['gitlab-rails']['log_directory'] = "/var/log/gitlab/gitlab-rails"
46 default['gitlab']['gitlab-rails']['environment'] = 'production' 46 default['gitlab']['gitlab-rails']['environment'] = 'production'
47 47
48 -default['gitlab']['gitlab-rails']['internal_api_url'] = "http://localhost:8080" 48 +default['gitlab']['gitlab-rails']['internal_api_url'] = nil
49 default['gitlab']['gitlab-rails']['uploads_directory'] = "/var/opt/gitlab/gitlab-rails/uploads" 49 default['gitlab']['gitlab-rails']['uploads_directory'] = "/var/opt/gitlab/gitlab-rails/uploads"
50 default['gitlab']['gitlab-rails']['rate_limit_requests_per_period'] = 10 50 default['gitlab']['gitlab-rails']['rate_limit_requests_per_period'] = 10
51 default['gitlab']['gitlab-rails']['rate_limit_period'] = 60 51 default['gitlab']['gitlab-rails']['rate_limit_period'] = 60
files/gitlab-cookbooks/gitlab/recipes/gitlab-shell.rb
@@ -70,12 +70,16 @@ end @@ -70,12 +70,16 @@ end
70 end 70 end
71 end 71 end
72 72
  73 +# If no internal_api_url is specified, default to the IP/port Unicorn listens on
  74 +api_url = node['gitlab']['gitlab-rails']['internal_api_url']
  75 +api_url ||= "http://#{node['gitlab']['unicorn']['listen']}:#{node['gitlab']['unicorn']['port']}"
  76 +
73 template_symlink File.join(gitlab_shell_var_dir, "config.yml") do 77 template_symlink File.join(gitlab_shell_var_dir, "config.yml") do
74 link_from File.join(gitlab_shell_dir, "config.yml") 78 link_from File.join(gitlab_shell_dir, "config.yml")
75 source "gitlab-shell-config.yml.erb" 79 source "gitlab-shell-config.yml.erb"
76 variables( 80 variables(
77 :user => git_user, 81 :user => git_user,
78 - :api_url => node['gitlab']['gitlab-rails']['internal_api_url'], 82 + :api_url => api_url,
79 :repositories_path => repositories_path, 83 :repositories_path => repositories_path,
80 :authorized_keys => authorized_keys, 84 :authorized_keys => authorized_keys,
81 :redis_port => node['gitlab']['redis']['port'], 85 :redis_port => node['gitlab']['redis']['port'],