fix(relay): stop requiring operator API origin for admin console boot

RELAY_OPERATOR_PUBKEYS is the shared allowlist for both the NIP-98 admin
console and the community-provisioning endpoints, but only provisioning needs
RELAY_OPERATOR_API_ORIGIN. The boot hard-error forced admin-console operators
to configure a provisioning surface they never use.

Demote the boot error to a WARN naming the affected feature, and keep the
provisioning endpoints fail-closed at request time: authorize_operator_request
already rejects with a clean 500 when the origin is unset, before any replay or
DB access. Document the decoupling and the NIP-11 admin_api advertisement in
the env examples and the admin README.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
Duncan
2026-08-10 20:06:41 -04:00
parent bcfa86046f
commit 7a73eaa926
6 changed files with 151 additions and 12 deletions

View File

@@ -48,10 +48,16 @@ BUZZ_S3_ADDRESSING_STYLE=path
# and the relay_operators table (DB-managed Operator/Moderator roster).
# Dashboard requires a NIP-07 browser extension (nos2x or Alby).
# Any unrecognised BUZZ_ADMIN_AUTH value, or conflicting combinations, aborts startup.
# When BUZZ_ADMIN_HOST is set, the relay advertises the admin origin in its NIP-11
# document (`admin_api` field) so clients auto-discover the console without manual entry.
# Setting RELAY_OPERATOR_PUBKEYS for the console does NOT require RELAY_OPERATOR_API_ORIGIN;
# that origin is only for community provisioning (POST /operator/communities), which fails
# closed at request time until it is set (the relay boots with a WARN in the meantime).
# BUZZ_ADMIN_HOST=admin.buzz.example.com
# BUZZ_ADMIN_AUTH=token
# BUZZ_ADMIN_TOKEN=CHANGE_ME_RANDOM_64_HEX
# RELAY_OPERATOR_PUBKEYS=<64-char hex pubkey>[,<64-char hex pubkey>...]
# RELAY_OPERATOR_API_ORIGIN=https://admin.buzz.example.com
# Optional host ports. Base compose publishes the relay directly on BUZZ_HTTP_PORT.
BUZZ_HTTP_PORT=3000