Compare commits

...

9 Commits

Author SHA1 Message Date
Donal McBreen
18f1bbbeac Merge pull request #1614 from basecamp/dependabot/bundler/bundler-f02c9c4a61
Bump the bundler group across 1 directory with 2 updates
2025-08-11 16:05:05 +01:00
Donal McBreen
5dd8eba182 Merge pull request #1611 from flavorjones/flavorjones/remote-builder-check
`Builder::Remote.inspect_builder` requires both checks to pass
2025-08-11 11:20:23 +01:00
dependabot[bot]
75754e4b7b Bump the bundler group across 1 directory with 2 updates
Bumps the bundler group with 2 updates in the / directory: [thor](https://github.com/rails/thor) and [nokogiri](https://github.com/sparklemotion/nokogiri).


Updates `thor` from 1.3.2 to 1.4.0
- [Release notes](https://github.com/rails/thor/releases)
- [Commits](https://github.com/rails/thor/compare/v1.3.2...v1.4.0)

Updates `nokogiri` from 1.18.8 to 1.18.9
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.8...v1.18.9)

---
updated-dependencies:
- dependency-name: thor
  dependency-version: 1.4.0
  dependency-type: direct:production
  dependency-group: bundler
- dependency-name: nokogiri
  dependency-version: 1.18.9
  dependency-type: indirect
  dependency-group: bundler
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-22 04:31:00 +00:00
Mike Dalessio
8e470ed051 Builder::Remote.inspect_builder requires both checks to pass
Previously, if either of the builder or the remote context were in a
bad state, the build would proceed anyway and fail.
2025-07-17 15:41:38 -04:00
Donal McBreen
4b88852aea Merge pull request #1589 from airblade/patch-1
Remove obsolete conditional
2025-06-20 15:49:07 +01:00
Andy Stewart
cfaa4fb0db Remove obsolete conditional
This postfix conditional is left over from the refactor in #1584 and is no longer needed.
2025-06-20 10:53:17 +01:00
Donal McBreen
2bcb313590 Fix typo: host -> more 2025-06-19 14:17:16 +01:00
Donal McBreen
3cf510bc8f Merge pull request #1585 from basecamp/cert-docs
Update custom cert docs
2025-06-18 11:57:40 +01:00
Donal McBreen
e61d96d154 Update custom cert docs
Remove ssl: ..., reword some of the docs and ensure the formatting is
correct.
2025-06-18 11:13:07 +01:00
6 changed files with 39 additions and 25 deletions

View File

@@ -82,15 +82,15 @@ GEM
net-sftp (4.0.0) net-sftp (4.0.0)
net-ssh (>= 5.0.0, < 8.0.0) net-ssh (>= 5.0.0, < 8.0.0)
net-ssh (7.3.0) net-ssh (7.3.0)
nokogiri (1.18.8-aarch64-linux-musl) nokogiri (1.18.9-aarch64-linux-musl)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.18.8-arm64-darwin) nokogiri (1.18.9-arm64-darwin)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.18.8-x86_64-darwin) nokogiri (1.18.9-x86_64-darwin)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.18.8-x86_64-linux-gnu) nokogiri (1.18.9-x86_64-linux-gnu)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.18.8-x86_64-linux-musl) nokogiri (1.18.9-x86_64-linux-musl)
racc (~> 1.4) racc (~> 1.4)
ostruct (0.6.1) ostruct (0.6.1)
parallel (1.26.3) parallel (1.26.3)
@@ -169,7 +169,7 @@ GEM
net-ssh (>= 2.8.0) net-ssh (>= 2.8.0)
ostruct ostruct
stringio (3.1.2) stringio (3.1.2)
thor (1.3.2) thor (1.4.0)
tzinfo (2.0.6) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (3.1.2) unicode-display_width (3.1.2)

View File

@@ -19,7 +19,7 @@ class Kamal::Commands::Builder::Remote < Kamal::Commands::Builder::Base
def inspect_builder def inspect_builder
combine \ combine \
combine inspect_buildx, inspect_remote_context, combine(inspect_buildx, inspect_remote_context),
[ "(echo no compatible builder && exit 1)" ], [ "(echo no compatible builder && exit 1)" ],
by: "||" by: "||"
end end

View File

