Skip to content
Snippets Groups Projects
Commit ad5efdc2 authored by Robert Marshall's avatar Robert Marshall
Browse files

Change socket_file_path method to listen_address


- Changes the socket_file_path to be the listen_address method in the
  Workhorse helper per review discussion

Signed-off-by: default avatarRobert Marshall <rmarshall@gitlab.com>
parent 01860897
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -22,7 +22,7 @@ class GitlabWorkhorseHelper < BaseHelper
node['gitlab']['gitlab-workhorse']['listen_network'] == "unix"
end
 
def socket_file_path
def listen_address
return File.join(sockets_directory, socket_file_name) if unix_socket?
 
node['gitlab']['gitlab-workhorse']['listen_addr']
Loading
Loading
Loading
Loading
@@ -19,7 +19,7 @@ class WebServerHelper
gitlab_url = node['gitlab']['gitlab-rails']['internal_api_url']
 
# If no internal_api_url is specified, default to Workhorse settings
workhorse_url = workhorse_helper.socket_file_path
workhorse_url = workhorse_helper.listen_address
relative_path = Gitlab['gitlab_workhorse']['relative_url']
gitlab_url ||= workhorse_helper.unix_socket? ? "http+unix://#{ERB::Util.url_encode(workhorse_url)}" : "http://#{workhorse_url}#{relative_path}"
gitlab_relative_path = relative_path || '' if workhorse_helper.unix_socket?
Loading
Loading
Loading
Loading
@@ -29,7 +29,7 @@ else
# Always use http for workhorse
schema = 'http'
use_socket = node['gitlab']['gitlab-workhorse']['listen_network'] == "unix"
host = use_socket ? 'localhost' : workhorse_helper.socket_file_path
host = use_socket ? 'localhost' : workhorse_helper.listen_address
end
 
template "/opt/gitlab/etc/gitlab-healthcheck-rc" do
Loading
Loading
@@ -38,7 +38,7 @@ template "/opt/gitlab/etc/gitlab-healthcheck-rc" do
variables(
{
use_socket: use_socket,
socket_path: use_socket ? workhorse_helper.socket_file_path : '',
socket_path: use_socket ? workhorse_helper.listen_address : '',
url: "#{schema}://#{host}#{Gitlab['gitlab_rails']['gitlab_relative_url']}/help"
}
)
Loading
Loading
Loading
Loading
@@ -77,7 +77,7 @@ http {
<% end -%>
 
upstream gitlab-workhorse {
server <%= "unix:" if node['gitlab']['gitlab-workhorse']['listen_network'] == "unix" %><%= GitlabWorkhorseHelper.new(node).socket_file_path %>;
server <%= "unix:" if node['gitlab']['gitlab-workhorse']['listen_network'] == "unix" %><%= GitlabWorkhorseHelper.new(node).listen_address %>;
}
 
<% if @gitlab_http_config %>
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ exec chpst -e /opt/gitlab/etc/gitlab-workhorse/env -P \
/opt/gitlab/embedded/bin/gitlab-workhorse \
-listenNetwork <%= node['gitlab']['gitlab-workhorse']['listen_network'] %> \
-listenUmask <%= node['gitlab']['gitlab-workhorse']['listen_umask'] %> \
-listenAddr <%= GitlabWorkhorseHelper.new(node).socket_file_path %> \
-listenAddr <%= GitlabWorkhorseHelper.new(node).listen_address %> \
-authBackend <%= node['gitlab']['gitlab-workhorse']['auth_backend'] %><%= node['gitlab']['gitlab-workhorse']['relative_url'] %> \
<% if node['gitlab']['gitlab-workhorse']['auth_socket'] %>
-authSocket <%= node['gitlab']['gitlab-workhorse']['auth_socket'] %> \
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment