Skip to content

presets/wireguard: check that the firewall rules can run and stay loaded - #188

Merged
prusnak merged 3 commits into
bitcoinix:masterfrom
ostermayer:wireguard-firewall-package
Nov 10, 2026
Merged

prusnak merged 3 commits into
bitcoinix:masterfrom
ostermayer:wireguard-firewall-package

Conversation

@ostermayer

@ostermayer ostermayer commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

The WireGuard preset binds the REST ports of the enabled *connect helpers to 0.0.0.0 and guards them, and restrictPeer, only through networking.firewall.extraCommands. Its assertion required the iptables backend, but some layouts pass that check and still end with no firewall. This is the same kind of gap #175 closed for netns-isolation.

What changed, one commit on current master:

  • Package check. networking.firewall.package defaults to pkgs.nftables whenever networking.nftables is enabled, whatever the backend says. The firewall service then has no iptables binary and fails at its first rule. The assertion now rejects the nftables package unless networking.firewall.extraPackages holds iptables, which the service also puts on its PATH.
  • flushRuleset check. pkgs.iptables is iptables-nft, so the rules live in the nftables ruleset. With networking.nftables.flushRuleset, every start or reload of nftables.service runs flush ruleset and deletes them while firewall.service stays active. NixOS turns it on by default when ruleset or rulesetFile is set or system.stateVersion is older than 23.11. A separate assertion rejects it and points to networking.nftables.tables with flushRuleset = false.
  • Table name check. nftables.service deletes and recreates every table in networking.nftables.tables. A table named filter in the ip or ip6 family is the one iptables-nft keeps nixos-fw in, so that's rejected too. inet filter still passes. Raw flush or delete lines in ruleset, rulesetFile or extraDeletions aren't checked.
  • The messages say to restart firewall.service once after a fix, since the first nftables reload still runs the old deletions file.
  • docs/services.md lists the preset's firewall requirements in the WireGuard setup step.
  • Configuration checks: nftables with the iptables backend fails, the iptables package or extraPackages passes, ruleset set fails, system.stateVersion = lib.mkForce "23.05" fails, tables only passes, an ip filter table fails.

Tested

  • module-config on my KVM host on top of master: 67 tests pass. With master's preset and the new tests, the four rejection tests fail. With the previous PR head's preset, the ruleset and stateVersion tests fail.
  • In the pinned nixpkgs, nftables.nix sets the flushRuleset default to mkDefault (versionOlder stateVersion "23.11" || rulesetFile != null || ruleset != ""), and recreates each table in tables on reload.
  • The wireguard-lndconnect VM scenario passes.

DeepSeek V4.1 Flash 1017 (max) found the package gap in the gate runs on #170 and #184 and Codex (GPT-6 Astra, xhigh) confirmed it both times. @sebsgent found the flushRuleset hole. Claude Opus 5.5 wrote this version. Codex (GPT-5.6 Sol, xhigh) reviewed it in two passes and found two real issues: the ip filter table clash, and that the first reload after a fix still applies the old deletions. Both are in. Its point that any package not named nftables passes is by design, the same check as #175. DeepSeek V4.1 Flash 1017 (max) and GLM 5.3 (max) audited the tree at 1cea5a7 with Codex (GPT-6 Astra, xhigh) as the second opinion: seven findings, none in the files this PR touches. They're in RTL, mempool settings, the shared Tor SOCKS port and the netns source filter, and Astra marked the three netns ones false positives.

netns-isolation has the same flushRuleset and table-name hole: a flush deletes nb-netns-bridge's MASQUERADE rule and the host's nixos-fw, while the per-namespace rules survive. That's a separate PR.

@github-actions github-actions Bot added area: ci .github/, test/, dev/ area: modules modules/ and pkgs/lib.nix labels Oct 30, 2026
@sebsgent

sebsgent commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

The check still accepts layouts that end with no firewall.

Must fix

  • networking.nftables.flushRuleset wipes the rules this assertion is meant to guarantee. pkgs.iptables is iptables-nft, so flush ruleset in nftables.service deletes nixos-fw while firewall.service stays active. The default is true when ruleset or rulesetFile is set, or when stateVersion is below 23.11. In a VM with package = pkgs.iptables, and with extraPackages = [ pkgs.iptables ], the rules were gone after boot and the port was reachable from another host. Reloading firewall and then nftables wipes them again, so this isn't a boot-order race.
  • Reject it with a separate assertion and message: !(networking.nftables.enable && networking.nftables.flushRuleset). Point users to networking.nftables.tables with networking.nftables.flushRuleset = false. Add checks that ruleset fails and that system.stateVersion = lib.mkForce "23.05" fails, and keep the tables-only case passing.

