feat: configurable relay/discovery posture, default to no DNS beacon

The endpoint previously used presets::N0, which both relays through n0's
servers and publishes a signed EndpointId->addresses record to n0's public
DNS every time you go online. Since PeerSpeak already exchanges full peer
addresses via the join ticket and gossip, that DNS presence beacon is
redundant here.

Adds a NetworkMode config option (persisted, switchable from Settings):
- RelayNoDiscovery (new default): presets::Minimal + RelayMode::Default +
  the in-memory address lookup. Keeps n0 relay for NAT traversal but drops
  the DNS publish/resolve, so n0 only ever sees relayed-call metadata, never
  a standing online beacon.
- N0Full: previous behavior (relay + DNS) for maximum reliability.
- DirectOnly: RelayMode::Disabled, fully serverless.

The mode is applied when the endpoint is built on room join. Existing
config.json files load unchanged via #[serde(default)].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-29 16:10:38 -04:00
co-authored by Claude Opus 4.8
parent 875e6e124c
commit c8666d588b
4 changed files with 114 additions and 13 deletions
+4
View File
@@ -1,3 +1,4 @@
use crate::config::NetworkMode;
use crate::network::PeerState;
use iroh::EndpointId;
@@ -11,6 +12,9 @@ pub enum CoreCommand {
SetPttActive(bool),
SetPeerVolume(EndpointId, f32),
SetNoiseGateThreshold(f32),
/// Set the relay/discovery posture. Takes effect on the next room join,
/// since the endpoint is (re)built then.
SetNetworkMode(NetworkMode),
}
#[derive(Debug, Clone)]