diff --git a/lib/kamal/configuration/docs/ssh.yml b/lib/kamal/configuration/docs/ssh.yml index 88fcd1327..813881e61 100644 --- a/lib/kamal/configuration/docs/ssh.yml +++ b/lib/kamal/configuration/docs/ssh.yml @@ -32,7 +32,7 @@ ssh: # Proxy host # # Specified in the form or @ - proxy: root@proxy-host + proxy: proxy-host # Proxy command # diff --git a/lib/kamal/configuration/ssh.rb b/lib/kamal/configuration/ssh.rb index dc88367e2..993c746e6 100644 --- a/lib/kamal/configuration/ssh.rb +++ b/lib/kamal/configuration/ssh.rb @@ -19,9 +19,9 @@ def port end def proxy - if (proxy = ssh_config["proxy"]) - Net::SSH::Proxy::Jump.new(proxy.include?("@") ? proxy : "root@#{proxy}") - elsif (proxy_command = ssh_config["proxy_command"]) + if proxy = ssh_config["proxy"] + Net::SSH::Proxy::Jump.new(proxy) + elsif proxy_command = ssh_config["proxy_command"] Net::SSH::Proxy::Command.new(proxy_command) end end diff --git a/test/configuration/ssh_test.rb b/test/configuration/ssh_test.rb index 76d1ae9a7..987335197 100644 --- a/test/configuration/ssh_test.rb +++ b/test/configuration/ssh_test.rb @@ -30,7 +30,7 @@ class ConfigurationSshTest < ActiveSupport::TestCase test "ssh options with proxy host" do config = Kamal::Configuration.new(@deploy.tap { |c| c.merge!(ssh: { "proxy" => "1.2.3.4" }) }) - assert_equal "root@1.2.3.4", config.ssh.options[:proxy].jump_proxies + assert_equal "1.2.3.4", config.ssh.options[:proxy].jump_proxies end test "ssh options with proxy host and user" do