Vollständiger 1:1-Port des cloudflare-worker/ (dogfather-universe-postfach) auf server-internal/: Bewerbungs-Postfach mit Rollen/Rechten, Team- Zugangsverwaltung (verschlüsselte Owner-only-Codes), DogiCrew-Supporter-Abo (PayPal Subscriptions, Google-Login, Resend-E-Mail, 30-Monats-Prämienzyklus) und automatische TikTok-Live-Erkennung. D1 -> better-sqlite3, Cloudflare- Cron -> node-cron. Läuft ohne gesetzte Secrets weiter (PayPal/Google/Resend/ Ticketanizer/Discord bleiben "nicht konfiguriert" statt kaputt), bis die echten Zugangsdaten eingetragen werden.
17 lines
633 B
JavaScript
17 lines
633 B
JavaScript
/* =====================================================================
|
|
audit.js — Aktivitätsprotokoll. 1:1 portiert, D1 → better-sqlite3.
|
|
WICHTIG: Codes dürfen hier NIEMALS im Klartext auftauchen.
|
|
===================================================================== */
|
|
import { db } from "../db.js";
|
|
import { nowIso } from "./crypto.js";
|
|
|
|
export function logAction(actor, action, target, detail) {
|
|
db.prepare(`INSERT INTO audit_log (actor, action, target, detail, created_at) VALUES (?, ?, ?, ?, ?)`).run(
|
|
actor,
|
|
action,
|
|
target || null,
|
|
detail ? JSON.stringify(detail) : null,
|
|
nowIso()
|
|
);
|
|
}
|