feat: add auto-import toggle to restore latest backup after rclone pull

Adds autoImportEnabled/autoImportHour to rclone config. A separate
hourly cron finds the latest .zip in backups/ and restores it to the
database (drop schema, psql restore, apply migrations). Frontend shows
toggle + time picker + Import Now button in the Receiver PC section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-06-24 23:45:15 -04:00
co-authored by Claude Sonnet 4.6
parent 70b5e2ba47
commit cbe7d13dd2
5 changed files with 288 additions and 1 deletions
@@ -19,6 +19,13 @@ export interface RcloneConfig {
lastSyncAt: string | null;
lastSyncStatus: string | null;
lastSyncError: string | null;
// Auto-import: restore latest backup after rclone pull
autoImportEnabled: boolean;
autoImportHour: number;
lastImportAt: string | null;
lastImportStatus: string | null;
lastImportError: string | null;
}
const DEFAULT_CONFIG: RcloneConfig = {
@@ -31,6 +38,11 @@ const DEFAULT_CONFIG: RcloneConfig = {
lastSyncAt: null,
lastSyncStatus: null,
lastSyncError: null,
autoImportEnabled: false,
autoImportHour: 22,
lastImportAt: null,
lastImportStatus: null,
lastImportError: null,
};
export function readRcloneConfig(): RcloneConfig {