Skip to content

fix: Harden LNbits CLN REST startup#256

Merged
macterra merged 1 commit intomainfrom
lnbits-clnrest-readiness
Mar 24, 2026
Merged

fix: Harden LNbits CLN REST startup#256
macterra merged 1 commit intomainfrom
lnbits-clnrest-readiness

Conversation

@macterra
Copy link
Copy Markdown
Collaborator

Summary

  • wait for an authenticated CLN REST before starting LNbits
  • fail startup instead of falling back into broken mode when CLN REST is not ready
  • restart LNbits automatically so transient boot races self-heal

Verification

  • restarted with
  • confirmed fresh logs show
  • confirmed LNbits starts on and logs

@macterra macterra force-pushed the lnbits-clnrest-readiness branch from 81b49be to 84a6404 Compare March 24, 2026 00:02
@macterra macterra requested a review from Copilot March 24, 2026 00:04
@macterra macterra changed the title Harden LNbits CLN REST startup fix: Harden LNbits CLN REST startup Mar 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens LNbits startup when using the CLN REST wallet by blocking startup until CLN REST is reachable and authenticated, and by configuring Docker to restart LNbits so transient boot races can self-heal.

Changes:

  • Require CLNREST_READONLY_RUNE and perform an authenticated /v1/listfunds readiness check before launching LNbits.
  • Fail startup (exit non-zero) instead of starting LNbits in a known-broken mode when CLN REST isn’t ready within the timeout.
  • Add restart: unless-stopped to the LNbits service in the lightning compose stack.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
scripts/lnbits-entrypoint.sh Adds authenticated CLN REST readiness gating and fails fast when CLN REST isn’t ready.
docker-compose.lightning.yml Ensures LNbits is restarted automatically to recover from transient startup races.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/lnbits-entrypoint.sh
@macterra macterra merged commit bbb7f73 into main Mar 24, 2026
17 checks passed
@macterra macterra deleted the lnbits-clnrest-readiness branch March 24, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants