6a2393301d
- 0003_admin.sql: accounts.is_admin
- auth.js: ensureAdminFlag (Konto = ADMIN_EMAIL wird auto-promoted),
is_admin im JWT, requireAdmin-Middleware (prüft DB autoritativ)
- routes/admin.js: GET /stats (Kunden/Abos/Instanzen/MRR), GET /accounts,
GET /accounts/:id/instances, POST /instances/:id/{suspend,reactivate}
- register/login + /account/me liefern is_admin
- ADMIN_EMAIL in .env.example
E2E: Admin-Promotion, Kunde→403, Stats (2 Kunden/MRR 49), Kundenliste.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
40 lines
2.1 KiB
Bash
40 lines
2.1 KiB
Bash
# ─────────────────────────────────────────────────────────────────────────────
|
|
# RAPPORT-HOST — Konfiguration
|
|
# Kopiere nach .env (lokal) bzw. setze die Werte in der Hetzner-Umgebung.
|
|
# .env steht in .gitignore — niemals committen.
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
# ═══ Server ═══
|
|
PORT=8787
|
|
# Basis-URL, unter der RAPPORT-HOST erreichbar ist (für Stripe-Redirects).
|
|
# Lokal: http://localhost:8787 · Prod: https://host.rapport.studio
|
|
PUBLIC_BASE_URL=http://localhost:8787
|
|
|
|
# ═══ Auth ═══
|
|
# JWT-Signatur-Secret für HOST-Kundenkonten. openssl rand -hex 32
|
|
JWT_SECRET=CHANGE-ME-min-32-zeichen
|
|
# Konto mit dieser E-Mail wird automatisch Admin (Betreiber-Bereich /admin).
|
|
ADMIN_EMAIL=karim@gabrielevarano.ch
|
|
|
|
# ═══ Postgres (eigene HOST-DB, GETRENNT von Kunden-Rapport-Daten) ═══
|
|
DATABASE_URL=postgres://rapport_host:rapport_host@localhost:55432/rapport_host
|
|
|
|
# ═══ Stripe ═══
|
|
# Test-Mode-Keys (sk_test_… / pk_test_…) für lokale Entwicklung.
|
|
# Live-Keys (sk_live_…) erst in Produktion. Test-Karten: 4242 4242 4242 4242
|
|
STRIPE_SECRET_KEY=sk_test_CHANGE-ME
|
|
STRIPE_WEBHOOK_SECRET=whsec_CHANGE-ME
|
|
# Price-IDs aus dem Stripe-Dashboard (ein Recurring-Price pro Plan).
|
|
STRIPE_PRICE_SOLO=price_CHANGE-ME
|
|
STRIPE_PRICE_STUDIO=price_CHANGE-ME
|
|
STRIPE_PRICE_BUSINESS=price_CHANGE-ME
|
|
|
|
# ═══ Provisioning (Modell A: geteilter Rapport-Stack) ═══
|
|
# Wenn LEER: MOCK-Modus — Instanz wird nur als DB-Eintrag simuliert, der ganze
|
|
# Flow ist ohne laufenden Rapport-Stack testbar.
|
|
# Wenn gesetzt: echtes Provisioning gegen den geteilten Rapport-Stack.
|
|
RAPPORT_API_URL=
|
|
RAPPORT_SERVICE_KEY=
|
|
# URL-Template für die fertige Kunden-Instanz. {slug} wird ersetzt.
|
|
RAPPORT_INSTANCE_URL_TEMPLATE=http://localhost:8080/?studio={slug}
|