Files
x1pro/immortalwrt-patches/tools/rollback_watchdog.sh
T
zhangxiaokun 29cf67154a v46.1-ui-mt76: Argon theme + hardened WG tunnel + Link Health dashboard
基于 v46 正式版(mt76)只恢复 UI 层:
- luci-theme-argon 2.4.3: local-background-wins 登录页 + bg1.jpg fallback
- luci-app-argon-config: 去 ui.changes.apply, ACL mutator 移 write
- luci-app-wgtunnel: rpcd ucode 后端(get/status/prepare/apply/rollback/reconnect),
  JSONMap 前端, 60s 一次性 token, 快照回滚, 无全局 network ACL
- luci-app-tr3000-status: 只读 rpcd ucode + 5s 轮询仪表盘
- tools/: audit_ui_packages.py + install_preview.sh + rollback_watchdog.sh
- docs/: 开发经历与翻车记录 + 固件哈希记录

固件本体(含烤入 WG 私钥/PSK)不入 git, 仅 K 盘保存.
kernel 成员与 v46 byte-identical; 尚未刷机.
2026-08-19 15:04:02 +08:00

49 lines
1.8 KiB
Bash

#!/bin/sh
# v46.1 UI-only rollback watchdog
# - Removes ONLY the preview IPKs (luci-theme-argon, luci-app-argon-config, luci-i18n-argon-config-zh-cn, luci-app-wgtunnel, luci-app-tr3000-status)
# - Restores /luci-static/bootstrap as the active theme
# - Clears /tmp/luci-cache and the WG apply state directory
# - Restarts rpcd + uhttpd only. Does NOT touch network / firewall / Wi-Fi / WG / VXLAN.
# - Does NOT call opkg update or fetch anything from the network. Bootstrap is
# already part of the v46 image; we only flip mediaurlbase to it.
set -eu
PREVIEW_LUCI="
luci-theme-argon
luci-app-argon-config
luci-i18n-argon-config-zh-cn
luci-app-wgtunnel
luci-app-tr3000-status
"
# 1. Switch active theme to bootstrap (already present in the v46 image)
uci set luci.main.mediaurlbase=/luci-static/bootstrap
uci commit luci
# 2. Drop any in-memory Argon config so the admin does not "see" an empty form
uci -q delete argon.@global[0] 2>/dev/null || true
uci commit argon 2>/dev/null || true
# 3. Clean LuCI cache
rm -rf /tmp/luci-cache /tmp/luci-indexcache 2>/dev/null || true
rm -rf /www/luci-static/argon/background 2>/dev/null || true
mkdir -p /www/luci-static/argon/background
chmod 0755 /www/luci-static/argon/background
# 4. Clear the WG apply state directory (token / snapshot / lock). It is a
# DIRECTORY created by luci.wgtunnel, not a file.
rm -rf /tmp/luci-wgtunnel 2>/dev/null || true
# 5. Remove preview IPKs only
for pkg in $PREVIEW_LUCI; do
if opkg list-installed | awk '{print $1}' | grep -qx "$pkg"; then
opkg remove --autoremove "$pkg" || true
fi
done
# 6. Restart only web/rpcd - never network, never firewall, never wifi
/etc/init.d/rpcd restart >/dev/null 2>&1 || true
/etc/init.d/uhttpd restart >/dev/null 2>&1 || true
echo "v46.1 UI rollback watchdog: done; theme bootstrap, preview IPKs removed, web stack restarted"