kamal 2.8.0 → 2.8.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 +4 -4
- data/lib/kamal/cli/port_forwarding.rb +15 -2
- data/lib/kamal/sshkit_with_ext.rb +8 -0
- data/lib/kamal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd8b2329effde7405d2a1b8d60f394d1da81faaf5e8bcd6980c83f8bb590f988
|
4
|
+
data.tar.gz: 5543d21fbe88acf86a24fcf1f44dff30e0aaf410b3ead0293b0f005b15fa2cbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdae637114b1ad0630d5b1bbc0e76be5ebb3817d370d1f3f5a4222024f13fa3546a24806ad812e9d6d14735c2be23ed6956702723e75cc27c5ec34ebe87d72f9
|
7
|
+
data.tar.gz: 8db206acbeb707f3a0d3267720b9d248cb2566517d340a61072777e0fdbbf237701d42e203d2d96b21fb7c04596896d6039c4ba9d59eb1515d47de0f85148248
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "concurrent/atomic/count_down_latch"
|
2
|
+
|
1
3
|
class Kamal::Cli::PortForwarding
|
2
4
|
attr_reader :hosts, :port
|
3
5
|
|
@@ -23,13 +25,22 @@ class Kamal::Cli::PortForwarding
|
|
23
25
|
end
|
24
26
|
|
25
27
|
def forward_ports
|
28
|
+
ready = Concurrent::CountDownLatch.new(hosts.size)
|
29
|
+
|
26
30
|
@threads = hosts.map do |host|
|
27
31
|
Thread.new do
|
28
32
|
Net::SSH.start(host, KAMAL.config.ssh.user, **{ proxy: KAMAL.config.ssh.proxy }.compact) do |ssh|
|
29
|
-
ssh.forward.remote(port, "localhost", port, "
|
33
|
+
ssh.forward.remote(port, "localhost", port, "127.0.0.1") do |remote_port, bind_address|
|
34
|
+
if remote_port == :error
|
35
|
+
raise "Failed to establish port forward on #{host}"
|
36
|
+
else
|
37
|
+
ready.count_down
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
30
41
|
ssh.loop(0.1) do
|
31
42
|
if @done
|
32
|
-
ssh.forward.cancel_remote(port, "
|
43
|
+
ssh.forward.cancel_remote(port, "127.0.0.1")
|
33
44
|
break
|
34
45
|
else
|
35
46
|
true
|
@@ -38,5 +49,7 @@ class Kamal::Cli::PortForwarding
|
|
38
49
|
end
|
39
50
|
end
|
40
51
|
end
|
52
|
+
|
53
|
+
raise "Timed out waiting for port forwarding to be established" unless ready.wait(10)
|
41
54
|
end
|
42
55
|
end
|
@@ -140,3 +140,11 @@ class SSHKit::Runner::Parallel
|
|
140
140
|
|
141
141
|
prepend CompleteAll
|
142
142
|
end
|
143
|
+
|
144
|
+
# Avoid net-ssh debug, until https://github.com/net-ssh/net-ssh/pull/953 is merged
|
145
|
+
module NetSshForwardingNoPuts
|
146
|
+
def puts(*)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
Net::SSH::Service::Forward.prepend NetSshForwardingNoPuts
|
data/lib/kamal/version.rb
CHANGED