Skip to content

presets/wireguard: require the host argument of nix-bitcoin-wg-connect - #267

Merged
prusnak merged 2 commits into
bitcoinix:masterfrom
ostermayer:wg-connect-require-host
Nov 18, 2026
Merged

prusnak merged 2 commits into
bitcoinix:masterfrom
ostermayer:wg-connect-require-host

Conversation

@ostermayer

@ostermayer ostermayer commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #67.

Without a host, nix-bitcoin-wg-connect ran lndconnect to find the node's external IP. lndconnect does this through go-external-ip, which queries third-party IP lookup services over clearnet. That revealed the node's public IP to them, also on a node that otherwise uses only Tor. #201 documented the lookup, but the command still did it.

This makes the host required. Without it, the command prints a usage message and exits with status 1:

Usage: nix-bitcoin-wg-connect [--text] <host>

<host> is the address where your WireGuard client reaches this node:
its public IP or hostname, or its LAN IP for a client in your local network.
'ip address' lists the node's own addresses. Behind NAT, your router shows
the public IP.

The rest of the command works as before. The preset no longer references the lndconnect package.

A call that used to work now fails, so this adds a config version 0.2.0 notice for configs that import the preset (modules/versioning/0.2.0/wireguard-connect-host.nix). docs/upgrading.md and docs/release-notes.md get 0.2.0 entries. The note from #201 in docs/services.md now says that the address is required and how to find it. The dev topic dev/topics/lndconnect-and-wireguard.sh passes a host.

Testing

  • wireguard-lndconnect passes. A new subtest runs the command without a host and checks that it fails with the usage message and prints no config.
  • checks.x86_64-linux.module-config passes. The new testVersioningWireguardConnectHost checks that the notice fires for an older config with the preset and not without the preset, and that a config at 0.2.0 doesn't get it once 0.2.0 is released. Without the notice file, it fails.
  • checks.x86_64-linux.test-runner and nix eval .#ciTestInfo pass.
  • shellcheck passes on dev/topics/lndconnect-and-wireguard.sh.
  • The CVE scan node (test/ci/scan-node.nix) got lndconnect through the preset before. It now enables services.lnd.lndconnect.enable, so the scan still covers lndconnect. It evaluates, with lndconnect in its closure.
  • After the rebase onto master c3d955c (Keep unreleased migration notices visible on master #283), module-config, test-runner, ci-workflows, shellcheck and wireguard-lndconnect pass on the KVM host. acknowledged replaces current, because master now rejects config version 0.2.0 before the release. It checks that a config at 0.2.0 doesn't get the notice once 0.2.0 is released. On master, the notice is a warning until 0.2.0 is released, and the tests pass with version.nix at 0.1.6 and at 0.2.0.

Models

Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283.

@github-actions github-actions Bot added area: ci .github/, test/, dev/ area: docs docs/, README, examples/, SECURITY.md, book.toml, assets area: modules modules/ and pkgs/lib.nix type: feature New capability or service labels Nov 15, 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 96a7b9a06295.

No actionable findings. The missing-host path exits before reading keys or invoking a network lookup, explicit hosts retain the existing configuration format, and the config-version notice covers users of the preset. Checked the updated documentation and call sites, including retention of lndconnect in the CVE scan node. Local module-config and mdBook builds pass. I inspected the VM regression test and successful CI results; I did not rerun the WireGuard VM locally.

Review performed with Codex (GPT-6 Astra).

@github-actions github-actions Bot added the status: rebase needed Merge conflicts need to be resolved label Nov 16, 2026
@ostermayer
ostermayer force-pushed the wg-connect-require-host branch from 96a7b9a to 6a1305d Compare November 18, 2026 00:19
Without a host, nix-bitcoin-wg-connect ran lndconnect to find the node's
external IP. lndconnect does this through go-external-ip, which queries
third-party IP lookup services over clearnet. That revealed the node's
public IP to them, also on a node that otherwise uses only Tor.

Make the host required. Without it, the command prints a usage message
that says which address to pass and fails. A config version 0.2.0 notice
tells users of the preset, since a call that used to work now fails. The
docs, the upgrade notes and the release notes describe the change. The
VM test checks the usage message, and an eval test checks the notice.

Fixes bitcoinix#67.

Assisted-by: Claude Code (Claude Opus 5.5)
@ostermayer
ostermayer force-pushed the wg-connect-require-host branch from 6a1305d to d329bab Compare November 18, 2026 01:01
@github-actions github-actions Bot added status: rebase needed Merge conflicts need to be resolved and removed status: rebase needed Merge conflicts need to be resolved labels Nov 18, 2026
@prusnak prusnak added this to the v0.2.0 milestone Nov 18, 2026
@github-actions github-actions Bot removed the status: rebase needed Merge conflicts need to be resolved label Nov 18, 2026
@prusnak
prusnak merged commit a2804e0 into bitcoinix:master Nov 18, 2026
26 checks passed
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: feature New capability or service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

presets/wireguard: nix-bitcoin-wg-connect queries external IP services over clearnet

3 participants