Repository navigation
docs: explain that netns-isolation keeps other local users off the REST and Electrum ports - #347
Conversation
c7349cb to
c858a04
Compare
c858a04 to
c4b8fda
Compare
ostermayer
left a comment
There was a problem hiding this comment.
@sebsgent I ran our gate on c4b8fda with Kimi K3.1 Pro twice, DeepSeek V4.1 Flash, Gemini 4 Carbon and GPT-6 Astra twice, and checked each finding against the code. The default ports, the netns-isolation support for clnrest, electrs and Fulcrum, the WireGuard assertion and the links are right.
One small fix in docs/configuration.md. The new bullet says that without netns-isolation, any other local user can take a service's port while the service is down. That isn't true for RTL and Orchard. A systemd socket from modules/web-interface-proxy.nix holds their port while they're stopped, so another user's bind fails with EADDRINUSE. Naming the services that bind their port themselves, like clnrest, electrs and Fulcrum, would make it right.
c4b8fda to
78bf540
Compare
|
@ostermayer Thanks, fixed in 78bf540. The netns-isolation bullet now says that most services, such as clnrest, electrs and Fulcrum, bind their port themselves, and that RTL and Orchard aren't affected because a systemd socket from Assisted-by: Claude Code (Claude Opus 5.5) |
ostermayer
left a comment
There was a problem hiding this comment.
@sebsgent I reran our gate on 78bf540 with DeepSeek V4.1 Flash 1017 (max), Gemini 4 Carbon (high), Gemini 4 Neon (high), Claude Opus 5.5 (high) and GPT-6 Astra (max), and checked each finding against the code. The bullet is right now, and the Orchard link resolves to docs/services/orchard.md.
One small point, and it doesn't block. The socket holds RTL's and Orchard's port only once it has started. Its unit name comes from the listen address (modules/web-interface-proxy.nix:18), so enabling RTL or Orchard, changing the address or port, or turning off netns-isolation starts a new socket unit. If another user already listens on the port, the socket fails, but RTL still starts on its Unix socket because it only binds to its backends (modules/rtl.nix:395), and the onion service forwards to the other user. "once its socket has started" in the bullet would cover this. Making RTL and Orchard require their socket would make them fail closed, which fits better in a follow-up.
…e ports Without netns-isolation, clnrest, electrs and Fulcrum listen on the host's loopback address, and their onion services forward there. While a service is down, another local user can listen on its port and receive the clnrest rune or a wallet's addresses. With netns-isolation, the services listen on their namespace's address, which no process in the host namespace can take. RTL and Orchard aren't affected once their systemd socket has started, because it holds their port while they're stopped, so the netns-isolation section names them as exceptions. The WireGuard preset and the direct REST connection examples can't be combined with netns-isolation, so the ZEUS page says not to give untrusted users an account on such a node. Assisted-by: Claude Code (Claude Opus 5.5)
78bf540 to
7d7c6d0
Compare
Without netns-isolation, clnrest, electrs and Fulcrum listen on the host's loopback address, and their onion services forward there. While a service is down, for example during a restart or an update, another local user can listen on its port and receive the clnrest rune from ZEUS or a wallet's addresses. With netns-isolation, the services listen on their namespace's address, and a process in the host namespace can't receive connections to it.
This documents that on the ZEUS and electrs/Fulcrum pages and in the netns-isolation section, and adds a 0.2.1 release-note draft. lnd's onion service forwards to a Unix socket since #343 and isn't affected.
The WireGuard preset (
lndconnect-wg,lnconnect-clnrest-wg) binds lnd and clnrest to0.0.0.0and can't be combined with netns-isolation, so it isn't covered. The same applies to the direct REST connection examples. The ZEUS page says not to give untrusted users an account on such a node.Docs only, no code or config changes.
Closes #342.
Assisted-by: Claude Code (Claude Opus 5.5)