[Relay] Sovereign Nostr Relay Infrastructure (strfry on Hermes) #46
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & Why
Deploy strfry (high-performance Nostr relay in C++) as a containerized service inside Timmy's infrastructure stack on Hermes VPS. The relay uses strfry's plugin/webhook system to call back to the API server before accepting any event — so the API server is the single arbiter of what gets through.
Done looks like
strfrycontainer added toinfrastructure/docker-compose.ymlonnode-net, bound to port 7777infrastructure/strfry.conf: setsdb,bind,port,writePolicy.pluginpointing to sidecar webhookinfrastructure/relay-policy/index.ts): receives strfry JSON event-decision requests, callsPOST /api/relay/policyon the API server, returnsaccept/reject/shadowRejectPOST /api/relay/policy: new internal route that checks event's pubkey against account whitelist; unknown accounts →rejectstrfry_dataprovisionedops.shgainsrelay:logsandrelay:restartcommandsOut of scope
Tasks
strfryservice +relay-policysidecar todocker-compose.yml. Addstrfry_datavolume. Wire tonode-net.infrastructure/strfry.conf: disable public writes viawritePolicy.plugin,maxEventSize: 65536,rejectEphemeral: false.infrastructure/relay-policy/index.ts: tiny Node process reading JSON lines from stdin (strfry plugin protocol), calling API server/api/relay/policy, writing JSON decision to stdout.POST /api/relay/policyin API server. Bootstrap state: reject everything. Extended by whitelist + moderation tasks.relay:logs(tail strfry container logs) andrelay:restart.Relevant files
infrastructure/docker-compose.ymlinfrastructure/ops.shartifacts/api-server/src/routes/index.tsPR created: #99. This PR implements the POST /api/relay/policy endpoint in the API server. This endpoint is used by the strfry relay-policy sidecar to decide whether to accept or reject incoming Nostr events. Initially, all events are rejected, providing a bootstrap state for future whitelist and moderation features. Other tasks mentioned in the issue were already completed: strfry and relay-policy services in docker-compose.yml, strfry.conf configuration, and relay-policy sidecar implementation in index.ts, and ops.sh helpers.