openvibers/openvibe.vip Commits
Listen on the socket systemd hands over, so a restart never answers 502 (#133)
Changes
@@@ -57,7 +57,10 @@ async function start() {outbox.start();}-- 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(`[VIP] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl} (db ${domain.db.store})`);console.log(`[VIP] billing ${config.billing.url}; events relay ${outbox.enabled ? `→ ${config.events.url}` : 'off (outbox accumulates)'}; billing events ${config.events.webhookSecrets.length ? 'accepted' : 'not accepted (VIP_EVENTS_SECRET unset)'}`);});
@@ -57,7 +57,10 @@ async function start() {
@@ -57,7 +57,10 @@ async function start() {
outbox.start();
outbox.start();
}
}
- 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(`[VIP] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl} (db ${domain.db.store})`);
console.log(`[VIP] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl} (db ${domain.db.store})`);
console.log(`[VIP] billing ${config.billing.url}; events relay ${outbox.enabled ? `→ ${config.events.url}` : 'off (outbox accumulates)'}; billing events ${config.events.webhookSecrets.length ? 'accepted' : 'not accepted (VIP_EVENTS_SECRET unset)'}`);
console.log(`[VIP] billing ${config.billing.url}; events relay ${outbox.enabled ? `→ ${config.events.url}` : 'off (outbox accumulates)'}; billing events ${config.events.webhookSecrets.length ? 'accepted' : 'not accepted (VIP_EVENTS_SECRET unset)'}`);
});
});