Should fix

  • Squash the two commits. The first message says the service looks for iptables only in the package and mentions two checks; both are out of date and would land on master.
  • Add the WireGuard preset's firewall requirements to the docs, next to the netns-isolation note.

Tested: module-config passes merged with master, the rejection test fails on master, the VM runs above used the pinned nixpkgs with the preset's rule shapes and a dummy listener, and the proposed condition rejects the failing layouts and keeps the working ones.

Review performed with Claude Code (Opus 5.5).

@ostermayer
ostermayer force-pushed the wireguard-firewall-package branch from c6efd17 to 1cea5a7 Compare November 2, 2026 20:57
@github-actions github-actions Bot added the area: docs docs/, README, examples/, SECURITY.md, book.toml, assets label Nov 2, 2026
@ostermayer ostermayer changed the title presets/wireguard: check the firewall package the rules run with presets/wireguard: check that the firewall rules can run and stay loaded Nov 2, 2026
@ostermayer

Copy link
Copy Markdown
Collaborator Author

Thanks, good catch. Pushed one squashed commit.

flushRuleset

  • New assertion, separate from the package check: !(networking.nftables.enable && networking.nftables.flushRuleset). The message points to networking.nftables.tables with flushRuleset = false.
  • The default matches what you said at the pinned nixpkgs: mkDefault (versionOlder stateVersion "23.11" || rulesetFile != null || ruleset != "").
  • The message also says to restart firewall once after the fix, since the first nftables reload still includes the old deletions file with flush ruleset.
  • Tests: ruleset set fails, system.stateVersion = lib.mkForce "23.05" fails, tables only passes.

Table name clash

  • While in there: a networking.nftables.tables entry named filter in the ip or ip6 family gets deleted and recreated on every nftables reload. That's the table iptables-nft keeps nixos-fw in, so it hits the same hole without any flush. It's now rejected too, with a test. inet filter still passes. Raw flush or delete lines in ruleset, rulesetFile or extraDeletions aren't checked.

Should fix

  • Squashed into one commit. The message now describes the final checks.
  • Docs: the requirements are in the WireGuard section of docs/services.md, where people set up the preset. The wording follows the netns-isolation note in docs/configuration.md.

Tested

  • module-config passes on top of master (67 tests).
  • With master's preset and the new tests, the four rejection tests fail. With the old PR head preset, the ruleset and stateVersion tests fail.
  • wireguard-lndconnect VM scenario passes.

@viberaven viberaven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 1cea5a7 against its merge base and the pinned NixOS firewall/nftables modules. The package-PATH check and the nftables reload checks address the intended failure modes, including the saved deletions file. One P2 compatibility regression remains: the latter two assertions also reject a firewall explicitly using iptables-legacy.

Validation:

  • All 7 added configuration tests passed in separate Nix evaluations using the PR's pinned inputs.
  • Additional evaluations covered rulesetFile, an ip6 filter table under a different attribute name, disabled tables, inet filter, restrictPeer-only use, and a preset that needs no extra firewall rules.
  • The two legacy configurations pass the pre-PR assertions and fail the new assertions.
  • Reproduced the kernel behavior in a disposable network namespace with the pinned iptables 1.8.13 packages: legacy nixos-fw rules and the INPUT jump survive both deletion of the nftables ip filter table and nft flush ruleset; the equivalent iptables-nft rules are removed by the flush.

Full flake and VM tests were not run locally; this host has no /dev/kvm.

Review performed with Codex (GPT-6 Astra).

Comment thread modules/presets/wireguard.nix Resolved
@prusnak prusnak added the status: changes needed Cannot proceed until suggested changes are implemented label Nov 4, 2026
@ostermayer

Copy link
Copy Markdown
Collaborator Author

Thanks, you're right. Legacy rules aren't in the nftables ruleset, so neither check should apply to them. Fixed in e02f02f.

Both checks are now skipped when the firewall runs pkgs.iptables-legacy. That's when its bin comes first on the firewall service's PATH, with only nftables' bin before it, which has no iptables. The check reads the unit's real environment.PATH, so extraPackages, entries added to systemd.services.firewall.path and a forced PATH all count. It compares exact store paths, not package names. A renamed or wrapped iptables-nft build, or one with odd configure flags, still gets the checks.

New tests cover:

  • legacy as the package, with a ruleset, and with an ip filter table: pass
  • legacy in extraPackages with the default nftables package: pass
  • legacy before pkgs.iptables in extraPackages: pass, since legacy's iptables comes first
  • pkgs.iptables before legacy, a renamed build, a symlinkJoin wrapper, an iptables added to the service path, and a forced PATH: all still fail
  • a null PATH still evaluates

