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
64 lines
2.3 KiB
Plaintext
64 lines
2.3 KiB
Plaintext
#
|
|
# =============================================================================
|
|
# /etc/config/shater -- MINIMAL quick-start example (shater / xrayctl)
|
|
# =============================================================================
|
|
#
|
|
# 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-shater.minimal /etc/config/shater
|
|
# xrayctl test && xrayctl apply
|
|
#
|
|
# From here, add rules/chains/egresses incrementally (see etc-config-shater.full).
|
|
# =============================================================================
|
|
|
|
config globals 'globals'
|
|
option enabled '1'
|
|
option loglevel 'warning'
|
|
option kill_switch 'closed' # fail-closed: block if the proxy is down
|
|
option dns_mode 'nftset'
|
|
option ipv6 '1'
|
|
option fwmark_base '0x2000'
|
|
option table_base '0x2000'
|
|
option confirm_timeout '0' # no commit-confirm for the simple case
|
|
|
|
# Transparent intercept of the main LAN (TCP+UDP), with sniffing for domain rules.
|
|
config inbound
|
|
option name 'lan'
|
|
option enabled '1'
|
|
option network 'lan'
|
|
option tproxy_port '12345'
|
|
option tcp '1'
|
|
option udp '1'
|
|
option sniff '1'
|
|
|
|
# One subscription (HAPP emulation, auto HWID).
|
|
config subscription
|
|
option name 'qomar'
|
|
option enabled '1'
|
|
option url 'https://pro.qomar.pw/sub/EXAMPLEtoken0000'
|
|
option update_interval '6h'
|
|
option fetch_via 'direct'
|
|
option ua 'Happ/3.13.0'
|
|
option hwid 'auto'
|
|
option device_os 'Android'
|
|
option ver_os '14'
|
|
option device_model 'SM-G998B'
|
|
|
|
# One group over that subscription, pick the lowest-latency node.
|
|
config group
|
|
option name 'sub0'
|
|
option source 'subscription'
|
|
option subscription 'qomar'
|
|
option strategy 'leastping'
|
|
option probe_url 'http://www.gstatic.com/generate_204'
|
|
option probe_interval '60s'
|
|
|
|
# One default rule: everything -> the group. Fail-closed if it dies.
|
|
config rule
|
|
option name 'default'
|
|
option enabled '1'
|
|
option order '1000'
|
|
option target 'group:sub0'
|
|
option kill 'closed'
|