kamal 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7358f4d2dd4e267e0fccab45df538facb5f1cfb598cee5561495139e3b06f62
4
- data.tar.gz: 6bc6d6e32693cba5af10dba86aefe0af00e48fee214eee1b9483a892f0a30d0d
3
+ metadata.gz: fba91f4d7c980288819db64e720bd4295ab0d5107b9ecb0178a412cbef74c175
4
+ data.tar.gz: a2a5c57843f85ca13eb9c1e7dbc9227b3044273ff7ca629619b03395c0eae2d1
5
5
  SHA512:
6
- metadata.gz: 3629d4180a4f0350fc28f9488dbf516f79a8c6fe0e64854a56e88b4846d0f855e0e9621f3695958db12104342ef1bee90cdfc93d2b5a32583973862c71e8eba4
7
- data.tar.gz: 2dbd756cf617c2afc9b70603a9da9991c83f6d7fb6cf2e0be59c07d29b65ba53d84ea875727c1b888cde0889458099c24451eed3c406017548891815329eb289
6
+ metadata.gz: 578305b46242ea6853beae0d5342090e64b91aea2146cdd37448e82b744645b900b9c670e509b0adc56db62b4d22b0040c2c2b03ea17d48a4cd469a8a7c5a4ab
7
+ data.tar.gz: e10cfcb8c13ae177822afbbcfd1024731cfd416e1cde0b2b43d8ed9b3abe93b7638246eb0432f0c0e28f98e99430f5d97610f9f5ae5c880abfe3459e8fe23f09
@@ -43,7 +43,12 @@ class Kamal::Commander::Specifics
43
43
  end
44
44
 
45
45
  def specified_hosts
46
- (specific_hosts || config.all_hosts) \
47
- .select { |host| (specific_roles || config.roles).flat_map(&:hosts).include?(host) }
46
+ specified_hosts = specific_hosts || config.all_hosts
47
+
48
+ if (specific_role_hosts = specific_roles&.flat_map(&:hosts)).present?
49
+ specified_hosts.select { |host| specific_role_hosts.include?(host) }
50
+ else
51
+ specified_hosts
52
+ end
48
53
  end
49
54
  end
data/lib/kamal/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kamal
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
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.1.0
4
+ version: 2.1.1
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-02 00:00:00.000000000 Z
11
+ date: 2024-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -285,7 +285,6 @@ files:
285
285
  - lib/kamal/configuration/env/tag.rb
286
286
  - lib/kamal/configuration/logging.rb
287
287
  - lib/kamal/configuration/proxy.rb
288
- - lib/kamal/configuration/proxy.rb.orig
289
288
  - lib/kamal/configuration/registry.rb
290
289
  - lib/kamal/configuration/role.rb
291
290
  - lib/kamal/configuration/servers.rb
@@ -337,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
337
336
  - !ruby/object:Gem::Version
338
337
  version: '0'
339
338
  requirements: []
340
- rubygems_version: 3.3.22
339
+ rubygems_version: 3.5.16
341
340
  signing_key:
342
341
  specification_version: 4
343
342
  summary: Deploy web apps in containers to servers running Docker with zero downtime.
@@ -1,67 +0,0 @@
1
- class Kamal::Configuration::Proxy
2
- include Kamal::Configuration::Validation
3
-
4
- DEFAULT_LOG_REQUEST_HEADERS = [ "Cache-Control", "Last-Modified", "User-Agent" ]
5
- CONTAINER_NAME = "kamal-proxy"
6
-
7
- delegate :argumentize, :optionize, to: Kamal::Utils
8
-
9
- attr_reader :config, :proxy_config
10
-
11
- def initialize(config:, proxy_config:, context: "proxy")
12
- @config = config
13
- @proxy_config = proxy_config
14
- validate! @proxy_config, with: Kamal::Configuration::Validator::Proxy, context: context
15
- end
16
-
17
- def app_port
18
- proxy_config.fetch("app_port", 80)
19
- end
20
-
21
- def ssl?
22
- proxy_config.fetch("ssl", false)
23
- end
24
-
25
- def hosts
26
- proxy_config["hosts"] || proxy_config["host"]&.split(",") || []
27
- end
28
-
29
- def deploy_options
30
- {
31
- <<<<<<< HEAD
32
- host: hosts,
33
- tls: proxy_config["ssl"] ? true : nil,
34
- =======
35
- host: proxy_config["host"],
36
- tls: proxy_config["ssl"],
37
- >>>>>>> 530d2cb (Use `=` in kamal-proxy deploy command args)
38
- "deploy-timeout": seconds_duration(config.deploy_timeout),
39
- "drain-timeout": seconds_duration(config.drain_timeout),
40
- "health-check-interval": seconds_duration(proxy_config.dig("healthcheck", "interval")),
41
- "health-check-timeout": seconds_duration(proxy_config.dig("healthcheck", "timeout")),
42
- "health-check-path": proxy_config.dig("healthcheck", "path"),
43
- "target-timeout": seconds_duration(proxy_config["response_timeout"]),
44
- "buffer-requests": proxy_config.fetch("buffering", { "requests": true }).fetch("requests", true),
45
- "buffer-responses": proxy_config.fetch("buffering", { "responses": true }).fetch("responses", true),
46
- "buffer-memory": proxy_config.dig("buffering", "memory"),
47
- "max-request-body": proxy_config.dig("buffering", "max_request_body"),
48
- "max-response-body": proxy_config.dig("buffering", "max_response_body"),
49
- "forward-headers": proxy_config.dig("forward_headers"),
50
- "log-request-header": proxy_config.dig("logging", "request_headers") || DEFAULT_LOG_REQUEST_HEADERS,
51
- "log-response-header": proxy_config.dig("logging", "response_headers")
52
- }.compact
53
- end
54
-
55
- def deploy_command_args(target:)
56
- optionize ({ target: "#{target}:#{app_port}" }).merge(deploy_options), with: "="
57
- end
58
-
59
- def merge(other)
60
- self.class.new config: config, proxy_config: proxy_config.deep_merge(other.proxy_config)
61
- end
62
-
63
- private
64
- def seconds_duration(value)
65
- value ? "#{value}s" : nil
66
- end
67
- end