From fcd16640e9858753c87815845dab8129e56abdf6 Mon Sep 17 00:00:00 2001 From: kenzok8 Date: Thu, 8 Jan 2026 00:36:29 +0800 Subject: [PATCH] update 2026-01-08 00:36:29 --- .../luasrc/model/cbi/passwall/client/rule.lua | 4 +++- .../cbi/passwall/client/socks_config.lua | 4 ++-- .../view/passwall/socks_auto_switch/btn.htm | 23 +++++++++++++++--- luci-app-passwall/po/zh-cn/passwall.po | 3 +++ .../root/usr/share/passwall/rule_update.lua | 23 +++++++++++++----- .../root/etc/init.d/shadowsocksr | 24 +++++++++++++------ upx/Makefile | 4 ++-- 7 files changed, 64 insertions(+), 21 deletions(-) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua index 2f209507d..9bdf13292 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua @@ -72,9 +72,11 @@ if has_xray or has_singbox then o.rmempty = false if api.is_finded("geoview") then - o = s:option(Flag, "geo2rule", translate("Generate Rule List from Geo"), translate("Generate rule lists such as GFW, China domains, and China IP ranges based on Geo files.")) + o = s:option(Flag, "geo2rule", translate("Generate Rule List from Geo")) o.default = 0 o.rmempty = false + o.description = translate("Generate rule lists such as GFW, China domains, and China IP ranges based on Geo files.") .. "
" .. + translate("When manually updating with this option enabled, rules will be regenerated from existing Geo files even if no new version is available.") .. "" o = s:option(Flag, "enable_geoview", translate("Enable Geo Data Parsing")) o.default = 0 diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua index 304e18fd4..51df20908 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua @@ -136,16 +136,16 @@ o = s:option(Flag, "autoswitch_restore_switch", translate("Restore Switch"), tra o:depends("enable_autoswitch", true) o = s:option(Value, "autoswitch_probe_url", translate("Probe URL"), translate("The URL used to detect the connection status.")) -o.default = "https://www.google.com/generate_204" o:value("https://cp.cloudflare.com/", "Cloudflare") o:value("https://www.gstatic.com/generate_204", "Gstatic") o:value("https://www.google.com/generate_204", "Google") o:value("https://www.youtube.com/generate_204", "YouTube") o:value("https://connect.rom.miui.com/generate_204", "MIUI (CN)") o:value("https://connectivitycheck.platform.hicloud.com/generate_204", "HiCloud (CN)") +o.default = o.keylist[3] o:depends("enable_autoswitch", true) -o = s:option(DummyValue, "btn", " ") +o = s:option(DummyValue, "btn") o.template = appname .. "/socks_auto_switch/btn" o:depends("enable_autoswitch", true) diff --git a/luci-app-passwall/luasrc/view/passwall/socks_auto_switch/btn.htm b/luci-app-passwall/luasrc/view/passwall/socks_auto_switch/btn.htm index 37186c4b2..485889d52 100644 --- a/luci-app-passwall/luasrc/view/passwall/socks_auto_switch/btn.htm +++ b/luci-app-passwall/luasrc/view/passwall/socks_auto_switch/btn.htm @@ -19,9 +19,26 @@ local api = require "luci.passwall.api" } //]]> -
" data-index="<%=self.index%>" data-depends="<%=pcdata(self:deplist2json(section))%>"> - -
+ +
" data-index="<%=self.index%>" data-depends="<%=pcdata(self:deplist2json(section))%>"> + +
diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index 6e5a2d05b..417b04e06 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -1009,6 +1009,9 @@ msgstr "从 Geo 文件生成规则" msgid "Generate rule lists such as GFW, China domains, and China IP ranges based on Geo files." msgstr "根据 Geo 文件生成规则列表,包括 GFW、中国域名和中国 IP 段等。" +msgid "When manually updating with this option enabled, rules will be regenerated from existing Geo files even if no new version is available." +msgstr "启用此选项后手动更新时,即使没有新版本也会从现有 Geo 文件重新生成规则。" + msgid "Enable Geo Data Parsing" msgstr "开启 Geo 数据解析" diff --git a/luci-app-passwall/root/usr/share/passwall/rule_update.lua b/luci-app-passwall/root/usr/share/passwall/rule_update.lua index 2e9b62767..2873e7c74 100755 --- a/luci-app-passwall/root/usr/share/passwall/rule_update.lua +++ b/luci-app-passwall/root/usr/share/passwall/rule_update.lua @@ -690,14 +690,25 @@ if geo2rule == "1" then remove_tmp_geofile("geosite") end - if geoip_update_ok then - safe_call(fetch_chnroute, "生成chnroute发生错误...") - safe_call(fetch_chnroute6, "生成chnroute6发生错误...") + -- 如果是手动更新(arg2存在)始终生成规则 + local force_generate = (arg2 ~= nil) + + if geoip_update_ok or force_generate then + if fs.access(asset_location .. "geoip.dat") then + safe_call(fetch_chnroute, "生成chnroute发生错误...") + safe_call(fetch_chnroute6, "生成chnroute6发生错误...") + else + log("geoip.dat 文件不存在,跳过规则生成。") + end end - if geosite_update_ok then - safe_call(fetch_gfwlist, "生成gfwlist发生错误...") - safe_call(fetch_chnlist, "生成chnlist发生错误...") + if geosite_update_ok or force_generate then + if fs.access(asset_location .. "geosite.dat") then + safe_call(fetch_gfwlist, "生成gfwlist发生错误...") + safe_call(fetch_chnlist, "生成chnlist发生错误...") + else + log("geosite.dat 文件不存在,跳过规则生成。") + end end else if gfwlist_update == "1" then diff --git a/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index e45d2954e..17af435bc 100755 --- a/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -1544,6 +1544,13 @@ start() { fi /etc/init.d/dnsmasq restart >/dev/null 2>&1 check_server + if command -v nft >/dev/null 2>&1; then + local CURRENT_SERVER="$(uci_get_by_type global global_server nil)" + if [ "$CURRENT_SERVER" != "nil" ]; then + uci set shadowsocksr.@global[0].old_global_server="$CURRENT_SERVER" + uci commit shadowsocksr + fi + fi start_server start_monitor clean_log @@ -1560,13 +1567,16 @@ boot() { stop() { unlock set_lock - if command -v nft >/dev/null 2>&1; then - /usr/bin/ssr-rules -K - #local CLEANUP_PERSISTENCE="$(uci_get_by_type global global_server nil)" - #if [ "$CLEANUP_PERSISTENCE" == "nil" ]; then - # /usr/bin/ssr-rules -X - #fi - fi + if command -v nft >/dev/null 2>&1; then + /usr/bin/ssr-rules -K + local OLD_SERVER="$(uci_get_by_type global old_global_server nil)" + local NEW_SERVER="$(uci_get_by_type global global_server nil)" + if [ "$OLD_SERVER" != "nil" ] && [ "$NEW_SERVER" != "nil" ] && [ "$OLD_SERVER" != "$NEW_SERVER" ]; then + /usr/bin/ssr-rules -X + fi + uci delete shadowsocksr.@global[0].old_global_server 2>/dev/null + uci commit shadowsocksr + fi /usr/bin/ssr-rules -f local srulecount=0 if command -v nft >/dev/null 2>&1; then diff --git a/upx/Makefile b/upx/Makefile index 95232298b..f1be661d6 100644 --- a/upx/Makefile +++ b/upx/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=upx -PKG_VERSION:=5.0.2 +PKG_VERSION:=5.1.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.xz PKG_SOURCE_URL:=https://github.com/upx/upx/releases/download/v$(PKG_VERSION) -PKG_HASH:=209b219bbcfa58c249ffe6eba3c244e0910fa8be792b5521e4daf938167f05cc +PKG_HASH:=9f7a810b8a810b1ca2c5cb01ffcf23066e3fb8a51ddc406ea05bdd5d37d0b8bd PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING LICENSE