Move database backup policy and scheduling to shared global configuration. - Split project memory backups from cluster-wide database backup settings. - Migrate legacy backup values and routines safely into central global storage. - Schedule and dispatch one shared PostgreSQL backup routine across project engines. Files changed: .changeset/fn-8129-backup-settings-scope-split.md | 7 + docs/dashboard-guide.md | 2 + docs/settings-reference.md | 10 +- packages/cli/src/commands/backup.ts | 3 +- .../__tests__/backup-settings-migration.test.ts | 50 ++++++ .../src/__tests__/backup-settings-scope.test.ts | 27 +++ packages/core/src/backup-settings-migration.ts | 188 +++++++++++++++++++++ packages/core/src/backup.ts | 77 +++++---- packages/core/src/global-routine-store.ts | 104 ++++++++++++ packages/core/src/index.gate.ts | 6 +- packages/core/src/index.ts | 6 +- .../core/src/postgres/migrations/0000_initial.sql | 19 +++ .../postgres/migrations/0015_global_routines.sql | 19 +++ packages/core/src/postgres/schema-applier.ts | 19 ++- packages/core/src/postgres/schema/central.ts | 21 ++- packages/core/src/postgres/startup-factory.ts | 11 ++ packages/core/src/settings-schema.ts | 14 +- packages/core/src/types.ts | 31 +++- .../dashboard/app/components/SettingsModal.tsx | 10 +- .../settings/__tests__/section-keys.test.ts | 1 + .../app/components/settings/save-split.ts | 2 + .../search/__tests__/settings-search-index.test.ts | 1 + .../settings/search/entries.ts | 2 + .../app/components/settings/section-keys.ts | 4 - .../settings/sections/BackupsSection.search.ts | 40 ----- .../settings/sections/BackupsSection.tsx | 112 +----------- .../sections/DatabaseBackupsSection.search.ts | 51 ++++++ .../settings/sections/DatabaseBackupsSection.tsx | 142 ++++++++++++++++ .../settings-default-descriptions.test.tsx | 1 + packages/dashboard/src/routes.ts | 12 +- .../src/routes/register-settings-memory-routes.ts | 41 ++--- .../engine/src/__tests__/routine-scheduler.test.ts | 55 +++++- packages/engine/src/cron-runner.ts | 4 +- packages/engine/src/routine-runner.ts | 67 +++++--- packages/engine/src/routine-scheduler.ts | 35 +++- 35 files changed, 929 insertions(+), 265 deletions(-) Fusion-Task-Id: FN-8129 Fusion-Task-Lineage: af17f39a-7f1c-40ff-8a4a-cd63895cd532 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
52 lines
2.3 KiB
TypeScript
52 lines
2.3 KiB
TypeScript
/**
|
|
* Search entries for the global Database Backups section.
|
|
*
|
|
* FNXC:SettingsSearch 2026-07-15-17:35:
|
|
* One entry per settings control the section renders, co-located so a setting and its index entry change in the same edit. Labels and help mirror the section's `t()` calls verbatim: the index matches on the copy operators actually read, so a paraphrase here would make search miss the words on screen.
|
|
* The section's backup-stats panel and "Backup Now" button are deliberately absent — they report and trigger, they do not configure.
|
|
*/
|
|
import type { SettingsSearchEntry } from "../search/types";
|
|
|
|
export const databaseBackupsSearchEntries: SettingsSearchEntry[] = [
|
|
{
|
|
sectionId: "backups-global",
|
|
key: "autoBackupEnabled",
|
|
labelKey: "settings.backups.enableAutomaticDatabaseBackups",
|
|
labelFallback: " Enable automatic database backups ",
|
|
helpKey: "settings.backups.whenEnabledTheDatabaseIsBackedUpAutomatically",
|
|
helpFallback:
|
|
"When enabled, the database is backed up automatically on a schedule. Default: disabled.",
|
|
keywords: ["sqlite", "snapshot", "restore"],
|
|
},
|
|
{
|
|
sectionId: "backups-global",
|
|
key: "autoBackupSchedule",
|
|
labelKey: "settings.backups.backupScheduleCron",
|
|
labelFallback: "Backup Schedule (Cron)",
|
|
helpKey: "settings.backups.cronExpressionForBackupTimingDefault02",
|
|
helpFallback:
|
|
" Cron expression for backup timing. Default: 0 2 * * * (daily at 2 AM). Examples: 0 * * * * (hourly), 0 0 * * 0 (weekly), */15 * * * * (every 15 min) ",
|
|
keywords: ["timing", "frequency"],
|
|
},
|
|
{
|
|
sectionId: "backups-global",
|
|
key: "autoBackupRetention",
|
|
labelKey: "settings.backups.retentionCount",
|
|
labelFallback: "Retention Count",
|
|
helpKey: "settings.backups.numberOfBackupFilesToKeepOldestAre",
|
|
helpFallback:
|
|
"Number of backup files to keep (oldest are deleted first). Range: 1-100. Default: 7.",
|
|
keywords: ["how many", "prune", "rotation"],
|
|
},
|
|
{
|
|
sectionId: "backups-global",
|
|
key: "autoBackupDir",
|
|
labelKey: "settings.backups.backupDirectory",
|
|
labelFallback: "Backup Directory",
|
|
helpKey: "settings.backups.directoryForBackupFilesRelativeToProjectRoot",
|
|
helpFallback:
|
|
"Directory for backup files, relative to project root. Default: .fusion/backups.",
|
|
keywords: ["location", "folder", "destination"],
|
|
},
|
|
];
|