← back to Tools Dw Hub
scraper-api → Kamatera :8124 (option A executed): per-tool probeHost support, manifest updated
5170814d82aaf0207c0859ef25aa8914759fe0a3 · 2026-07-28 14:14:49 -0700 · Steve
Files touched
Diff
commit 5170814d82aaf0207c0859ef25aa8914759fe0a3
Author: Steve <steve@designerwallcoverings.com>
Date: Tue Jul 28 14:14:49 2026 -0700
scraper-api → Kamatera :8124 (option A executed): per-tool probeHost support, manifest updated
---
server.js | 8 ++++----
tools.json | 9 +++++----
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/server.js b/server.js
index 394bce4..c8d0431 100644
--- a/server.js
+++ b/server.js
@@ -19,16 +19,16 @@ const manifest = () => JSON.parse(fs.readFileSync(path.join(ROOT, 'tools.json'),
// 401 => up (the tool's own auth wall answered — alive).
// TCP-open but wrong body (another app squatting the port) => down. This kills the
// false-positive class where port 5000 = macOS ControlCenter read as a live tool.
-function probe(port, marker, timeout = 2500, path = '/', hop = 0) {
+function probe(port, marker, timeout = 2500, path = '/', hop = 0, host = PROBE_HOST) {
return new Promise((resolve) => {
if (!port) return resolve('n/a');
- const req = http.get({ host: PROBE_HOST, port, path, timeout }, (res) => {
+ const req = http.get({ host, port, path, timeout }, (res) => {
if (res.statusCode === 401) { res.resume(); return resolve('up'); }
// one-hop redirect follow (auth tools 302 to /login — still THIS tool if the target marker-matches)
if ([301, 302, 303, 307, 308].includes(res.statusCode) && res.headers.location && hop < 1) {
res.resume();
const loc = res.headers.location.startsWith('http') ? new URL(res.headers.location).pathname : res.headers.location;
- return probe(port, marker, timeout, loc, hop + 1).then(resolve);
+ return probe(port, marker, timeout, loc, hop + 1, host).then(resolve);
}
let body = '';
res.on('data', (c) => { if (body.length < 65536) body += c; });
@@ -73,7 +73,7 @@ const server = http.createServer(async (req, res) => {
if (url === '/api/status') {
const { tools } = manifest();
- const results = await Promise.all(tools.map(async (t) => ({ slug: t.slug, status: await probe(t.port, t.marker) })));
+ const results = await Promise.all(tools.map(async (t) => ({ slug: t.slug, status: await probe(t.port, t.marker, 2500, '/', 0, t.probeHost || PROBE_HOST) })));
res.writeHead(200, { 'Content-Type': 'application/json' });
return res.end(JSON.stringify(Object.fromEntries(results.map((r) => [r.slug, r.status]))));
}
diff --git a/tools.json b/tools.json
index e950aec..f18efbe 100644
--- a/tools.json
+++ b/tools.json
@@ -232,13 +232,14 @@
{
"slug": "scraper-api",
"name": "DW Scraper API",
- "desc": "Internal scrape API (degraded-honest mode without Mongo/Redis — full revival is an infra decision).",
+ "desc": "Internal scrape API — FULLY REVIVED on Kamatera (Mongo 7 + Redis local, all health checks true).",
"category": "Ops",
"folder": "Designer-Wallcoverings/DW-Programming/scraper-api",
- "port": 8123,
+ "port": 8124,
"marker": "DW Scraper API",
- "start": "cd ~/Projects/Designer-Wallcoverings/DW-Programming/scraper-api && PORT=8123 npm start",
- "created": "2026-01-30"
+ "start": "ssh root@45.61.58.125 pm2 restart dw-scraper-api # runs on Kamatera :8124",
+ "created": "2026-01-30",
+ "probeHost": "127.0.0.1"
},
{
"slug": "system-dashboard",
← f12c756 Cody-gate: surface 2 MISSING-SOURCE tools in manifest with ⚠
·
back to Tools Dw Hub
·
per-tool probePath (scraper-api probes /health on Kamatera-l 337ae8b →