Add the proxy/ssl config and pass on to kamal-proxy

This commit is contained in:
Donal McBreen
2024-09-10 14:47:33 +01:00
parent e0d336dc11
commit 9b673c2114
4 changed files with 47 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
require "test_helper"
class ConfigurationEnvTest < ActiveSupport::TestCase
setup do
@deploy = {
service: "app", image: "dhh/app", registry: { "username" => "dhh", "password" => "secret" },
builder: { "arch" => "amd64" }, servers: [ "1.1.1.1" ]
}
end
test "ssl with host" do
@deploy[:proxy] = { "ssl" => true, "host" => "example.com" }
assert_equal true, config.proxy.ssl?
end
test "ssl with no host" do
@deploy[:proxy] = { "ssl" => true }
assert_raises(Kamal::ConfigurationError) { config.proxy.ssl? }
end
private
def config
Kamal::Configuration.new(@deploy)
end
end