feat(marmot-interop): patch wnd to honour \$WHITENOISE_DISCOVERY_RELAYS
Without this, wnd exits on startup with NoRelayConnections in any environment that can't reach wnd's baked-in public discovery relay set (nos.lol, relay.damus.io, …). The headless harness runs entirely on a loopback relay, so hitting the public internet is never OK. Changes: - headless/patches/whitenoise-discovery-env.patch: adds an env-var override at the top of DiscoveryPlaneConfig::curated_default_relays. When \$WHITENOISE_DISCOVERY_RELAYS is set (comma-separated) we use that list instead of the hardcoded public one. - headless/setup.sh: applies the patch in preflight (idempotent — checks for a .headless-discovery-patched marker), invalidates the previous wn/wnd build on first patch, rebuilds, and threads \$WHITENOISE_DISCOVERY_RELAYS=\$RELAY_URL into every start_daemon invocation. https://claude.ai/code/session_01M6dCKAF5Y1VyHGZPjzwDXq
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
--- a/src/relay_control/discovery.rs
|
||||
+++ b/src/relay_control/discovery.rs
|
||||
@@ -87,6 +87,20 @@
|
||||
|
||||
/// Initial curated relay set from the planning doc.
|
||||
pub(crate) fn curated_default_relays() -> Vec<RelayUrl> {
|
||||
+ // marmot-interop-headless patch: honour $WHITENOISE_DISCOVERY_RELAYS
|
||||
+ // (comma-separated list) when present, so the harness can force wnd
|
||||
+ // to use a loopback relay instead of the baked-in public set.
|
||||
+ if let Ok(from_env) = std::env::var("WHITENOISE_DISCOVERY_RELAYS") {
|
||||
+ let parsed: Vec<RelayUrl> = from_env
|
||||
+ .split(',')
|
||||
+ .map(str::trim)
|
||||
+ .filter(|s| !s.is_empty())
|
||||
+ .filter_map(|u| RelayUrl::parse(u).ok())
|
||||
+ .collect();
|
||||
+ if !parsed.is_empty() {
|
||||
+ return parsed;
|
||||
+ }
|
||||
+ }
|
||||
[
|
||||
"wss://index.hzrd149.com",
|
||||
"wss://indexer.coracle.social",
|
||||
Reference in New Issue
Block a user