From 01636561aa58b031ac01bdc9a5779ace35040389 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 27 Aug 2026 09:01:45 -0700 Subject: harden: remove debug /echo endpoint; widen LN health probe timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the unauthenticated POST /echo route — a request-body reflector with no place in production; it served only to echo attacker probe payloads. Raise the health-check listener-backlog probe timeout from 5s to 15s. The waitanyinvoice probe normally returns in ~1s but can intermittently take ~8s while lightningd is briefly busy; the 5s cap turned those transient spikes into health-check failures (and, at 3 consecutive, an unnecessary process exit / container restart). 15s absorbs the busy spikes while a genuinely wedged RPC still fails the check. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01DKkev76U4YRnRAqM6jqbae --- lib/health.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/health.ts b/lib/health.ts index bb05b0db..96d15030 100644 --- a/lib/health.ts +++ b/lib/health.ts @@ -93,7 +93,7 @@ async function checkLightningHealth(): Promise { try { const waiting = await withTimeout( ln.waitanyinvoice(payIndex, 1), - 5_000, + 15_000, "listener backlog probe", ); if (Number(waiting?.pay_index) > payIndex) { -- cgit v1.2.3