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; 尚未刷机.
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
config global
|
||||
option primary '#5e72e4'
|
||||
option dark_primary '#483d8b'
|
||||
option blur '0'
|
||||
option blur_dark '0'
|
||||
option transparency '0.3'
|
||||
option transparency_dark '0.3'
|
||||
option mode 'normal'
|
||||
option online_wallpaper 'bing'
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
bing_background="$(uci -q get "argon.@global[0].bing_background")"
|
||||
[ -n "$bing_background" ] || exit 0
|
||||
|
||||
if [ "$bing_background" = "1" ]; then
|
||||
uci -q set "argon.@global[0].online_wallpaper"="bing"
|
||||
else
|
||||
uci -q set "argon.@global[0].online_wallpaper"="none"
|
||||
fi
|
||||
uci -q delete "argon.@global[0].bing_background"
|
||||
uci -q commit "argon"
|
||||
|
||||
exit 0
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
readonly bg_path="/www/luci-static/argon/background"
|
||||
readonly tmp_path="/tmp/argon_background.tmp"
|
||||
readonly max_size=5242880
|
||||
readonly builtin_bg="bg1.jpg"
|
||||
|
||||
valid_name() {
|
||||
local name="$1" ext
|
||||
[ -n "$name" ] || return 1
|
||||
[ "$name" = "${name##*/}" ] || return 1
|
||||
[ "$name" = "${name##*\\}" ] || return 1
|
||||
[ "$name" = "${name#.*}" ] || return 1
|
||||
case "$name" in *..*|*[!A-Za-z0-9_.-]*) return 1 ;; esac
|
||||
ext="${name##*.}"
|
||||
[ "$ext" != "$name" ] || return 1
|
||||
case "$(echo "$ext" | tr 'A-Z' 'a-z')" in jpg|jpeg|png|gif|webp|mp4|webm|ogg) return 0 ;; esac
|
||||
return 1
|
||||
}
|
||||
|
||||
json_result() {
|
||||
json_init
|
||||
json_add_int "result" "$1"
|
||||
json_dump
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"list")
|
||||
json_init
|
||||
json_add_object "remove"
|
||||
json_add_string "filename" "filename"
|
||||
json_close_object
|
||||
json_add_object "rename"
|
||||
json_add_string "newname" "filename"
|
||||
json_close_object
|
||||
json_dump
|
||||
json_cleanup
|
||||
;;
|
||||
"call")
|
||||
case "$2" in
|
||||
"remove")
|
||||
read -r input
|
||||
json_load "$input"
|
||||
json_get_var filename "filename"
|
||||
json_cleanup
|
||||
|
||||
if ! valid_name "$filename" || [ "$filename" = "$builtin_bg" ] || [ -L "$bg_path/$filename" ]; then
|
||||
json_result 255
|
||||
exit 255
|
||||
fi
|
||||
|
||||
rm -f -- "$bg_path/$filename"
|
||||
json_result 0
|
||||
;;
|
||||
"rename")
|
||||
read -r input
|
||||
json_load "$input"
|
||||
json_get_var newname "newname"
|
||||
json_cleanup
|
||||
|
||||
if ! valid_name "$newname" || [ "$newname" = "$builtin_bg" ] || [ -L "$tmp_path" ] || [ ! -f "$tmp_path" ]; then
|
||||
json_result 255
|
||||
exit 255
|
||||
fi
|
||||
|
||||
size="$(wc -c < "$tmp_path" 2>/dev/null)" || size=0
|
||||
case "$size" in *[!0-9]*|'') size=0 ;; esac
|
||||
if [ "$size" -le 0 ] || [ "$size" -gt "$max_size" ]; then
|
||||
rm -f -- "$tmp_path"
|
||||
json_result 254
|
||||
exit 254
|
||||
fi
|
||||
|
||||
mkdir -p -- "$bg_path"
|
||||
target="$bg_path/$newname"
|
||||
if [ -e "$target" ] || [ -L "$target" ]; then
|
||||
json_result 253
|
||||
exit 253
|
||||
fi
|
||||
if (set -C; umask 022; cat "$tmp_path" > "$target") 2>/dev/null; then
|
||||
if chmod 0644 "$target" && rm -f -- "$tmp_path"; then
|
||||
json_result 0
|
||||
else
|
||||
rm -f -- "$target"
|
||||
json_result 1
|
||||
fi
|
||||
else
|
||||
json_result 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"admin/system/argon-config": {
|
||||
"title": "Argon Config",
|
||||
"order": 90,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "argon-config"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-argon-config" ],
|
||||
"uci": { "argon": true }
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"luci-app-argon-config": {
|
||||
"description": "Grant UCI access for luci-app-argon-config",
|
||||
"read": {
|
||||
"file": {
|
||||
"/www/luci-static/argon/background/*": [ "list" ]
|
||||
},
|
||||
"ubus": {
|
||||
"system": [ "info" ]
|
||||
},
|
||||
"uci": [ "argon" ]
|
||||
},
|
||||
"write": {
|
||||
"file": {
|
||||
"/tmp/argon_background.tmp": [ "write" ]
|
||||
},
|
||||
"ubus": {
|
||||
"luci.argon": [ "remove", "rename" ]
|
||||
},
|
||||
"uci": [ "argon" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user