Skip to content

feat(install): install the pinned-TLS proxy, so https:// works without a manual step - #464

Merged
ralyodio merged 1 commit into
mainfrom
feat/install-proxy
Aug 30, 2026
Merged

feat(install): install the pinned-TLS proxy, so https:// works without a manual step#464
ralyodio merged 1 commit into
mainfrom
feat/install-proxy

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

moshcode dns enable can finish perfectly and every https:// URL still fails. No public CA will ever sign for .eggs, so a name answers its origin's own self-signed leaf and a stock client refuses it — correctly. The documented fix was a separate install of moshpit-proxy, which meant the supported path ended one step short of working, and the alternative was dns trust per name.

install.sh now installs it, and moshcode update re-runs install.sh, so existing installs pick it up. One local root covers every ending instead of per-name trust.

  • MOSHCODE_NO_PROXY=1 skips it — this is the only part of the install that touches the system trust store, so it's the only part with an opt-out
  • MOSHCODE_PROXY_INSTALLER overrides the source (also how the failure paths are tested)
  • No DNS routing is installed and no resolver started; dns enable stays deliberate

The bug testing caught

Downloaded first, run second, rather than curl … | sh. A pipeline reports its last command's status, and a sh handed empty stdin by a 404 exits 0 — so the piped form printed ✓ pinned-TLS proxy installed, local root trusted for a script that never arrived.

Never fatal either: a machine that can't reach GitHub for an optional component still wants the CLI. Adds warn(), which unlike fail() doesn't exit.

Verified

All five branches, each reporting honestly, none aborting the install: success · installer exits non-zero · 404 · unreachable host · MOSHCODE_NO_PROXY=1.

Suite: 2726 tests, 0 failures.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ThnQwoieWt8VR6N7gtgnhp

…t a manual step

`moshcode dns enable` can finish perfectly and every https:// URL still fails.
No public CA will ever sign for `.eggs`, so a name answers its origin's own
self-signed leaf and a stock client refuses it — correctly. The fix was
documented as a separate install of moshpit-proxy, which meant the supported
path ended one step short of working and the alternative was trusting
certificates one name at a time.

install.sh now installs it, and `moshcode update` re-runs install.sh, so an
existing install picks it up too. One local root covers every ending instead of
per-name trust.

MOSHCODE_NO_PROXY=1 skips it: this is the only part of the install that touches
the system trust store, so it is the only part with an opt-out.
MOSHCODE_PROXY_INSTALLER overrides the source, which is also how the failure
paths are tested. No DNS routing is installed and no resolver is started —
`dns enable` stays something a person types deliberately.

Downloaded first and run second, rather than `curl … | sh`. A pipeline reports
the status of its last command, and a `sh` handed empty stdin by a 404 exits 0,
so the piped form printed "✓ pinned-TLS proxy installed, local root trusted"
for a script that never arrived. Caught by pointing it at a missing URL.

Never fatal: a machine that cannot reach GitHub for an optional component still
wants the CLI it asked for. Adds warn(), which unlike fail() does not exit.

Verified across all five branches — success, installer exits non-zero, 404,
unreachable host, and MOSHCODE_NO_PROXY — each reporting honestly and none
aborting the install. Suite: 2726 tests, 0 failures.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01ThnQwoieWt8VR6N7gtgnhp
Comment thread install.sh
if ! curl -fsSL "$PROXY_INSTALLER" -o "$_proxy_sh" 2>/dev/null; then
rm -f "$_proxy_sh"
warn "could not download the pinned-TLS proxy — moshcode is fine, but https:// on a Moshpit name will not verify"
warn " retry: curl -fsSL $PROXY_INSTALLER | sh"
Comment thread install.sh
ok "pinned-TLS proxy installed, local root trusted"
info " it covers .moshpit by default — for other endings:"
info " MOSHPIT_PROXY_TLDS=moshpit,eggs,hacker,2600"
info " undo just this: curl -fsSL $PROXY_INSTALLER | sh -s -- --uninstall"
Comment thread install.sh
# finish an optional component still wants the CLI it asked for. Said out
# loud so it is not discovered later as a TLS error with no explanation.
warn "the pinned-TLS proxy did not install — moshcode is fine, but https:// on a Moshpit name will not verify"
warn " retry: curl -fsSL $PROXY_INSTALLER | sh"
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

5 finding(s) in the 1 file(s) this pull request changes.

HIGH/CRITICAL: 5

Severity Rule Location
HIGH sh-remote-script-execution install.sh:86
HIGH sh-remote-script-execution install.sh:90
HIGH sh-remote-script-execution install.sh:202
HIGH sh-remote-script-execution install.sh:213
HIGH sh-remote-script-execution install.sh:219
86 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 3 | **MEDIUM**: 73 | **LOW**: 10

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 tls-verification-disabled src/dns.mjs:766
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
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1044
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1147
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1170
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1192
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1391
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1541

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

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 78e0aca into main Aug 30, 2026
5 of 6 checks passed
@ralyodio ralyodio mentioned this pull request Aug 30, 2026
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.

2 participants