From 7d9ba80838b88452da5c9ccb4e0c687b8817b5ea Mon Sep 17 00:00:00 2001 From: actions-user Date: Thu, 13 Nov 2025 00:13:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=84=20Sync=202025-11-13=2000:13:36?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libcron/Makefile | 7 +-- .../luasrc/view/passwall/global/backup.htm | 4 +- .../view/passwall/node_list/node_list.htm | 15 +++++ .../root/usr/share/passwall/subscribe.lua | 42 +++++++------ .../luasrc/view/passwall2/global/backup.htm | 4 +- .../passwall2/node_list/link_add_node.htm | 61 ++++++++++--------- .../view/passwall2/node_list/node_list.htm | 19 +++++- .../root/usr/share/passwall2/subscribe.lua | 42 +++++++------ 8 files changed, 121 insertions(+), 73 deletions(-) diff --git a/libcron/Makefile b/libcron/Makefile index 76ed1b2..2278f99 100644 --- a/libcron/Makefile +++ b/libcron/Makefile @@ -5,19 +5,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libcron +PKG_VERSION:=1.3.3 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/PerMalmberg/libcron.git -PKG_SOURCE_DATE:=2023-11-14 -PKG_SOURCE_VERSION:=41f238ceb09d4179e7346d78584a0c978e5d0059 -PKG_MIRROR_HASH:=1d5ed3dd15abd1df765904b80153943c12cf1b2b212432c8f116a5eff30e953d +PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_MIRROR_HASH:=74a81dc759bc6ff664601c9b0767120957e54571c0d8500177f7645e07287f24 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Tianling Shen -PKG_BUILD_PARALLEL:=1 CMAKE_INSTALL:=1 include $(INCLUDE_DIR)/package.mk diff --git a/luci-app-passwall/luasrc/view/passwall/global/backup.htm b/luci-app-passwall/luasrc/view/passwall/global/backup.htm index 0c8a916..2261160 100644 --- a/luci-app-passwall/luasrc/view/passwall/global/backup.htm +++ b/luci-app-passwall/luasrc/view/passwall/global/backup.htm @@ -134,10 +134,10 @@ local api = require "luci.passwall.api" setTimeout(function () { if (confirm("<%: Are you sure you want to restore the client to default settings?%>")) { var xhr1 = new XMLHttpRequest(); - xhr1.open("GET",'<%= api.url("clear_log") %>', true); + xhr1.open("GET",'<%= api.url("clear_log") %>', false); xhr1.send(); var xhr2 = new XMLHttpRequest(); - xhr2.open("GET",'<%= api.url("reset_config") %>', true); + xhr2.open("GET",'<%= api.url("reset_config") %>', false); xhr2.send(); window.location.href = '<%= api.url("log") %>' } diff --git a/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm b/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm index 94e231c..5b31219 100644 --- a/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm +++ b/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm @@ -659,6 +659,21 @@ table td, .table .td { if (default_group) { cbi_t_switch("passwall.nodes", default_group) } + + //clear expire data + if (localStorage && localStorage.length > 0) { + const now = Date.now(); + for (let i = 0; i < localStorage.length; i++) { + let key = localStorage.key(i); + if (key && (key.startsWith("icmp") || key.startsWith("tcping"))) { + let value_str = localStorage.getItem(key); + const value = JSON.parse(value_str); + if (!(value && value.savetime && (now - value.timestamp) < value.savetime)) { + localStorage.removeItem(key); + } + } + } + } get_now_use_node(); diff --git a/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/luci-app-passwall/root/usr/share/passwall/subscribe.lua index efaeb89..5e7c69c 100755 --- a/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -449,6 +449,26 @@ local function get_subscribe_info(cfgid, value) end end +-- 设置 ss 协议实现类型 +local function set_ss_implementation(result) + if ss_type_default == "shadowsocks-libev" and has_ss then + result.type = "SS" + elseif ss_type_default == "shadowsocks-rust" and has_ss_rust then + result.type = 'SS-Rust' + elseif ss_type_default == "xray" and has_xray then + result.type = 'Xray' + result.protocol = 'shadowsocks' + result.transport = 'raw' + elseif ss_type_default == "sing-box" and has_singbox then + result.type = 'sing-box' + result.protocol = 'shadowsocks' + else + log("跳过 SS 节点,因未适配到 SS 核心程序,或未正确设置节点使用类型。") + return nil + end + return result +end + -- 处理数据 local function processData(szType, content, add_mode, group) --log(content, add_mode, group) @@ -602,21 +622,8 @@ local function processData(szType, content, add_mode, group) return nil end elseif szType == "ss" then - if ss_type_default == "shadowsocks-libev" and has_ss then - result.type = "SS" - elseif ss_type_default == "shadowsocks-rust" and has_ss_rust then - result.type = 'SS-Rust' - elseif ss_type_default == "xray" and has_xray then - result.type = 'Xray' - result.protocol = 'shadowsocks' - result.transport = 'raw' - elseif ss_type_default == "sing-box" and has_singbox then - result.type = 'sing-box' - result.protocol = 'shadowsocks' - else - log("跳过 SS 节点,因未适配到 SS 核心程序,或未正确设置节点使用类型。") - return nil - end + result = set_ss_implementation(result) + if not result then return nil end --SS-URI = "ss://" userinfo "@" hostname ":" port [ "/" ] [ "?" plugin ] [ "#" tag ] --userinfo = websafe-base64-encode-utf8(method ":" password) @@ -1069,7 +1076,8 @@ local function processData(szType, content, add_mode, group) end elseif szType == "ssd" then - result.type = "SS" + result = set_ss_implementation(result) + if not result then return nil end result.address = content.server result.port = content.port result.password = content.password @@ -1831,7 +1839,7 @@ local function parse_link(raw, add_mode, group, cfgid) end for _, v in ipairs(nodes) do - if v and not string.match(v, "^%s*$") then + if v and (szType == 'ssd' or not string.match(v, "^%s*$")) then xpcall(function () local result if szType == 'ssd' then diff --git a/luci-app-passwall2/luasrc/view/passwall2/global/backup.htm b/luci-app-passwall2/luasrc/view/passwall2/global/backup.htm index c10c6ce..eba48ff 100644 --- a/luci-app-passwall2/luasrc/view/passwall2/global/backup.htm +++ b/luci-app-passwall2/luasrc/view/passwall2/global/backup.htm @@ -134,10 +134,10 @@ local api = require "luci.passwall2.api" setTimeout(function () { if (confirm("<%: Are you sure you want to restore the client to default settings?%>")) { var xhr1 = new XMLHttpRequest(); - xhr1.open("GET",'<%= api.url("clear_log") %>', true); + xhr1.open("GET",'<%= api.url("clear_log") %>', false); xhr1.send(); var xhr2 = new XMLHttpRequest(); - xhr2.open("GET",'<%= api.url("reset_config") %>', true); + xhr2.open("GET",'<%= api.url("reset_config") %>', false); xhr2.send(); window.location.href = '<%= api.url("log") %>' } diff --git a/luci-app-passwall2/luasrc/view/passwall2/node_list/link_add_node.htm b/luci-app-passwall2/luasrc/view/passwall2/node_list/link_add_node.htm index 9f258c3..cbf4aa8 100644 --- a/luci-app-passwall2/luasrc/view/passwall2/node_list/link_add_node.htm +++ b/luci-app-passwall2/luasrc/view/passwall2/node_list/link_add_node.htm @@ -177,13 +177,13 @@ local api = require "luci.passwall2.api"