@@ -45,27 +45,23 @@ proxy:
# unless you explicitly set `forward_headers: true` # unless you explicitly set `forward_headers: true`
# #
# Defaults to `false`: # Defaults to `false`:
ssl: ... ssl: true
# Custom SSL certificate # Custom SSL certificate
# #
# In some cases, using Let's Encrypt for automatic certificate management is not an # In some cases, using Let's Encrypt for automatic certificate management is not an
# option, for example if you are running from host than one host. Or you may already # option, for example if you are running from more than one host.
# have SSL certificates issued by a different Certificate Authority (CA).
# Kamal supports loading custom SSL certificates
# directly from secrets.
# #
# Examples: # Or you may already have SSL certificates issued by a different Certificate Authority (CA).
# ssl: true # Enable SSL with Let's Encrypt
# ssl: false # Disable SSL
# ssl: # Enable custom SSL
# certificate_pem: CERTIFICATE_PEM
# private_key_pem: PRIVATE_KEY_PEM
# #
# Kamal supports loading custom SSL certificates directly from secrets. You should
# pass a hash mapping the `certificate_pem` and `private_key_pem` to the secret names.
ssl:
certificate_pem: CERTIFICATE_PEM
private_key_pem: PRIVATE_KEY_PEM
# ### Notes # ### Notes
# - If the certificate or key is missing or invalid, kamal-proxy will fail to start. # - If the certificate or key is missing or invalid, deployments will fail.
# - Always handle SSL certificates and private keys securely. Avoid hard-coding them in deploy.yml files or source control. # - Always handle SSL certificates and private keys securely. Avoid hard-coding them in source control.
# - For automated certificate management, consider using the built-in Let's Encrypt integration instead.
# SSL redirect # SSL redirect
# #

View File

@@ -24,11 +24,11 @@ class Kamal::Configuration::Validator
example_value = example[key] example_value = example[key]
if example_value == "..." if example_value == "..."
if key.to_s == "ssl" unless key.to_s == "proxy" && boolean?(value.class)
validate_type! value, TrueClass, FalseClass, Hash
elsif key.to_s != "proxy" || !boolean?(value.class)
validate_type! value, *(Array if key == :servers), Hash validate_type! value, *(Array if key == :servers), Hash
end end
elsif key.to_s == "ssl"
validate_type! value, TrueClass, FalseClass, Hash
elsif key == "hosts" elsif key == "hosts"
validate_servers! value validate_servers! value
elsif example_value.is_a?(Array) elsif example_value.is_a?(Array)

View File

@@ -17,7 +17,7 @@ class Kamal::Secrets::Adapters::OnePassword < Kamal::Secrets::Adapters::Base
def fetch_secrets(secrets, from:, account:, session:) def fetch_secrets(secrets, from:, account:, session:)
if secrets.blank? if secrets.blank?
fetch_all_secrets(from: from, account: account, session: session) if secrets.blank? fetch_all_secrets(from: from, account: account, session: session)
else else
fetch_specified_secrets(secrets, from: from, account: account, session: session) fetch_specified_secrets(secrets, from: from, account: account, session: session)
end end

View File

@@ -31,6 +31,24 @@ class CliBuildTest < CliTestCase
end end
end end
test "push with remote builder checks both the builder and the remote context" do
with_build_directory do |build_directory|
Kamal::Commands::Hook.any_instance.stubs(:hook_exists?).returns(true)
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:git, "-C", anything, :"rev-parse", :HEAD)
.returns(Kamal::Git.revision)
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:git, "-C", anything, :status, "--porcelain")
.returns("")
run_command("push", "--verbose", fixture: :with_remote_builder).tap do |output|
assert_match "docker buildx inspect kamal-remote-ssh---app-1-1-1-5 | grep -q Endpoint:.*kamal-remote-ssh---app-1-1-1-5-context && docker context inspect kamal-remote-ssh---app-1-1-1-5-context --format '{{.Endpoints.docker.Host}}' | grep -xq ssh://app@1.1.1.5 || (echo no compatible builder && exit 1)", output
end
end
end
test "push --output=docker" do test "push --output=docker" do
with_build_directory do |build_directory| with_build_directory do |build_directory|
Kamal::Commands::Hook.any_instance.stubs(:hook_exists?).returns(true) Kamal::Commands::Hook.any_instance.stubs(:hook_exists?).returns(true)