Skip to content

fix(ops): guarded dev2 Moshpit DNS recovery, rollback and tests - #398

Merged
ralyodio merged 5 commits into
masterfrom
fix/dev2-moshpit-dns-recovery
Nov 18, 2026
Merged

ralyodio merged 5 commits into
masterfrom
fix/dev2-moshpit-dns-recovery

Conversation

@ralyodio

Copy link
Copy Markdown
Collaborator

Restore dev2 DNS safely after a Moshpit local-resolver conflict

The latest four GitHub Actions deploys to dev2 failed before deploy-app.sh ran because SSH port 22 timed out. Example: run 44172958010. Meanwhile moshcode dns enable can install a systemd-resolved Domains=~. override that routes all DNS queries through 127.0.0.1:5354; if the Moshpit bridge is unavailable, this can break ordinary DNS. There may also be a second 00-moshpit.conf from the Moshpit proxy installer.

This is a recovery tool, NOT a remote deployment. There is no safe SSH-based fix until the server is reachable.

Changes

  • Add scripts/dev2-dns-recovery.py: dry-run by default, console-only --apply with root permission. Inspects only recognized Moshpit-owned /etc/systemd/resolved.conf.d/moshpit.conf and 00-moshpit.conf, rejects symlinks/unrecognized contents, backs up files mode 0600, removes only matching resolver overrides, restarts systemd-resolved, tests two ordinary DNS hostnames, restores original files and restarts resolver if verification fails.
  • Add runbook with read-only IP route/DNS checks, provider console recovery, post-change SSH checks and split-DNS guidance.
  • Add regression unit tests covering ownership, unrelated files, symlink refusal, successful recovery, failed DNS and failed restart rollback; separate CI workflow to run them without touching actual host settings.

Safety

No GitHub Action directly changes dev2 DNS or opens firewall ports. This PR does not disable SSH host key verification, adjust firewall, replace resolv.conf, or claim to fix upstream IP connectivity. The operator must use trusted console/VNC access and verify the origin of the problem first. If routing/firewall/SSH is broken, that is separate from DNS. Merging a runbook/script alone cannot repair a server that is unreachable from GitHub Actions.

Test

python3 -m py_compile scripts/dev2-dns-recovery.py tests/test_dev2_dns_recovery.py
python3 -m unittest discover -s tests -p test_dev2_dns_recovery.py -v

Merge after all required Rust/security and recovery-specific CI passes. Related #391.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

ThreatCrush Security Scan

15 finding(s)

HIGH/CRITICAL: 2 | MEDIUM: 9 | LOW: 4

Severity Rule Location
HIGH js-ssrf-outbound-request apps/web/public/sw.js:24
HIGH sh-remote-script-execution scripts/install.sh:611
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:53
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:109
MEDIUM sql-template-interpolation apps/web/src/lib/chat/convo-store.ts:116
MEDIUM sql-template-interpolation apps/web/src/lib/chat/convo-store.ts:117
MEDIUM sql-template-interpolation apps/web/src/lib/chat/push.ts:476
MEDIUM js-dynamic-code-execution apps/web/src/lib/router/verify.ts:91
MEDIUM sh-remote-script-execution scripts/dev-setup.sh:25
MEDIUM sh-eval-expansion scripts/dev-setup.sh:35
MEDIUM redos-nested-quantifier scripts/dev2-dns-recovery.py:31
LOW py-ssrf-outbound-request examples/business-strategist-agent/chat.py:37
LOW py-ssrf-outbound-request examples/business-strategist-agent/train.py:54
LOW secret-generic-credential node/crates/c0mpute-core/src/webhook.rs:1171
LOW py-path-traversal node/crates/c0mpute-core/tests/fixtures/fake-infernet-text:29

Snippets are redacted; ThreatCrush never prints matched credential material.

NAMES = ("moshpit.conf", "00-moshpit.conf")
CHECK_NAMES = ("github.com", "c0mpute.com")
LOOPBACK_DNS = re.compile(r"^\s*DNS\s*=\s*(?:127\.0\.0\.1|::1|\[::1\])(?::\d+)?(?:\s|$)", re.I | re.M)
ROUTE_ALL = re.compile(r"^\s*Domains\s*=\s*(?:\S+\s+)*~\.(?:\s|$)", re.I | re.M)
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