Öffentliche Statusseite mit Wartungs- und Vorfallverwaltung (#23)

- Modul status (Migration 044): Störungen und Wartungen mit Zustand,
  Auswirkung, Bereich, Zeitraum und Meldungsverlauf. Öffentlich
  (/v1/public/status, Seite /status) nur, was das Personal veröffentlicht –
  nur dessen Texte, keine Kunden-/Ressourcen-/Anbieterdaten, nicht aus den
  internen Betriebsalarmen gespeist. Gesamtzustand aus aktiven Einträgen;
  angekündigte Wartungen zählen erst ab Beginn.
- Verwaltung /admin/status (Support/Admin/Superadmin; Buchhaltung und Kunden
  nicht), Navigation.
- Tests: API (Rechte, Veröffentlichung, Zustände, Abschluss, Felder) und
  Browser (Status- und Registrierungsseite barrierefrei, 12/12 grün).
Passkeys und Berichte bleiben eigene offene Teilaufgaben.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude (KI) 2026-10-06 13:32:19 +02:00
parent 17bd9e2817
commit 03cf2b00c4
10 changed files with 248 additions and 3 deletions

View file

@ -15,6 +15,7 @@ import { mailModule } from './mail/index.js';
import { discordModule } from './discord/index.js';
import { licenseModule } from './license/index.js';
import { licensingModule } from './licensing/index.js';
import { statusModule } from './status/index.js';
/** Aktive Module. Neue Module (Produkte, Verträge, Connectoren, Tickets, Rechnungen) werden hier eingetragen. */
export const modules: KcModule[] = [systemModule, identityModule, customersModule, auditModule, connectorsModule, resourcesModule, catalogModule, domainsModule, ordersModule, ticketsModule, invoicesModule, backupModule, mailModule, discordModule, licenseModule, licensingModule];
export const modules: KcModule[] = [systemModule, identityModule, customersModule, auditModule, connectorsModule, resourcesModule, catalogModule, domainsModule, ordersModule, ticketsModule, invoicesModule, backupModule, mailModule, discordModule, licenseModule, licensingModule, statusModule];

View file

@ -0,0 +1,78 @@
import type { FastifyInstance } from 'fastify';
import { z } from 'zod';
import { randomUUID } from 'node:crypto';
import { one, query, run, tx } from '../../core/db.js';
import { audit } from '../../core/audit.js';
import { clientIp, requirePermission } from '../../core/auth.js';
import { badRequest, notFound } from '../../core/errors.js';
import { rl } from '../../core/config.js';
import type { KcModule } from '../../core/module.js';
/**
* Öffentliche Statusseite (#23). Wartungen und Vorfälle werden vom Personal angelegt und erst mit „veröffentlichen“
* öffentlich sichtbar. Die öffentliche Ausgabe enthält nur die vom Personal geschriebenen Texte (Titel, Bereich,
* Meldungen) – nie Kunden-, Ressourcen- oder Anbieterdaten und nichts aus den internen Betriebsalarmen.
*/
const OPEN_STATES = ['planned', 'investigating', 'identified', 'monitoring', 'in_progress'];
const STATE = { incident: ['investigating', 'identified', 'monitoring', 'resolved'], maintenance: ['planned', 'in_progress', 'completed'] } as const;
const view = (e: any, updates: any[], admin = false) => ({
...(admin ? { published: !!e.published } : {}),
id: e.id, kind: e.kind, title: e.title, component: e.component, impact: e.impact, state: e.state, startsAt: e.starts_at, endsAt: e.ends_at,
updates: updates.filter((u) => u.event_id === e.id).map((u) => ({ state: u.state, body: u.body, at: u.created_at })),
});
async function withUpdates(events: any[], admin = false) {
if (!events.length) return [];
const ups = await query(`SELECT event_id, state, body, created_at FROM status_updates WHERE event_id IN (${events.map(() => '?').join(',')}) ORDER BY created_at DESC`, events.map((e) => e.id));
return events.map((e) => view(e, ups, admin));
}
export const statusModule: KcModule = {
name: 'status',
permissions: { staff: { support: ['status.read', 'status.write'], admin: ['status.read', 'status.write'], superadmin: ['status.read', 'status.write'] } },
register(app: FastifyInstance) {
/** Öffentlich, ohne Anmeldung. */
app.get('/public/status', { config: rl(60, '1 minute') }, async () => {
const current = await query(`SELECT * FROM status_events WHERE published = 1 AND state IN (${OPEN_STATES.map(() => '?').join(',')}) ORDER BY starts_at`, OPEN_STATES);
const recent = await query("SELECT * FROM status_events WHERE published = 1 AND state IN ('resolved','completed') AND COALESCE(ends_at, updated_at) > DATE_SUB(UTC_TIMESTAMP(3), INTERVAL 14 DAY) ORDER BY COALESCE(ends_at, updated_at) DESC LIMIT 20");
const now = Date.now();
const active = current.filter((e) => e.kind === 'incident' || new Date(e.starts_at).getTime() <= now);
const overall = active.some((e) => e.impact === 'major') ? 'major' : active.some((e) => e.impact === 'minor') ? 'minor' : active.length ? 'maintenance' : 'ok';
return { overall, current: await withUpdates(current), recent: await withUpdates(recent), generatedAt: new Date().toISOString() };
});
app.get('/admin/status-events', async (req) => {
requirePermission(req, 'status.read');
return withUpdates(await query('SELECT * FROM status_events ORDER BY starts_at DESC LIMIT 100'), true);
});
app.post('/admin/status-events', async (req) => {
const a = requirePermission(req, 'status.write');
const b = z.object({ kind: z.enum(['incident', 'maintenance']), title: z.string().trim().min(3).max(200), component: z.string().trim().max(100).optional(),
impact: z.enum(['none', 'minor', 'major']).default('minor'), startsAt: z.coerce.date().optional(), endsAt: z.coerce.date().optional(), body: z.string().trim().min(3).max(2000), published: z.boolean().default(false) }).parse(req.body);
if (b.endsAt && b.startsAt && b.endsAt < b.startsAt) throw badRequest('Das Ende liegt vor dem Beginn', 'BAD_RANGE');
const id = randomUUID(); const state = b.kind === 'incident' ? 'investigating' : 'planned';
await tx(async (c) => {
await run('INSERT INTO status_events (id, kind, title, component, impact, state, starts_at, ends_at, published, created_by) VALUES (?,?,?,?,?,?,?,?,?,?)',
[id, b.kind, b.title, b.component ?? null, b.impact, state, b.startsAt ?? new Date(), b.endsAt ?? null, b.published ? 1 : 0, a.user.id], c);
await run('INSERT INTO status_updates (id, event_id, state, body, created_by) VALUES (?,?,?,?,?)', [randomUUID(), id, state, b.body, a.user.id], c);
});
await audit({ actorType: 'user', actorId: a.user.id, action: 'status.create', resourceType: 'status_event', resourceId: id, correlationId: req.correlationId, ip: clientIp(req), after: { kind: b.kind, published: b.published } });
return { id };
});
/** Neuer Stand (Meldung) und/oder Veröffentlichung ändern. */
app.post('/admin/status-events/:id/update', async (req) => {
const a = requirePermission(req, 'status.write');
const { id } = z.object({ id: z.string().uuid() }).parse(req.params);
const b = z.object({ state: z.string().max(30).optional(), body: z.string().trim().min(3).max(2000).optional(), published: z.boolean().optional(), impact: z.enum(['none', 'minor', 'major']).optional(), endsAt: z.coerce.date().optional() }).parse(req.body);
const e = await one('SELECT * FROM status_events WHERE id = ?', [id]); if (!e) throw notFound();
if (b.state && !(STATE[e.kind as 'incident' | 'maintenance'] as readonly string[]).includes(b.state)) throw badRequest('Dieser Zustand passt nicht zur Art des Eintrags', 'BAD_STATE');
const closing = b.state === 'resolved' || b.state === 'completed';
await tx(async (c) => {
await run('UPDATE status_events SET state = COALESCE(?, state), published = COALESCE(?, published), impact = COALESCE(?, impact), ends_at = COALESCE(?, IF(?, UTC_TIMESTAMP(3), ends_at)) WHERE id = ?',
[b.state ?? null, b.published === undefined ? null : b.published ? 1 : 0, b.impact ?? null, b.endsAt ?? null, closing ? 1 : 0, id], c);
if (b.body) await run('INSERT INTO status_updates (id, event_id, state, body, created_by) VALUES (?,?,?,?,?)', [randomUUID(), id, b.state ?? e.state, b.body, a.user.id], c);
});
await audit({ actorType: 'user', actorId: a.user.id, action: 'status.update', resourceType: 'status_event', resourceId: id, correlationId: req.correlationId, ip: clientIp(req), after: { state: b.state, published: b.published } });
return { ok: true };
});
},
};

View file

@ -0,0 +1,34 @@
import { beforeAll, describe, expect, it } from 'vitest';
import type { FastifyInstance } from 'fastify';
import { buildApp } from '../src/server.js';
import { call, code, login, makeUser } from './helpers.js';
let app: FastifyInstance;
beforeAll(async () => { app = await buildApp(); await app.ready(); });
const pub = async () => (await app.inject({ method: 'GET', url: '/v1/public/status' })).json();
async function staff(email: string, role: string) {
await makeUser({ email, kind: 'staff', staffRole: role }); const { client } = await login(app, email);
const s = (await call(app, client, 'POST', '/auth/mfa/setup')).json(); await call(app, client, 'POST', '/auth/mfa/confirm', { code: code(s.secret) }); return client;
}
describe('Öffentliche Statusseite (#23)', () => {
it('nur Veröffentlichtes ist öffentlich, ohne interne Felder; Gesamtzustand und Abschluss', async () => {
const sup = await staff('status-support@example.com', 'support'); const acc = await staff('status-buha@example.com', 'accounting');
await makeUser({ email: 'status-kunde@example.com' }); const cust = (await login(app, 'status-kunde@example.com')).client;
expect((await pub()).overall).toBe('ok');
expect((await call(app, cust, 'POST', '/admin/status-events', { kind: 'incident', title: 'X', body: 'xxx' })).statusCode).toBe(403);
expect((await call(app, acc, 'POST', '/admin/status-events', { kind: 'incident', title: 'X', body: 'xxx' })).statusCode).toBe(403);
const ev = (await call(app, sup, 'POST', '/admin/status-events', { kind: 'incident', title: 'E-Mail verzögert', component: 'E-Mail', impact: 'major', body: 'Wir untersuchen das.' })).json();
expect((await pub()).current).toHaveLength(0); // nicht veröffentlicht
await call(app, sup, 'POST', `/admin/status-events/${ev.id}/update`, { published: true, state: 'identified', body: 'Ursache gefunden.' });
let p = await pub(); expect(p.overall).toBe('major'); expect(p.current[0].title).toBe('E-Mail verzögert');
expect(p.current[0].updates.map((u: any) => u.state)).toEqual(['identified', 'investigating']);
const keys = Object.keys(p.current[0]); for (const k of ['published', 'created_by', 'createdBy']) expect(keys).not.toContain(k);
expect((await call(app, sup, 'POST', `/admin/status-events/${ev.id}/update`, { state: 'completed' })).statusCode).toBe(400); // passt nicht zu Störung
await call(app, sup, 'POST', `/admin/status-events/${ev.id}/update`, { state: 'resolved', body: 'Behoben.' });
p = await pub(); expect(p.overall).toBe('ok'); expect(p.recent[0].state).toBe('resolved'); expect(p.recent[0].endsAt).toBeTruthy();
// geplante Wartung in der Zukunft: angekündigt, beeinflusst den Gesamtzustand noch nicht
await call(app, sup, 'POST', '/admin/status-events', { kind: 'maintenance', title: 'Wartung Webserver', impact: 'minor', startsAt: new Date(Date.now() + 86400000).toISOString(), body: 'Kurze Unterbrechung möglich.', published: true });
p = await pub(); expect(p.overall).toBe('ok'); expect(p.current.map((e: any) => e.kind)).toContain('maintenance');
});
});

View file

@ -87,3 +87,17 @@ test('2FA-Code kann nicht wiederverwendet werden (Replay)', async ({ page }) =>
await page.getByRole('button', { name: 'Bestätigen' }).click();
await expect(page).not.toHaveURL(/\/dashboard/);
});
test('Öffentliche Statusseite: ohne Anmeldung erreichbar und barrierefrei', async ({ page }) => {
await page.goto('/status');
await expect(page.getByRole('heading', { name: 'Systemstatus' })).toBeVisible();
await expect(page.getByText('Alle Systeme laufen normal')).toBeVisible();
await expectAccessible(page, 'Statusseite');
});
test('Registrierungsseite: bei ausgeschalteter Registrierung nur Hinweis, barrierefrei', async ({ page }) => {
await page.goto('/registrieren');
await expect(page.getByText('Eine Selbstregistrierung ist derzeit nicht möglich')).toBeVisible();
await expectAccessible(page, 'Registrierung');
});

