openvibers/openvibe.space Commits
Listen on the socket systemd hands over, so a restart never answers 502 (#139)
Changes
@@@ -13,7 +13,10 @@ const { createPgTelemetrySink, startTelemetryRetention } = require('openvibe-sdk// PostgreSQL first (migrations run as the owner); readiness reports the serving database.await require('./db').initDb(config);const app = await createApp();-- const server = app.listen(config.port, config.host, () => {++ // Socket activation (2026-10-31): systemd's .socket unit holds the listener across restarts, so a deploy++ // queues requests in the kernel instead of answering 502. Without the socket unit, the usual listen.++ const socketActivated = process.env.LISTEN_FDS === '1' && Number(process.env.LISTEN_PID) === process.pid;++ const server = app.listen(...(socketActivated ? [{ fd: 3 }] : [config.port, config.host]), () => {console.log(`[Space] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl}`);console.log(`[Space] spaces and static hosting (publishing for staff until launch); the forum is on ${config.communityUrl}; identity via ${config.networkUrl}`);});
@@ -13,7 +13,10 @@ const { createPgTelemetrySink, startTelemetryRetention } = require('openvibe-sdk
@@ -13,7 +13,10 @@ const { createPgTelemetrySink, startTelemetryRetention } = require('openvibe-sdk
// PostgreSQL first (migrations run as the owner); readiness reports the serving database.
// PostgreSQL first (migrations run as the owner); readiness reports the serving database.
await require('./db').initDb(config);
await require('./db').initDb(config);
const app = await createApp();
const app = await createApp();
- const server = app.listen(config.port, config.host, () => {
+ // Socket activation (2026-10-31): systemd's .socket unit holds the listener across restarts, so a deploy
+ // queues requests in the kernel instead of answering 502. Without the socket unit, the usual listen.
+ const socketActivated = process.env.LISTEN_FDS === '1' && Number(process.env.LISTEN_PID) === process.pid;
+ const server = app.listen(...(socketActivated ? [{ fd: 3 }] : [config.port, config.host]), () => {
console.log(`[Space] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl}`);
console.log(`[Space] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl}`);
console.log(`[Space] spaces and static hosting (publishing for staff until launch); the forum is on ${config.communityUrl}; identity via ${config.networkUrl}`);
console.log(`[Space] spaces and static hosting (publishing for staff until launch); the forum is on ${config.communityUrl}; identity via ${config.networkUrl}`);
});
});