module-config passes with 79 checks, and wireguard-lndconnect passes on my KVM host. The docs note in step 2 says when legacy is exempt.

Codex GPT-6 Astra and GPT-5.6 Sol (both at max) reviewed it over six rounds. They found the renamed and wrapped builds, string configure flags, the service path cases and the null PATH. One claim was wrong: that iptables-legacy only ships sbin/iptables. In the pinned nixpkgs it also has bin/iptables -> xtables-legacy-multi.

Kimi K3, DeepSeek V4.1 Flash and GLM 5.3 (all at max) ran over e02f02f, and Astra and Sol checked their report. Nothing came up in the files this PR touches.

@prusnak prusnak removed the status: changes needed Cannot proceed until suggested changes are implemented label Nov 5, 2026

@viberaven viberaven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed e02f02f against its merge base and the pinned NixOS firewall/nftables modules. The legacy exemption addresses the previous compatibility finding when the kernel supports legacy xtables. One P2 documentation issue remains, described inline: the newly documented legacy setup also needs a compatible kernel, and fails with the pinned default kernel.

Validation on this PR head:

  • module-config passed.
  • The wireguard-lndconnect VM scenario passed under KVM.
  • An additional VM check confirmed that iptables-nft with an inet filter table and flushRuleset disabled preserves its firewall rules across nftables reloads and restarts.
  • Additional VMs reproduced firewall.service failing with both documented iptables-legacy package placements. The pinned default Linux 6.18.60 kernel has CONFIG_NETFILTER_XTABLES_LEGACY disabled; the failure occurs before the reload checks.

Before merging, also add the Assisted-by: commit trailers required by AGENTS.md. Both PR commits currently lack them; the AI-assistance disclosure in the PR description does not satisfy the commit-trailer policy.

The complete flake/VM matrix was not run locally.

Review performed with Codex (GPT-6 Astra).

Comment thread docs/services.md Resolved
@ostermayer

Copy link
Copy Markdown
Collaborator Author

Thanks, good catch. The default kernel doesn't have legacy xtables, so that setup couldn't run at all. Fixed in abffc5f.

  • docs/services.md now says iptables-legacy needs a kernel with legacy xtables (CONFIG_NETFILTER_XTABLES_LEGACY, or CONFIG_IP_NF_IPTABLES_LEGACY on older kernels). It says the default kernel doesn't enable them, and that pkgs.linuxPackages_6_12 does. Its kernel and modules are in cache.nixos.org.
  • New VM scenario wireguardIptablesLegacy. It's buildable, not in the CI matrix:
    • It boots 6.12 with iptables-legacy as the firewall package and an nftables ruleset, so flushRuleset is on.
    • It checks that the preset's rules are in the legacy tables and not in the nftables ruleset.
    • It then reloads and restarts nftables. A probe table shows that the flush ran, and the rules are still there afterwards.

On my KVM host the scenario passes, and it fails on the default kernel with can't initialize iptables table 'filter'. wireguard-lndconnect and module-config pass too.

Codex GPT-6 Astra and GPT-5.6 Sol (both at max) found no defects. This commit and future ones carry the Assisted-by: trailer. I didn't rewrite the earlier commits.

Kimi K3, DeepSeek V4.1 Flash and GLM 5.3 (all at max) ran over abffc5f, and Astra checked their report. Nothing came up in the files this PR touches.

@seberm seberm added the type: security Hardening or vulnerability (public-safe only) label Nov 6, 2026
@ostermayer
ostermayer force-pushed the wireguard-firewall-package branch from abffc5f to 36a27c2 Compare November 8, 2026 21:59
@ostermayer

Copy link
Copy Markdown
Collaborator Author

Rebased onto master to fix the conflict in test/configuration.nix. The changes are the same. module-config, test-runner and the wireguardIptablesLegacy and netns scenarios pass.

@ostermayer
ostermayer force-pushed the wireguard-firewall-package branch from 36a27c2 to 00fa784 Compare November 10, 2026 18:06
@ostermayer

Copy link
Copy Markdown
Collaborator Author

@viberaven I added the Assisted-by trailer to the two commits that didn't have it. Only the messages changed, and the tree is the same as 36a27c2.

Both points from your reviews are in: 89a4765 skips the reload checks when the firewall runs iptables-legacy, and 00fa784 says in docs/services.md which kernel option legacy xtables needs and tests that setup in a VM. Could you take another look?

