feat(backup): tar.gz format with uploads + manifest, restore guard

- New tar.gz backup format bundling SQLite snapshot + uploads tree + manifest.json (version, app+schema versions, checksums, dbSize)
- BACKUPS_DIR env override; defaults to /app/data/backups in prod, <cwd>/data/backups in dev (matches uploads convention)
- 503 guard in hooks.server.ts while restore is mid-flight (DB file is being swapped); excludes static assets + /api/health; sets Retry-After: 15
- Legacy .db restore still supported (DB-only)
- Restore endpoint adds schema-mismatch detection + force flag; download/schedule endpoints updated
- 256 MiB free-disk safety margin before backup
- tar dep added to package.json; 18 new backupService tests
- i18n labels (en + ru) for new restore/format states
This commit is contained in:
2026-05-28 14:39:24 +03:00
parent 0a13b6b58c
commit 555ac9ea63
15 changed files with 1068 additions and 108 deletions
+2 -1
View File
@@ -476,7 +476,8 @@ export const auditLogQuerySchema = z.object({
AuditAction.EXPORT,
AuditAction.BACKUP_CREATED,
AuditAction.BACKUP_RESTORED,
AuditAction.BACKUP_DELETED
AuditAction.BACKUP_DELETED,
AuditAction.BACKUP_FAILED
])
.optional(),
entityType: z.string().max(50).optional(),