mirror of
https://github.com/Such-Software/smirk-backend-core.git
synced 2026-10-17 15:31:38 +02:00
public-free and paid-relay both set SERVER_PORT=8081, which is the ADMIN_BIND default (config.rs). An operator following either example with the admin plane enabled gets 'Address already in use' at startup and no obvious cause. Moves ADMIN_BIND rather than SERVER_PORT so the nginx config in the example still matches.
101 lines
4.3 KiB
Bash
101 lines
4.3 KiB
Bash
# ── Recipe: paid-relay ───────────────────────────────────────────────────────
|
|
# Free wallet (open + PoW) PLUS a paid premium tier for GENERAL Nostr posting to
|
|
# your relay. Wallet-functional events (encrypted DMs, tips, swap coordination)
|
|
# stay FREE for registered users; premium unlocks general posting. This is the
|
|
# flagship monetization recipe — recurring revenue tied to a real service.
|
|
#
|
|
# ⚠️ Running a relay means hosting user content — read ../LEGAL_AND_OPS.md
|
|
# (DMCA designated agent + NCMEC reporting + acceptable-use + moderation).
|
|
#
|
|
# Start from ../../.env.example and apply the lines below. openssl rand -hex 32
|
|
# for each secret.
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
SERVER_HOST=127.0.0.1
|
|
SERVER_PORT=8081
|
|
# ADMIN_BIND defaults to 127.0.0.1:8081, which is the SAME port as SERVER_PORT
|
|
# above. With the admin plane enabled the process fails to start with
|
|
# "Address already in use". Move it rather than moving SERVER_PORT, so the
|
|
# nginx config in this example keeps working.
|
|
ADMIN_BIND=127.0.0.1:8091
|
|
# REQUIRED: replace with YOUR real https domain. The your-domain.example placeholder
|
|
# is rejected at boot in production (Nostr identity is on by default).
|
|
PUBLIC_API_URL=https://api.your-domain.example/api/v1
|
|
ENVIRONMENT=production
|
|
|
|
DATABASE_URL=postgresql:///smirk?host=/var/run/postgresql
|
|
|
|
# Secrets (REQUIRED; openssl rand -hex 32 each).
|
|
JWT_SECRET=
|
|
SEED_FINGERPRINT_PEPPER=
|
|
REFRESH_TOKEN_PEPPER=
|
|
IP_SALT=
|
|
ALTCHA_HMAC_KEY=
|
|
ADMIN_KEY_INTEGRITY_SECRET=
|
|
|
|
# ── Free registration, PoW-gated (wallet use is always free) ──
|
|
# FEATURE_POW is the master switch; POW_REQUIRED alone is inert without it.
|
|
FEATURE_POW=true
|
|
POW_REQUIRED=true
|
|
REGISTRATION_REQUIRE_INVITE=false
|
|
REGISTRATION_REQUIRE_PAYMENT=false
|
|
|
|
# ── Relay ON, premium-post policy ──
|
|
RELAY_ENABLED=true
|
|
RELAY_MODE=bundled
|
|
RELAY_URL=wss://relay.your-domain.example
|
|
RELAY_WRITE_POLICY=premium-post
|
|
# Blunt cross-ecosystem DM spam (inbound gift-wraps from non-registered authors).
|
|
RELAY_INBOUND_POW_BITS=8
|
|
RELAY_ADMISSION_BIND=127.0.0.1:8090
|
|
# Shared-box resource governance — the relay runs beside the wallet backend + LWS.
|
|
# Also cap connections / subscriptions / ingest rate in the nostr-rs-relay config
|
|
# (see deploy/relay); move to RELAY_MODE=external on its own box if load climbs.
|
|
RELAY_MAX_EVENT_BYTES=65536
|
|
RELAY_RETENTION_DAYS=30
|
|
|
|
# ── Premium tier: tiered discount plans (id:days:amount), reusing the processor ──
|
|
PREMIUM_ENABLED=true
|
|
# Price currency: a fiat code the processor converts (so "5" = $5, paid in any coin
|
|
# your processor offers), or a specific coin (then amounts are in that coin).
|
|
PREMIUM_CURRENCY=USD
|
|
PREMIUM_PLANS=quarter:90:5,halfyear:182:9,year:365:15
|
|
|
|
# Payment processor (BTCPay-compatible; also serves xmrcheckout/wowcheckout). The
|
|
# backend only READS invoice status — it never holds funds. Invoices are paid
|
|
# directly to YOUR wallet.
|
|
PAYMENT_PROVIDER=btcpay
|
|
PAYMENT_PROVIDER_URL=https://pay.your-domain.example
|
|
PAYMENT_STORE_ID=
|
|
PAYMENT_API_KEY=
|
|
PAYMENT_CONFIRMATIONS=1
|
|
PAYMENT_EXPIRES_MINUTES=60
|
|
|
|
# Prices on; tips parked; admin plane optional.
|
|
FEATURE_PRICES=true
|
|
FEATURE_TIPS=false
|
|
ADMIN_ENABLED=false
|
|
|
|
# ── Chains: enable ONLY what this recipe wires up ────────────────────────────
|
|
# FAIL-CLOSED RULE: in production, an ENABLED chain with no source configured makes
|
|
# the server REFUSE TO BOOT. Every FEATURE_* chain defaults to true, so this recipe
|
|
# turns off the chains it does not wire up. It wires up Monero + Wownero (the
|
|
# XMR_/WOW_ blocks below); fill their *_LWS_ADMIN_KEY and it boots. To add BTC/LTC
|
|
# (electrum URL) or GRIN (GRIN_OWNER_API_SECRET + wiring), configure the source
|
|
# first, THEN flip its flag to true.
|
|
FEATURE_XMR=true
|
|
FEATURE_WOW=true
|
|
FEATURE_BTC=false
|
|
FEATURE_LTC=false
|
|
FEATURE_GRIN=false
|
|
|
|
# Chain endpoints — see ../../.env.example (XMR/WOW LWS + daemon, GRIN_*, electrum).
|
|
XMR_LWS_URL=
|
|
XMR_LWS_ADMIN_URL=
|
|
XMR_LWS_ADMIN_KEY=
|
|
XMR_DAEMON_URL=
|
|
WOW_LWS_URL=
|
|
WOW_LWS_ADMIN_URL=
|
|
WOW_LWS_ADMIN_KEY=
|
|
WOW_DAEMON_URL=
|