Skip to content

dns ca: escalate itself for the system store, like dns enable; never advise sudo moshcode - #522

Merged
ralyodio merged 1 commit into
mainfrom
fix/dns-ca-escalate
Sep 17, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/dns-ca-escalate

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

moshcode dns ca escalates itself for the system-store half, the way dns enable already does, and never advises sudo moshcode ….

Why

On bonita, following the hint the CLI printed:

$ sudo moshcode dns ca
sudo: 'moshcode': command not found

moshcode is installed in the operator's PATH (~/.local/bin), not root's. dns enable solved this long ago by escalating the one command from inside (escalateSelf, which carries the path and lets operatorHome() find the person behind sudo); dns ca did not, and its skipped-step hint pointed at the exact command that fails.

Change

  • dns ca (and --remove): when not root and not --user-only, escalate via escalateSelf; if that ran, return its code. If no sudo or tty is available, continue with the browser store only and say so. --user-only keeps it to the browser store with no prompt, for a machine where sudo is not on offer.
  • The two hints in trust.mjs now say to run moshcode dns ca (or --remove) from a terminal, which asks for sudo itself.
  • Schema synopsis updated.

Verified

node --test test/trust-registry.test.mjs test/trust.test.mjs test/dns*.test.mjs: 488 pass, 0 fail. node --check on the three files.

🤖 Generated with Claude Code

…advise sudo moshcode

bonita: sudo moshcode dns ca → sudo: 'moshcode': command not found, because moshcode lives in the operator's PATH, not root's. The verb now escalates this one command from inside (escalateSelf, which carries the path and lets operatorHome find the person behind sudo) and falls back to the browser store alone with a note when no sudo is on offer; --user-only skips the prompt on purpose. The two skipped-step hints that said sudo moshcode dns ca now say to run moshcode dns ca from a terminal.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

8 finding(s) in the 3 file(s) this pull request changes.

HIGH/CRITICAL: 1 | MEDIUM: 7

Severity Rule Location
HIGH tls-verification-disabled src/dns.mjs:766
MEDIUM sql-string-concatenation src/cli-schema.mjs:161
MEDIUM sql-string-concatenation src/cli-schema.mjs:220
MEDIUM sql-string-concatenation src/cli-schema.mjs:592
MEDIUM sql-string-concatenation src/cli-schema.mjs:625
MEDIUM sql-string-concatenation src/cli-schema.mjs:732
MEDIUM sql-string-concatenation src/cli-schema.mjs:1485
MEDIUM sql-string-concatenation src/cli-schema.mjs:1503
93 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 7 | **MEDIUM**: 75 | **LOW**: 11

Not introduced by this pull request. The full set is in the Security tab.

Severity Rule Location
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
HIGH tls-verification-disabled apps/pwa/src/lib/moshpit-gateway.mjs:299
HIGH sh-remote-script-execution install.sh:86
HIGH sh-remote-script-execution install.sh:90
HIGH sh-remote-script-execution install.sh:258
HIGH sh-remote-script-execution install.sh:269
HIGH sh-remote-script-execution install.sh:275
MEDIUM sql-template-interpolation apps/pwa/src/lib/moshpit-certs.mjs:44
MEDIUM sql-template-interpolation apps/pwa/src/lib/moshpit-certs.mjs:82
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:139
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:153
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:179
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:373
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:377
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:422
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:671
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:867
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:869
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:928
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:974

…and 73 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit a6e96bf into main Sep 17, 2026
6 checks passed
@ralyodio
ralyodio deleted the fix/dns-ca-escalate branch September 17, 2026 09:12
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