Add configurable automatic database backup scheduling

This commit is contained in:
Dotta
2026-03-04 18:03:23 -06:00
parent f6a09bcbea
commit c145074daf
17 changed files with 722 additions and 351 deletions

View File

@@ -29,6 +29,10 @@ type StartupBannerOptions = {
migrationSummary: string;
heartbeatSchedulerEnabled: boolean;
heartbeatSchedulerIntervalMs: number;
databaseBackupEnabled: boolean;
databaseBackupIntervalMinutes: number;
databaseBackupRetentionDays: number;
databaseBackupDir: string;
};
const ansi = {
@@ -125,6 +129,9 @@ export function printStartupBanner(opts: StartupBannerOptions): void {
const heartbeat = opts.heartbeatSchedulerEnabled
? `enabled ${color(`(${opts.heartbeatSchedulerIntervalMs}ms)`, "dim")}`
: color("disabled", "yellow");
const dbBackup = opts.databaseBackupEnabled
? `enabled ${color(`(every ${opts.databaseBackupIntervalMinutes}m, keep ${opts.databaseBackupRetentionDays}d)`, "dim")}`
: color("disabled", "yellow");
const art = [
color("██████╗ █████╗ ██████╗ ███████╗██████╗ ██████╗██╗ ██╗██████╗ ", "cyan"),
@@ -154,6 +161,8 @@ export function printStartupBanner(opts: StartupBannerOptions): void {
: color(agentJwtSecret.message, "yellow"),
),
row("Heartbeat", heartbeat),
row("DB Backup", dbBackup),
row("Backup Dir", opts.databaseBackupDir),
row("Config", configPath),
agentJwtSecret.status === "warn"
? color(" ───────────────────────────────────────────────────────", "yellow")