From 8b4823b55da632873410e3b35819e256faf652f6 Mon Sep 17 00:00:00 2001 From: Igor Alexandrov Date: Thu, 26 Sep 2024 19:42:19 +0400 Subject: [PATCH 1/9] Added commands to deploy accessory to kamal-proxy --- lib/kamal/cli/accessory.rb | 3 +++ lib/kamal/commands/accessory.rb | 18 +++++++++++++++++- lib/kamal/configuration/accessory.rb | 15 ++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/kamal/cli/accessory.rb b/lib/kamal/cli/accessory.rb index 6c51c774d..ebb2ff18c 100644 --- a/lib/kamal/cli/accessory.rb +++ b/lib/kamal/cli/accessory.rb @@ -18,6 +18,7 @@ def boot(name, prepare: true) execute *accessory.ensure_env_directory upload! accessory.secrets_io, accessory.secrets_path, mode: "0600" execute *accessory.run + execute *accessory.deploy if accessory.running_proxy? end end end @@ -75,6 +76,7 @@ def start(name) on(hosts) do execute *KAMAL.auditor.record("Started #{name} accessory"), verbosity: :debug execute *accessory.start + execute *accessory.deploy if accessory.running_proxy? end end end @@ -87,6 +89,7 @@ def stop(name) on(hosts) do execute *KAMAL.auditor.record("Stopped #{name} accessory"), verbosity: :debug execute *accessory.stop, raise_on_non_zero_exit: false + # execute *accessory.remove if accessory.running_proxy? end end end diff --git a/lib/kamal/commands/accessory.rb b/lib/kamal/commands/accessory.rb index 0c1b9009c..41c8b1740 100644 --- a/lib/kamal/commands/accessory.rb +++ b/lib/kamal/commands/accessory.rb @@ -2,8 +2,10 @@ class Kamal::Commands::Accessory < Kamal::Commands::Base attr_reader :accessory_config delegate :service_name, :image, :hosts, :port, :files, :directories, :cmd, :publish_args, :env_args, :volume_args, :label_args, :option_args, - :secrets_io, :secrets_path, :env_directory, + :secrets_io, :secrets_path, :env_directory, :running_proxy?, to: :accessory_config + delegate :proxy_container_name, to: :config + def initialize(config, name:) super(config) @@ -38,6 +40,16 @@ def info docker :ps, *service_filter end + def deploy + target = container_id_for(container_name: service_name, only_running: true) + proxy_exec :deploy, service_name, *accessory_config.proxy.deploy_command_args(target: target) if target + end + + def remove + target = container_id_for(container_name: service_name, only_running: true) + proxy_exec :remove, service_name, *accessory_config.proxy.remove_command_args(target: target) if target + end + def logs(timestamps: true, since: nil, lines: nil, grep: nil, grep_options: nil) pipe \ @@ -110,4 +122,8 @@ def ensure_env_directory def service_filter [ "--filter", "label=service=#{service_name}" ] end + + def proxy_exec(*command) + docker :exec, proxy_container_name, "kamal-proxy", *command + end end diff --git a/lib/kamal/configuration/accessory.rb b/lib/kamal/configuration/accessory.rb index 804a15029..7f78dbd6a 100644 --- a/lib/kamal/configuration/accessory.rb +++ b/lib/kamal/configuration/accessory.rb @@ -3,7 +3,7 @@ class Kamal::Configuration::Accessory delegate :argumentize, :optionize, to: Kamal::Utils - attr_reader :name, :accessory_config, :env + attr_reader :name, :accessory_config, :env, :proxy def initialize(name, config:) @name, @config, @accessory_config = name.inquiry, config, config.raw_config["accessories"][name] @@ -18,6 +18,8 @@ def initialize(name, config:) config: accessory_config.fetch("env", {}), secrets: config.secrets, context: "accessories/#{name}/env" + + # initialize_proxy if running_proxy? end def service_name @@ -100,6 +102,17 @@ def cmd accessory_config["cmd"] end + def running_proxy? + @accessory_config["proxy"].present? + end + + def initialize_proxy + @proxy = Kamal::Configuration::Proxy.new \ + config: config, + proxy_config: accessory_config["proxy"], + context: "accessories/#{name}/proxy" + end + private attr_accessor :config From 3aee229d5be20c0c7a4f4165f708cacb090a1795 Mon Sep 17 00:00:00 2001 From: Igor Alexandrov Date: Thu, 26 Sep 2024 23:02:43 +0400 Subject: [PATCH 2/9] Added tests for accessory configuration with proxy --- lib/kamal/cli/accessory.rb | 2 +- lib/kamal/configuration/accessory.rb | 2 +- lib/kamal/configuration/docs/accessory.yml | 85 ++++++++++++++++++++++ test/configuration/accessory_test.rb | 8 ++ 4 files changed, 95 insertions(+), 2 deletions(-) diff --git a/lib/kamal/cli/accessory.rb b/lib/kamal/cli/accessory.rb index ebb2ff18c..12cbd44c8 100644 --- a/lib/kamal/cli/accessory.rb +++ b/lib/kamal/cli/accessory.rb @@ -89,7 +89,7 @@ def stop(name) on(hosts) do execute *KAMAL.auditor.record("Stopped #{name} accessory"), verbosity: :debug execute *accessory.stop, raise_on_non_zero_exit: false - # execute *accessory.remove if accessory.running_proxy? + execute *accessory.remove if accessory.running_proxy? end end end diff --git a/lib/kamal/configuration/accessory.rb b/lib/kamal/configuration/accessory.rb index 7f78dbd6a..afd0f856c 100644 --- a/lib/kamal/configuration/accessory.rb +++ b/lib/kamal/configuration/accessory.rb @@ -19,7 +19,7 @@ def initialize(name, config:) secrets: config.secrets, context: "accessories/#{name}/env" - # initialize_proxy if running_proxy? + initialize_proxy if running_proxy? end def service_name diff --git a/lib/kamal/configuration/docs/accessory.yml b/lib/kamal/configuration/docs/accessory.yml index 86d49b77a..44aab078f 100644 --- a/lib/kamal/configuration/docs/accessory.yml +++ b/lib/kamal/configuration/docs/accessory.yml @@ -90,3 +90,88 @@ accessories: # They are not created or copied before mounting: volumes: - /path/to/mysql-logs:/var/log/mysql + + # Proxy + # + proxy: + # Host + # + # 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. + host: foo.example.com + + # App port + # + # The port the application container is exposed on + # + # Defaults to 80 + app_port: 3000 + + # SSL + # + # kamal-proxy can provide automatic HTTPS for your application via Let's Encrypt. + # + # This requires that we are deploying to a one server and the host option is set. + # The host value must point to the server we are deploying to and port 443 must be + # open for the Let's Encrypt challenge to succeed. + # + # Defaults to false + ssl: true + + # Response timeout + # + # How long to wait for requests to complete before timing out, defaults to 30 seconds + response_timeout: 10 + + # Healthcheck + # + # When deploying, the proxy will by default hit /up once every second until we hit + # the deploy timeout, with a 5 second timeout for each request. + # + # Once the app is up, the proxy will stop hitting the healthcheck endpoint. + healthcheck: + interval: 3 + path: /health + timeout: 3 + + # Buffering + # + # Whether to buffer request and response bodies in the proxy + # + # By default buffering is enabled with a max request body size of 1GB and no limit + # for response size. + # + # You can also set the memory limit for buffering, which defaults to 1MB, anything + # larger than that is written to disk. + buffering: + requests: true + responses: true + max_request_body: 40_000_000 + max_response_body: 0 + memory: 2_000_000 + + # Logging + # + # Configure request logging for the proxy + # You can specify request and response headers to log. + # By default, Cache-Control, Last-Modified and User-Agent request headers are logged + logging: + request_headers: + - Cache-Control + - X-Forwarded-Proto + response_headers: + - X-Request-ID + - X-Request-Start + + # Forward headers + # + # Whether to forward the X-Forwarded-For and X-Forwarded-Proto headers. + # + # If you are behind a trusted proxy, you can set this to true to forward the headers. + # + # By default kamal-proxy will not forward the headers the ssl option is set to true, and + # will forward them if it is set to false. + forward_headers: true \ No newline at end of file diff --git a/test/configuration/accessory_test.rb b/test/configuration/accessory_test.rb index 2615dab60..adc78f170 100644 --- a/test/configuration/accessory_test.rb +++ b/test/configuration/accessory_test.rb @@ -63,6 +63,9 @@ class ConfigurationAccessoryTest < ActiveSupport::TestCase "options" => { "cpus" => "4", "memory" => "2GB" + }, + "proxy" => { + "host" => "monitoring.example.com" } } } @@ -152,4 +155,9 @@ class ConfigurationAccessoryTest < ActiveSupport::TestCase test "options" do assert_equal [ "--cpus", "\"4\"", "--memory", "\"2GB\"" ], @config.accessory(:redis).option_args end + + test "proxy" do + assert @config.accessory(:monitoring).running_proxy? + assert_equal "monitoring.example.com", @config.accessory(:monitoring).proxy.host + end end From b27606237e6d3cf33f22737d8e6ab0c0fa0688c5 Mon Sep 17 00:00:00 2001 From: Igor Alexandrov Date: Fri, 27 Sep 2024 12:24:54 +0400 Subject: [PATCH 3/9] Added tests for accessory deploy and remove commands --- lib/kamal/cli/accessory.rb | 17 ++++++++++++++--- lib/kamal/commands/accessory.rb | 10 ++++------ test/commands/accessory_test.rb | 17 ++++++++++++++++- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/lib/kamal/cli/accessory.rb b/lib/kamal/cli/accessory.rb index 12cbd44c8..1a5949373 100644 --- a/lib/kamal/cli/accessory.rb +++ b/lib/kamal/cli/accessory.rb @@ -18,7 +18,11 @@ def boot(name, prepare: true) execute *accessory.ensure_env_directory upload! accessory.secrets_io, accessory.secrets_path, mode: "0600" execute *accessory.run - execute *accessory.deploy if accessory.running_proxy? + + if accessory.running_proxy? + target = accessory.container_id_for(container_name: accessory.service_name, only_running: true) + execute *accessory.deploy(target: target) + end end end end @@ -76,7 +80,10 @@ def start(name) on(hosts) do execute *KAMAL.auditor.record("Started #{name} accessory"), verbosity: :debug execute *accessory.start - execute *accessory.deploy if accessory.running_proxy? + if accessory.running_proxy? + target = container_id_for(container_name: service_name, only_running: true) + execute *accessory.deploy(target: target) + end end end end @@ -89,7 +96,11 @@ def stop(name) on(hosts) do execute *KAMAL.auditor.record("Stopped #{name} accessory"), verbosity: :debug execute *accessory.stop, raise_on_non_zero_exit: false - execute *accessory.remove if accessory.running_proxy? + + if accessory.running_proxy? + target = accessory.container_id_for(container_name: accessory.service_name, only_running: true) + execute *accessory.remove(target: target) + end end end end diff --git a/lib/kamal/commands/accessory.rb b/lib/kamal/commands/accessory.rb index 41c8b1740..a68b5d6e8 100644 --- a/lib/kamal/commands/accessory.rb +++ b/lib/kamal/commands/accessory.rb @@ -40,14 +40,12 @@ def info docker :ps, *service_filter end - def deploy - target = container_id_for(container_name: service_name, only_running: true) - proxy_exec :deploy, service_name, *accessory_config.proxy.deploy_command_args(target: target) if target + def deploy(target:) + proxy_exec :deploy, service_name, *accessory_config.proxy.deploy_command_args(target: target) end - def remove - target = container_id_for(container_name: service_name, only_running: true) - proxy_exec :remove, service_name, *accessory_config.proxy.remove_command_args(target: target) if target + def remove(target:) + proxy_exec :remove, service_name, *accessory_config.proxy.remove_command_args(target: target) end diff --git a/test/commands/accessory_test.rb b/test/commands/accessory_test.rb index f3d71ffd3..626d8ebea 100644 --- a/test/commands/accessory_test.rb +++ b/test/commands/accessory_test.rb @@ -39,7 +39,10 @@ class CommandsAccessoryTest < ActiveSupport::TestCase "busybox" => { "service" => "custom-busybox", "image" => "busybox:latest", - "host" => "1.1.1.7" + "host" => "1.1.1.7", + "proxy" => { + "host" => "busybox.example.com" + } } } } @@ -158,6 +161,18 @@ class CommandsAccessoryTest < ActiveSupport::TestCase new_command(:mysql).remove_image.join(" ") end + test "deploy" do + assert_equal \ + "docker exec kamal-proxy kamal-proxy deploy custom-busybox --target \"172.1.0.2:80\" --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 + + test "remove" do + assert_equal \ + "docker exec kamal-proxy kamal-proxy remove custom-busybox --target \"172.1.0.2:80\"", + new_command(:busybox).remove(target: "172.1.0.2").join(" ") + end + private def new_command(accessory) Kamal::Commands::Accessory.new(Kamal::Configuration.new(@config), name: accessory) From fe8569aede2b3ef7ab06df8c97fc2d5bb8a5918b Mon Sep 17 00:00:00 2001 From: Igor Alexandrov Date: Fri, 27 Sep 2024 12:38:12 +0400 Subject: [PATCH 4/9] Added host to the expected accessory deploy command result --- test/commands/accessory_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/commands/accessory_test.rb b/test/commands/accessory_test.rb index 626d8ebea..698671ab4 100644 --- a/test/commands/accessory_test.rb +++ b/test/commands/accessory_test.rb @@ -163,7 +163,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\" --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 From 2c5a83734a7ef7f8ea15c24b62d97c23be1fc892 Mon Sep 17 00:00:00 2001 From: Igor Alexandrov Date: Fri, 27 Sep 2024 17:37:58 +0400 Subject: [PATCH 5/9] Fixed kamal-proxy remove command --- lib/kamal/cli/accessory.rb | 4 ++-- lib/kamal/commands/accessory.rb | 8 ++++---- test/commands/accessory_test.rb | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/kamal/cli/accessory.rb b/lib/kamal/cli/accessory.rb index 1a5949373..d21858459 100644 --- a/lib/kamal/cli/accessory.rb +++ b/lib/kamal/cli/accessory.rb @@ -98,8 +98,8 @@ def stop(name) execute *accessory.stop, raise_on_non_zero_exit: false if accessory.running_proxy? - target = accessory.container_id_for(container_name: accessory.service_name, only_running: true) - execute *accessory.remove(target: target) + target = capture_with_info(*accessory.container_id_for(container_name: accessory.service_name, only_running: true)).strip + execute *accessory.remove if target end end end diff --git a/lib/kamal/commands/accessory.rb b/lib/kamal/commands/accessory.rb index a68b5d6e8..97bde8098 100644 --- a/lib/kamal/commands/accessory.rb +++ b/lib/kamal/commands/accessory.rb @@ -2,7 +2,7 @@ class Kamal::Commands::Accessory < Kamal::Commands::Base attr_reader :accessory_config delegate :service_name, :image, :hosts, :port, :files, :directories, :cmd, :publish_args, :env_args, :volume_args, :label_args, :option_args, - :secrets_io, :secrets_path, :env_directory, :running_proxy?, + :secrets_io, :secrets_path, :env_directory, :proxy, :running_proxy?, to: :accessory_config delegate :proxy_container_name, to: :config @@ -41,11 +41,11 @@ def info end def deploy(target:) - proxy_exec :deploy, service_name, *accessory_config.proxy.deploy_command_args(target: target) + proxy_exec :deploy, service_name, *proxy.deploy_command_args(target: target) end - def remove(target:) - proxy_exec :remove, service_name, *accessory_config.proxy.remove_command_args(target: target) + def remove + proxy_exec :remove, service_name end diff --git a/test/commands/accessory_test.rb b/test/commands/accessory_test.rb index 698671ab4..a6a91d3ff 100644 --- a/test/commands/accessory_test.rb +++ b/test/commands/accessory_test.rb @@ -169,7 +169,7 @@ class CommandsAccessoryTest < ActiveSupport::TestCase test "remove" do assert_equal \ - "docker exec kamal-proxy kamal-proxy remove custom-busybox --target \"172.1.0.2:80\"", + "docker exec kamal-proxy kamal-proxy remove custom-busybox", new_command(:busybox).remove(target: "172.1.0.2").join(" ") end From a4884ef01966c109b371af77e00813954c578cfc Mon Sep 17 00:00:00 2001 From: Igor Alexandrov Date: Wed, 9 Oct 2024 12:33:22 +0400 Subject: [PATCH 6/9] Fixed kamal-proxy remove command --- test/commands/accessory_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/commands/accessory_test.rb b/test/commands/accessory_test.rb index a6a91d3ff..9062ad98b 100644 --- a/test/commands/accessory_test.rb +++ b/test/commands/accessory_test.rb @@ -170,7 +170,7 @@ class CommandsAccessoryTest < ActiveSupport::TestCase test "remove" do assert_equal \ "docker exec kamal-proxy kamal-proxy remove custom-busybox", - new_command(:busybox).remove(target: "172.1.0.2").join(" ") + new_command(:busybox).remove.join(" ") end private From bf64900a36f520e502ebf83b8280c699a03f098c Mon Sep 17 00:00:00 2001 From: Igor Alexandrov Date: Sat, 28 Sep 2024 20:56:13 +0400 Subject: [PATCH 7/9] Extracted proxy commands to a module --- lib/kamal/commands/accessory.rb | 14 ++++++-------- lib/kamal/commands/app.rb | 10 +++++++++- lib/kamal/commands/{app/proxy.rb => proxy/exec.rb} | 6 +++--- 3 files changed, 18 insertions(+), 12 deletions(-) rename lib/kamal/commands/{app/proxy.rb => proxy/exec.rb} (54%) diff --git a/lib/kamal/commands/accessory.rb b/lib/kamal/commands/accessory.rb index 97bde8098..9b0e34da8 100644 --- a/lib/kamal/commands/accessory.rb +++ b/lib/kamal/commands/accessory.rb @@ -1,4 +1,6 @@ class Kamal::Commands::Accessory < Kamal::Commands::Base + include Kamal::Commands::Proxy::Exec + attr_reader :accessory_config delegate :service_name, :image, :hosts, :port, :files, :directories, :cmd, :publish_args, :env_args, :volume_args, :label_args, :option_args, @@ -40,14 +42,6 @@ def info docker :ps, *service_filter end - def deploy(target:) - proxy_exec :deploy, service_name, *proxy.deploy_command_args(target: target) - end - - def remove - proxy_exec :remove, service_name - end - def logs(timestamps: true, since: nil, lines: nil, grep: nil, grep_options: nil) pipe \ @@ -117,6 +111,10 @@ def ensure_env_directory end private + def proxy_deploy_command_args(target:) + proxy.deploy_command_args(target: target) + end + def service_filter [ "--filter", "label=service=#{service_name}" ] end diff --git a/lib/kamal/commands/app.rb b/lib/kamal/commands/app.rb index 6d8f44c60..78e9b9048 100644 --- a/lib/kamal/commands/app.rb +++ b/lib/kamal/commands/app.rb @@ -1,5 +1,5 @@ class Kamal::Commands::App < Kamal::Commands::Base - include Assets, Containers, Execution, Images, Logging, Proxy + include Assets, Containers, Execution, Images, Logging, Kamal::Commands::Proxy::Exec ACTIVE_DOCKER_STATUSES = [ :running, :restarting ] @@ -76,6 +76,14 @@ def ensure_env_directory end private + def service_name + role.container_prefix + end + + def proxy_deploy_command_args(target:) + role.proxy.deploy_command_args(target: target) + end + def latest_image_id docker :image, :ls, *argumentize("--filter", "reference=#{config.latest_image}"), "--format", "'{{.ID}}'" end diff --git a/lib/kamal/commands/app/proxy.rb b/lib/kamal/commands/proxy/exec.rb similarity index 54% rename from lib/kamal/commands/app/proxy.rb rename to lib/kamal/commands/proxy/exec.rb index 777a4aaf5..ac6f30a9b 100644 --- a/lib/kamal/commands/app/proxy.rb +++ b/lib/kamal/commands/proxy/exec.rb @@ -1,12 +1,12 @@ -module Kamal::Commands::App::Proxy +module Kamal::Commands::Proxy::Exec delegate :proxy_container_name, to: :config def deploy(target:) - proxy_exec :deploy, role.container_prefix, *role.proxy.deploy_command_args(target: target) + proxy_exec :deploy, service_name, *proxy_deploy_command_args(target: target) end def remove - proxy_exec :remove, role.container_prefix + proxy_exec :remove, service_name end private From c17bf6cef238acd3b07f934a38d24c6de59a467e Mon Sep 17 00:00:00 2001 From: Igor Alexandrov Date: Mon, 30 Sep 2024 13:07:05 +0400 Subject: [PATCH 8/9] Removed duplicated method --- lib/kamal/commands/accessory.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/kamal/commands/accessory.rb b/lib/kamal/commands/accessory.rb index 9b0e34da8..3519a4886 100644 --- a/lib/kamal/commands/accessory.rb +++ b/lib/kamal/commands/accessory.rb @@ -118,8 +118,4 @@ def proxy_deploy_command_args(target:) def service_filter [ "--filter", "label=service=#{service_name}" ] end - - def proxy_exec(*command) - docker :exec, proxy_container_name, "kamal-proxy", *command - end end From 2b4cb8fe1df67a4c60ee383006bceb5b2f19e55f Mon Sep 17 00:00:00 2001 From: Igor Alexandrov Date: Wed, 9 Oct 2024 14:06:38 +0400 Subject: [PATCH 9/9] Updated accessory proxy to support hosts option --- lib/kamal/configuration/docs/accessory.yml | 7 ++++++- test/commands/accessory_test.rb | 2 +- test/configuration/accessory_test.rb | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/kamal/configuration/docs/accessory.yml b/lib/kamal/configuration/docs/accessory.yml index 44aab078f..e81cf3919 100644 --- a/lib/kamal/configuration/docs/accessory.yml +++ b/lib/kamal/configuration/docs/accessory.yml @@ -94,14 +94,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 # diff --git a/test/commands/accessory_test.rb b/test/commands/accessory_test.rb index 9062ad98b..68603203d 100644 --- a/test/commands/accessory_test.rb +++ b/test/commands/accessory_test.rb @@ -163,7 +163,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 diff --git a/test/configuration/accessory_test.rb b/test/configuration/accessory_test.rb index adc78f170..0a9c452f9 100644 --- a/test/configuration/accessory_test.rb +++ b/test/configuration/accessory_test.rb @@ -158,6 +158,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