Skip to content

docs(miner): regenerate env-reference.md for GITTENSORY_MINER_KILL_SWITCH - #5507

Closed
JSONbored wants to merge 1 commit into
mainfrom
fix/github-datasource-secret-leak
Closed

docs(miner): regenerate env-reference.md for GITTENSORY_MINER_KILL_SWITCH#5507
JSONbored wants to merge 1 commit into
mainfrom
fix/github-datasource-secret-leak

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

`npm run miner:env-reference:check` has been failing on `main` since #5198/#5500 added the `env.GITTENSORY_MINER_KILL_SWITCH` read in `lib/config-precedence.js` (`config-precedence.js:14`) without regenerating this generated doc. Found while running the full local gate for an unrelated fix and confirmed the drift is real and still present at current `main`.

Ran `npm run miner:env-reference` and committed the regenerated `packages/gittensory-miner/docs/env-reference.md` (single line added, matching the file's own "Generated by ... Do not edit manually" contract).

Validation

  • `npm run miner:env-reference:check` — clean after regeneration
  • Confirmed `GITTENSORY_MINER_KILL_SWITCH` is a genuine, currently-live read (not dead code)

Mechanical, zero-risk generated-artifact fix — no behavior change.

…gv and child env

setup-github-datasource.sh had the identical secret-leak pattern PR #5489
fixed in its sibling setup-sentry-datasource.sh: sourcing .env with `set -a`
exported GITHUB_TOKEN/GRAFANA_ADMIN_PASSWORD into every child process's
environment, `curl -u "$AUTH"` put GRAFANA_ADMIN_PASSWORD on the process
argv (visible to any local user via ps), and `-d "$(payload)"` put the
GitHub token in argv too.

Apply the same fix: drop `set -a` on the .env source, authenticate via a
temporary permissioned netrc file instead of `-u`, pipe the JSON payload
to curl over stdin via `--data-binary @-` instead of `-d`, and wrap curl
in a `grafana_curl()` helper that additionally unsets GRAFANA_ADMIN_PASSWORD
and GITHUB_TOKEN from its own environment as defense in depth. Idempotent
update-vs-create and the health check are unchanged.

Adds test/unit/selfhost-grafana-github-datasource.test.ts (no prior
dedicated test file existed for this script) with a regression test
mirroring the one added for the Sentry script in #5489, plus mode and
behavior-preservation checks.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored

Copy link
Copy Markdown
Owner Author

Closing: this was created against the wrong branch by mistake (a tooling slip picked up fix/github-datasource-secret-leak — the branch behind #5503 — instead of docs/miner-env-reference-kill-switch-drift). It's a duplicate of #5503 with a mismatched title, not a real second PR. The actual env-reference.md fix is being re-opened correctly.

@JSONbored JSONbored closed this Jul 12, 2026
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
JSONbored added a commit that referenced this pull request Jul 13, 2026
…me.storage.sync (#5511)

#5343 removed the discoveryIndexUrl UI field and stopped reading/writing
it, but chrome.storage.sync.set only merges keys -- it never deletes ones
an earlier extension version already synced. Without an active purge, a
value synced before #5343 stays in a user's account indefinitely, which
is a real privacy/data-retention gap #5343 didn't close.

Add removeLegacyDiscoveryIndexUrl(), called from refreshSettings() (which
runs on every options-page load and again at the end of every save), so
any stale value is cleared regardless of which path a user hits first.
Extends the existing dead-field regression test with coverage for the
purge on both load and save.

Also regenerates packages/gittensory-miner/docs/env-reference.md, which
was already stale on main (GITTENSORY_MINER_KILL_SWITCH from #5198/#5500
was never regenerated in) -- unrelated to this fix but required for
miner:env-reference:check to pass in this PR's own CI; also fixed
standalone in #5507.
@JSONbored
JSONbored deleted the fix/github-datasource-secret-leak branch July 19, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant