mirror of
https://github.com/Such-Software/smirk-backend-core.git
synced 2026-10-17 23:41:33 +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.
Operator cookbook
smirk-backend-core is one binary with composable knobs — registration gates
(PoW / invite / pay-to-register), an optional Nostr relay with a configurable write
policy, restore policy, and per-feature flags. This directory turns those knobs into
ready-to-run recipes, one per operator persona.
Each recipe is a directory with:
.env.example— the tuned config (only the lines that differ from defaults are called out; copy the full../../.env.exampleand apply the deltas).README.md— what it's for, what it costs to run, the legal/operational notes.
Each recipe below has its own directory with a tuned
.env.exampleand a short README.paid-relay/is the flagship — it uses the shipped premium-relay feature.
Every recipe, the same three steps
cp ../../.env.example .env, then apply the recipe's deltas.- Set
PUBLIC_API_URLto your real domain (a placeholder is rejected at boot in production). Generate each secret:openssl rand -hex 32(JWT_SECRET,SEED_FINGERPRINT_PEPPER,REFRESH_TOKEN_PEPPER,IP_SALT,ADMIN_*_SECRET, plusALTCHA_HMAC_KEYonly if the recipe setsFEATURE_POW=true). Fill chain endpoints.chmod 600 .env. - Run the binary (migrations apply on boot). Reverse-proxy TLS; bind the API to
127.0.0.1.
Non-custodial in every recipe — the backend never holds seeds, spend keys, or funds. Self-hosting bypasses every gate. Secrets are never committed.
The menu
| Recipe | For | Registration | Relay | Pitch | Status |
|---|---|---|---|---|---|
personal/ |
Just you | open, no gate | off (or open, just you) | Your own sovereign backend | ✅ set domain + secrets |
public-free/ |
A free public instance | open + PoW | off (v1) | The shape a free public instance runs | ✅ set domain + secrets |
friends/ |
Your circle | invite-only | on, inbox-outbox |
A backend for people you trust | ✅ |
paid-access/ |
A paid wallet service | pay-to-register | optional | Charge once for a hosted wallet backend | ✅ |
paid-relay/ |
Monetize a relay | open + PoW (free wallet) | on, premium-post |
Free wallet, paid ($/quarter) Nostr posting | ✅ premium-relay shipped |
community/ |
A project/community space | invite | on, author-allowlist |
A gated relay for a named group | ✅ |
Recipe summaries (config deltas)
personal—POW_REQUIRED=false, all registration gates off,WALLET_RESTORE_POLICY=unlimited,RELAY_ENABLED=false(or on, just for you),ADMIN_ENABLED=false. Minimal footprint; you are the only user.public-free—POW_REQUIRED=true, gates off,WALLET_RESTORE_POLICY=bounded- PoW-priced,
FEATURE_PRICES=true,FEATURE_TIPS=false,RELAY_ENABLED=falseat launch. Open to all, spam-gated by compute.
- PoW-priced,
friends—REGISTRATION_REQUIRE_INVITE=true(mint withsmirk-admin mint-invite),RELAY_ENABLED=true+RELAY_WRITE_POLICY=inbox-outbox,WALLET_RESTORE_POLICY=unlimited. Hand out codes; run a locked-down relay for the group.paid-access—REGISTRATION_REQUIRE_PAYMENT=true+PAYMENT_*(a BTCPay-compatible processor paying your wallet). A one-time access fee gates wallet creation. Non-custodial; you never touch funds (pull-model invoice reads only).paid-relay— free wallet (open + PoW) plusPREMIUM_ENABLED=true,RELAY_ENABLED=true,RELAY_WRITE_POLICY=premium-post,PREMIUM_CURRENCY+PREMIUM_PLANS(id:days:amount). Recurring revenue for relay posting; reads open (v1). Content posture: running a relay carries user content — see the NCMEC/DMCA clauses in the published Terms (§6, §9.1). Spec: premium-relay.community—REGISTRATION_REQUIRE_INVITE=true,RELAY_ENABLED=true+RELAY_WRITE_POLICY=author-allowlist(only your registered members publish).
Choosing
- Solo, or a trusted group →
personal/friends. - A free public instance →
public-free. - Cost recovery →
paid-relay(recurring, tied to a real service — the flagship) orpaid-access(a one-time signup fee).