Repository navigation
fix(docker): probe /healthz over https when the web UI serves TLS - #2848
Conversation
) The image's HEALTHCHECK always built an http:// URL, so with both INSPECTOR_TLS_KEY_PATH and INSPECTOR_TLS_CERT_PATH set the probe failed every time and a correctly running TLS container was reported unhealthy forever. The probe now follows the server's TLS rule (both paths set, a blank value counting as unset) and uses https without verifying the certificate, since it only reaches the container's own listener where a self-signed or private-CA certificate is the normal case. It uses node:http/https rather than fetch because fetch has no per-request way to skip verification without undici, which the copied script cannot resolve. It also probes the unauthenticated /healthz route (#2438) instead of /, which read and token-injected index.html on every probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the TLS-aware Docker health-check changes.
No open issues 🎉
What changed in this PR
Fixes Docker health checks for TLS-enabled web deployments, addressing #2825 by matching the web server’s protocol and using the existing /healthz endpoint.
Changes:
- Selects HTTPS when both TLS paths are set and skips certificate verification for the container-local probe.
- Replaces
fetchwith Node’s HTTP/HTTPS clients and probes/healthzinstead of/. - Adds TLS configuration and real HTTPS listener tests, and updates Docker documentation.
| File | Description |
|---|---|
scripts/docker-healthcheck.test.mjs |
Tests health-route URLs, TLS detection, and self-signed HTTPS probing. |
scripts/docker-healthcheck.mjs |
Adds protocol-aware /healthz probing using Node’s HTTP/HTTPS clients. |
docs/docker.md |
Documents HTTPS health checks and certificate-verification behavior. |
Dockerfile |
Updates comments to describe /healthz and TLS-aware probing; configuration is unchanged. |
Review effort: Balanced
|
Copilot review loop closed: round 1 (review 5692602420) was clean — no inline comments, no headline finding, no suppressed comments — so per pr-flow 7c no further round is requested. |
|
CodeQL flags alert #84 ( Suggested dismissal: |
Closes #2825
The Docker
HEALTHCHECK(scripts/docker-healthcheck.mjs) always built anhttp://URL, so with bothINSPECTOR_TLS_KEY_PATHandINSPECTOR_TLS_CERT_PATHset every probe failed and a correctly running TLS container was reported unhealthy forever.tlsEnabled(env)mirrorsclients/web/server/tls.ts: https only when both paths are set, a blank value counting as unset.node:http/node:httpsinstead of globalfetch, sincefetchhas no per-request way to skip verification without importingundici, which the copied-out script cannot resolve./healthz(Web client's backend server has no health/readiness endpoint #2438) instead of/. Verified onv2/main: both backends serve it unauthenticated, it is exempt from the Host allow-list, and it avoids reading and token-injectingindex.htmlon every probe.docs/docker.mdupdated.Tests
scripts/docker-healthcheck.test.mjs:probeUrlexpectations move to/healthzplus https cases; atlsEnabledtable; the http probe asserts the path it hit; a newprobe over httpsblock runs against a real TLS listener with a throwawayopenssl-generated self-signed cert (healthy), and an http probe to that port (unhealthy).Hand smoke (built launcher, self-signed cert)
0; thev2/mainprobe → exit1(the bug).0.npm run local:gategreen.🤖 Generated with Claude Code