Warn on client server version mismatch
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled
This commit is contained in:
+21
-3
@@ -925,6 +925,13 @@ async fn run_doctor_for_host(
|
|||||||
&check.server_version
|
&check.server_version
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
if server_version_mismatch(&check.server_version) {
|
||||||
|
println!(
|
||||||
|
"[warn] version mismatch: client={} server={}",
|
||||||
|
env!("CARGO_PKG_VERSION"),
|
||||||
|
check.server_version
|
||||||
|
);
|
||||||
|
}
|
||||||
println!("[ok] known host: trusted");
|
println!("[ok] known host: trusted");
|
||||||
println!("[ok] native auth: authorized as {}", check.requested_user);
|
println!("[ok] native auth: authorized as {}", check.requested_user);
|
||||||
println!(
|
println!(
|
||||||
@@ -942,6 +949,10 @@ async fn run_doctor_for_host(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn server_version_mismatch(server_version: &str) -> bool {
|
||||||
|
!server_version.is_empty() && server_version != env!("CARGO_PKG_VERSION")
|
||||||
|
}
|
||||||
|
|
||||||
fn ensure_tui_safe_status_overlay(bytes: &[u8]) -> Result<()> {
|
fn ensure_tui_safe_status_overlay(bytes: &[u8]) -> Result<()> {
|
||||||
anyhow::ensure!(
|
anyhow::ensure!(
|
||||||
bytes.starts_with(b"\x1b7"),
|
bytes.starts_with(b"\x1b7"),
|
||||||
@@ -5101,9 +5112,9 @@ mod tests {
|
|||||||
parse_escape_key, parse_local_forward, parse_remote_forward, parse_ssh_config,
|
parse_escape_key, parse_local_forward, parse_remote_forward, parse_ssh_config,
|
||||||
queue_pending_user_input, raw_contains_host_table, recv_response_until,
|
queue_pending_user_input, raw_contains_host_table, recv_response_until,
|
||||||
render_status_clear, render_status_overlay, requested_env, resolved_startup_command,
|
render_status_clear, render_status_overlay, requested_env, resolved_startup_command,
|
||||||
rewrite_forward_command, selected_predict_mode, selected_udp_host, ssh_destination_host,
|
rewrite_forward_command, selected_predict_mode, selected_udp_host, server_version_mismatch,
|
||||||
ssh_username, ssh_with_user, startup_command, status_ssh_target, toml_bare_key_or_quoted,
|
ssh_destination_host, ssh_username, ssh_with_user, startup_command, status_ssh_target,
|
||||||
update_check_requested, valid_forward_host,
|
toml_bare_key_or_quoted, update_check_requested, valid_forward_host,
|
||||||
};
|
};
|
||||||
use dosh::config::{ClientConfig, CommandExtension, HostConfig};
|
use dosh::config::{ClientConfig, CommandExtension, HostConfig};
|
||||||
use dosh::native::EnvVar;
|
use dosh::native::EnvVar;
|
||||||
@@ -5792,6 +5803,13 @@ mod tests {
|
|||||||
assert!(RESTART_STATUS_SCRIPT.contains("dosh-server"));
|
assert!(RESTART_STATUS_SCRIPT.contains("dosh-server"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn doctor_detects_server_version_mismatch() {
|
||||||
|
assert!(!server_version_mismatch(""));
|
||||||
|
assert!(!server_version_mismatch(env!("CARGO_PKG_VERSION")));
|
||||||
|
assert!(server_version_mismatch("0.0.0-old"));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn release_download_url_uses_latest_release_asset() {
|
fn release_download_url_uses_latest_release_asset() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|||||||
Reference in New Issue
Block a user