- lib/coolify.ts typed client (whitelisted apps) - /operations: deploy/restart server actions per app, audited - /operations: backup status cards reading MinIO listings - lib/minio.ts shared client - docs/phase5-deferred.md (migration runner + stripe webhook rationale)
2.4 KiB
2.4 KiB
Phase 5 deferred: migration runner + Stripe webhook
Migration runner
Why deferred: PRD envisions a per-project "Migrate Now" button with log stream — driven by /internal/admin/migrate on each spoke. No spoke currently exposes this endpoint. Building the panel UI for a button that calls nothing is premature.
Trigger to revisit:
- The first spoke ships
/internal/admin/migrate(and ideally/internal/admin/migrate/status). - OR migrations on the spokes start being a bottleneck (manual
prisma migrate deployon each host gets annoying).
When triggered, do:
- Add
migrate()andmigrateStatus()to@/lib/admin-sdk/<spoke>.ts. - Add
/projects/[key]/migratepage with a Server Action that calls migrate, then long-polls status (or upgrades to SSE if log streaming is needed). - Audit row is automatic (AdminClient already wraps with
writeAudit). - Guard: require a manual confirm dialog (typed project key) — destructive on prod.
Stripe central webhook receiver
Why deferred: no spoke currently uses Stripe (sase.tr's payments table exists but isn't wired to Stripe yet — at least the panel can't see Stripe traffic). A central receiver with no events to receive is dead code.
Trigger to revisit:
- A spoke goes live with Stripe and needs cross-project subscription/MRR rollups.
- OR a Stripe Connect / multi-account setup arrives and routing per-spoke is needed.
When triggered, do:
- Add
STRIPE_WEBHOOK_SECRETper spoke +STRIPE_CENTRAL_SIGNING_SECRETfor panel. /api/webhooks/stripeRoute Handler: verifyStripe-Signatureheader (raw body required), normalize event, write toEventmodel withprojectKeyderived from account ID.- Re-publish into
<key>:eventsRedis Stream so worker-side consumers see Stripe events alongside spoke-native events (single fan-out path). - Dashboard cards on
/start showing MRR / new subs per project.
What Phase 5 actually delivered
lib/coolify.tstyped client (listApplications, deploy, restart, recentDeployments) withCOOLIFY_API_TOKENenv./operationspage lists panel-managed apps (whitelist viaMANAGED_APP_UUIDS), shows status / commit / branch / last deploy, with Deploy + Restart Server Actions (audited)./operationsbackup status section reads MinIOpanel-backups/+panel-audit-archive/listings — latest dump age, total size, latest audit archive.- Server Actions audited via the existing
writeAudithelper.