feat: 2.0.0-alpha.11 — DB-backed service registry + LAN auto-discovery

- monitored_services table (mig 015) replaces config/services.json (now a boot seed)
- owner CRUD over /api/health/services; GET is DB-backed; cron+worker read the DB
- discover.lan worker: pure-Node TCP sweep + HTTP-title probe -> disabled 'discovered'
  candidates (never clobbers curated entries); POST /api/health/discover + GET .../discovered
- dashboard: Scan button + Discovered(N) section with one-click promote

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-04 07:55:08 +10:00
parent b728696020
commit ce26895d8e
17 changed files with 466 additions and 46 deletions

View File

@@ -8,8 +8,9 @@ import { registerWorkers } from './lib/jobs/index.js';
import { router as ingestRouter } from './lib/api/routes/ingest.js';
import { router as iconsRouter } from './lib/api/routes/icons.js';
import { startCron } from './lib/cron/index.js';
import { seedFromConfig } from './lib/health/registry.js';
const VERSION = '2.0.0-alpha.10';
const VERSION = '2.0.0-alpha.11';
export function createApp() {
const app = express();
@@ -58,6 +59,9 @@ if (import.meta.url === `file://${process.argv[1]}`) {
.then(() => log.info('job queue ready'))
.catch(err => log.error({ err }, 'queue boot failed'));
startCron();
// One-time bootstrap of the service registry from config/services.json if empty.
seedFromConfig().then(n => { if (n) log.info({ seeded: n }, 'monitored_services seeded from config'); })
.catch(err => log.error({ err }, 'service registry seed failed'));
app.listen(port, () => log.info({ port }, 'void-server listening'));
for (const sig of ['SIGTERM', 'SIGINT']) {
process.on(sig, async () => {