feat: add DISABLE_LN_ADDRESS kill-switch for Lightning Address payouts#830
Conversation
Adds a temporary, reversible mitigation to disable Lightning Address auto-resolution as a security measure. When DISABLE_LN_ADDRESS=true, buyers are routed to the manual BOLT11 invoice flow instead of having their saved Lightning Address resolved automatically. - Guards all three resolvLightningAddress call sites (commands.ts and both addInvoice wizards in scenes.ts) - Saved Lightning Addresses are kept and ignored, so the change is fully reversible by unsetting the flag - Default (unset/empty) keeps Lightning Address enabled, no behavior change unless explicitly activated - Adds en/es locale strings for the user-facing notice Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR implements a temporary kill-switch for Lightning Address payouts via the ChangesLightning Address Kill-Switch Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The lockfile version was left at 0.15.0 while package.json is at 0.15.1, causing the ci_to_main format check (git diff --exit-code after npm install) to fail. Only the version field is updated; no dependencies change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Adds a temporary, reversible kill-switch to disable Lightning Address payouts as a security mitigation. When
DISABLE_LN_ADDRESS=true, buyers are routed to the manual BOLT11 invoice flow instead of having their saved Lightning Address auto-resolved and paid.Motivation
Provides operators a way to quickly shut off the Lightning Address payout path (e.g. in response to a security concern) without code changes or losing user data.
Changes
bot/commands.ts— guards the auto-resolution path inaddInvoice; when disabled, notifies the buyer and falls back to the manual invoice wizard.bot/scenes.ts— guards bothaddInvoiceWizardandaddInvoicePHIWizardso a pasted Lightning Address is rejected with a notice while BOLT11 invoices keep working..env-sample— documents the newDISABLE_LN_ADDRESSflag.locales/en.yaml,locales/es.yaml— adds theln_address_temporarily_disableduser-facing notice.Safety / behavior
resolvLightningAddresscall sites are guarded by the flag.validateLightningAddressonly matches thename@domainpattern (+ DNS check), so regular invoices flow through normally — users can still receive sats.=== 'true'match.Notes
enandes; other languages fall back to the default locale. Happy to add the remaining locales if desired.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation