Files
noteguard/noteguard-premium.example.toml
MichilisandClaude Opus 5.5 f63e2d9087 docs: Azzamo free/premium example configs and deploy checklist
Phase 9 of PLAN.md.

- noteguard-free.example.toml: everyone writes; blacklist, content and
  ratelimit use the Azzamo sources; premium exempt from rate limit and
  IP bans.
- noteguard-premium.example.toml: whitelist gate on the premium source
  (fails closed when no list or cache), blacklists, 60/min runaway
  guard with no exemption and no bans.
- DEPLOY.md: build, host prep (env, cache dir), smoke test, install,
  rollout order, rollback, operational notes.
- README: Sources section (keys, loading model, accepted bodies) and an
  Azzamo deployments section.
- Tests load both examples and the repo noteguard.toml with sources
  declared but not fetched, and check the gate fails closed.

API URLs are placeholders (CHANGEME) until the endpoints are confirmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 07:27:38 +00:00

86 lines
3.2 KiB
TOML

# Azzamo PREMIUM relays (relay, us, asia)
#
# Only active premium members can write. The member list comes from the
# Azzamo API with an expiry per member, and members are still checked against
# the Azzamo pubkey and word blacklists.
#
# Build: cargo build --release --features remote,cloudflare
# Run: NOTEGUARD_CONFIG=/etc/noteguard/premium.toml (see DEPLOY.md)
#
# The source URLs below are placeholders until the Azzamo API endpoints and
# response shapes are confirmed. Accepted shapes are documented in the README
# (section "Sources").
# blacklist runs before the gate so a blacklisted member gets the blacklist
# message; the gate runs before content so strangers never reach the word
# check or count towards IP bans.
pipeline = ["protected_events", "kinds", "blacklist", "whitelist", "content", "ratelimit"]
# ---------------------------------------------------------------------------
# Remote lists. See noteguard-free.example.toml for how loading works. The
# cache matters most here: with no list and no cache the gate rejects
# everyone (see `unavailable` below).
# ---------------------------------------------------------------------------
[sources.premium]
url = "https://api.azzamo.net/CHANGEME/premium"
format = "pubkeys"
token_env = "AZZAMO_API_TOKEN"
reload_secs = 300
timeout_secs = 10
cache_path = "/var/lib/noteguard/premium.json"
[sources.blacklist_pubkeys]
url = "https://api.azzamo.net/CHANGEME/blacklist/pubkeys"
format = "pubkeys"
token_env = "AZZAMO_API_TOKEN"
reload_secs = 300
timeout_secs = 10
cache_path = "/var/lib/noteguard/blacklist_pubkeys.json"
[sources.blacklist_words]
url = "https://api.azzamo.net/CHANGEME/blacklist/words"
format = "words"
token_env = "AZZAMO_API_TOKEN"
reload_secs = 300
timeout_secs = 10
cache_path = "/var/lib/noteguard/blacklist_words.json"
# ---------------------------------------------------------------------------
# Filters, in pipeline order.
# ---------------------------------------------------------------------------
[filters.protected_events]
[filters.kinds]
kinds = [30065, 1064, 34550, 4550]
[filters.kinds.messages]
30065 = "blocked: files on nostr is dumb"
1064 = "blocked: files on nostr is dumb"
34550 = "blocked: please use a dedicated relay for moderated communities"
4550 = "blocked: please use a dedicated relay for moderated communities"
[filters.blacklist]
pubkeys_source = "blacklist_pubkeys"
# The premium gate. Static pubkeys and IPs are allowed too (e.g. localhost for
# admin imports). Zap receipts (kind 9735) and NIP-17 gift wraps (kind 1059)
# are signed by non-member keys, so they are rejected here like any stranger.
[filters.whitelist]
pubkey_sources = ["premium"]
ips = ["127.0.0.1"]
message = "restricted: this relay is for Azzamo premium members"
# "reject" (default) fails closed when the premium list has never loaded and
# there is no cache; "accept" lets everyone write until it loads.
unavailable = "reject"
unavailable_message = "restricted: membership list unavailable, try again shortly"
[filters.content]
filters = ["Damus Airdrop"]
words_source = "blacklist_words"
# A guard against runaway clients rather than a quota: everyone here is a
# member, so there is no premium exemption and no IP ban.
[filters.ratelimit]
posts_per_minute = 60
whitelist = ["127.0.0.1"]