Updated accessory proxy to support hosts option
This commit is contained in:
@@ -101,14 +101,19 @@ accessories:
|
||||
# Proxy
|
||||
#
|
||||
proxy:
|
||||
# Host
|
||||
# Hosts
|
||||
#
|
||||
# The hosts that will be used to serve the app. The proxy will only route requests
|
||||
# to this host to your app.
|
||||
#
|
||||
# If no hosts are set, then all requests will be forwarded, except for matching
|
||||
# requests for other apps deployed on that server that do have a host set.
|
||||
#
|
||||
# Specify one of `host` or `hosts`.
|
||||
host: foo.example.com
|
||||
hosts:
|
||||
- foo.example.com
|
||||
- bar.example.com
|
||||
|
||||
# App port
|
||||
#
|
||||
|
||||
@@ -171,7 +171,7 @@ class CommandsAccessoryTest < ActiveSupport::TestCase
|
||||
|
||||
test "deploy" do
|
||||
assert_equal \
|
||||
"docker exec kamal-proxy kamal-proxy deploy custom-busybox --target \"172.1.0.2:80\" --host \"busybox.example.com\" --deploy-timeout \"30s\" --drain-timeout \"30s\" --buffer-requests --buffer-responses --log-request-header \"Cache-Control\" --log-request-header \"Last-Modified\" --log-request-header \"User-Agent\"",
|
||||
"docker exec kamal-proxy kamal-proxy deploy custom-busybox --target=\"172.1.0.2:80\" --host=\"busybox.example.com\" --deploy-timeout=\"30s\" --drain-timeout=\"30s\" --buffer-requests --buffer-responses --log-request-header=\"Cache-Control\" --log-request-header=\"Last-Modified\" --log-request-header=\"User-Agent\"",
|
||||
new_command(:busybox).deploy(target: "172.1.0.2").join(" ")
|
||||
end
|
||||
|
||||
|
||||
@@ -167,6 +167,6 @@ class ConfigurationAccessoryTest < ActiveSupport::TestCase
|
||||
|
||||
test "proxy" do
|
||||
assert @config.accessory(:monitoring).running_proxy?
|
||||
assert_equal "monitoring.example.com", @config.accessory(:monitoring).proxy.host
|
||||
assert_equal [ "monitoring.example.com" ], @config.accessory(:monitoring).proxy.hosts
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user