Repository navigation
Description
What's the problem
Part of #2476. Owner priority (2026-10-27): build the opt-in donation feature now, shipping dark. Every other child binds to three config names that do not exist yet. The defaults table (dashboard/mining_dashboard/config/defaults.json:13-27) has proxy.donate_level and the xvb block and nothing for a project donation, so nothing can reach the dashboard.
Add, as a new donation block after xvb:
donation.enabled, false.donation.percent, integer 1 to 10, default 2 (the value used when first enabled; the owner has not ruled on the default).donation.tor, true.
Each surface that already carries xvb.tor needs the matching change:
- Generated exports: run
scripts/build-config-defaults.py(:10-47); it rewritesconfig.reference.jsonandlib/pithead/19a-config-defaults.sh. The--checkleg (:50-75) is run bytests/stack/standalone/test_config_defaults.sh:6. - Validation:
lib/pithead/28-parse-and-validate-config.sh, beside theproxy.donate_levelcheck at:223-232(file is 412 of 464 lines). - Render:
lib/pithead/33-render-env.sh, next to thexvb_torread at:127-139and the env lines at:364-368(466 of 481 lines, so about 15 spare). EmitDONATION_ENABLED,DONATION_PERCENT,DONATION_TOR_ENABLED. - Compose, DIY only: the dashboard service env beside
XVB_TOR_ENABLED(docker-compose.yml:745-746). The appliance unit is a separate child. - Dashboard config:
config/config.pynext toXVB_TOR_ENABLED(:178), defaults read throughdefault_ofasENABLE_XVBdoes (:166-168) (674 of 693 lines). - Config editor:
web/static/config/configlogic.mjsLOGICAL_GROUPS(:98-114).configlogic.test.mjs:170-178fails anyconfig.reference.jsonleaf that no group claims, so thedonationprefix must be added to a group (the Mining group, besidexvb). - Change previews: rows for the three keys in
lib/pithead/39b-describe-change-exposure.sh(theXVB_TOR_ENABLEDrow:33-43is the pattern), not in39-describe-change.sh, which is 395 lines. Plain sentences, flagged CONFIRM; fordonation.torfalse, name that the project endpoint sees this host's IP. - Support bundle:
lib/pithead/07-support-bundle.sh:17-39redacts any.envkey missing from its survivor list, andtests/integration/selftest/selftest-bundle-redact-env.sh:199mirrors it and fails by name on a disagreement. Classify the three keys as survivors (not secret). - Reference docs: three rows in
docs/configuration.mdbeside thexvb.*rows (:257-259). - Gate: the keys are schema-backed, so they take the unlisted route that demands the typed APPLY (
lib/pithead/42-control-policy-and-host-checks.sh:42-45, :125-129). Do not addDONATION_*toCONTROL_DASHBOARD_EDITABLE_KEYS(:51-67) orCONTROL_DASHBOARD_APPROVAL_KEYS(:113): the typed APPLY on the unlisted route is where an operator confirms a route change. It prevents operator mistakes, not hostile requests (:30-31), which is why the destination lives in image constants ({{A2}}) and not in these keys.
What it impacts
Existing installs: additive only. A config without the block takes the defaults, no key is rewritten and no migration runs. New installs on all three setup paths. The config editor gains three fields in its Mining group, the support bundle shows the three values, and the rendered .env gains three lines.
How I found it
Read-only scan of origin/develop-v2.1.0 at 02852bd on 2026-10-27 from the paths above. Nothing was executed. Unknown: whether #3632, #3575 or #3576 land first (they edit the same defaults, parse and render files; keep this diff additive and rebase), and the first-enable percentage the owner wants (2 is a suggestion).
How important is it
High inside this lane: every other child depends on these names. Low risk: additive, off by default.
Acceptance criteria
python3 scripts/build-config-defaults.py --checkpasses. The table holds the three keys fordiyandappliance; none is inmaterialize, soconfig.minimal.jsonandconfig.minimal.appliance.jsonare unchanged.- Parse tests under
tests/stack/config/(new file):donation.percentof 0, 11,"5", 2.5 andtruefail with a message namingdonation.percent; 1 to 10 pass; absent takes the default.donation.enabledanddonation.toraccept booleans only. - Default off on every path: after the CLI wizard Enter-through, the browser wizard answers, the no-JS form, both minimal configs and the sparse 2.0.0 config, the rendered env has
DONATION_ENABLED=false(extend the rows intests/stack/standalone/test_config_defaults.sh:11-48anddashboard/tests/web/test_config_defaults.py). - The golden env fixtures
tests/stack/fixtures/config-2.0.0/diy.envandappliance.envchange only by the three added default lines; every existing line is byte-identical (test_config_defaults.sh:33-35). docker-compose.ymlpasses the three values to the dashboard; a compose test pins them.- Dashboard tests (new file,
dashboard/tests/config/test_config.pyis at its ceiling): the config module exposes the three values and defaults them from the table. configlogic.test.mjs:170-178passes with thedonationprefix claimed.- A host preview test beside
tests/stack/control/control-sensitive-preview.sh:77-86: enabling and each percent change produce a plain sentence;donation.torfalse names the IP exposure. A commit gate test showsdonation.enabledis refused without the typed APPLY and accepted with it, and that noDONATION_*key is on the editable or approval lists. A dashboard test showsdonation.enabledin_confirm_keysand not in_editable_keys(pattern:dashboard/tests/service/test_control_service.py:304-317). selftest-bundle-redact-env.shpasses with the three keys classified as survivors.- The PR changes
docker-compose.yml, so it cites atier4-e2ejob (modetargeted) on the head SHA. It changes nothing underos/. make test,make test-patch-coverage(90 % of changed lines) andmake lint-file-budgetpass with no ceiling raised.make lint-operator-stringspasses: the preview sentences name no issue number and no baredocs/path. No new explanatory code comments.
Possible solutions
- Render
DONATION_PERCENTalways, asXVB_TOR_ENABLEDis rendered always, so the dashboard never has to guess a default; the alternative of rendering it only when enabled saves a line but forks the test matrix. - Keep
donation.torits own key rather than reusingxvb.tor, because the privacy profile will govern the two separately (Add a Performance / Balance / Privacy profile that sets the privacy keys together #3574). - If the 15 spare lines in
33-render-env.shrun out, move the new reads into a new slice underlib/pithead/and runmaketo regenerate the CLI (make lint-pithead-buildchecks slice order).
Part of #2476.
Activity
pithead-developer commentedon Oct 27, 2026
Owner, 2026-10-27: the dashboard offers 0.1, 0.25, 0.5, 1, 2 and 5 percent, plus a custom value from 0.1 to 10 (#3733). So
donation.percentmust be a decimal from 0.1 to 10: reject values below 0.1 or above 10, and anything non-numeric. The default stays 2, withdonation.enabledfalse. Validation, docs and tests cover 0.1 and 0.25.pithead-developer commentedon Oct 27, 2026
Owner, 2026-10-27: every donation defaults to 0 %, and owners opt in by choosing a share. This replaces the earlier operator answer that
donation.percentdefaults to 2.donation.enableddefaults to false anddonation.percentto 0. Choosing a preset (0.1 to 5 %, or a custom value up to 10) sets both. Validation accepts 0 only while the donation is disabled.setup: fix #3575, #3693, #3699 — automatic defaults and dark donation…
pithead-developer commentedon Nov 10, 2026
Merged in #3721.
Forward-port the donation config keys (#3693) to develop (#4375)