From 5394fc930bfd9c3c8dcfe9bc5d3aca122f6ed2d2 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 11 Sep 2026 05:18:02 +0200 Subject: [PATCH] fix: metrics are not public, and the workspace launcher renders again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /metrics answered on every public hostname — app.pedshub.com, peds.danvics.com and scribe.pedshub.com — with 201 lines naming routes, traffic volumes, event-loop timings and process internals. No credential in it, but a free map of the application for anyone probing. Prometheus scrapes the container directly over the Docker network and never goes through the proxy, so a request carrying X-Forwarded-For is by definition not Prometheus and now gets a 404. METRICS_TOKEN allows an explicit override; unset, it can never match. Verified: 404 on all three hostnames, and up{job="ped-ai"} still 1. The workspace launcher was blank. [hidden]{display:none!important}, added to stop "Retry loading settings" showing permanently, outranked `body.assistant-mode-workspace .assistant-workspace-view { display:block }` — and that view is the one element toggled by CSS rather than by JavaScript removing the attribute, so it could never be revealed again. The attribute is gone from the markup; the class already defaults it to display:none, so it still starts hidden. Everything else using the attribute is JS-toggled and unaffected. Verified with a real login: 17 cards at 208x40 in an 860x240 grid. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU --- .env.example | 7 +++++++ public/components/assistant.html | 6 +++++- server.js | 17 ++++++++++++++++- test/policy-flows.test.js | 17 +++++++++++++++++ 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index c3f62d94..8104063e 100644 --- a/.env.example +++ b/.env.example @@ -279,3 +279,10 @@ DB_PASSWORD=pedscribe_secret_change_me # OPENBAO_ROLE_ID= # OPENBAO_SECRET_ID= # OPENBAO_KV_PATH=kv/ped-ai/prod + +# Optional. Lets something outside this host scrape /metrics with +# `Authorization: Bearer `. Unset by default, and an unset token can +# never match — Prometheus scrapes pediatric-ai-scribe:3000 directly over the +# Docker network, which needs no token. Requests arriving through the reverse +# proxy (they carry X-Forwarded-For) get a 404 either way. +METRICS_TOKEN= diff --git a/public/components/assistant.html b/public/components/assistant.html index 28c9a91c..2a54a469 100644 --- a/public/components/assistant.html +++ b/public/components/assistant.html @@ -54,7 +54,11 @@ -