feat(lightning): add ThunderHub health endpoint for monitoring#182
Merged
TaprootFreak merged 1 commit intodevelopfrom May 8, 2026
Merged
feat(lightning): add ThunderHub health endpoint for monitoring#182TaprootFreak merged 1 commit intodevelopfrom
TaprootFreak merged 1 commit intodevelopfrom
Conversation
Adds GET /v1/thunderhub/health which proxies an HTTP check to the
upstream ThunderHub container and returns 200 {"up": true} when
reachable, 503 with the error otherwise.
Why: Uptime Kuma already monitors all 14 LDS services on dev.lightning.space
via lds-api-forwarded paths (/v1/lndhub/getinfo, /v1/swap/v2/...). ThunderHub
was the one service without coverage because it only listens on the internal
nginx port 6123 (127.0.0.1 on dfxdev) and is reachable to operators only via
the SSH-tunneled `thunderhub-remote` script in the server repo. Several
times now a tunnel reconnect has been the only signal that the underlying
container has been down for hours. The Kuma-consistent fix is to expose a
narrow health probe through the same lds-api forwarding pattern the other
13 monitors already use.
Configuration:
- New env var LIGHTNING_THUNDERHUB_URL (default: empty → 503).
In the DFX server repo's compose, this should be set to
http://thunderhub:3000 (intra-stack docker DNS, no SSL — same pattern
as the existing LIGHTNING_LNBITS_*_URL after the recent HTTP-intra-stack
switch in DFXServer/server PR #133).
Endpoint behavior:
- 200 { "up": true } when ThunderHub responds with any 2xx/3xx/4xx
(validateStatus rules out 5xx), so login-redirect is treated as up.
- 503 { "up": false, "error": "..." } on connect failure / 5xx / timeout.
- 5s timeout — short enough that Kuma sees DOWN within one probe interval.
No auth on the endpoint by design: it returns only a boolean, no internal
state, no upstream response body. Safe to be public.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was
Neuer Endpoint
GET /v1/thunderhub/health— gibt 200{ "up": true }wenn der upstream-ThunderHub-Container erreichbar ist, 503 wenn nicht.Warum
Aus der DFX-Server-Migration (DFXServer/server, Stage 2.1 live seit 2026-05-08): Uptime Kuma hat 14 LDS-DEV-Monitore, alle nach demselben Pattern —
https://dev.lightning.space/v1/<path>, mit lds-api als Forwarder zu lnbits / boltz-backend / claim-graphql.ThunderHub war der einzige LDS-Service ohne Kuma-Coverage, weil:
127.0.0.1:6123exposed (SSH-Tunnel-Only Access für Operatoren)http://localhost:6125), nicht auf nginxErgebnis: mehrfach hat erst ein toter Tunnel-Reconnect des
thunderhub-remote-Skripts dem Operator gezeigt, dass der Container über Stunden down war.Konsistent zu den existing 13 Monitoren ist der Probe via lds-api. Dieser PR fügt diesen Endpoint hinzu.
Wie
validateStatus: 2xx-4xxheisst: ThunderHub-Login-Redirect (302) oder 401-Forderung wird als UP gewertet — wir prüfen Erreichbarkeit, nicht Auth-Status.{up: true}oder{up: false, error}zurück, niemals Upstream-Inhalt.Konfiguration
Neue env-var
LIGHTNING_THUNDERHUB_URLin den 4 Vault-Items:LDS DEV - API Environment Variables(OrgDFX-dev-infra) →http://thunderhub:3000LDS PRD - API Environment Variables(OrgDFX-prd-infra) →http://thunderhub:3000Default ist leer → Endpoint antwortet 503 mit
LIGHTNING_THUNDERHUB_URL not configured. Damit ist es safe wenn die Vault-Items vor dem Vault-Update bereits ge-mergt sind.Test plan
nest buildkompiliert ohne Errorscurl https://dev.lightning.space/v1/thunderhub/health→ 200{"up":true}docker stop lds-thunderhub-1→curl ...→ 503 mit ErrorSicherheit