Added optionnal online storage and cross-client sync
All checks were successful
Tests et déploiement / validate (push) Successful in 2m44s
Tests et déploiement / deploy (push) Successful in 51s

This commit is contained in:
2026-10-10 16:01:06 +02:00
parent 277b9c887e
commit 5686ee5072
33 changed files with 2466 additions and 25 deletions

9
server/backup.js Normal file
View File

@@ -0,0 +1,9 @@
// Online SQLite backup includes committed WAL transactions. Run in the service
// container, then copy the resulting file to independent, protected storage.
import { DatabaseSync, backup } from 'node:sqlite';
const source = process.env.SYNC_DB ?? './sync-data/pardis.sqlite';
const destination = process.argv[2];
if (!destination || destination === source) throw new Error('Usage: node server/backup.js /data/backup.sqlite (distinct destination)');
const db = new DatabaseSync(source, { readOnly: true });
try { await backup(db, destination); console.info('Encrypted database backup completed.'); }
finally { db.close(); }