(gateway: &str, name: &str)
| 1433 | } |
| 1434 | |
| 1435 | fn render_ssh_config(gateway: &str, name: &str) -> String { |
| 1436 | let exe = std::env::current_exe().expect("failed to resolve OpenShell executable"); |
| 1437 | let exe = shell_escape(&exe.to_string_lossy()); |
| 1438 | |
| 1439 | let proxy_cmd = format!( |
| 1440 | "{exe} ssh-proxy --gateway-name {} --name {}", |
| 1441 | shell_escape(gateway), |
| 1442 | shell_escape(name), |
| 1443 | ); |
| 1444 | let host_alias = host_alias(name); |
| 1445 | format!( |
| 1446 | "Host {host_alias}\n User sandbox\n StrictHostKeyChecking no\n UserKnownHostsFile /dev/null\n GlobalKnownHostsFile /dev/null\n LogLevel ERROR\n ServerAliveInterval 15\n ServerAliveCountMax 3\n ProxyCommand {proxy_cmd}\n" |
| 1447 | ) |
| 1448 | } |
| 1449 | |
| 1450 | fn openshell_ssh_config_path() -> Result<PathBuf> { |
| 1451 | Ok(openshell_core::paths::xdg_config_dir()? |
no test coverage detected