@viberaven viberaven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 00fa784 against the PR base and the pinned NixOS firewall/nftables modules. No remaining actionable findings.

The current revision addresses both previous review findings: the legacy exemption accounts for PATH ordering, and the documentation now states the kernel prerequisite and gives a working Linux 6.12 configuration. All three PR commits also contain the required Assisted-by trailers.

Validation on this head:

  • All 87 module-config checks passed.
  • The new wireguardIptablesLegacy VM scenario passed under KVM, including verification that legacy firewall rules survive nftables reload and restart while a probe table is flushed.

The full flake/VM matrix was not rerun locally. I also attempted wireguard-lndconnect, but stopped that additional check while it was waiting for a shared Core Lightning dependency build; I do not count it as passed. GitHub's current ci_gate is green.

Review performed with Codex (GPT-6 Astra).

The preset guards the REST API of the *connect helpers and enforces
restrictPeer only through networking.firewall.extraCommands. Some
layouts pass the backend check but leave the box with no firewall.

networking.firewall.package defaults to pkgs.nftables whenever
networking.nftables is enabled, even with backend = "iptables". The
firewall service then finds no iptables binary and fails at its first
rule. So reject the nftables package unless networking.firewall.extraPackages
holds iptables, which the service also puts on its PATH.

pkgs.iptables is iptables-nft, so its rules live in the nftables
ruleset. With networking.nftables.flushRuleset, every start or reload of
nftables.service runs "flush ruleset" and deletes them while
firewall.service stays active. NixOS turns it on by default when ruleset
or rulesetFile is set or system.stateVersion is older than 23.11. Reject
it with its own assertion and point users to networking.nftables.tables
with flushRuleset = false.

nftables.service also deletes and recreates every table in
networking.nftables.tables. A table named filter in the ip or ip6 family
is the one iptables-nft uses, so reject that too.

Add evaluation tests for these checks and document the preset's firewall
requirements.

Assisted-by: Claude Code (Claude Opus 5.5)
…er tables

The flushRuleset and filter-table checks assumed the firewall runs
iptables-nft. pkgs.iptables-legacy keeps its rules in the legacy xtables,
so "flush ruleset" and a replaced "ip filter" table leave them in place.
Skip both checks when pkgs.iptables-legacy's bin comes first on the firewall
service's PATH, after only nftables' bin. Renamed or wrapped builds still
get the checks.

Assisted-by: Claude Code (Claude Opus 5.5)
…gacy xtables

The default kernel in the pinned nixpkgs (6.18) doesn't enable legacy
xtables, so iptables-legacy can't load its tables and firewall.service
fails at boot. The docs now say so and name linuxPackages_6_12, which has
them. The new wireguardIptablesLegacy VM scenario boots that kernel with
nftables and a flushing ruleset, and checks that the preset's rules stay in
the legacy tables across an nftables reload and restart.

