nix: allow archive relay URL affinity override

This commit is contained in:
every.channel 2026-02-24 22:02:29 -08:00
parent 1197bb4baa
commit cc5cf0be3b
No known key found for this signature in database
2 changed files with 43 additions and 1 deletions

View file

@ -0,0 +1,33 @@
# ECP-0073: Archive Relay Affinity Override
## Context
`wt-archive` workers discover streams from `/api/public-streams` and subscribe to the listed `relay_url`. In practice, `cdn.moq.dev` resolves to region-local relay IPs, and broadcasts published from one region are not consistently visible from another region endpoint.
For archive nodes running in a different region than publishers, this causes workers to connect successfully but wait indefinitely for broadcast announcements.
## Decision
Add an explicit Nix module option:
- `services.every-channel.ec-node.archive.relayUrlOverride` (nullable string)
When set, archive workers ignore per-entry `relay_url` from directory listings and always subscribe through the configured override URL.
This allows operators to pin archive ingestion to the same relay endpoint used by publishers without changing public directory payloads.
## Why
- Restores deterministic archival ingestion across regions.
- Keeps deployment-level control in Nix (no app-level migration needed).
- Reversible with a single config change.
## Rollout
1. Set `archive.relayUrlOverride` on archive hosts that need relay affinity.
2. If override uses an IP literal, enable `archive.tlsDisableVerify = true` until SNI-preserving IP overrides are implemented.
3. Rebuild host and verify manifest growth.
## Reversibility
Unset `archive.relayUrlOverride` to return to directory-provided `relay_url` behavior.