From 190f4fba2844ddebba5ca9411f921ec61e215052 Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Tue, 13 Aug 2024 12:46:50 -0700 Subject: [PATCH 1/5] SSH: allow setting `config: false` to ignore local user `~/.ssh/config` --- lib/kamal/configuration/docs/ssh.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/kamal/configuration/docs/ssh.yml b/lib/kamal/configuration/docs/ssh.yml index 88fcd132..aa573b79 100644 --- a/lib/kamal/configuration/docs/ssh.yml +++ b/lib/kamal/configuration/docs/ssh.yml @@ -64,3 +64,10 @@ ssh: # An array of strings, with each element of the array being # a raw private key in PEM format. key_data: [ "-----BEGIN OPENSSH PRIVATE KEY-----" ] + + # Config + # + # Set to true to load the default OpenSSH config files (~/.ssh/config, + # /etc/ssh_config), to false ignore config files, or to a file path + # (or array of paths) to load specific configuration. Defaults to true. + config: true From 73c78079bc1bf385e3f5cbe42b56d4b037acdd0a Mon Sep 17 00:00:00 2001 From: Nick Hammond Date: Tue, 1 Oct 2024 08:16:52 -0700 Subject: [PATCH 2/5] Set KAMAL_DESTINATION when loading config --- lib/kamal/configuration.rb | 2 ++ test/configuration_test.rb | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lib/kamal/configuration.rb b/lib/kamal/configuration.rb index 2848a365..1c87e051 100644 --- a/lib/kamal/configuration.rb +++ b/lib/kamal/configuration.rb @@ -20,6 +20,8 @@ class Kamal::Configuration class << self def create_from(config_file:, destination: nil, version: nil) + ENV['KAMAL_DESTINATION'] = destination + raw_config = load_config_files(config_file, *destination_config_file(config_file, destination)) new raw_config, destination: destination, version: version diff --git a/test/configuration_test.rb b/test/configuration_test.rb index 814aa26e..96ceb36f 100644 --- a/test/configuration_test.rb +++ b/test/configuration_test.rb @@ -222,6 +222,13 @@ class ConfigurationTest < ActiveSupport::TestCase assert_equal "my-user", config.registry.username end + test "destination is loaded into env" do + dest_config_file = Pathname.new(File.expand_path("fixtures/deploy_for_dest.yml", __dir__)) + + config = Kamal::Configuration.create_from config_file: dest_config_file, destination: "world" + assert_equal ENV['KAMAL_DESTINATION'], "world" + end + test "destination yml config merge" do dest_config_file = Pathname.new(File.expand_path("fixtures/deploy_for_dest.yml", __dir__)) From 1d8c40f5d2048ac8d24533ee0151732bf4f9817e Mon Sep 17 00:00:00 2001 From: Nick Hammond Date: Tue, 1 Oct 2024 08:20:21 -0700 Subject: [PATCH 3/5] Run RC --- lib/kamal/configuration.rb | 2 +- test/configuration_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kamal/configuration.rb b/lib/kamal/configuration.rb index 1c87e051..59563de9 100644 --- a/lib/kamal/configuration.rb +++ b/lib/kamal/configuration.rb @@ -20,7 +20,7 @@ class Kamal::Configuration class << self def create_from(config_file:, destination: nil, version: nil) - ENV['KAMAL_DESTINATION'] = destination + ENV["KAMAL_DESTINATION"] = destination raw_config = load_config_files(config_file, *destination_config_file(config_file, destination)) diff --git a/test/configuration_test.rb b/test/configuration_test.rb index 96ceb36f..eaeffa22 100644 --- a/test/configuration_test.rb +++ b/test/configuration_test.rb @@ -226,7 +226,7 @@ class ConfigurationTest < ActiveSupport::TestCase dest_config_file = Pathname.new(File.expand_path("fixtures/deploy_for_dest.yml", __dir__)) config = Kamal::Configuration.create_from config_file: dest_config_file, destination: "world" - assert_equal ENV['KAMAL_DESTINATION'], "world" + assert_equal ENV["KAMAL_DESTINATION"], "world" end test "destination yml config merge" do From f47fd13e5b49969e31bb5b1eed8d0a3ef413b68b Mon Sep 17 00:00:00 2001 From: Jerome Dalbert Date: Tue, 1 Oct 2024 13:08:22 -0700 Subject: [PATCH 4/5] Follow logs on primary role by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not default `kamal app logs -f` to use the hardcoded “web” role; instead use the primary role, which can be different from “web”. --- lib/kamal/cli/app.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kamal/cli/app.rb b/lib/kamal/cli/app.rb index 98a08f7d..74b7b4df 100644 --- a/lib/kamal/cli/app.rb +++ b/lib/kamal/cli/app.rb @@ -203,7 +203,7 @@ class Kamal::Cli::App < Kamal::Cli::Base run_locally do info "Following logs on #{KAMAL.primary_host}..." - KAMAL.specific_roles ||= [ "web" ] + KAMAL.specific_roles ||= [ KAMAL.primary_role.name ] role = KAMAL.roles_on(KAMAL.primary_host).first app = KAMAL.app(role: role, host: host) From 279bda2770f309cdea175384cdf40696350d888b Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Wed, 2 Oct 2024 11:35:45 +0100 Subject: [PATCH 5/5] Bump version for 2.1.0 --- Gemfile.lock | 2 +- lib/kamal/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d98fcb4f..e055f6a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - kamal (2.0.0) + kamal (2.1.0) activesupport (>= 7.0) base64 (~> 0.2) bcrypt_pbkdf (~> 1.0) diff --git a/lib/kamal/version.rb b/lib/kamal/version.rb index c43aab05..b69ff471 100644 --- a/lib/kamal/version.rb +++ b/lib/kamal/version.rb @@ -1,3 +1,3 @@ module Kamal - VERSION = "2.0.0" + VERSION = "2.1.0" end