Keep the selected exit ready and report idle tunnels in 1.0.5
Read the exit network and endpoint from the published routing choice. Start a normal WireGuard exchange at 120 seconds for that tunnel even when idle. BoringTun keeps the current key usable during the exchange and owns retry and expiry. Switching or clearing the route also moves or removes the renewal policy. Show Idle in the tray, on Android and in CLI status after 30 seconds without IP traffic on a previously established tunnel. Keep key changes and keepalives out of activity, and keep waiting packets, missing paths and transport errors visible. Preserve queued flow tags when a native keepalive occupies a slot and drain pending IP on key confirmation. Bump the local status IPC to 26 and update the workspace, Android and Nix versions. Upgrade the daemon and desktop clients together. Mesh protocols, key lifetimes and persistent storage remain compatible. On macOS arm64 the initial workspace run passed 602 tests. A separate 181-second two-agent test observed renewal only in the selected mesh and delivered its first internet packet after idle. Formatting and strict workspace Clippy passed on the release sources. The maintainer requested publication without waiting for another full test run.
This commit is contained in:
1 parent
e3e6089d0b
commit
6a0a87e76c
25 files changed
+506
-130
No files matched your search
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tsunagi"
|
||||
version = "1.0.4"
|
||||
version = "1.0.5"
|
||||
description = "The tsunagi command line agent."
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
@@ -12,11 +12,11 @@ name = "tsng"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
tsunagi-runtime = { path = "../tsunagi-runtime", version = "1.0.4" }
|
||||
tsunagi-core = { path = "../tsunagi-core", version = "1.0.4", features = ["tun-device", "dns-publish"] }
|
||||
tsunagi-wireguard = { path = "../tsunagi-wireguard", version = "1.0.4" }
|
||||
tsunagi-wg-quic = { path = "../tsunagi-wg-quic", version = "1.0.4" }
|
||||
tsunagi-tcp-tls = { path = "../tsunagi-tcp-tls", version = "1.0.4" }
|
||||
tsunagi-runtime = { path = "../tsunagi-runtime", version = "1.0.5" }
|
||||
tsunagi-core = { path = "../tsunagi-core", version = "1.0.5", features = ["tun-device", "dns-publish"] }
|
||||
tsunagi-wireguard = { path = "../tsunagi-wireguard", version = "1.0.5" }
|
||||
tsunagi-wg-quic = { path = "../tsunagi-wg-quic", version = "1.0.5" }
|
||||
tsunagi-tcp-tls = { path = "../tsunagi-tcp-tls", version = "1.0.5" }
|
||||
iroh.workspace = true
|
||||
tokio = { version = "1.53", features = ["rt", "rt-multi-thread", "sync", "time", "macros", "signal"] }
|
||||
tracing.workspace = true
|
||||
|
||||
@@ -3884,12 +3884,17 @@ fn member_row(row: &MemberRow<'_>) -> report::Row {
|
||||
),
|
||||
Some(DataPathReport::None) | None => ("connected · no data path yet".to_string(), false),
|
||||
};
|
||||
let idle = data_path_good && row.data_error.is_none() && row.tunnel.is_some_and(|t| t.idle);
|
||||
let show_counters = tunnel_up || idle;
|
||||
|
||||
let mut detail = String::new();
|
||||
if let Some(v4) = row.overlay_address_v4 {
|
||||
detail.push_str(&format!("{v4:<15} "));
|
||||
}
|
||||
detail.push_str(&path);
|
||||
if idle {
|
||||
detail.push_str(" · idle");
|
||||
}
|
||||
if let Some(rtt) = row.data_rtt_ms {
|
||||
detail.push_str(&format!(" data RTT {rtt}ms"));
|
||||
}
|
||||
@@ -3906,7 +3911,7 @@ fn member_row(row: &MemberRow<'_>) -> report::Row {
|
||||
}
|
||||
detail.extend(taken);
|
||||
|
||||
let health = if !data_path_good || row.data_error.is_some() || (has_overlay && !tunnel_up) {
|
||||
let health = if !data_path_good || row.data_error.is_some() || (has_overlay && !show_counters) {
|
||||
Health::Degraded
|
||||
} else {
|
||||
Health::Good
|
||||
@@ -3916,12 +3921,12 @@ fn member_row(row: &MemberRow<'_>) -> report::Row {
|
||||
if let Some(reason) = row.data_error {
|
||||
out = out.with_note(reason.to_owned());
|
||||
}
|
||||
if !tunnel_up && let Some(path) = row.data_transport_detail {
|
||||
if !show_counters && let Some(path) = row.data_transport_detail {
|
||||
out = out.with_note(path.to_owned());
|
||||
}
|
||||
if let Some(tunnel) = row.tunnel {
|
||||
out = out.with_note(match tunnel.handshake_secs_ago {
|
||||
Some(_) => format!(
|
||||
out = out.with_note(if show_counters {
|
||||
format!(
|
||||
"tx {} rx {} · IP bytes ↑{} ↓{}{} · {}",
|
||||
tunnel.tx_packets,
|
||||
tunnel.rx_packets,
|
||||
@@ -3933,8 +3938,9 @@ fn member_row(row: &MemberRow<'_>) -> report::Row {
|
||||
String::new()
|
||||
},
|
||||
row.data_transport_detail.unwrap_or(&tunnel.path)
|
||||
),
|
||||
None => "encrypted data channel is not ready yet".into(),
|
||||
)
|
||||
} else {
|
||||
"encrypted data channel is not ready yet".into()
|
||||
});
|
||||
}
|
||||
out
|
||||
@@ -5773,6 +5779,36 @@ mod status_tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_idle_peer_keeps_its_counters_and_a_missing_route_is_still_degraded() {
|
||||
let mut network = network_after_a_peer_returned();
|
||||
let mut quiet = tunnel(ONLINE, None);
|
||||
quiet.idle = true;
|
||||
network.overlay = Some(overlay(vec![quiet]));
|
||||
for (path, health) in [
|
||||
(
|
||||
tsunagi::ipc::DataPathReport::Direct {
|
||||
transport: "wg".into(),
|
||||
},
|
||||
Health::Good,
|
||||
),
|
||||
(tsunagi::ipc::DataPathReport::None, Health::Degraded),
|
||||
] {
|
||||
network.peers[0].path = path.clone();
|
||||
network.members[1].path = path;
|
||||
let mut report = report::Report::new();
|
||||
report.push(network_section(&network, OWN, false));
|
||||
let text = report.render(false);
|
||||
assert_eq!(report.worst(), health, "{text}");
|
||||
if health == Health::Good {
|
||||
assert!(
|
||||
text.contains("idle") && text.contains("tx 32 rx 887"),
|
||||
"{text}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn handshake_failures_with_nobody_connected_point_at_the_secret() {
|
||||
// The classic symptom of one member being given a different secret.
|
||||
|
||||
Reference in new issue
Block a user