chore: deploy once through Compose
This commit is contained in:
@@ -32,7 +32,7 @@ export function restore(sourceDir: string, targetDir: string) {
|
||||
try {
|
||||
if (check.pragma('integrity_check', { simple: true }) !== 'ok') throw new ContentError('Database integrity check failed');
|
||||
const rows = check.prepare('SELECT key FROM media').all() as { key: string }[];
|
||||
if (rows.some(row => !/^[0-9a-f-]{36}\.(pdf|webp)$/.test(row.key) || !existsSync(path.join(source, 'uploads', row.key)))) throw new ContentError('Backup is missing uploaded files');
|
||||
if (rows.some(row => !/^(?:[0-9a-f-]{36}\.(?:pdf|webp)|[0-9a-f]{64}\.(?:png|jpg|webp))$/.test(row.key) || !existsSync(path.join(source, 'uploads', row.key)))) throw new ContentError('Backup is missing uploaded files');
|
||||
} finally { check.close(); }
|
||||
const staging = `${target}.restore-${Date.now()}`;
|
||||
mkdirSync(staging, { recursive: true, mode: 0o700 });
|
||||
|
||||
Reference in New Issue
Block a user