fixed API and stopping delay

This commit is contained in:
Marco Mooren
2026-05-27 12:54:56 +02:00
parent 470d4e8e76
commit 7b8d78ddaf
22 changed files with 495 additions and 98 deletions

View File

@@ -12,7 +12,7 @@ import { fileURLToPath } from 'node:url';
import { existsSync } from 'node:fs';
import { initDb } from './db/index.js';
import { authMiddleware, ensureBootstrapAdmin, ensureMainUser } from './auth.js';
import { authMiddleware, ensureBootstrapAdmin, ensureMainUser, ensureBootstrapApiKey } from './auth.js';
import { applySeedIfEmpty } from './sources/seed.js';
import { scheduleHealthCheck } from './streams/checker.js';
import { attachWs } from './ws.js';
@@ -39,6 +39,7 @@ export async function startServer(opts = {}) {
password: process.env.ADMIN_BOOTSTRAP_PASSWORD
});
ensureMainUser(process.env.MAIN_USER || 'morphix');
ensureBootstrapApiKey(process.env.ORADIO_API_KEY);
const seedResult = applySeedIfEmpty();
console.log('[seed]', seedResult);
ensureImageDirs();