feat(core): fail-safe hardening — live-flag, watchdog, procd fixes

Close the "rules live, engine dead" LAN-blackout class and make an admin
`stop` durable:
- live-flag /var/run/shater.active gates hotplug/cron reconcile, so `stop`
  sticks — a WAN flap can no longer resurrect interception behind a stopped
  engine.
- procd respawn retry=0 (never abandon the engine while rules stand) + guard
  that /usr/bin/xray is executable before installing the data plane.
- shater-cron watchdog: engine dead N ticks with interception live escalates
  per kill_switch (open -> auto-stop/fail-open, closed -> crit log).
- fix procd cron detach: `command "$INIT_SCRIPT" loop` (rc.common dispatch)
  instead of `/bin/sh $INIT_SCRIPT loop`, which detached the loop from procd
  (running:false + respawn churn) — the auto-updater/watchdog ran unsupervised.
- run.json regenerated at start after sysupgrade; cron stamps only on success
  with backoff, and waits for a default route before boot-time fetches.
- sysctl route_localnet/accept_local scoped to lo (was all — WAN anti-spoof
  weakening); applied at install time so no reboot is needed.
- fix stale example filenames; bump shater-core to r19.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LLthkP2S8WAfxu7fcYbPfE
This commit is contained in:
omarandClaude Opus 4.8 committed 2026-07-13 03:37:26 +03:00
1 parent f1e4f16a9f
commit 65883e20d9
8 files changed
+269 -81

No files matched your search

+2 -2
View File
@@ -6,10 +6,10 @@
# The smallest useful config: ONE subscription, ONE group, ONE tproxy inbound,
# ONE default rule sending everything to the group. Copy to the device and
# apply:
# cp examples/etc-config-xray.minimal /etc/config/shater
# cp examples/etc-config-shater.minimal /etc/config/shater
# xrayctl test && xrayctl apply
#
# From here, add rules/chains/egresses incrementally (see etc-config-xray.full).
# From here, add rules/chains/egresses incrementally (see etc-config-shater.full).
# =============================================================================
config globals 'globals'