Support SSH aliases in Dosh client installs
This commit is contained in:
@@ -80,7 +80,7 @@ async fn main() -> Result<()> {
|
||||
"read-write"
|
||||
}
|
||||
.to_string();
|
||||
let ssh_port = args.ssh_port.unwrap_or(config.ssh_port);
|
||||
let ssh_port = args.ssh_port.or(config.ssh_port);
|
||||
let dosh_port = args.dosh_port.unwrap_or(config.dosh_port);
|
||||
let cache_path = cache_path(&config.credential_cache, &server, &session, &mode);
|
||||
let (cols, rows) = size().unwrap_or((80, 24));
|
||||
@@ -232,7 +232,7 @@ fn local_bootstrap(
|
||||
|
||||
fn ssh_bootstrap(
|
||||
server: &str,
|
||||
ssh_port: u16,
|
||||
ssh_port: Option<u16>,
|
||||
ssh_auth_command: &str,
|
||||
ssh_key: Option<&std::path::Path>,
|
||||
ssh_known_hosts: Option<&std::path::Path>,
|
||||
@@ -246,7 +246,10 @@ fn ssh_bootstrap(
|
||||
let nonce_b64 = URL_SAFE_NO_PAD.encode(nonce);
|
||||
let size = format!("{cols}x{rows}");
|
||||
let mut command = Command::new("ssh");
|
||||
command.arg("-p").arg(ssh_port.to_string()).arg("-T");
|
||||
if let Some(ssh_port) = ssh_port {
|
||||
command.arg("-p").arg(ssh_port.to_string());
|
||||
}
|
||||
command.arg("-T");
|
||||
if let Some(key) = ssh_key {
|
||||
command.arg("-i").arg(key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user