Skip to content

nodeinfo: don't rely on jq being in PATH - #196

Merged
seberm merged 1 commit into
bitcoinix:masterfrom
sebsgent:nodeinfo-pin-jq
Nov 1, 2026
Merged

seberm merged 1 commit into
bitcoinix:masterfrom
sebsgent:nodeinfo-pin-jq

Conversation

@sebsgent

@sebsgent sebsgent commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Needed before #186.

nodeinfo called a bare jq, which only secure-node.nix installs. Without the preset, nodeinfo printed "nodeid": "" for lnd and clightning, still exited 0, and the clightning id became @<onion address>. The test nodes always install jq, so CI didn't see it.

This pins ${pkgs.jq}/bin/jq, like the other modules. lncli, lightning-cli, systemctl and bash stay bare: the system PATH provides them whenever these lines run.

Tested with a temporary VM scenario (not part of this PR): lnd, clightning and nodeinfo without the preset, jq removed from the system PATH. With this change nodeinfo returns both 66-character node IDs. On master the same scenario fails with jq: command not found and no node IDs.

@github-actions github-actions Bot added the area: modules modules/ and pkgs/lib.nix label Nov 1, 2026
@seberm
seberm marked this pull request as ready for review November 1, 2026 19:57
@seberm
seberm marked this pull request as draft November 1, 2026 20:23
@seberm
seberm marked this pull request as ready for review November 1, 2026 21:18
nodeinfo pipes the lncli and lightning-cli output through a bare jq.
That was safe while it was part of the secure-node preset, which
installs jq, but nodeinfo can also be enabled on its own. Without jq it
printed an empty nodeid and still exited 0, and the clightning id
became @<onion address>.

Use the store path, like the other modules that call jq.

Assisted-by: Claude Code (Claude Opus 5.5)
@seberm
seberm enabled auto-merge November 1, 2026 22:05
@seberm
seberm merged commit 1e65778 into bitcoinix:master Nov 1, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: modules modules/ and pkgs/lib.nix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants