Add a Rust Android mesh client with shared tray views
Run one agent for all joined networks behind Android's VPN service. Share transport registration and reporting with the CLI, and move the tray's egui forms into a Rust UI crate. Phones use compact device rows and a full-width exit picker with RTT and data path. All four transports retain their per-network selection and priority. The phone consumes remote IPv4 exits and keeps the existing desktop identity and wire protocols. Send discovery and transport traffic over the physical network and bind VIP TCP health checks to the mesh. Build local DNS zones from the same signed membership and VIP records on desktop and Android. Answer UDP and TCP queries on the VPN, keep unknown mesh names local, and resolve public names through Android's underlying resolver, including with an exit. Show an ongoing notification for the selected exit. Guard its disconnect action against a stale selection and keep mesh routing and DNS alive when it removes the default route. Remove the app notification in mesh-only mode. Document Android 14's unlocked-device swipe behavior. Checked formatting and ran locked all-target workspace Clippy with warnings denied and tests on macOS (547 passed, 2 ignored). Built the arm64 debug APK. A physical Pixel resolved a mesh member and a Kubernetes VIP, answered UDP and TCP DNS, and reached the API over TLS (HTTP 401 without credentials). On a separate Android emulator the notification action removed the default route and notice while mesh DNS still worked.
This commit is contained in:
1 parent
9dec056349
commit
ef67e1c0ae
70 files changed
+6199
-1181
No files matched your search
@@ -59,6 +59,56 @@ pub fn listen_plan(port: u16) -> ListenPlan {
|
||||
pub use server::{DnsServer, SharedZone};
|
||||
pub use zone::{Answer, Query, Zone, ZoneError, ZoneName, Zones};
|
||||
|
||||
/// Authoritative zones and the publication diagnostics for one agent snapshot.
|
||||
pub struct RosterZones {
|
||||
/// Member and service records indexed by zone.
|
||||
pub zones: Zones,
|
||||
/// Zone names in configured-network order.
|
||||
pub labels: Vec<String>,
|
||||
/// Unusable or potentially conflicting zone names.
|
||||
pub warnings: Vec<String>,
|
||||
}
|
||||
|
||||
impl RosterZones {
|
||||
/// Build the desktop and mobile DNS view from the same signed state.
|
||||
pub fn from_networks(networks: &[crate::NetworkStatus]) -> Self {
|
||||
let mut zones = Vec::new();
|
||||
let mut labels = Vec::new();
|
||||
let mut warnings = Vec::new();
|
||||
for network in networks {
|
||||
let zone = match ZoneName::new(network.name.as_str()) {
|
||||
Ok(zone) => zone,
|
||||
Err(err) => {
|
||||
warnings.push(format!(
|
||||
"`{}` cannot be a zone, so its members have no names: {err}",
|
||||
network.name
|
||||
));
|
||||
continue;
|
||||
}
|
||||
};
|
||||
if let Some(warning) = zone.collision() {
|
||||
warnings.push(warning);
|
||||
}
|
||||
labels.push(zone.as_str().to_string());
|
||||
let members = network
|
||||
.members
|
||||
.iter()
|
||||
.filter_map(|member| Some((member.hostname.clone()?, member.overlay_address_v4?)));
|
||||
let services = network
|
||||
.vips
|
||||
.iter()
|
||||
.filter(|vip| vip.error.is_none())
|
||||
.filter_map(|vip| Some((vip.config.name.clone(), vip.address?)));
|
||||
zones.push(Zone::new(zone, members.chain(services)).with_reverse_range(network.range));
|
||||
}
|
||||
Self {
|
||||
zones: Zones::new(zones),
|
||||
labels,
|
||||
warnings,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
||||
|
||||
Reference in new issue
Block a user