From 039fd6ecd43ab1e851d6cd54ceb31cc0303e48b0 Mon Sep 17 00:00:00 2001 From: kenzok8 Date: Thu, 5 Feb 2026 04:39:26 +0800 Subject: [PATCH] update 2026-02-05 04:39:26 --- alist/Makefile | 8 +- luci-app-passwall2/luasrc/passwall2/api.lua | 31 ++++--- .../luasrc/passwall2/util_sing-box.lua | 63 +++++++------ .../luasrc/passwall2/util_xray.lua | 92 +++++++++---------- .../luasrc/view/passwall2/global/footer.htm | 21 +++-- .../passwall2/node_config/link_share_man.htm | 4 +- .../view/passwall2/node_list/node_list.htm | 77 ++++++++-------- 7 files changed, 147 insertions(+), 149 deletions(-) diff --git a/alist/Makefile b/alist/Makefile index 8e63fa803..f14027184 100644 --- a/alist/Makefile +++ b/alist/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=alist -PKG_VERSION:=3.56.0 -PKG_WEB_VERSION:=3.56.0 +PKG_VERSION:=3.57.0 +PKG_WEB_VERSION:=3.57.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/AlistGo/alist/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=bd4621a15e10e5c446d7bce44c31ba1be5be653f4d255f3724a2bedb53265bd9 +PKG_HASH:=595854d82bce51a8959840cb976f7291769c377139d4e7f4db0c64d777f59777 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILE:=LICENSE @@ -23,7 +23,7 @@ define Download/$(PKG_NAME)-web FILE:=$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz URL_FILE:=dist.tar.gz URL:=https://github.com/AlistGo/alist-web/releases/download/$(PKG_WEB_VERSION)/ -HASH:=3afcfd6488ddbc112a37858b7e2a6a8c83711cc118af0072903280dd89995a81 +HASH:=58c26ccfa9b87aecf74091826371277461698b923c632cc29c85d529c93373c3 endef PKG_BUILD_DEPENDS:=golang/host diff --git a/luci-app-passwall2/luasrc/passwall2/api.lua b/luci-app-passwall2/luasrc/passwall2/api.lua index bd2303e0d..8a7e4730e 100644 --- a/luci-app-passwall2/luasrc/passwall2/api.lua +++ b/luci-app-passwall2/luasrc/passwall2/api.lua @@ -466,9 +466,9 @@ function get_node_name(node_id) if e then if e.type and e.remarks then if e.protocol and (e.protocol == "_balancing" or e.protocol == "_shunt" or e.protocol == "_iface") then - local type = e.type - if type == "sing-box" then type = "Sing-Box" end - local remark = "%s:[%s] " % {type .. " " .. i18n.translatef(e.protocol), e.remarks} + local type_name = e.type + if e.type == "sing-box" then type_name = "Sing-Box" end + local remark = "%s:[%s] " % {type_name .. " " .. i18n.translatef(e.protocol), e.remarks} return remark end end @@ -484,9 +484,10 @@ function get_valid_nodes() uci:foreach(appname, "nodes", function(e) e.id = e[".name"] if e.type and e.remarks then - if e.type == "sing-box" then e.type = "Sing-Box" end + local type_name = e.type + if e.type == "sing-box" then type_name = "Sing-Box" end if e.protocol and (e.protocol == "_balancing" or e.protocol == "_shunt" or e.protocol == "_iface" or e.protocol == "_urltest") then - e["remark"] = trim("%s:[%s]" % {e.type .. " " .. i18n.translatef(e.protocol), e.remarks}) + e["remark"] = trim("%s:[%s]" % {type_name .. " " .. i18n.translatef(e.protocol), e.remarks}) e["node_type"] = "special" if not e.group or e.group == "" then default_nodes[#default_nodes + 1] = e @@ -498,7 +499,7 @@ function get_valid_nodes() if port and e.address then local address = e.address if is_ip(address) or datatypes.hostname(address) then - if (e.type == "Sing-Box" or e.type == "Xray") and e.protocol then + if (e.type == "sing-box" or e.type == "Xray") and e.protocol then local protocol = e.protocol if protocol == "vmess" then protocol = "VMess" @@ -521,13 +522,13 @@ function get_valid_nodes() else protocol = protocol:gsub("^%l",string.upper) end - e.type = e.type .. " " .. protocol + type_name = type_name .. " " .. protocol end if is_ipv6(address) then address = get_ipv6_full(address) end - e["remark"] = trim("%s:[%s]" % {e.type, e.remarks}) + e["remark"] = trim("%s:[%s]" % {type_name, e.remarks}) if show_node_info == "1" then port = port:gsub(":", "-") - e["remark"] = trim("%s:[%s] %s:%s" % {e.type, e.remarks, address, port}) + e["remark"] = trim("%s:[%s] %s:%s" % {type_name, e.remarks, address, port}) end e.node_type = "normal" if not e.group or e.group == "" then @@ -547,12 +548,12 @@ end function get_node_remarks(n) local remarks = "" if n then - if n.type == "sing-box" then n.type = "Sing-Box" end + local type_name = n.type + if n.type == "sing-box" then type_name = "Sing-Box" end if n.protocol and (n.protocol == "_balancing" or n.protocol == "_shunt" or n.protocol == "_iface" or n.protocol == "_urltest") then - remarks = trim("%s:[%s]" % {n.type .. " " .. i18n.translatef(n.protocol), n.remarks}) + remarks = trim("%s:[%s]" % {type_name .. " " .. i18n.translatef(n.protocol), n.remarks}) else - local type2 = n.type - if (n.type == "Sing-Box" or n.type == "Xray") and n.protocol then + if (n.type == "sing-box" or n.type == "Xray") and n.protocol then local protocol = n.protocol if protocol == "vmess" then protocol = "VMess" @@ -575,9 +576,9 @@ function get_node_remarks(n) else protocol = protocol:gsub("^%l",string.upper) end - type2 = type2 .. " " .. protocol + type_name = type_name .. " " .. protocol end - remarks = trim("%s:[%s]" % {type2, n.remarks}) + remarks = trim("%s:[%s]" % {type_name, n.remarks}) end end return remarks diff --git a/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua b/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua index 6c505d847..0cde82ae1 100644 --- a/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua +++ b/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua @@ -1087,7 +1087,29 @@ function gen_config(var) node.port = server_port end - local function gen_urltest(_node) + function gen_socks_config_node(node_id, socks_id, remarks) + if node_id then + socks_id = node_id:sub(1 + #"Socks_") + end + local result + local socks_node = uci:get_all(appname, socks_id) or nil + if socks_node then + if not remarks then + remarks = "Socks_" .. socks_node.port + end + result = { + remarks = remarks, + type = "sing-box", + protocol = "socks", + address = "127.0.0.1", + port = socks_node.port, + uot = "1" + } + end + return result + end + + function gen_urltest(_node) local urltest_id = _node[".name"] local urltest_tag = "urltest-" .. urltest_id -- existing urltest @@ -1113,25 +1135,16 @@ function gen_config(var) if is_new_ut_node then local ut_node if ut_node_id:find("Socks_") then - local socks_id = ut_node_id:sub(1 + #"Socks_") - local socks_node = uci:get_all(appname, socks_id) or nil - if socks_node then - ut_node = { - type = "sing-box", - protocol = "socks", - address = "127.0.0.1", - port = socks_node.port, - uot = "1", - remarks = "Socks_" .. socks_node.port - } - end + ut_node = gen_socks_config_node(ut_node_id) else ut_node = uci:get_all(appname, ut_node_id) end if ut_node then local outbound = gen_outbound(flag, ut_node, ut_node_tag, { fragment = singbox_settings.fragment == "1" or nil, record_fragment = singbox_settings.record_fragment == "1" or nil, run_socks_instance = not no_run }) if outbound then - outbound.tag = outbound.tag .. ":" .. ut_node.remarks + if ut_node.remarks then + outbound.tag = outbound.tag .. ":" .. ut_node.remarks + end table.insert(outbounds, outbound) valid_nodes[#valid_nodes + 1] = outbound.tag end @@ -1153,7 +1166,7 @@ function gen_config(var) return urltest_tag end - local function set_outbound_detour(node, outbound, outbounds_table, shunt_rule_name) + function set_outbound_detour(node, outbound, outbounds_table, shunt_rule_name) if not node or not outbound or not outbounds_table then return nil end local default_outTag = outbound.tag local last_insert_outbound @@ -1238,21 +1251,11 @@ function gen_config(var) elseif _node_id == "_default" and rule_name ~= "default" then rule_outboundTag = "default" elseif _node_id and _node_id:find("Socks_") then - local socks_id = _node_id:sub(1 + #"Socks_") - local socks_node = uci:get_all(appname, socks_id) or nil - if socks_node then - local _node = { - type = "sing-box", - protocol = "socks", - address = "127.0.0.1", - port = socks_node.port, - uot = "1", - } - local _outbound = gen_outbound(flag, _node, rule_name) - if _outbound then - table.insert(outbounds, _outbound) - rule_outboundTag = _outbound.tag - end + local socks_node = gen_socks_config_node(_node_id) + local _outbound = gen_outbound(flag, socks_node, rule_name) + if _outbound then + table.insert(outbounds, _outbound) + rule_outboundTag = _outbound.tag end elseif _node_id then local _node = uci:get_all(appname, _node_id) diff --git a/luci-app-passwall2/luasrc/passwall2/util_xray.lua b/luci-app-passwall2/luasrc/passwall2/util_xray.lua index 8b1581315..efa3d4c8e 100644 --- a/luci-app-passwall2/luasrc/passwall2/util_xray.lua +++ b/luci-app-passwall2/luasrc/passwall2/util_xray.lua @@ -724,7 +724,30 @@ function gen_config(var) table.insert(inbounds, inbound) end - local function gen_loopback(outboundTag, dst_node_id) + function gen_socks_config_node(node_id, socks_id, remarks) + if node_id then + socks_id = node_id:sub(1 + #"Socks_") + end + local result + local socks_node = uci:get_all(appname, socks_id) or nil + if socks_node then + if not remarks then + remarks = "Socks_" .. socks_node.port + end + result = { + remarks = remarks, + type = "Xray", + protocol = "socks", + address = "127.0.0.1", + port = socks_node.port, + transport = "tcp", + stream_security = "none" + } + end + return result + end + + function gen_loopback(outboundTag, dst_node_id) if not outboundTag then return nil end local inboundTag = dst_node_id and "loop-in-" .. dst_node_id or outboundTag .. "-lo" table.insert(outbounds, { @@ -735,7 +758,7 @@ function gen_config(var) return inboundTag end - local function gen_balancer(_node, loopback_tag) + function gen_balancer(_node, loopback_tag) local balancer_id = _node[".name"] local balancer_tag = "balancer-" .. balancer_id local loopback_dst = balancer_id -- route destination for the loopback outbound @@ -764,26 +787,16 @@ function gen_config(var) if is_new_blc_node then local blc_node if blc_node_id:find("Socks_") then - local socks_id = blc_node_id:sub(1 + #"Socks_") - local socks_node = uci:get_all(appname, socks_id) or nil - if socks_node then - blc_node = { - type = "Xray", - protocol = "socks", - address = "127.0.0.1", - port = socks_node.port, - transport = "tcp", - stream_security = "none", - remarks = "Socks_" .. socks_node.port - } - end + blc_node = gen_socks_config_node(blc_node_id) else blc_node = uci:get_all(appname, blc_node_id) end if blc_node then local outbound = gen_outbound(flag, blc_node, blc_node_tag, { fragment = xray_settings.fragment == "1" or nil, noise = xray_settings.noise == "1" or nil, run_socks_instance = not no_run }) if outbound then - outbound.tag = outbound.tag .. ":" .. blc_node.remarks + if blc_node.remarks then + outbound.tag = outbound.tag .. ":" .. blc_node.remarks + end table.insert(outbounds, outbound) valid_nodes[#valid_nodes + 1] = outbound.tag end @@ -808,19 +821,7 @@ function gen_config(var) if is_new_node then local fallback_node if fallback_node_id:find("Socks_") then - local socks_id = fallback_node_id:sub(1 + #"Socks_") - local socks_node = uci:get_all(appname, socks_id) or nil - if socks_node then - fallback_node = { - type = "Xray", - protocol = "socks", - address = "127.0.0.1", - port = socks_node.port, - transport = "tcp", - stream_security = "none", - remarks = "Socks_" .. socks_node.port - } - end + fallback_node = gen_socks_config_node(fallback_node_id) else fallback_node = uci:get_all(appname, fallback_node_id) end @@ -828,7 +829,9 @@ function gen_config(var) if fallback_node.protocol ~= "_balancing" then local outbound = gen_outbound(flag, fallback_node, fallback_node_id, { fragment = xray_settings.fragment == "1" or nil, noise = xray_settings.noise == "1" or nil, run_socks_instance = not no_run }) if outbound then - outbound.tag = outbound.tag .. ":" .. fallback_node.remarks + if fallback_node.remarks then + outbound.tag = outbound.tag .. ":" .. fallback_node.remarks + end table.insert(outbounds, outbound) fallback_node_tag = outbound.tag end @@ -886,7 +889,7 @@ function gen_config(var) return balancer_tag end - local function set_outbound_detour(node, outbound, outbounds_table, shunt_rule_name) + function set_outbound_detour(node, outbound, outbounds_table, shunt_rule_name) if not node or not outbound or not outbounds_table then return nil end local default_outTag = outbound.tag local last_insert_outbound @@ -959,27 +962,16 @@ function gen_config(var) elseif _node_id == "_default" then return "default", nil elseif _node_id and _node_id:find("Socks_") then - local socks_id = _node_id:sub(1 + #"Socks_") - local socks_node = uci:get_all(appname, socks_id) or nil local socks_tag - if socks_node then - local _node = { - type = "Xray", - protocol = "socks", - address = "127.0.0.1", - port = socks_node.port, - transport = "tcp", - stream_security = "none" - } - local outbound = gen_outbound(flag, _node, rule_name) - if outbound then - if rule_name == "default" then - table.insert(outbounds, 1, outbound) - else - table.insert(outbounds, outbound) - end - socks_tag = outbound.tag + local socks_node = gen_socks_config_node(_node_id) + local outbound = gen_outbound(flag, socks_node, rule_name) + if outbound then + if rule_name == "default" then + table.insert(outbounds, 1, outbound) + else + table.insert(outbounds, outbound) end + socks_tag = outbound.tag end return socks_tag, nil elseif _node_id then diff --git a/luci-app-passwall2/luasrc/view/passwall2/global/footer.htm b/luci-app-passwall2/luasrc/view/passwall2/global/footer.htm index a3cbd1291..b5c8becf4 100644 --- a/luci-app-passwall2/luasrc/view/passwall2/global/footer.htm +++ b/luci-app-passwall2/luasrc/view/passwall2/global/footer.htm @@ -1,12 +1,13 @@ <% local api = self.api +local appname = api.appname -%>