feat: comprehensive health check with DB, scheduler, cache

- Add /api/v1/health endpoint with component-level checks
- Verify DB connectivity, fail2ban socket, scheduler, session cache
- Add SQLite WAL cleanup on startup (orphan crash files)
- Migration 8: import_log.timestamp → INTEGER UNIX epoch
- Align import_log timestamps with history_archive (already UNIX int)
- Add unit tests for DB cleanup and health router

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-05-02 23:03:57 +02:00
parent b631c1c546
commit 1285bc8571
12 changed files with 472 additions and 241 deletions

View File

@@ -3,6 +3,11 @@ import { ArrowClockwiseRegular } from "@fluentui/react-icons";
import { useCommonSectionStyles } from "../../components/commonStyles";
import { useImportLog } from "../../hooks/useImportLog";
import { useBlocklistStyles } from "./blocklistStyles";
import { formatDate } from "../../utils/formatDate";
function formatUnixTimestamp(unixTs: number, timezone: string | null | undefined): string {
return formatDate(new Date(unixTs * 1000).toISOString(), timezone);
}
export function BlocklistImportLogSection(): React.JSX.Element {
const styles = useBlocklistStyles();
@@ -52,7 +57,7 @@ export function BlocklistImportLogSection(): React.JSX.Element {
<TableRow key={entry.id} className={entry.errors ? styles.errorRow : undefined}>
<TableCell>
<TableCellLayout>
<span className={styles.mono}>{entry.timestamp}</span>
<span className={styles.mono}>{formatUnixTimestamp(entry.timestamp, undefined)}</span>
</TableCellLayout>
</TableCell>
<TableCell>

View File

@@ -41,7 +41,7 @@ export interface ImportLogEntry {
id: number;
source_id: number | null;
source_url: string;
timestamp: string;
timestamp: number;
ips_imported: number;
ips_skipped: number;
errors: string | null;