Refactor proxy_publish_args argument concatenation

This commit is contained in:
Matthew Croall
2024-12-03 08:11:19 +10:30
parent 11e4f37409
commit ffe1ac3483

View File

@@ -250,8 +250,9 @@ class Kamal::Configuration
end
def proxy_publish_args(http_port, https_port, bind_ip = nil)
bind_ip = bind_ip ? "#{bind_ip}:" : ""
argumentize "--publish", [ "#{bind_ip}#{http_port}:#{PROXY_HTTP_PORT}", "#{bind_ip}#{https_port}:#{PROXY_HTTPS_PORT}" ]
publish_http = [ bind_ip, http_port, PROXY_HTTP_PORT ].compact.join(":")
publish_https = [ bind_ip, https_port, PROXY_HTTPS_PORT ].compact.join(":")
argumentize "--publish", [ publish_http, publish_https ]
end
def proxy_logging_args(max_size)