Repository navigation
rtl: stop RTL when lnd or clightning stops - #250
Conversation
RTL sends the lnd admin macaroon and the clightning admin rune to the REST ports of lnd and clnrest. It does not check their certificate. The RTL unit only had `wants` on its backends, so RTL kept running while they were down. Without netns-isolation, a local user could then bind the free port and collect the credential. Bind RTL to its backends. RTL now stops when lnd or clightning stops, crashes or exits. Each backend starts RTL again from `ExecStartPost`. If RTL can't start, the backend still starts. RTL's start waits until the backend is ready. When lnd can't bind its REST port, lnd fails to start and RTL stays down. `wantedBy` on the backends would also start RTL, but in a VM test it made lnd restart at once after an exit and skip its `RestartSec`. With both backends enabled, RTL stops when one of them stops. While that one is stopped, stopping or waiting to restart, the other one's start doesn't start RTL, because RTL's `bindsTo` would start the stopped one too. Its own next start starts RTL. On nodes with RTL, the deploy restarts lnd and clightning once, because their units change. The new rtl-stops-with-backend test stops each backend and makes it exit by itself. It checks that RTL stops at once and starts again after the backend, that lnd still waits its RestartSec, and that a start of lnd leaves a stopped clightning alone. This does not cover a clnrest port that another process holds before clnrest starts. RTL still has to check the certificate. Part of bitcoinix#151. Assisted-by: Claude Code (Claude Opus 5.5)
viberaven
left a comment
There was a problem hiding this comment.
Reviewed commit 08203f4. The lifecycle changes passed the focused checks below. One required integration gap remains: the new RTL availability behavior needs the config-version notice and user-facing documentation required by AGENTS.md (inline finding).
Validation on x86_64-linux:
nix eval --json .#ciTestInfopassed.nix build --no-link .#checks.x86_64-linux.module-config .#checks.x86_64-linux.test-runnerpassed.- Ran
rtl-stops-with-backendin the PR's regtest KVM driver; passed. - Also killed each backend's main process with SIGKILL in that VM: RTL stopped within the five-second assertion window and restarted after backend recovery in both cases.
- With RTL shutdown deliberately delayed, a queued Core Lightning stop was preserved during LND crash recovery.
The PR's existing CI is green. Local VM validation was focused on this change, rather than a rerun of the entire scenario matrix.
RTL now stops with lnd and clightning. With both backends enabled, that also stops RTL for the other one during maintenance, and starting RTL starts a stopped backend. Add a 0.1.6 notice for nodes with RTL, the upgrade text, a release note and a paragraph in the RTL service docs. The notice and the upgrade text also say that the deploy restarts each backend that RTL uses once. Assisted-by: Claude Code (Claude Opus 5.5)
|
Thanks, and thanks for the SIGKILL check. Added in 535d4c2:
On the KVM host, |
The backends' `ExecStartPost` queried the other backend's state and then started RTL, so that RTL's `bindsTo` wouldn't start a stopped backend. The other backend could stop between the query and the start, and a failed query failed the backend's own start. Start RTL with `--job-mode=ignore-requirements` instead, with no query. It doesn't pull in RTL's backends, and systemd refuses to start a unit while a unit that it's bound to and ordered after isn't active. `-` keeps a failed start of RTL from failing the backend. In `rtl-stops-with-backend`, a SIGTERM to clightning can hit its stop timeout when a clboss subprocess ignores the signal. clightning then restarts after RestartSec, and the test waited for a stopped state that it never saw. Wait for either outcome. The docs said that RTL runs only while its backends run. It's bound to their units, and it still doesn't check their certificates, so say that. Assisted-by: Claude Code (Claude Opus 5.5)
|
I pushed more fixes:
On the KVM host, |
viberaven
left a comment
There was a problem hiding this comment.
Reviewed head 57b0539. No remaining actionable findings.
The earlier request for an upgrade notice is addressed: the conditional 0.1.6 versioning entry, upgrade guide, service documentation, and release note cover coupled RTL availability, maintenance behavior, and the one-time backend restart on deployment.
I also reviewed the revised ExecStartPost hook and its interaction with backend readiness and recovery. The nonblocking start preserves ordering, while ignore-requirements avoids pulling a deliberately stopped second backend back up. The tests cover explicit stops, backend exits, restart ordering, LND's restart delay, and the stopped-second-backend case.
Validation:
- Local module-config and test-runner flake checks passed on x86_64-linux at this head.
- GitHub CI is green for this exact head, including default, netns, and netnsRegtest VM scenarios.
- I did not rerun VM integration tests locally for this review.
The documented remaining TLS-validation and clnrest readiness limitations remain follow-up work; this change does not fully eliminate credential interception risks.
Reviewed with Codex (GPT-6 Astra).
Fixes #102. `rtl-setup-config` rebuilds `RTL-Config.json` from the Nix template at every start. RTL keeps the 2FA secret that a user sets up in its web interface in that file as `secret2FA`, and on load it turns 2FA on only when that field is set (`backend/utils/config.js` in RTL 0.15.16). So every restart turned 2FA off without a warning. #250 binds RTL to its backends, so RTL would restart more often. This carries `secret2FA` over from the old file when it's a non-empty string: - jq reads it from the old file with `--slurpfile`, so it never shows up in argv, like the password. - A missing or empty old file, or one that isn't exactly one JSON object, gives the old behavior. bitcoinix logs a warning when it ignores an existing file, because 2FA is then off. - The new config goes to a temp file in the data dir, which then replaces the old one. `>` on the same path would truncate it before jq reads it. The file is now mode 0600, so group `rtl` can no longer read the 2FA secret in it. - It doesn't keep `multiPassHashed`, the hash that RTL saves when you change the password in the web interface. RTL prefers it over `multiPass`, so `rtl-password` would stop setting the password. Each start still resets the other web interface settings. The docs say how to turn 2FA off without the authenticator: delete `RTL-Config.json` and restart RTL. Before, any restart did that. A 0.1.6 versioning entry and upgrade text say so too, and they name the new file mode. When `RTL-Config.json` itself is a bind mount, `mv` can't replace it, and RTL fails to start. Before this PR, bitcoinix rewrote that file at every start, so persisting it alone had no use. Persist RTL's data dir instead. `test_rtl` sets a `secret2FA`, restarts RTL and checks the file, the file mode and RTL's own `enable2FA` from `/rtl/api/conf`. Then it removes the secret again and checks that 2FA is off, and it checks that a file with two JSON values isn't carried over and logs the warning. On the KVM host, `nix eval .#ciTestInfo` and the `regtest`, `netnsRegtest` and `default` scenarios pass. Models: Claude Opus 5.5 wrote it. Fable 5.2 reviewed it twice and Codex GPT-6 Astra three times.
RTL sends the lnd admin macaroon and the clightning admin rune to its backends with `rejectUnauthorized: false`, and it has no option for a CA. Since bitcoinix#250, RTL stops with its backends. But clightning's start only waits until clnrest's port accepts a connection, and any listener passes that check. A local user who takes the port first gets the rune. Preload a small Node module into RTL that wraps `tls.connect`. A connection to a backend's address and port must present the backend's own cert: lnd's cert, or clnrest's server cert from the cert dir that clightning reports. Pinning clnrest's server cert instead of its CA keeps out other certs from that CA. Every other connection gets `rejectUnauthorized: true` and the normal checks against the system CAs. So a backend reached through another address or a proxy fails, because the system CAs don't trust its cert, and fiat rate requests still work. Node's own check drops the connection before any request data goes out. RTL doesn't start when the pins are missing or malformed, or when `LN_SERVER_URL` or `LND_SERVER_URL` is set: RTL would use them instead of the configured URLs, even over plain HTTP. For the same reason, an assertion rejects `Settings.lnServerUrl` in a node's `extraConfig`. Another assertion keeps the preload in `NODE_OPTIONS`. Assisted-by: Claude Code (Claude Opus 5.5)
RTL sends the lnd admin macaroon and the clightning admin rune to its backends with `rejectUnauthorized: false`, and it has no option for a CA. Since bitcoinix#250, RTL stops with its backends. But clightning's start only waits until clnrest's port accepts a connection, and any listener passes that check. A local user who takes the port first gets the rune. Preload a small Node module into RTL that wraps `tls.connect`. A connection to a backend's address and port must present the backend's own cert: lnd's cert, or clnrest's server cert from the cert dir that clightning reports. Pinning clnrest's server cert instead of its CA keeps out other certs from that CA. Every other connection gets `rejectUnauthorized: true` and the normal checks against the system CAs. So a backend reached through another address or a proxy fails, because the system CAs don't trust its cert, and fiat rate requests still work. Node's own check drops the connection before any request data goes out. RTL doesn't start when the pins are missing or malformed, or when `LN_SERVER_URL` or `LND_SERVER_URL` is set: RTL would use them instead of the configured URLs, even over plain HTTP. For the same reason, an assertion rejects `Settings.lnServerUrl` in a node's `extraConfig`. Another assertion keeps the preload in `NODE_OPTIONS`. Assisted-by: Claude Code (Claude Opus 5.5)
RTL sends the lnd admin macaroon and the clightning admin rune to its backends with `rejectUnauthorized: false`, and it has no option for a CA. Since #250, RTL stops with its backends, but clightning's start only waits until clnrest's port accepts a connection, so a local user who takes the port first still gets the rune. Preload a small Node module into RTL (`NODE_OPTIONS`) that wraps `tls.connect`. A connection to a backend's address and port must present that backend's own cert: lnd's cert, or clnrest's server cert from the cert dir that clightning reports. Pinning the server cert instead of its CA keeps out other certs from that CA. Every other connection gets `rejectUnauthorized: true` and the normal checks against the system CAs, so fiat rate requests still work. Node drops a connection that fails the check before any request data goes out. RTL doesn't start when the pins are missing or malformed, or when `LN_SERVER_URL` or `LND_SERVER_URL` is set, and evaluation fails when a node's `extraConfig` changes `Settings.lnServerUrl`. A proxy without `no_proxy` for the backend address and self-signed non-backend servers set through `extraConfig` no longer work; for the latter, add the cert with `NODE_EXTRA_CA_CERTS`. Config version 0.1.6 has a notice and an upgrading entry for this. The scoped credentials and TLS for the web UI are now #261 and #262. Fixes #151
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [bitcoinix/bitcoinix](https://github.com/bitcoinix/bitcoinix) | patch | `v0.1.5` → `v0.1.6` | --- ### Release Notes <details> <summary>bitcoinix/bitcoinix</summary> ### [`v0.1.6`](https://github.com/bitcoinix/bitcoinix/releases/tag/v0.1.6): bitcoinix 0.1.6 [Compare Source](bitcoinix/bitcoinix@v0.1.5...v0.1.6) **Security release with breaking changes.** Narrows Tor enforcement to local addresses, closes a netns-isolation bypass, hardens RTL and the custom lnd macaroons, and updates lnd to 0.21.8-beta. All users should upgrade. Evaluation fails with a message for each breaking change that affects your config; act on it, then set `nix-bitcoin.configVersion = "0.1.6";`. Deploying restarts every netns-isolated service and each RTL backend once. #### Security - **Tor enforcement allowed more than Tor.** Services with `tor.enforce` and charge-lnd could reach every link-local address `169.254.0.0/16`, including a cloud provider's metadata service, and could resolve names through the host's resolver sockets. They now reach only localhost and, with netns-isolation, the namespace subnet, and can't use the nscd, systemd-resolved, D-Bus and Avahi sockets ([#​264](bitcoinix/bitcoinix#264), [GHSA-cgh8-4w2p-8fr8](GHSA-cgh8-4w2p-8fr8)). - **netns-isolation:** with `br_netfilter` loaded, which Docker does, a service without `tor.enforce` could reach the listeners of namespaces it isn't connected to. Traffic between namespaces is no longer masqueraded ([#​239](bitcoinix/bitcoinix#239)). - **RTL verifies its backends.** RTL sent the lnd admin macaroon and the clightning admin rune to any server on a backend's port. It now requires the backend's pinned TLS certificate ([#​258](bitcoinix/bitcoinix#258)) and stops when lnd or clightning stops, instead of polling a port that another local user could take over ([#​250](bitcoinix/bitcoinix#250)). - **RTL two-factor authentication survives restarts.** Before, each restart turned 2FA off without a warning. `RTL-Config.json`, which holds the 2FA secret, is now readable only by RTL's user ([#​254](bitcoinix/bitcoinix#254)). - **Custom lnd macaroons** (`services.lnd.macaroons`, used by BTCPay Server and charge-lnd) are now readable only by their `user`. Before, the user's primary group could read them, which for `operator` is `users`, so other normal users could. If other users log in to your node, [revoke all macaroons](https://docs.bitcoinix.net/services.html#revoke-all-macaroons) ([#​255](bitcoinix/bitcoinix#255)). Each custom macaroon now has its own root key, so one can be revoked without the others ([#​236](bitcoinix/bitcoinix#236)). - **Root scripts no longer load config files from a service user's home.** The lnd user could make root's `curl` and `jq` load `~/.curlrc` and `~/.jq` from lnd's data dir ([#​241](bitcoinix/bitcoinix#241), [GHSA-cwmc-wjvh-3qp6](GHSA-cwmc-wjvh-3qp6)). - **Backups fail when a database dump fails.** Before, duplicity succeeded without the database. With `services.postgresqlBackup.compression` set to `"zstd"` or `"none"`, backups left out the BTCPay and NBXplorer databases; they are now included, so run `systemctl start duplicity` after upgrading if you use one of these ([#​225](bitcoinix/bitcoinix#225)). - **Multipath TCP:** service namespaces now copy the host's `net.mptcp.enabled`, so the setting of `hardened-extended` reaches netns-isolated services ([#​206](bitcoinix/bitcoinix#206)). - **Secrets:** `setup-secrets` rejects empty secret files, and secret generation no longer replaces an empty TLS, WireGuard or replication SSH key ([#​244](bitcoinix/bitcoinix#244)). - **WireGuard preset:** evaluation fails for firewall setups in which the preset's rules can't run or don't stay loaded ([#​188](bitcoinix/bitcoinix#188)). - **lnd [0.21.8-beta](https://github.com/lightningnetwork/lnd/blob/master/docs/release-notes/release-notes-0.21.8.md)** fixes correctness bugs in channel state persistence, gossip validation, the sweeper and HTLC recovery ([#​263](bitcoinix/bitcoinix#263)). #### Breaking changes - **Tor enforcement:** a service with `tor.enforce` that connects to a non-local address or by host name needs a change. netns-isolation rejects `addressblock` 169 and 170 ([#​264](bitcoinix/bitcoinix#264)). - **Onion address access:** `lndconnect.onion` and `clnrest.lnconnect.onion` give the operator user access only when `nix-bitcoin.operator.enable` is set. `nix-bitcoin.onionAddresses.access` accepts only users that are defined and enabled in `users.users` ([#​170](bitcoinix/bitcoinix#170)). - **Secrets:** an empty or non-regular secret file now fails `setup-secrets`, and then no service can read its secrets. Check before deploying: `find /etc/nix-bitcoin-secrets -maxdepth 1 -type f -empty`. Set `nix-bitcoin.secrets.<name>.allowEmpty = true` for a secret that may be empty ([#​244](bitcoinix/bitcoinix#244)). - **lnd wallet:** lnd stops when `wallet.db` isn't a regular file, or when its seed file is a symlink to a missing file while it has no wallet ([#​244](bitcoinix/bitcoinix#244)). - **lnd macaroons:** bitcoinix deletes unused root keys with IDs `0x6e62000000000000` to `0x6e62ffffffffffff` on each lnd start; check `lncli listmacaroonids` before deploying. lnd's `no-macaroons` option isn't supported. Restart services that read a custom macaroon only at startup ([#​236](bitcoinix/bitcoinix#236)). A program that read a custom macaroon through the group needs its own macaroon ([#​255](bitcoinix/bitcoinix#255)). - **RTL:** with both backends enabled, stopping one stops RTL for both ([#​250](bitcoinix/bitcoinix#250)). `LN_SERVER_URL`/`LND_SERVER_URL`, another `Settings.lnServerUrl`, a proxy without `no_proxy` for the backend, and servers with a self-signed certificate no longer work as before ([#​258](bitcoinix/bitcoinix#258)). - **WireGuard preset:** fails evaluation with the nftables firewall package without iptables, with `networking.nftables.flushRuleset`, and with an `ip` or `ip6` table named `filter` in `networking.nftables.tables` ([#​188](bitcoinix/bitcoinix#188)). - **extra-container [1.0.1](https://github.com/extra-container/extra-container/releases/tag/v1.0.1):** containers can no longer reach the host's Nix daemon socket, so `nix build`, `nix run`, `nix develop` and `nix-shell` fail inside them. `extra.hostNixDaemon = true;` restores the old behavior; read the security section of the extra-container README first ([#​211](bitcoinix/bitcoinix#211)). - **Packages:** `rtl` and `trustedcoin` moved to `legacyPackages.<system>.pinned`. Trezor is `nix-bitcoin.pkgs.nbPython3Packages.trezor`. `nbPython3Packages` uses the Python interpreter of nixpkgs-unstable, so build custom Python environments with `nbPython3Packages.python` ([#​245](bitcoinix/bitcoinix#245)). - **nodeinfo:** every bitcoinix update now produces a new system generation, because the revision is part of the script. Set `nix-bitcoin.revision = null;` to opt out ([#​243](bitcoinix/bitcoinix#243)). See [Upgrading to config version 0.1.6](https://docs.bitcoinix.net/upgrading.html#upgrading-to-config-version-016). #### New - **[Unbeholden Wallet](https://docs.bitcoinix.net/services.html#connect-to-unbeholden-wallet):** a watch-only wallet that runs in the browser and hands transactions to an air-gapped signer over QR codes. Enable it with `services.unbeholden-wallet.enable = true;` ([#​230](bitcoinix/bitcoinix#230)). - **nodeinfo** shows the bitcoinix revision and the package version of each service. `nodeinfo --version` prints only the revision, `nodeinfo NAME ...` only the given entries ([#​243](bitcoinix/bitcoinix#243)). #### Fixes - lnd announces its onion address with the port Tor forwards. With a `services.lnd.port` other than 9735, peers couldn't reach the node over Tor ([#​228](bitcoinix/bitcoinix#228)). - clnrest replaces an empty or `null` admin rune on start. Generate connection URLs from `lnconnect-clnrest` again if they were created with such a rune ([#​217](bitcoinix/bitcoinix#217)). - btcpayserver with the clightning backend joins `services.clightning.group`, so a custom group works ([#​238](bitcoinix/bitcoinix#238)). - The lnd seed and electrs index migration steps keep the data when an earlier step fails ([#​242](bitcoinix/bitcoinix#242)). #### Updates | Package | 0.1.5 | 0.1.6 | | ----------------------------- | ----------- | -------------------------------------------------------------------------------- | | lnd | 0.21.6-beta | [0.21.8-beta](https://github.com/lightningnetwork/lnd/releases/tag/v0.21.8-beta) | | RTL | 0.15.16 | [0.15.17](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.15.17) | | extra-container (flake input) | 0.17 | [1.0.1](https://github.com/extra-container/extra-container/releases/tag/v1.0.1) | | Unbeholden Wallet | – | [0.4.0](https://github.com/unbeholdendev/unbeholden-wallet/releases/tag/v0.4.0) | Also: mempool builds with Node.js 24 ([#​246](bitcoinix/bitcoinix#246)); the docs say what netns-isolation doesn't isolate ([#​237](bitcoinix/bitcoinix#237)) and how to close public SSH without losing access ([#​234](bitcoinix/bitcoinix#234)). Contributors: [@​msgilligan](https://github.com/msgilligan), [@​ostermayer](https://github.com/ostermayer), [@​prusnak](https://github.com/prusnak), [@​seberm](https://github.com/seberm), [@​unbeholdendev](https://github.com/unbeholdendev), [@​viberaven](https://github.com/viberaven). Full changes: <bitcoinix/bitcoinix@v0.1.5...v0.1.6> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNDEuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjI0MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: agent <[email protected]> Reviewed-on: https://git.home.unbeholden.dev/unbeholden/infra/pulls/140
Part of #151.
RTL sends the lnd admin macaroon and the clightning admin rune to the backends' REST ports without checking their certificate. The RTL unit only had
wantson lnd and clightning, so RTL kept polling while they were down. Without netns-isolation, a local user could bind the free port in that window and collect the credential.This binds RTL to its backends (
bindsTowithafter), so RTL stops whenever the lnd or clightning unit stops, crashes or exits.bindsTodoesn't start RTL again, so each backend starts it fromExecStartPostwithsystemctl start --no-block --job-mode=ignore-requirements rtl.service. RTL'safterholds that start until the backend's start job, with its readiness checks, has finished. If lnd can't bind its REST port, it stops, and RTL stays down.--job-mode=ignore-requirementskeeps that start from pulling in RTL's backends. With both backends enabled, a normal start of RTL would also start the other backend while it's stopped, for example in the middle of the FAQ's clightning reset. systemd refuses to start a unit while a unit that it's bound to and ordered after isn't active ("Bound to unit clightning.service, but unit isn't active"), so RTL then stays down until the other backend's own start starts it. The command has a-prefix, so a failed start of RTL, for example because it's masked, never fails the backend's start.I first used
wantedByon the backends, asmodules/onion-addresses.nixdoes with tor. In the VM, lnd then restarted at once afterlncli stopinstead of after its 10 sRestartSec. A small VM test on the pinned systemd 260.5 showed why: aType=notifyservice that sendsSTOPPING=1as it shuts down, like lnd, gets restarted right away when a unit it wants is bound to it. WithExecStartPostit waits itsRestartSec.On nodes with RTL, the deploy restarts lnd and clightning once, because their units change. A 0.1.6 versioning entry, upgrade text and a release note say so.
The new
rtl-stops-with-backendtest stops each backend and makes it exit by itself. It checks that RTL stops with it and starts again after the backend, that lnd still waits itsRestartSec, and that a start of lnd leaves a stopped clightning alone while systemd refuses RTL's start. Two comments inrestarts.pydescribed the oldwants, andclnrest-admin-runenow waits for RTL instead of restarting it.Limits, for follow-ups:
modules/clightning-plugins/clnrest.nix). So a process that holds that port before clnrest starts still gets the rune. A readiness check that verifies clnrest's own certificate would close that.On the KVM host,
nix eval .#ciTestInfoand theregtest,netnsRegtestanddefaultscenarios pass.Models: Fable 5.2 wrote the plan and reviewed the change three times, Claude Opus 5.5 wrote it, and Codex GPT-6 Astra reviewed it three times. Astra found the race in the first version of the start hook, which checked the other backend's state.