kamal 2.2.0 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f37e44e951bb159f0af8f19aea46d1cbbf4d6950777c11f545b0eafd0e3dcf0
4
- data.tar.gz: 628944b9411d03c7890b715eda2984c2b920fc271b8567432a20fe5b1af709ba
3
+ metadata.gz: 7da17dcbc307380fd036004d67e3007ea6824a4b634f161c2882776b5c2020df
4
+ data.tar.gz: c394f629044adecac7c2bc65a8ea6615269a010d68be8051c4fd4c579e5be686
5
5
  SHA512:
6
- metadata.gz: 7067b13ef2d61dca2e184a6abfc4707a840f954277febd489836e0e684fadef932015032ec23fc94889c33d37094ac5345ddd65e139ab63572c7d9e20090f240
7
- data.tar.gz: 3e1a750fc601a401ecd650e3701dbafc7adc5775c97e12131f47f75a5e04f0524a7ce867202f38a70c769086389bda8889de66f18614565d164f4e6c96f71ec3
6
+ metadata.gz: 41028ff1893c92dfea1d1de5f5289e60fd719f28445f7f827b513482463e364e3640a88003ef68b24b4fcb4f502f88dbb3daf9c4e04d956fc8a03e09d4f64d90
7
+ data.tar.gz: b6db1eb9d4acbd57ce4fcce79798a2f1ad47cd043e2624c03ee940a86fc32bf49bf0446c70142e98e7d87e06cc5c6ee6dd89448533b5c2577fd2d6ee57faaa87
@@ -21,7 +21,7 @@ class Kamal::Cli::Proxy < Kamal::Cli::Base
21
21
  end
22
22
  end
23
23
 
24
- desc "boot_config <set|get|clear>", "Mange kamal-proxy boot configuration"
24
+ desc "boot_config <set|get|reset>", "Manage kamal-proxy boot configuration"
25
25
  option :publish, type: :boolean, default: true, desc: "Publish the proxy ports on the host"
26
26
  option :http_port, type: :numeric, default: Kamal::Configuration::PROXY_HTTP_PORT, desc: "HTTP port to publish on the host"
27
27
  option :https_port, type: :numeric, default: Kamal::Configuration::PROXY_HTTPS_PORT, desc: "HTTPS port to publish on the host"
@@ -11,14 +11,7 @@ module Kamal::Commands
11
11
  end
12
12
 
13
13
  def run_over_ssh(*command, host:)
14
- "ssh".tap do |cmd|
15
- if config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Jump)
16
- cmd << " -J #{config.ssh.proxy.jump_proxies}"
17
- elsif config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Command)
18
- cmd << " -o ProxyCommand='#{config.ssh.proxy.command_line_template}'"
19
- end
20
- cmd << " -t #{config.ssh.user}@#{host} -p #{config.ssh.port} '#{command.join(" ").gsub("'", "'\\\\''")}'"
21
- end
14
+ "ssh#{ssh_proxy_args} -t #{config.ssh.user}@#{host} -p #{config.ssh.port} '#{command.join(" ").gsub("'", "'\\\\''")}'"
22
15
  end
23
16
 
24
17
  def container_id_for(container_name:, only_running: false)
@@ -92,5 +85,14 @@ module Kamal::Commands
92
85
  def tags(**details)
93
86
  Kamal::Tags.from_config(config, **details)
94
87
  end
88
+
89
+ def ssh_proxy_args
90
+ case config.ssh.proxy
91
+ when Net::SSH::Proxy::Jump
92
+ " -J #{config.ssh.proxy.jump_proxies}"
93
+ when Net::SSH::Proxy::Command
94
+ " -o ProxyCommand='#{config.ssh.proxy.command_line_template}'"
95
+ end
96
+ end
95
97
  end
96
98
  end
@@ -1,29 +1,31 @@
1
1
  module Kamal::Commands::Builder::Clone
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
- delegate :clone_directory, :build_directory, to: :"config.builder"
6
- end
7
-
8
2
  def clone
9
- git :clone, Kamal::Git.root, "--recurse-submodules", path: clone_directory
3
+ git :clone, escaped_root, "--recurse-submodules", path: config.builder.clone_directory.shellescape
10
4
  end
11
5
 
12
6
  def clone_reset_steps
13
7
  [
14
- git(:remote, "set-url", :origin, Kamal::Git.root, path: build_directory),
15
- git(:fetch, :origin, path: build_directory),
16
- git(:reset, "--hard", Kamal::Git.revision, path: build_directory),
17
- git(:clean, "-fdx", path: build_directory),
18
- git(:submodule, :update, "--init", path: build_directory)
8
+ git(:remote, "set-url", :origin, escaped_root, path: escaped_build_directory),
9
+ git(:fetch, :origin, path: escaped_build_directory),
10
+ git(:reset, "--hard", Kamal::Git.revision, path: escaped_build_directory),
11
+ git(:clean, "-fdx", path: escaped_build_directory),
12
+ git(:submodule, :update, "--init", path: escaped_build_directory)
19
13
  ]
20
14
  end
21
15
 
22
16
  def clone_status
23
- git :status, "--porcelain", path: build_directory
17
+ git :status, "--porcelain", path: escaped_build_directory
24
18
  end
25
19
 
26
20
  def clone_revision
27
- git :"rev-parse", :HEAD, path: build_directory
21
+ git :"rev-parse", :HEAD, path: escaped_build_directory
22
+ end
23
+
24
+ def escaped_root
25
+ Kamal::Git.root.shellescape
26
+ end
27
+
28
+ def escaped_build_directory
29
+ config.builder.build_directory.shellescape
28
30
  end
29
31
  end
@@ -14,7 +14,7 @@ class Kamal::Configuration
14
14
 
15
15
  include Validation
16
16
 
17
- PROXY_MINIMUM_VERSION = "v0.8.0"
17
+ PROXY_MINIMUM_VERSION = "v0.8.1"
18
18
  PROXY_HTTP_PORT = 80
19
19
  PROXY_HTTPS_PORT = 443
20
20
  PROXY_LOG_MAX_SIZE = "10m"
data/lib/kamal/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kamal
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamal
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-08 00:00:00.000000000 Z
11
+ date: 2024-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport