2.0 KiB
| id | title | status | assignee | created_date | updated_date | labels | dependencies | priority |
|---|---|---|---|---|---|---|---|---|
| TASK-2 | Multi-tenant provisioning platform | Done | 2026-02-24 03:54 | 2026-02-25 05:30 | medium |
Description
Self-service API for communities to provision their own Postiz instance at .rsocials.online. CRDT token gating, x402 micropayment metering, Sablier hibernation. Full plan at ~/.claude/plans/greedy-skipping-dahl.md. Phases: 1) Provisioning API Core, 2) CRDT Token Gating, 3) Landing Page + Provision UI, 4) x402 Usage Metering, 5) Sablier + Hardening.
Implementation Notes
Starting Phase 1: Provisioning API Core (Hono/Bun)
Phase 1 complete: Provisioning API scaffold with all core services. Compiles clean, starts on port 3001. Next: Phase 2 (CRDT token gating) or deploy Phase 1 to Netcup for testing.
Phase 2 complete: SIWE wallet auth + CRDT token gate + x402 middleware ported. Sablier removed (breaks scheduled posts). Auth supports both API key (admin) and wallet SIWE. Token gate configurable via CRDT_GATE_ENABLED env var.
Phase 3 complete: Provision wizard at /provision (wallet connect → subdomain picker → confirm → deploy). Dashboard at /dashboard (instance list, status, delete). wagmi + viem + react-query integrated. Navbar updated with Deploy + Dashboard links.
Phase 4 complete: Usage metrics service (Docker container stats, PG post count, volume storage). Billing calculator with pro-rated monthly base ($5), per-post ($0.01), per-GB storage ($0.50 above 1GB free). Usage + payment routes wired. x402 middleware applied to POST /v1/spaces when X402_PAY_TO is set.
Phase 5 complete: In-memory rate limiter (general 10/min, provision 2/hour, admin bypass). Admin routes: force teardown, suspend/resume. Dockerfile hardened: non-root user, healthcheck, NODE_ENV=production. Suspended status added to types + frontend.
All 5 phases implemented. Ready for deployment to Netcup.