Use installed dosh-auth path for SSH bootstrap
This commit is contained in:
@@ -23,7 +23,7 @@ struct Args {
|
||||
local_auth: bool,
|
||||
#[arg(long)]
|
||||
client: Option<PathBuf>,
|
||||
#[arg(long, default_value = "dosh-auth")]
|
||||
#[arg(long, default_value = "~/.local/bin/dosh-auth")]
|
||||
ssh_auth_command: String,
|
||||
#[arg(long)]
|
||||
ssh_key: Option<PathBuf>,
|
||||
|
||||
@@ -39,8 +39,8 @@ struct Args {
|
||||
attach_only: bool,
|
||||
#[arg(long)]
|
||||
ssh_port: Option<u16>,
|
||||
#[arg(long, default_value = "dosh-auth")]
|
||||
ssh_auth_command: String,
|
||||
#[arg(long)]
|
||||
ssh_auth_command: Option<String>,
|
||||
#[arg(long)]
|
||||
ssh_key: Option<std::path::PathBuf>,
|
||||
#[arg(long)]
|
||||
@@ -81,6 +81,11 @@ async fn main() -> Result<()> {
|
||||
}
|
||||
.to_string();
|
||||
let ssh_port = args.ssh_port.or(config.ssh_port);
|
||||
let ssh_auth_command = args
|
||||
.ssh_auth_command
|
||||
.clone()
|
||||
.or_else(|| config.ssh_auth_command.clone())
|
||||
.unwrap_or_else(|| "~/.local/bin/dosh-auth".to_string());
|
||||
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));
|
||||
@@ -164,7 +169,7 @@ async fn main() -> Result<()> {
|
||||
let mut bootstrap = ssh_bootstrap(
|
||||
&server,
|
||||
ssh_port,
|
||||
&args.ssh_auth_command,
|
||||
&ssh_auth_command,
|
||||
args.ssh_key.as_deref(),
|
||||
args.ssh_known_hosts.as_deref(),
|
||||
args.ssh_control_path.as_deref(),
|
||||
|
||||
@@ -46,6 +46,7 @@ impl Default for ServerConfig {
|
||||
pub struct ClientConfig {
|
||||
pub server: String,
|
||||
pub dosh_host: Option<String>,
|
||||
pub ssh_auth_command: Option<String>,
|
||||
pub ssh_port: Option<u16>,
|
||||
pub dosh_port: u16,
|
||||
pub default_session: String,
|
||||
@@ -60,6 +61,7 @@ impl Default for ClientConfig {
|
||||
Self {
|
||||
server: "user@example.com".to_string(),
|
||||
dosh_host: None,
|
||||
ssh_auth_command: Some("~/.local/bin/dosh-auth".to_string()),
|
||||
ssh_port: None,
|
||||
dosh_port: 50000,
|
||||
default_session: "default".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user