View file

@ -0,0 +1,53 @@
'use client';
import { useCallback, useEffect, useState, type FormEvent } from 'react';
import Link from 'next/link';
import { api, errMsg } from '@/lib/api';
import { useSession } from '@/lib/session';
import { Alert, Empty, Field, fmt } from '@/components/ui';
interface Ev { id: string; kind: 'incident' | 'maintenance'; title: string; component: string | null; impact: string; state: string; startsAt: string; endsAt: string | null; published?: boolean; updates: { state: string; body: string; at: string }[] }
const STATES = { incident: [['investigating', 'Wird untersucht'], ['identified', 'Ursache gefunden'], ['monitoring', 'Wird beobachtet'], ['resolved', 'Behoben']], maintenance: [['planned', 'Geplant'], ['in_progress', 'Läuft'], ['completed', 'Abgeschlossen']] } as const;
function Row({ e, onDone }: { e: Ev; onDone: (m: { k: 'ok' | 'err'; t: string }) => void }) {
const [busy, setBusy] = useState(false);
async function update(ev: FormEvent<HTMLFormElement>) {
ev.preventDefault(); setBusy(true); const f = new FormData(ev.currentTarget);
try { await api('POST', `/admin/status-events/${e.id}/update`, { state: f.get('state'), body: String(f.get('body') ?? '').trim() || undefined, published: f.get('published') === 'on' }); onDone({ k: 'ok', t: 'Gespeichert.' }); (ev.target as HTMLFormElement).reset(); }
catch (x) { onDone({ k: 'err', t: errMsg(x) }); } finally { setBusy(false); }
}
return (<form className="card" onSubmit={update}>
<strong>{e.title}</strong> <span className="small muted">({e.kind === 'incident' ? 'Störung' : 'Wartung'}{e.component ? `, ${e.component}` : ''}, Auswirkung {e.impact}, seit {fmt(e.startsAt)})</span>
<ul className="small" style={{ paddingLeft: 18 }}>{e.updates.map((u, i) => <li key={i}>{u.state} ({fmt(u.at)}): {u.body}</li>)}</ul>
<div className="cols"><Field id={`s-${e.id}`} label="Zustand"><select id={`s-${e.id}`} name="state" defaultValue={e.state}>{STATES[e.kind].map(([v, l]) => <option key={v} value={v}>{l}</option>)}</select></Field>
<Field id={`b-${e.id}`} label="Neue Meldung (öffentlich, wenn veröffentlicht)"><input id={`b-${e.id}`} name="body" maxLength={2000} /></Field></div>
<label className="row" style={{ gap: 8, margin: '4px 0 12px' }}><input type="checkbox" name="published" defaultChecked={!!e.published} style={{ width: 20, minHeight: 20 }} />Auf der Statusseite veröffentlicht</label>
<button className="btn small" disabled={busy} type="submit">Speichern</button>
</form>);
}
/** Verwaltung der öffentlichen Statusseite (#23). Nur eigene Texte, keine Kunden- oder Anbieterdetails eintragen. */
export default function StatusAdmin() {
const { can } = useSession();
const [list, setList] = useState<Ev[] | null>(null); const [msg, setMsg] = useState<{ k: 'ok' | 'err'; t: string } | null>(null); const [kind, setKind] = useState<'incident' | 'maintenance'>('incident');
const load = useCallback(() => api<Ev[]>('GET', '/admin/status-events').then(setList).catch((e) => setMsg({ k: 'err', t: errMsg(e) })), []);
useEffect(() => { void load(); }, [load]);
async function create(ev: FormEvent<HTMLFormElement>) {
ev.preventDefault(); const f = new FormData(ev.currentTarget); const v = (k: string) => String(f.get(k) ?? '').trim() || undefined;
try { await api('POST', '/admin/status-events', { kind, title: v('title'), component: v('component'), impact: f.get('impact'), startsAt: v('startsAt'), endsAt: v('endsAt'), body: v('body'), published: f.get('published') === 'on' }); setMsg({ k: 'ok', t: 'Angelegt.' }); (ev.target as HTMLFormElement).reset(); void load(); }
catch (x) { setMsg({ k: 'err', t: errMsg(x) }); }
}
const w = can('status.write');
return (<>
<div className="row between"><h1>Statusseite</h1><Link className="btn" href="/status" target="_blank">Öffentliche Ansicht</Link></div>
<p className="muted">Öffentlich sichtbar ist nur, was hier veröffentlicht wird. Bitte keine Kundennamen, Ressourcen oder internen Details eintragen.</p>
{msg && <Alert kind={msg.k}>{msg.t}</Alert>}
{w && <form className="card" onSubmit={create}><h2>Neuer Eintrag</h2>
<div className="row" style={{ marginBottom: 12 }}>{([['incident', 'Störung'], ['maintenance', 'Wartung']] as const).map(([k, l]) => <label key={k} className="row"><input type="radio" name="kind" checked={kind === k} onChange={() => setKind(k)} style={{ width: 20, minHeight: 20 }} />{l}</label>)}</div>
<div className="cols"><Field id="title" label="Titel"><input id="title" name="title" required minLength={3} maxLength={200} /></Field><Field id="component" label="Bereich (optional)" hint="z. B. Webhosting, E-Mail, Kundencenter"><input id="component" name="component" maxLength={100} /></Field>
<Field id="impact" label="Auswirkung"><select id="impact" name="impact" defaultValue="minor"><option value="none">keine</option><option value="minor">teilweise</option><option value="major">größere Störung</option></select></Field></div>
{kind === 'maintenance' && <div className="cols"><Field id="startsAt" label="Beginn"><input id="startsAt" name="startsAt" type="datetime-local" required /></Field><Field id="endsAt" label="Ende (geplant)"><input id="endsAt" name="endsAt" type="datetime-local" /></Field></div>}
<Field id="body" label="Erste Meldung"><input id="body" name="body" required minLength={3} maxLength={2000} /></Field>
<label className="row" style={{ gap: 8, margin: '4px 0 12px' }}><input type="checkbox" name="published" style={{ width: 20, minHeight: 20 }} />Sofort veröffentlichen</label>
<button className="btn primary" type="submit">Anlegen</button></form>}
{list === null ? <p className="muted" role="status">Wird geladen …</p> : list.length === 0 ? <div className="card"><Empty title="Noch keine Einträge" /></div> : list.map((e) => <Row key={e.id} e={e} onDone={(m) => { setMsg(m); void load(); }} />)}
</>);
}

