Files
aza/AzA march 2026 - Kopie (18)/README_ADMIN_PLAN.txt
2026-04-22 22:33:46 +02:00

98 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
AZA Admin: Plan setzen (ohne UI)
Voraussetzung:
- Setze die Umgebungsvariable AZA_ADMIN_KEY auf ein geheimes Passwort (z.B. "SUPERSECRET123")
- Server neu starten
Endpoint:
POST /admin/set_plan
Body (JSON):
{
"admin_key": "SUPERSECRET123",
"email": "user@example.com",
"plan": "pro"
}
Beispiele für Plans:
- basic -> Default Geräte-Limit (AZA_DEVICE_LIMIT_DEFAULT, typischerweise 2)
- pro -> 4 Geräte (Fallback) oder via AZA_PLAN_LIMITS
- custom -> nur sinnvoll, wenn AZA_PLAN_LIMITS gesetzt ist, z.B.:
AZA_PLAN_LIMITS="basic:2,pro:4,business:10"
Hinweis:
- Plan-Änderung wirkt beim nächsten /license/check sofort.
---
Admin: Token sperren (Logout / Sperre)
Endpoint:
POST /admin/revoke_token
Body (JSON):
{
"admin_key": "SUPERSECRET123",
"token": "PASTE_TOKEN_HERE"
}
Ergebnis:
- Das Token ist danach ungültig (revoked=1)
- /license/check gibt dann 401 "Invalid or revoked token"
---
Admin: Account-Status setzen (Abo-Status)
Ziel:
- active = normal
- suspended = Zugriff gesperrt (z.B. Zahlung fehlgeschlagen)
- cancelled = Zugriff gesperrt (Abo beendet)
Endpoint:
POST /admin/set_status
Body (JSON):
{
"admin_key": "SUPERSECRET123",
"email": "user@example.com",
"status": "suspended"
}
Hinweis:
- Blockt sowohl /login als auch /license/check mit HTTP 403 "Account not active".
---
Audit-Log (Admin-Aktionen)
Was wird geloggt:
- set_plan (alt -> neu)
- set_status (alt -> neu)
- revoke_token (active -> revoked)
Wo:
- SQLite Tabelle: admin_audit
Spalten:
- action, email, token, old_value, new_value, created_at
Hinweis:
- Das Audit-Log ist rein serverseitig (kein UI), dient Support & Nachvollziehbarkeit.
---
Audit-Log anzeigen (Admin)
Endpoint:
POST /admin/audit/list
Body (JSON):
{
"admin_key": "SUPERSECRET123",
"limit": 50
}
Ergebnis:
- Liste der letzten Audit-Einträge (neueste zuerst)