Skip to content

Final pre-release pass: setup/service/config fixes + privacy & API-exposure docs#109

Merged
VijitSingh97 merged 3 commits into
mainfrom
claude/objective-jones-7bf761
Jun 13, 2026
Merged

Final pre-release pass: setup/service/config fixes + privacy & API-exposure docs#109
VijitSingh97 merged 3 commits into
mainfrom
claude/objective-jones-7bf761

Conversation

@VijitSingh97

Copy link
Copy Markdown
Contributor

A final pre-release review pass (docs-for-new-users, docs-match-code, no privacy/logical gaps). Findings + fixes below. Lint clean, 604/604 tests pass.

🔴 Exposure (documented, no behavior change)

The XMRig HTTP API binds 0.0.0.0:8080 by default. It's read-only (restricted: true) and token-gated (token is never empty in practice), so the real leak is small — but "my miner listens on all interfaces" is the thing the r/MoneroMining audience reacts to, and solo/public-pool users (the majority) don't need it at all. Per decision, kept the bind (Pithead needs it) and documented it loudly instead:

  • SECURITY.md → new "What RigForge exposes (and what it doesn't)" section: no telemetry, honest 1% (zeroable) dev fee, and exactly what :8080 serves — plus the ufw commands to firewall it off when not running Pithead.
  • README.md → concise "🔒 Privacy & security" section linking to it.

🐛 Logic bugs (fixed)

  1. setup re-run wrote the config to the wrong directory. On a no-rebuild re-run, compile_xmrig returned before cd-ing into the build dir, so generate_xmrig_config emitted config.json into $WORKER_ROOT instead of xmrig/build/ where the service reads it — config edits silently never applied. Fixed by cd-ing on the skip path (matches the rebuild and apply paths).
  2. cpupower could wedge the service in a restart loop. The governor ExecStartPre had no - prefix; on VM/cloud kernels with no cpufreq driver it aborted startup with Restart=always churn. Now best-effort.
  3. First-run prompt bricked itself on a host-less URL. :3333 passed the port check, got written, then parse_config hard-failed — leaving a broken config.json that suppressed the re-prompt. Now validates the host before writing (+ regression test).

🔒 Hardening / UX

  • chmod 600 the generated live config (holds pool/wallet + API token) so a root jq redirect can't leave it world-readable. Asserted in the suite.
  • First-run wallet hint — warns public-pool users to set their wallet as the pool user, since the minimal config credits hashes to the hostname and nothing (incl. doctor) flags it.

📄 Docs ↔ code

  • config.advanced.example.json said the autotune schedule was "nightly" (twice) — it's monthly in code and every other doc. Fixed.
  • Everything else verified consistent: subcommands, tune flags, config keys/defaults, ports (3333/8080), paths, benchmark numbers.

✅ Verified clean

No telemetry/phone-home; honest 1% dev fee (= XMRig's default, → XMRig's address, zeroable); source pinned and commit-verified; no security mitigations disabled; GRUB backed up + reversible; systemd unit hardened.

🤖 Generated with Claude Code

VijitSingh97 and others added 3 commits June 12, 2026 23:06
Four correctness/robustness fixes found in a final pre-release pass:

- setup: on a no-rebuild re-run, compile_xmrig returned before cd-ing into
  the build dir, so generate_xmrig_config wrote config.json into $WORKER_ROOT
  instead of xmrig/build/ where the service reads it (--config=$BUILD_DIR/
  config.json). Config edits then silently never took effect. cd into the
  build dir on the skip path, matching the rebuild and `apply` paths.

- service: the cpupower governor ExecStartPre had no `-` prefix, so on VM/
  cloud kernels with no active cpufreq driver (or distros without cpupower)
  it aborted startup and, with Restart=always, wedged the miner in a restart
  loop. Make it best-effort.

- setup: validate the pool host in the first-run prompt before writing, so a
  host-less URL like ":3333" can't be persisted and then rejected by
  parse_config — which left a broken config.json that suppressed the prompt
  on the re-run. New regression case (':3333') added.

- config: chmod 600 the generated live config (pool/wallet + API token) so a
  root jq redirect can't leave it world-readable. Asserted in the suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e cadence

- SECURITY.md: new "What RigForge exposes (and what it doesn't)" section —
  no telemetry, honest 1% (zeroable) dev fee, and the read-only/token-gated
  `:8080` stats API that binds the LAN by default, with the exact ufw
  commands to firewall it off when not running Pithead.
- README.md: concise "Privacy & security" section linking to SECURITY.md.
- config.advanced.example.json: autotune schedule is monthly, not "nightly"
  (matched the code default and every other doc).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
diff-cover flagged rigforge.sh:248 (the `[...]` IPv6 arm of ensure_config_exists'
host validation) as the one uncovered changed line. Add an invalid IPv6 literal
('[zz]:3333') to the first-run bad-URL cases so the arm is exercised and the
"writes no config" guarantee is asserted for it too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VijitSingh97 VijitSingh97 merged commit ba58316 into main Jun 13, 2026
5 checks passed
@VijitSingh97 VijitSingh97 deleted the claude/objective-jones-7bf761 branch June 13, 2026 04:22
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