Repository navigation
Factor out RTL’s systemd proxy and share LND’s IPv6-safe gRPC endpoint - #334
Conversation
23faed5 to
405a08f
Compare
ostermayer
left a comment
There was a problem hiding this comment.
I ran the gate on both commits with GPT-6 Astra, Kimi K3.1 Pro twice, DeepSeek V4.1 Flash and Gemini 4 Carbon. RTL's units come out of the extraction the same as on master for every config I evaluated, including ::1, ::, tor.enforce, clightning, a custom user and group, and netns. The shared endpoint gives lnd, lncli, the macaroon setup, charge-lnd and Unbeholden LNURL the same address, and the CI run of unbeholden-lnurl-lnd shows all of them on [::]:10009. Two reviewers thought the clients' IP filters would block a wildcard target. They don't, because the kernel sends a connect to 0.0.0.0 or :: to loopback before the filter sees the packets. One small point is inline.
web-interface-proxy.nix now has the address check for the socket, but the port != 0 check that goes with it stays in rtl.nix. That's fine while RTL is the only user. A second dashboard on the module would need its own copy.
|
Addressed both review points in 6c6e987.
|
ostermayer
left a comment
There was a problem hiding this comment.
I checked 6c6e987 with GPT-6 Astra and an eval on the KVM host. The bracket check and the moved port assertion hold. One point is inline.
ostermayer
left a comment
There was a problem hiding this comment.
Thanks for adding the empty-host migration guidance and upgrade notice. The rpcEndpoint sharing and proxy extraction look solid overall; I left a few notes on whitespace handling in rpcAddress, the 0.2.1 upgrade doc link and manual-cert SAN guidance, and making web-interface-proxy.nix safe for services with optional settings.
56b6126 to
fa4814d
Compare
ostermayer
left a comment
There was a problem hiding this comment.
I ran the gate on fa4814d with Gemini 4 Carbon (high), Gemini 4 Neon (high), Kimi K3.1 Pro (max, x2) and DeepSeek V4.1 Flash 1017 (max). All five points from the previous round are fixed. Three passes claimed :: and :10009 are dual-stack in Go, which isn't true for LND because lncfg.ListenOnAddress maps ResolveTCPAddr addresses without IPv4 bytes to tcp6, so IPv6-only is right. Two small points are inline.
sebsgent
left a comment
There was a problem hiding this comment.
Approve: no must-fix or should-fix items.
Tested: at 71196a9, evaluated RTL with LND on 127.0.0.1 and ::. The rtl-proxy-*.socket and rtl-proxy.service units and the check-rtl-address derivation are identical to master. A dashboard with dataDir = null keeps all four path masks; on fa4814d it got an empty InaccessiblePaths= line. A Go program that copies LND's ResolveTCPAddr and parseNetwork steps listens on tcp6 for an empty host and :: (IPv6 only, even with bindv6only=0), and on tcp4 for 0.0.0.0. So the notice and the upgrade note describe the listener families correctly. CI is green, including unbeholden-lnurl-lnd on [::] and the new error check.
Assisted-by: Claude Code (Claude Opus 5.5)
ostermayer
left a comment
There was a problem hiding this comment.
I ran the gate on 71196a9 with Gemini 4 Carbon (high), Gemini 4 Neon (high), Kimi K3.1 Pro (max, x2) and DeepSeek V4.1 Flash 1017 (max). Both points from fa4814d are fixed. A dashboard with a null or empty dataDir now keeps all of its InaccessiblePaths masks, and check-lnd-rpc-error.sh evaluates x86_64-linux cleanly regardless of the host platform or working directory.
Parameterize the socket and proxy service by dashboard name, Unix socket path and user. Check the port in the shared module and copy the IP filters the dashboard defines. Keep the secrets and resolver paths masked even when the dashboard has no data directory. Cover those optional settings in the module checks. Use RTL's configured listener for the permissions test, including in the IPv6 VM, and read it only in scenarios that enable RTL. Assisted-by: OpenAI Codex (GPT-6.2 Astra)
Build the listener and client endpoints from the same address and port. Bracket IPv6 in the endpoint and use the bare IP in the TLS certificate. Use that endpoint for lncli, macaroon creation, charge-lnd and Unbeholden LNURL, including when the configured IP is a wildcard. Reject malformed brackets, whitespace and empty hosts during evaluation. Show users of an empty host how to keep their intended listener and check that the diagnostic points them to the upgrade guide. Cover address formats and custom ports in the module checks. Run both gRPC clients against the IPv6 wildcard in the LNURL regtest VM. Assisted-by: OpenAI Codex (GPT-6.2 Astra)
71196a9 to
b0367d6
Compare
This PR extracts two independent changes from #326. Each can be reviewed as a separate commit.
rtlIPv6VM permissions check now uses the configured listener, and only scenarios that enable RTL read its address. The shared module validates the port and preserves the secrets and resolver masks when a dashboard has no data directory. Commit46cb2f56lncli, macaroon creation, charge-lnd and Unbeholden LNURL. Bare and bracketed IPv6 inputs produce the same endpoint syntax. Certificates use the bare IP, and clients keep the configured address when verifying TLS, including wildcard addresses. Empty hosts, whitespace and malformed brackets fail evaluation. Commitb0367d66The LND module test covers loopback and wildcard addresses on a custom port. The
unbeholden-lnurl-lndregtest VM runs both gRPC clients against[::].Local verification
The
rtlIPv6VM passed on x86_64 Linux. The RTL commit and the PR head produce the same test derivation. Theunbeholden-lnurl-lndVM passed on the PR head.nix flake check --all-systems, the CI test-driver evaluation (nix eval --raw .#ciTestInfo), shellcheck, release-note validation, and the empty LND RPC host diagnostic also passed.Applying the complete pre-rebase diff (
2fbd6ef5..71196a9e) directly tomasterata760f5d3produced the same Git tree (0b34b85e) as the two commits above.