diff options
| author | Adam Soltys <[email protected]> | 2026-08-27 09:01:45 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-27 09:01:45 -0700 |
| commit | 01636561aa58b031ac01bdc9a5779ace35040389 (patch) | |
| tree | ad9e68c6f80bd5e0a8b03b17b5d5e0b56ab3f463 | |
| parent | be1f54473273a97d5201948433a53216da26398f (diff) | |
| download | coinos-server-01636561aa58b031ac01bdc9a5779ace35040389.tar.gz coinos-server-01636561aa58b031ac01bdc9a5779ace35040389.zip | |
harden: remove debug /echo endpoint; widen LN health probe timeout
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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DKkev76U4YRnRAqM6jqbae
| -rw-r--r-- | index.ts | 5 | ||||
| -rw-r--r-- | lib/health.ts | 2 |
2 files changed, 1 insertions, 6 deletions
@@ -198,11 +198,6 @@ app.get("/replay/:index", (req, res) => { res.send({}); }); -app.post("/echo", (req, res) => { - console.log("echo", req.body); - res.send(req.body); -}); - const host: string = process.env["HOST"] || "0.0.0.0"; const port: number = Number.parseInt(process.env["PORT"]) || 3119; 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<boolean> { try { const waiting = await withTimeout( ln.waitanyinvoice(payIndex, 1), - 5_000, + 15_000, "listener backlog probe", ); if (Number(waiting?.pay_index) > payIndex) { |
