SSH proxy: allow using a bare hostname without root@
Otherwise we can't connect to the proxy as the local user and we can't use ~/.ssh/config to set User directives. Defaulting to root@ is hard to deprecate without introducing new config. A clean break is probably clearest.
This commit is contained in:
@@ -29,8 +29,8 @@ ssh:
|
||||
|
||||
# Proxy host
|
||||
#
|
||||
# Specified in the form <host> or <user>@<host>:
|
||||
proxy: root@proxy-host
|
||||
# Specified in the form <host> or <user>@<host>
|
||||
proxy: proxy-host
|
||||
|
||||
# Proxy command
|
||||
#
|
||||
|
||||
@@ -19,9 +19,9 @@ class Kamal::Configuration::Ssh
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user