From 4ef7fa2d75c8b3404bb28a3975122e027ce398e2 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 9 Jun 2026 17:58:44 +1000 Subject: [PATCH] fix(health): derive /health version from package.json (kills the manual server.js bump gotcha) Co-Authored-By: Claude Opus 4.8 --- package-lock.json | 4 ++-- package.json | 2 +- server.js | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6198fc8..a2f1612 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "void-server", - "version": "2.6.1", + "version": "2.6.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "void-server", - "version": "2.6.1", + "version": "2.6.2", "dependencies": { "@modelcontextprotocol/sdk": "^1.29.0", "@mozilla/readability": "^0.6.0", diff --git a/package.json b/package.json index 886a492..57f14a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "void-server", - "version": "2.6.1", + "version": "2.6.2", "type": "module", "private": true, "scripts": { diff --git a/server.js b/server.js index 8744227..41444fb 100644 --- a/server.js +++ b/server.js @@ -14,8 +14,12 @@ import { seedFromConfig } from './lib/health/registry.js'; import { mcpAuth } from './lib/api/middleware/mcp_auth.js'; import { handleMcp } from './lib/mcp/http.js'; import httpProxy from 'http-proxy'; +import { readFileSync } from 'node:fs'; -const VERSION = '2.6.1'; +// Read the version from package.json so a deploy never serves a stale /health +// version (the old hardcoded const had to be bumped by hand and caused the +// health-gated deploy to roll back 3x when forgotten). +const VERSION = JSON.parse(readFileSync(new URL('./package.json', import.meta.url))).version; // Proxy /terminal (+ its WebSocket) to ttyd on CT 300, so the embedded terminal // works whether the Void is reached via Traefik (void2-app.hynesy.com) OR the