Repository navigation
Description
What's the problem
Part of #2476. Owner priority (2026-10-27): build the opt-in donation feature now, shipping dark. The Tor-only egress firewall drops a direct dial from xmrig-proxy unless a chosen exception is installed. Today the only exception for xmrig-proxy is the XvB one: tor_egress_sync_ips adds the proxy's address only when XVB_ENABLED=true and XVB_TOR_ENABLED=false (lib/pithead/02b-tor-egress-apply.sh:18-19), tor_egress_choice_active knows only the p2pool and xvb choices (:24-31), and the boot-time choice markers are armed and pruned in two loops over p2pool xvb (:39, :52). With donation.tor false and the firewall on, the project route would be dropped without any exception, so the slice would silently end in the fail-open fallback.
Add donation as a third choice:
tor_egress_sync_ipsadds the proxy's address whenDONATION_ENABLED=trueandDONATION_TOR_ENABLED=false;tor_egress_choice_activeand both marker loops handledonation.lib/pithead/39b-describe-change-exposure.sh:egress_firewall_exempts(:14-20) returns true for xmrig-proxy when the donation choice is active, and aDONATION_TOR_ENABLEDrow follows theXVB_TOR_ENABLEDrow (:33-43) with plain sentences for both directions.docs/privacy.mdwhere it lists the chosen exceptions (the paragraph that says a P2Pool or XvB exception refuses startup on refresh failure) gains the donation choice.
The exception is per container address, not per destination, so it also opens whatever else xmrig-proxy dials directly; the XvB choice has the same property (docs/configuration.md:258: only xmrig-proxy gets an IPv4 firewall exception). The PR states this in the privacy text.
What it impacts
Hosts with donation.tor false and the egress firewall on; no effect with Tor on (the default) or the feature off. Boot ordering: the choice marker is what lets the exception exist before containers start, so it must be right on reboot.
How I found it
Read-only scan of origin/develop-v2.1.0 at 02852bd on 2026-10-27 from the paths above and tests/stack/firewall/choice-startup.sh:10-42 (the marker lifecycle tests). Nothing was executed. Unknown: whether the exception can be narrowed to the project endpoint address instead of the container (a clearnet endpoint has a fixed address, an onion has none and is never exempted); and whether the owner will allow a clearnet route at all (owner decision: onion only, or clearnet with a pinned TLS fingerprint). This issue is only needed if a clearnet route is allowed.
How important is it
Medium, security-sensitive: it widens the egress firewall for an opt-in path, and the boot-time marker logic is subtle. Needed before the privacy profile's Performance setting can mean "no Tor on anything" for the donation.
Acceptance criteria
- New cases in
tests/stack/firewall/(patternchoice-startup.sh:31-42): withDONATION_ENABLED=trueandDONATION_TOR_ENABLED=falsethe proxy address is in the exception list and thedonationmarker is armed before Compose; with Tor on or the feature off it is absent; a failed refresh removes only the disableddonationmarker; removal clears the marker. - XvB and P2Pool choice behavior is unchanged: the existing cases in
choice-startup.shpass untouched. - A preview test in
tests/stack/control/(patterncontrol-sensitive-preview.sh:77-86):donation.torfalse with the firewall on names the exposure of this host's IP to the project endpoint; with the firewall off it says the same without claiming a scoped exception; turning Tor back on names the restored posture. docs/privacy.mdlists the donation choice and states the per-container scope.- The PR changes shell under
lib/pithead/only (noos/,build/or compose path), so notier4job is required to merge. It cites the stack firewall tests; a bench run of the--hardeningphase before go-live is advised. make test,make lint-sh,make lint-pithead-buildandmake lint-file-budgetpass. No new explanatory code comments.
Possible solutions
- A third choice name through the existing machinery (recommended: reuses the tested marker lifecycle).
- Restrict the donation route to Tor and drop
donation.toras a user key: removes this whole child, and means Performance cannot reach the project without Tor. Needs the owner's routing ruling. - Narrow the exception to the endpoint address with a destination rule: smaller exposure, a larger firewall change.
Part of #2476. Depends on {{A1}}.
Activity
pithead-developer commentedon Nov 22, 2026
Blocked on #4309. I made no edits and opened no PR. This issue's prerequisite config keys are not on
develop. #3703 depends on the donation config keys (#3693, closed). Those landed only ondevelop-v2.1.0, and their forward-port todevelopis still open as pithead#4309. Ondevelop,DONATION_ENABLED,DONATION_TOR_ENABLEDanddonation.tordo not exist inconfig.reference.json,33-render-env.sh, compose or any test (the onlyDONATIONhit inlibisXVB_DONATION_LEVEL). The firewall change (02b-tor-egress-apply.sh,39b-describe-change-exposure.sh) would therefore read env keys nothing sets, and the preview'sconfig_bool '.donation.tor'would have no schema behind it, so I could not write meaningful failing-without-fix tests or preview text againstdevelop. Unblocked by: #4309 merging. I will then resume and add the thirddonationchoice (the.xxproxy address intor_egress_sync_ips,tor_egress_choice_active, both marker loops), the preview row afterXVB_TOR_ENABLED, tests intests/stack/firewallandtests/stack/control, anddocs/privacy.mdwith the per-container scope. Note for the owner: the issue says it is needed only if a clearnet donation route is allowed, and that ruling (onion only versus clearnet with a pinned TLS fingerprint) is not recorded on the issue. Default if no ruling comes: build it, since the issue's own acceptance criteria assume the clearnet choice exists and it ships dark.The runner resumes this issue when that one closes.
Preview donation enable off Tor, execute the boot-unit marker test, d…
Test the donation enable preview off Tor (#3703)
Fix the donation preview cases: valid percent, a real baseline for ba…
Preview back-on-Tor from a temporary baseline instead of committing it (
Seed the back-on-Tor preview baseline in .env too (#3703)
Tighten the donation marker tests: assert the other markers survive (#…
pithead-developer commentedon Nov 24, 2026
Merged in #4412.
Open the egress firewall for a clearnet project donation route only w…