Repository navigation
mempool: bind the backend to services.mempool.address - #69
Merged
prusnak merged 2 commits intoOct 22, 2026
Merged
Conversation
This was referenced Oct 17, 2026
bobberb
force-pushed
the
bobberb/mempool-bind-address-d69e78ad
branch
from
October 17, 2026 22:52
9bab8e9 to
b63525f
Compare
Stock mempool calls `server.listen(HTTP_PORT)` without a host, so the backend has listened on all interfaces. `services.mempool.address` (default 127.0.0.1) only told nginx where to proxy; it never limited the listener. Without netns isolation, the backend API on port 8999 was reachable from any network the host firewall lets through. Patch the backend to take `MEMPOOL.HTTP_HOST` and set it to `services.mempool.address`. Under netns isolation this is the mempool namespace address, which is what nginx already proxies to. This narrows the listener for mempool users. Add a 0.1.2 migration entry and upgrade documentation, and test the configured address both with and without network namespace isolation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Assisted-by: Codex (GPT-6)
mempool connects to MariaDB over the unix socket, but the server it enables listens on all interfaces (MariaDB's default), so port 3306 was reachable from any network the host firewall admits. Default `bind-address` to 127.0.0.1 (mkDefault, for setups that use MariaDB over the network), document it in the 0.1.2 migration notes, and assert the host-namespace listener with and without network namespace isolation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Assisted-by: Codex (GPT-6)
prusnak
force-pushed
the
bobberb/mempool-bind-address-d69e78ad
branch
from
October 22, 2026 17:23
b63525f to
f1826c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #75.
Stock mempool calls
server.listen(HTTP_PORT)with no host, so the backendlistens on all interfaces.
services.mempool.address(default127.0.0.1)only told nginx where to proxy; it never limited the listener. Without netns
isolation, the backend API on 8999 is reachable from any network the host
firewall admits.
This patches the backend to take
MEMPOOL.HTTP_HOST(default127.0.0.1)and sets it to
services.mempool.address. Under netns isolation that is themempool namespace address, which is what nginx already proxies to.
The second commit does the same for the MariaDB server mempool enables: it
listens on all interfaces by default although mempool only uses the unix socket,
so
bind-addressnow defaults to127.0.0.1(mkDefault). The versioning entryand the test cover both listeners.
Because it narrows the listener for every mempool user, it adds a
0.1.1entry to
modules/versioning.nix(modelled on the 0.1.0 lndconnect/clnrestone).
masteris already at0.1.1(Liquid removal, clightning-rest), so theentry sits next to those two and
examples/configuration.nixneeds no bump.Test:
@test("mempool")now asserts that the backend listens on127.0.0.1:8999only, in non-netns scenarios (under netns it runs in its ownnamespace).
Tested locally:
./test/run-tests.sh(default,netns,netnsRegtest),nix flake check --all-systems,./test/shellcheck.sh. The patch applies tothe packaged mempool 3.2.1.
🤖 Generated with Claude Code