chore: deploy once through Compose

This commit is contained in:
2026-09-16 10:23:07 +03:30
parent b90161e504
commit a3a49adad2
7 changed files with 126 additions and 452 deletions

View File

@@ -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 });