From 02847ef1db7ca7c7da3d5d4c679a4af54cc042c7 Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Thu, 16 Apr 2026 20:58:01 +0800 Subject: [PATCH] fix(git): downgrade russh to 0.50.4, remove flate2 feature, fix log format - Downgrade russh from 0.55.0 to 0.50.4 - Remove unused flate2 feature from russh dependency - Use info!(logger, "{}", format!(...)) for channel lifecycle log messages --- Cargo.toml | 2 +- libs/git/Cargo.toml | 2 +- libs/git/ssh/handle.rs | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5d956bf..799fadd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,7 +98,7 @@ prost = "0.14.3" prost-build = "0.14.3" qdrant-client = "1.17.0" rand = "0.10.0" -russh = { version = "0.55.0", default-features = false } +russh = { version = "0.50.0", default-features = false, features = [] } hmac = { version = "0.12.1", features = ["std"] } sha1_smol = "1.0.1" rsa = { version = "0.9.7", package = "rsa" } diff --git a/libs/git/Cargo.toml b/libs/git/Cargo.toml index 9d0b62c..81127ee 100644 --- a/libs/git/Cargo.toml +++ b/libs/git/Cargo.toml @@ -39,7 +39,7 @@ chrono = { workspace = true } sysinfo = { workspace = true } num_cpus = { workspace = true } futures = { workspace = true } -russh = { workspace = true, features = ["flate2", "ring", "legacy-ed25519-pkcs8-parser"] } +russh = { workspace = true, features = ["legacy-ed25519-pkcs8-parser"] } anyhow = { workspace = true } base64 = { workspace = true } sha1 = { workspace = true } diff --git a/libs/git/ssh/handle.rs b/libs/git/ssh/handle.rs index ab4c8c9..1e93bc6 100644 --- a/libs/git/ssh/handle.rs +++ b/libs/git/ssh/handle.rs @@ -423,7 +423,7 @@ impl russh::server::Handler for SSHandle { .client_addr .map(|addr| format!("{}", addr)) .unwrap_or_else(|| "unknown".to_string()); - info!(self.logger, "channel_open_session"; "channel" => ?channel, "client" => %client_info); + info!(self.logger, "{}", format!("channel_open_session channel={:?} client={}", channel, client_info)); let _ = session.flush().ok(); Ok(true) } @@ -443,8 +443,7 @@ impl russh::server::Handler for SSHandle { .client_addr .map(|addr| format!("{}", addr)) .unwrap_or_else(|| "unknown".to_string()); - warn!(self.logger, "pty_request (not supported)"; - "channel" => ?channel, "term" => %term, "cols" => col_width, "rows" => row_height, "client" => %client_info); + warn!(self.logger, "{}", format!("pty_request not supported channel={:?} term={} cols={} rows={} client={}", channel, term, col_width, row_height, client_info)); let _ = session.flush().ok(); Ok(()) } @@ -459,8 +458,7 @@ impl russh::server::Handler for SSHandle { .client_addr .map(|addr| format!("{}", addr)) .unwrap_or_else(|| "unknown".to_string()); - info!(self.logger, "subsystem_request"; - "channel" => ?channel, "subsystem" => %name, "client" => %client_info); + info!(self.logger, "{}", format!("subsystem_request channel={:?} subsystem={} client={}", channel, name, client_info)); // git-clients may send "subsystem" for git protocol over ssh. // We don't use subsystem; exec_request handles it directly. let _ = session.flush().ok();