Skip to content

fix(tor): publish a node's inbound onion only while that node is local (#103)#759

Merged
VijitSingh97 merged 4 commits into
developfrom
claude/relaxed-mirzakhani-1b6564
Jul 24, 2026
Merged

fix(tor): publish a node's inbound onion only while that node is local (#103)#759
VijitSingh97 merged 4 commits into
developfrom
claude/relaxed-mirzakhani-1b6564

Conversation

@VijitSingh97

Copy link
Copy Markdown
Collaborator

What

With monero.mode or tari.mode set to remote, the bundled node container never starts — but build/tor/torrc.template still defined that node's inbound hidden service, so Tor published an onion address that accepted connections into nothing.

Each node's HiddenService block moves out of the template and into build/tor/entrypoint.sh, appended only when that node's compose profile is active. The gate is the profile list itself, passed to the tor container from pithead's rendered .env, so it cannot drift from which nodes actually run. P2Pool's onion stays unconditional — p2pool always runs.

pithead side

  • provision_tor waits only for the onions that will exist (a remote node's hostname would never appear — 60s timeout, then a fatal error).
  • doctor reports a remote node's missing address as expected, not a warning telling the operator to re-run setup.
  • The "Stack is not fully provisioned" guard keys off P2Pool's onion instead of Monero's — a placeholder Monero address is now legitimate.
  • provision_node_onions covers the remote → local switch: a stack first set up in remote mode has no address for that node, so apply/upgrade recreate tor against the committed profiles, capture the freshly minted hostname, and re-render .env before the node container starts against it (monerod templates anonymous-inbound from that value).

Testing

  • Tier 1 (tests/stack/run.sh): torrc gating on/off via the TORRC_TEMPLATE seam; provision_tor / provision_node_onions by node mode; doctor's onion report in both modes. 1674 pass, 0 fail.
  • Tier 2 (tests/stack/test_compose.sh): the active profile list reaches the tor service, so the gate matches the running nodes. 73 pass.
  • Tier 3 (tests/integration/run.sh): the live torrc carries the Monero hidden service only in local mode — reads the torrc, not the hostname file, since a key minted by an earlier local scenario stays on disk.

Docs

docs/configuration.md (both remote-node sections — the "inert leftover" sentence is gone, since it isn't one any more), docs/privacy.md inbound section, CHANGELOG.

make lint green (lint-proto needs a Docker daemon, unavailable locally — CI covers it).

🤖 Generated with Claude Code

VijitSingh97 and others added 4 commits July 23, 2026 20:44
#103)

With monero.mode or tari.mode set to remote the bundled node container never
starts, but torrc still defined its inbound hidden service — so Tor published
an onion address that accepted connections into nothing.

Each node's HiddenService block moves out of the template and into the tor
entrypoint, appended only when that node's compose profile is active. The gate
is the profile list itself, passed through to the tor container from pithead's
rendered .env, so it cannot drift from which nodes actually run. P2Pool's onion
stays unconditional — p2pool always runs.

pithead follows suit: provision_tor waits only for the onions that will exist,
doctor reports a remote node's missing address as expected rather than a
warning, and the "fully provisioned" guard keys off P2Pool's onion instead of
Monero's. A stack first set up in remote mode has no address for that node, so
provision_node_onions mints and captures it on the apply/upgrade that makes the
node local — before the node container starts against it, since monerod
templates anonymous-inbound from that value.

Covered at tier 1 (torrc gating, provisioning by mode, doctor's report), tier 2
(the profile list reaches the tor service), and tier 3 (the live torrc matches
the node mode).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…okup

Ponytail review: same behaviour, half the lines.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Both callers take the default; speculative flexibility, cut on the ponytail pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VijitSingh97
VijitSingh97 merged commit a7091d8 into develop Jul 24, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant