Skip to content

Commit

Permalink
Merge pull request #978 from basecamp/ignore-ssl-false
Browse files Browse the repository at this point in the history
Handle ssl: false in proxy config
  • Loading branch information
djmb authored Sep 26, 2024
2 parents 325bf9a + b3a6921 commit ae990ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/kamal/configuration/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def host
def deploy_options
{
host: proxy_config["host"],
tls: proxy_config["ssl"],
tls: proxy_config["ssl"] ? true : nil,
"deploy-timeout": seconds_duration(config.deploy_timeout),
"drain-timeout": seconds_duration(config.drain_timeout),
"health-check-interval": seconds_duration(proxy_config.dig("healthcheck", "interval")),
Expand Down
8 changes: 7 additions & 1 deletion test/configuration/proxy_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "test_helper"

class ConfigurationEnvTest < ActiveSupport::TestCase
class ConfigurationProxyTest < ActiveSupport::TestCase
setup do
@deploy = {
service: "app", image: "dhh/app", registry: { "username" => "dhh", "password" => "secret" },
Expand All @@ -18,6 +18,12 @@ class ConfigurationEnvTest < ActiveSupport::TestCase
assert_raises(Kamal::ConfigurationError) { config.proxy.ssl? }
end

test "ssl false" do
@deploy[:proxy] = { "ssl" => false }
assert_not config.proxy.ssl?
assert_not config.proxy.deploy_options.has_key?(:tls)
end

private
def config
Kamal::Configuration.new(@deploy)
Expand Down

0 comments on commit ae990ef

Please sign in to comment.