View file

@ -33,7 +33,7 @@ export default function AppLayout({ children }: { children: ReactNode }) {
async function logout() { await api('POST', '/auth/logout'); await reload(); r.replace('/login'); }
async function stopImpersonation() { const orgId = me!.impersonating!.orgId; await api('POST', '/auth/impersonate/stop'); await reload(); r.replace(`/admin/kunden/${orgId}`); }
const produkte = [(me.kind === 'customer' || can('licenses.read')) && ['/lizenzen', me.kind === 'customer' ? 'Meine Lizenzen' : 'Lizenzen'], (me.kind === 'customer' || can('resources.read')) && ['/ressourcen', 'Ressourcen'], (me.kind === 'customer' || can('contracts.read')) && ['/vertraege', 'Verträge'], (me.kind === 'customer' || can('orders.read')) && ['/bestellungen', 'Bestellungen']].filter(Boolean) as [string, string][];
const verwaltung = [can('customers.read') && ['/admin/kunden', 'Kunden'], can('products.read') && ['/admin/produkte', 'Produkte'], can('domains.read') && ['/admin/domains', 'Domain-Aufstellung'], can('users.read') && ['/admin/benutzer', 'Benutzer'], can('jobs.read') && ['/admin/auftraege', 'Aufträge'], can('audit.read') && ['/admin/audit', 'Audit-Protokoll'], (can('connectors.read') || can('backup.read')) && ['/einstellungen', 'Einstellungen']].filter(Boolean) as [string, string][];
const verwaltung = [can('customers.read') && ['/admin/kunden', 'Kunden'], can('products.read') && ['/admin/produkte', 'Produkte'], can('domains.read') && ['/admin/domains', 'Domain-Aufstellung'], can('users.read') && ['/admin/benutzer', 'Benutzer'], can('jobs.read') && ['/admin/auftraege', 'Aufträge'], can('audit.read') && ['/admin/audit', 'Audit-Protokoll'], can('status.read') && ['/admin/status', 'Statusseite'], (can('connectors.read') || can('backup.read')) && ['/einstellungen', 'Einstellungen']].filter(Boolean) as [string, string][];
const nav = (
<nav className={`nav ${open ? 'open' : ''}`} aria-label="Hauptnavigation">
<Link href="/dashboard" className="brandlink" aria-label="Kundencenter – zur Übersicht"><Brand /></Link>

View file

@ -0,0 +1,37 @@
'use client';
import { useEffect, useState } from 'react';
import Link from 'next/link';
import { api, errMsg } from '@/lib/api';
import { Alert } from '@/components/ui';
import { ThemeToggle } from '@/components/ThemeToggle';
interface Ev { id: string; kind: 'incident' | 'maintenance'; title: string; component: string | null; impact: string; state: string; startsAt: string; endsAt: string | null; updates: { state: string; body: string; at: string }[] }
interface St { overall: 'ok' | 'maintenance' | 'minor' | 'major'; current: Ev[]; recent: Ev[] }
const STATE: Record<string, string> = { investigating: 'Wird untersucht', identified: 'Ursache gefunden', monitoring: 'Wird beobachtet', resolved: 'Behoben', planned: 'Geplant', in_progress: 'Läuft', completed: 'Abgeschlossen' };
const OVERALL = { ok: ['ok', '✓', 'Alle Systeme laufen normal'], maintenance: ['info', 'ⓘ', 'Wartung läuft'], minor: ['warn', '▲', 'Teilweise Einschränkungen'], major: ['err', '✕', 'Größere Störung'] } as const;
const fmt = (d: string) => new Date(d).toLocaleString('de-DE', { dateStyle: 'medium', timeStyle: 'short' });
function Event({ e }: { e: Ev }) {
return (<article className="card">
<h3 style={{ margin: 0 }}>{e.title}</h3>
<p className="small muted" style={{ margin: '4px 0 8px' }}>{e.kind === 'maintenance' ? 'Wartung' : 'Störung'}{e.component ? ` · ${e.component}` : ''} · {STATE[e.state] ?? e.state} · {e.kind === 'maintenance' ? `${fmt(e.startsAt)}${e.endsAt ? ` – ${fmt(e.endsAt)}` : ''}` : `seit ${fmt(e.startsAt)}`}</p>
<ul className="small" style={{ margin: 0, paddingLeft: 18 }}>{e.updates.map((u, i) => <li key={i}><strong>{STATE[u.state] ?? u.state}</strong> ({fmt(u.at)}): {u.body}</li>)}</ul>
</article>);
}
/** Öffentliche Statusseite (#23) – zeigt nur vom Personal veröffentlichte Meldungen. */
export default function Status() {
const [s, setS] = useState<St | null>(null); const [err, setErr] = useState('');
useEffect(() => { const load = () => api<St>('GET', '/public/status').then(setS).catch((e) => setErr(errMsg(e))); void load(); const t = setInterval(load, 60_000); return () => clearInterval(t); }, []);
const o = s ? OVERALL[s.overall] : null;
return <main id="main" style={{ maxWidth: 760, margin: '0 auto', padding: '32px 16px' }}>
<div className="row between"><h1 style={{ margin: 0 }}>Systemstatus</h1><ThemeToggle compact /></div>
{err && <Alert kind="err">{err}</Alert>}
{!s ? <p className="muted" role="status">Wird geladen …</p> : (<>
<div className="card" role="status"><span className={`badge ${o![0]}`}><span aria-hidden="true">{o![1]}</span>{o![2]}</span></div>
{s.current.length > 0 && <><h2>Aktuell</h2>{s.current.map((e) => <Event key={e.id} e={e} />)}</>}
<h2>Letzte 14 Tage</h2>
{s.recent.length === 0 ? <p className="muted">Keine Störungen oder Wartungen.</p> : s.recent.map((e) => <Event key={e.id} e={e} />)}
</>)}
<p className="small" style={{ marginTop: 24 }}><Link href="/login">Zum Kundencenter</Link></p>
</main>;
}

View file

@ -7,6 +7,7 @@ Stand: 06.10.2026, aus `apps/web/src/app` (alle `page.tsx`). Sichtbarkeit richte
- `/passwort-vergessen`, `/passwort-reset` – Selbstbedienung per E-Mail-Link
- `/einladung` – Einladung annehmen, Passwort festlegen
- `/registrieren`, `/email-bestaetigen` – Selbstregistrierung mit E-Mail-Bestätigung (nur wenn eingeschaltet, #36)
- `/status` – öffentliche Statusseite (nur veröffentlichte Wartungen/Störungen, #23)
- `/vertrag-entscheidung` – „Vertrag behalten / kündigen“ aus der Erinnerungsmail (Einmal-Link)
## Kunde
@ -28,7 +29,7 @@ Stand: 06.10.2026, aus `apps/web/src/app` (alle `page.tsx`). Sichtbarkeit richte
| Domains | `/admin/domains` (Aufstellung EK/VK, CSV) |
| Abrechnung | `/rechnungen/faellig` (Mahnüberblick, Abrechnungslauf), `/rechnungen/export` (DATEV/CSV/PDF-ZIP) |
| Support | `/admin/posteingang` (IMAP-Mails zuordnen) |
| Verwaltung | `/admin/benutzer`, `/admin/auftraege`, `/admin/audit` |
| Verwaltung | `/admin/benutzer`, `/admin/auftraege`, `/admin/audit`, `/admin/status` (Statusseite pflegen) |
| Einstellungen | `/einstellungen` → `firma`, `lizenz`, `email` (SMTP/IMAP/Vorlagen), `discord`, `backup`, `verbindungen` |
Mobil (≤ 800 px): untere Navigation Übersicht · Ressourcen · Tickets · Rechnungen · Mehr (öffnet die volle Navigation inkl. Konto/Abmelden).

View file

@ -93,6 +93,7 @@ Annahmen: Angreifer von außen ohne Konto; Kunde, der fremde Daten sehen will; k
| T18 | Rechnungsmanipulation nach Ausstellung | Statusprüfung unter Zeilensperre, Snapshots, Storno statt Änderung, Audit | invoices | `invoices.test.ts` (#95) |
| T19 | Audit-Protokoll verfälschen | Hash-Kette, Trigger verbieten UPDATE/DELETE, Prüfung im Restore-Test | audit | `core.test.ts` „führt eine intakte Hash-Kette … erkennt eine eingeschleuste Fälschung“; täglicher Restore-Test prüft die Kette |
| T21 | Selbstregistrierung: Konten ausspähen, Massenanlagen, fremde E-Mail | standardmäßig aus; Antwort immer 202 (bestehende Adresse bekommt nur eine Hinweis-Mail), Rate-Limit 5/10 min, Konto erst nach E-Mail-Bestätigung (Einmal-Token, 24 h) und – Standard – Freigabe durch Personal; Kundengrenze gilt | customers | `registration.test.ts` |
| T22 | Statusseite gibt interne Details preis | nur vom Personal veröffentlichte Einträge, nur deren Texte; keine Kunden-/Ressourcen-/Anbieterdaten, nicht aus Betriebsalarmen gespeist; Verfasser/Veröffentlichungsstatus nicht in der öffentlichen Ausgabe | status | `status.test.ts` |
| T20 | Datenverlust / Erpressung | Verschlüsselte Backups, externes Ziel, automatischer Restore-Test, Alarm | backup | `backup*.test.ts`, täglicher Restore-Test |
**Beispielpayloads** in Tests und Doku enthalten nie echte Schlüssel (Dummy-`KC_SECRET_KEY`, generierte Testschlüssel).

View file

@ -0,0 +1,26 @@
-- Öffentliche Statusseite (#23): Wartungen und Vorfälle, vom Personal gepflegt. Öffentlich sichtbar ist nur, was
-- ausdrücklich veröffentlicht wurde – keine automatisch erzeugten Betriebs-, Kunden- oder Anbieterdaten.
CREATE TABLE status_events (
id CHAR(36) PRIMARY KEY,
kind ENUM('incident','maintenance') NOT NULL,
title VARCHAR(200) NOT NULL,
component VARCHAR(100) NULL,
impact ENUM('none','minor','major') NOT NULL DEFAULT 'minor',
state ENUM('planned','investigating','identified','monitoring','in_progress','resolved','completed') NOT NULL,
starts_at DATETIME(3) NOT NULL,
ends_at DATETIME(3) NULL,
published TINYINT(1) NOT NULL DEFAULT 0,
created_by CHAR(36) NULL REFERENCES users(id),
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
KEY idx_status_pub (published, starts_at)
);
CREATE TABLE status_updates (
id CHAR(36) PRIMARY KEY,
event_id CHAR(36) NOT NULL,
state VARCHAR(30) NOT NULL,
body VARCHAR(2000) NOT NULL,
created_by CHAR(36) NULL REFERENCES users(id),
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
FOREIGN KEY (event_id) REFERENCES status_events(id) ON DELETE CASCADE
);