feat(installer): WireGuard self-heal sudoers + boot persistence + engine-aware supervision (#5)#450
Open
dhnpmp-tech wants to merge 1 commit into
Open
feat(installer): WireGuard self-heal sudoers + boot persistence + engine-aware supervision (#5)#450dhnpmp-tech wants to merge 1 commit into
dhnpmp-tech wants to merge 1 commit into
Conversation
…ine-aware supervision (#5) Foolproofing roadmap #5 — make the provider daemon actually recover and survive reboot. Installer-only; dcp_daemon.py unchanged (its _self_heal_wg already shells `sudo -n wg-quick`). Cannot be exercised on macOS — needs a Linux systemd rig before deploy. dcp-setup-unix.sh: - Installs /etc/sudoers.d/dcp-wg (0440 root:root) granting the run-user passwordless sudo for EXACTLY wg-quick up/down on wg0+wg1 (absolute path, literal verbs/ifaces, no wildcards). Validated with `visudo -cf` BEFORE install; on failure it warns + skips (never breaks sudo). Skipped when run-user is root. This is the missing piece that made _self_heal_wg silently fail. - Boot persistence: loginctl enable-linger; systemctl enable wg-quick@<iface> for the present wg{0,1}.conf; enable the detected engine unit. - Engine detection: probes :11434/:8000/:8080/mlx and records the engine kind/unit so the assertion checks the unit actually in play (not a hardcoded gguf assumption). - Post-install assert: dc1-provider + engine unit + wg-quick@<iface> all `is-enabled`, else exit 1 with a loud banner (install-time fail-loud is correct; assertions auto-skip when the config/unit isn't present yet so a pre-config install isn't falsely failed). setup-inference-supervisors.sh: - Engine-aware: cleanly skips (exit 0) instead of hard-failing when a non-llama.cpp engine is running and llama.cpp prereqs are absent; the hard requirements remain for the llama.cpp path. Tests: bash -n passes on both scripts; dcp_daemon.py py_compiles (unmodified). visudo grammar of the generated drop-in validated. Full install behavior needs a Linux rig. Docs: docs/CHANGELOG.md [Unreleased].
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Foolproofing #5 — make the provider daemon self-heal and survive reboot
From
docs/ops/dcp-foolproofing-roadmap.md. Installer-only;dcp_daemon.pyis unchanged — its_self_heal_wgalready shellssudo -n wg-quick down/up <iface>; the only missing piece was the sudoers grant, so as a non-root run-user the heal silently failed (this is part of why Node 2 stayed dark for 3+ days).dcp-setup-unix.sh/etc/sudoers.d/dcp-wg(0440 root:root) granting the run-user passwordless sudo for exactlywg-quick up/downonwg0+wg1— absolute binary path, literal verbs/interfaces, no wildcards, no other binaries, no arbitrary.confpaths. Validated withvisudo -cfbeforeinstall; on failure it warns and skips (never breaks system-wide sudo). Skipped entirely when the run-user is root.loginctl enable-linger;systemctl enable wg-quick@<iface>for whicheverwg{0,1}.confexists; enables the detected engine unit (not juststart).:11434/:8000/:8080/MLX, records the engine kind/unit so assertions check the unit actually in play (not a hardcodedggufassumption).dc1-provider+ engine unit +wg-quick@<iface>allis-enabled, elseexit 1with a banner (install-time fail-loud is correct; asserts auto-skip when the relevant config/unit isn't present yet, so a pre-config install isn't falsely failed).setup-inference-supervisors.shexit 0) instead of hard-failing when a non-llama.cpp engine is running and llama.cpp prereqs are absent; the hard requirements remain for the llama.cpp path.🔍 Reviewer must check (security)
The exact
/etc/sudoers.d/dcp-wgcontent (heredoc in the FIX #5a block):Cmnd_Alias DCP_WGQUICK = <abs-wg-quick> up wg0, <abs-wg-quick> down wg0, <abs-wg-quick> up wg1, <abs-wg-quick> down wg1then<user> ALL=(root) NOPASSWD: DCP_WGQUICK. Confirm: (1)visudo -cfvalidated before install; (2) scoped towg-quickonly — no wildcards/other binaries; (3) absolute path required because the daemon invokes barewg-quickand sudo resolves viasecure_path.Rollout
Backend/installer deploys manually. Validate on a Linux rig (ideally Node 2 once its WG is back) before rolling into the live installer.
🤖 Generated with Claude Code