Assisted-by: Claude Code (Claude Opus 5.5)
@prusnak
prusnak force-pushed the wireguard-firewall-package branch from 00fa784 to 38969b3 Compare November 10, 2026 18:23
@prusnak
prusnak merged commit 03561ee into bitcoinix:master Nov 10, 2026
16 checks passed
prusnak added a commit that referenced this pull request Nov 10, 2026
…e is enabled (#170)

Fixes #166.

lndconnect and lnconnect added `nix-bitcoin.onionAddresses.access`
entries for the operator user whenever their onion variant was on. With
`nix-bitcoin.operator.enable` at its default of false that user doesn't
exist, `onion-addresses` failed at its `chown`, and no onion address was
published for anyone. A public bitcoind then started with an empty
`externalip` and refused to run, and lightningd behind it did the same.

One commit on current master:

- `lndconnect.nix` adds the operator entries only when
`nix-bitcoin.operator.enable` is set, like `onion-services.nix` and the
WireGuard preset do. The lnd user's own entry stays, as a separate
`mkMerge` part, so an operator named like the lnd user isn't a duplicate
attribute key.
- `lnconnect-clnrest` reads the operator's address file, so
`clnrest.lnconnect.onion` asserts that the operator has `clnrest` in
`nix-bitcoin.onionAddresses.access`. A config can grant that by hand
without the whole operator role. The helper also reads the admin rune,
which only the `clightning` group can read, so running it as that user
also needs `users.users.<name>.extraGroups = [ "clightning" ];`. That
group can read the rune and use the RPC socket. The message offers the
grant only when the user exists.
- `onion-addresses.nix` asserts at evaluation time that every access
user is defined and lists the missing ones, so a typo fails the build
instead of every address at boot.
- An existing account named as the operator with the role off used to
get the clnrest access implicitly and now loses it. A 0.1.5 versioning
entry fires for exactly those configs, and stays quiet when the config
grants the access itself. The operator's lnd-rest copy isn't checked:
`lndconnect` runs as the lnd user and reads that user's copy, and the
only reader of the operator's copy is nodeinfo, which enables the role
itself. v0.1.4 shipped without this change, so it's 0.1.5, with a
matching section in `docs/upgrading.md` and `examples/configuration.nix`
at 0.1.5.
- `docs/services.md` says the role, or the explicit grant plus the
group, gives the clnrest helper what it needs, or that it runs as root.
- Configuration checks for lndconnect and lnconnect with and without the
role, an existing account with the role off, the explicit grant, an
unknown access user, both assertion hints, and the versioning condition.
- A new VM scenario, `lnconnectNoOperatorRole`, turns the role off and
defines `operator` with only the `clightning` group and the explicit
grant, then runs `lightning-cli getinfo` and `lnconnect-clnrest --url`
as that user. It's in `buildable` in `run-tests.sh` but not in the CI
matrix.

## Tested

- `module-config` on my KVM host on top of master: 68 tests pass.
- `./test/run-tests.sh -s lnconnectNoOperatorRole` passes. With the
group removed it fails as expected, already at `lightning-cli getinfo`
with `Permission denied`.
- `./test/run-tests.sh -s full` passes, including the
`lndconnect-onion-lnd` and `lnconnect-onion-clnrest` tests.

Claude Fable 5.1 planned the first version and Claude Opus 5.5 wrote
both. Codex (GPT-5.6 Sol, xhigh) reviewed each. On this one it found
that the docs said only `lnconnect-clnrest` reads the operator's
directory, while nodeinfo does too, which is fixed. It also notes that
the access-user assertion rejects users created at runtime (useradd,
LDAP), which was in the first version too. DeepSeek V4.1 Flash 1017
(max) and GLM 5.3 (max) audited the tree at d1b46ab with Codex (GPT-6
Astra, xhigh) as the second opinion: eleven findings plus three Astra
extras, none in the files this PR touches. The WireGuard firewall one is
what #188 fixes.
@seberm seberm added this to the v0.1.6 milestone Nov 15, 2026
unbeholdendev added a commit to unbeholdendev/infra that referenced this pull request Nov 17, 2026
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 ([#&#8203;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 ([#&#8203;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 ([#&#8203;258](bitcoinix/bitcoinix#258)) and stops when lnd or clightning stops, instead of polling a port that another local user could take over ([#&#8203;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 ([#&#8203;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) ([#&#8203;255](bitcoinix/bitcoinix#255)). Each custom macaroon now has its own root key, so one can be revoked without the others ([#&#8203;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 ([#&#8203;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 ([#&#8203;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 ([#&#8203;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 ([#&#8203;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 ([#&#8203;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 ([#&#8203;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 ([#&#8203;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` ([#&#8203;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 ([#&#8203;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 ([#&#8203;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 ([#&#8203;236](bitcoinix/bitcoinix#236)). A program that read a custom macaroon through the group needs its own macaroon ([#&#8203;255](bitcoinix/bitcoinix#255)).
- **RTL:** with both backends enabled, stopping one stops RTL for both ([#&#8203;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 ([#&#8203;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` ([#&#8203;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 ([#&#8203;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` ([#&#8203;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 ([#&#8203;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;` ([#&#8203;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 ([#&#8203;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 ([#&#8203;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 ([#&#8203;217](bitcoinix/bitcoinix#217)).
- btcpayserver with the clightning backend joins `services.clightning.group`, so a custom group works ([#&#8203;238](bitcoinix/bitcoinix#238)).
- The lnd seed and electrs index migration steps keep the data when an earlier step fails ([#&#8203;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 ([#&#8203;246](bitcoinix/bitcoinix#246)); the docs say what netns-isolation doesn't isolate ([#&#8203;237](bitcoinix/bitcoinix#237)) and how to close public SSH without losing access ([#&#8203;234](bitcoinix/bitcoinix#234)).

Contributors: [@&#8203;msgilligan](https://github.com/msgilligan), [@&#8203;ostermayer](https://github.com/ostermayer), [@&#8203;prusnak](https://github.com/prusnak), [@&#8203;seberm](https://github.com/seberm), [@&#8203;unbeholdendev](https://github.com/unbeholdendev), [@&#8203;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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci .github/, test/, dev/ area: docs docs/, README, examples/, SECURITY.md, book.toml, assets area: modules modules/ and pkgs/lib.nix type: security Hardening or vulnerability (public-safe only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants