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

8
server/index.js Normal file
View File

@@ -0,0 +1,8 @@
import { mkdirSync } from 'node:fs';
import { dirname } from 'node:path';
import { createSyncServer } from './app.js';
const filename = process.env.SYNC_DB ?? './sync-data/pardis.sqlite';
mkdirSync(dirname(filename), { recursive: true });
const server = createSyncServer({ filename, origin: process.env.SYNC_ORIGIN ?? '', trustProxy: process.env.SYNC_TRUST_PROXY === '1', maxBytes: Number(process.env.SYNC_MAX_BYTES ?? 52428800), maxVaults: Number(process.env.SYNC_MAX_VAULTS ?? 10000) });
server.listen(Number(process.env.PORT ?? 3001), process.env.SYNC_HOST ?? '127.0.0.1', () => console.info('Pardis sync listening'));
for (const signal of ['SIGINT', 'SIGTERM']) process.on(signal, () => server.close());