feat(mesh): show federated Archipelago nodes on the Mesh Map
Peers that opt in via a new "Share Location" toggle in Settings (server.set-location RPC) get plotted on other trusted peers' Mesh Map with a distinct Archy-logo marker, separate from raw LoRa radio peers. Location is persisted locally, carried in NodeStateSnapshot, and propagated through federation sync/delta like other node state. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
e3baaa5de3
commit
177b8a4338
@@ -83,6 +83,16 @@ impl Server {
|
||||
data.server_info.name = Some(name);
|
||||
}
|
||||
}
|
||||
// Load persisted node location (Mesh Map opt-in sharing)
|
||||
let location_file = config.data_dir.join("server-location.json");
|
||||
if let Ok(bytes) = tokio::fs::read(&location_file).await {
|
||||
if let Ok(loc) = serde_json::from_slice::<serde_json::Value>(&bytes) {
|
||||
data.server_info.lat = loc.get("lat").and_then(|v| v.as_f64());
|
||||
data.server_info.lon = loc.get("lon").and_then(|v| v.as_f64());
|
||||
data.server_info.share_location =
|
||||
loc.get("share_location").and_then(|v| v.as_bool()).unwrap_or(false);
|
||||
}
|
||||
}
|
||||
data.server_info.tor_address = docker_packages::read_tor_address("archipelago").await;
|
||||
if let Some(ref tor) = data.server_info.tor_address {
|
||||
data.server_info.node_address = Some(identity.node_address(tor));
|
||||
|
||||
Reference in New Issue
Block a user