Skip to content

Feature: Add configurable seed relays, archive kinds, and listen port via environment variables - #96

Merged
barrydeen merged 1 commit into
barrydeen:masterfrom
r0d8lsh0p:integration/config-features
Apr 18, 2026
Merged

Feature: Add configurable seed relays, archive kinds, and listen port via environment variables#96
barrydeen merged 1 commit into
barrydeen:masterfrom
r0d8lsh0p:integration/config-features

Conversation

@r0d8lsh0p

Copy link
Copy Markdown
Contributor

Hi Barry

Thank you for your great relays. It's my pleasure to submit this set of new optional features for your WOT relay, which I have written for and are in production use with wss://relay.shosho.live

Summary

Three new optional environment variables that make wot-relay more flexible for operators running domain-specific relays (live streaming, marketplace, etc.) without requiring code changes.

All three are fully backward-compatible — existing deployments with no new env vars set behave identically to before.

SEED_RELAYS

Comma-separated list of WSS URLs to use as seed relays. Falls back to the current built-in list of 14 relays if not set.

SEED_RELAYS="wss://nos.lol,wss://relay.damus.io,wss://relay.primal.net"

ARCHIVE_KINDS

Comma-separated list of Nostr event kind numbers to archive and clean up. Falls back to the current default kinds if not set. ARCHIVE_REACTIONS=TRUE still adds kind 7 automatically if not already in the list.

ARCHIVE_KINDS="0,1,3,5,6,7,30023,30311,34235,9735"

This also simplifies archiveTrustedNotes() by removing the duplicated kind list that was identical in both the ARCHIVE_REACTIONS true/false branches.

PORT

Configurable listen port. Falls back to 3334 if not set. Useful for cloud platforms (Railway, Fly.io, etc.) that inject their own PORT variable.

Changes

  • main.go — new SeedRelays and ArchiveKinds fields on Config, parsing in LoadConfig(), wired into archiveTrustedNotes() and deleteOldNotes()
  • .env.example — documents both new variables with examples
  • README.md — adds the new variables to the setup instructions

Thank your for your time reviewing this PR. If you have any questions or comments or prefer changes please let me know and I will be happy to help.

Best regards

Rod

- SEED_RELAYS env var: comma-separated WSS URLs, falls back to built-in defaults
- ARCHIVE_KINDS env var: comma-separated event kind numbers, falls back to defaults
- PORT env var: configurable listen port, falls back to 3334
- ARCHIVE_REACTIONS=TRUE still auto-adds kind 7 if not in ARCHIVE_KINDS
- Simplify archiveTrustedNotes() by removing duplicated kind list branches

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@barrydeen
barrydeen merged commit e868939 into barrydeen:master Apr 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants