Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions crates/rustyclaw-core/src/gateway/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,8 @@ pub async fn run_gateway(
});

if let Some(ssh_listen) = ssh_addr {
let bind_addr: std::net::SocketAddr = ssh_listen.parse()
.unwrap_or_else(|_| "0.0.0.0:2222".parse().unwrap());
let ssh_cfg = {
let host_key = options.ssh_host_key.clone().unwrap_or_else(|| {
config.ssh.as_ref()
Expand All @@ -509,6 +511,7 @@ pub async fn run_gateway(
.unwrap_or_else(|| config.settings_dir.join("authorized_clients"))
});
ssh::SshConfig {
listen_addr: bind_addr,
host_key_path: host_key,
authorized_clients_path: authorized,
allow_password: false,
Expand All @@ -518,8 +521,6 @@ pub async fn run_gateway(

match ssh::SshServer::new(ssh_cfg).await {
Ok(mut ssh_server) => {
let bind_addr: std::net::SocketAddr = ssh_listen.parse()
.unwrap_or_else(|_| "0.0.0.0:2222".parse().unwrap());

if let Err(e) = ssh_server.listen(bind_addr).await {
error!(error = %e, "Failed to start SSH server");
Expand Down
Loading