🍓 Sync 2026-08-11 20:54:16

This commit is contained in:
github-actions[bot]
2026-08-11 20:54:16 +08:00
parent b10bf57011
commit 030d9d82a4
23 changed files with 228 additions and 213 deletions
+2 -2
View File
@@ -7,8 +7,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=26.8.10
PKG_RELEASE:=213
PKG_VERSION:=26.8.11
PKG_RELEASE:=214
PKG_PO_VERSION:=$(PKG_VERSION)
PKG_CONFIG_DEPENDS:= \
@@ -471,7 +471,7 @@ function socks_status()
e.use_http = 0
if tonumber(use_http) > 0 then
e.use_http = 1
e.http_status = luci.sys.call(string.format("/bin/busybox top -bn1 | grep -v 'grep' | grep '/tmp/etc/passwall/bin/' | grep -v '_acl_' | grep '%s' | grep -E 'HTTP_|HTTP2SOCKS' > /dev/null", id)) == 0
e.http_status = luci.sys.call(string.format("/bin/busybox top -bn1 | grep -v -E 'grep|acl/|acl_' | grep '%s/bin/' | grep '%s' | grep -E '\\+http|_http' > /dev/null", appname, id)) == 0
end
http_write_json(e)
end
@@ -64,8 +64,12 @@ uci -q delete passwall.@global_xray[0].route_only
for sid in $(uci show passwall | grep "=socks" | awk -F '.' '{print $2}' | awk -F '=' '{print $1}'); do
if [ -z "$(echo ${sid} | grep '^socks_')" ]; then
new_id="socks_$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 5)"
old_ref="Socks_${sid}"
uci -q rename passwall.${sid}="${new_id}"
unset sid new_id
for item in $(uci show passwall | grep "='${old_ref}'\$" | cut -d '=' -sf 1); do
uci -q set ${item}="${new_id}"
done
unset sid new_id old_ref item
fi
done
for sid in $(uci show passwall | grep "@acl_rule" | cut -d '.' -sf 2 | cut -d '=' -sf 1); do
@@ -407,7 +407,7 @@ run_socks() {
fi
[ "$http_port" != "0" ] && {
http_flag=1
config_file="${config_file//SOCKS/HTTP_SOCKS}"
config_file="${config_file%%.*}+http${config_file#${config_file%%.*}}"
json_add_string "local_http_address" "$bind"
json_add_string "local_http_port" "$http_port"
}
@@ -438,7 +438,7 @@ run_socks() {
sing-box)
[ "$http_port" != "0" ] && {
http_flag=1
config_file="${config_file//SOCKS/HTTP_SOCKS}"
config_file="${config_file%%.*}+http${config_file#${config_file%%.*}}"
local _args="http_address=$bind http_port=$http_port"
}
[ -n "$relay_port" ] && _args="${_args} server_host=$server_host server_port=$server_port"
@@ -448,7 +448,7 @@ run_socks() {
xray)
[ "$http_port" != "0" ] && {
http_flag=1
config_file="${config_file//SOCKS/HTTP_SOCKS}"
config_file="${config_file%%.*}+http${config_file#${config_file%%.*}}"
local _args="http_address=$bind http_port=$http_port"
}
[ -n "$relay_port" ] && _args="${_args} server_host=$server_host server_port=$server_port"
@@ -471,7 +471,7 @@ run_socks() {
ss-rust)
[ "$http_port" != "0" ] && {
http_flag=1
config_file="${config_file//SOCKS/HTTP_SOCKS}"
config_file="${config_file%%.*}+http${config_file#${config_file%%.*}}"
json_add_string "local_http_address" "$bind"
json_add_string "local_http_port" "$http_port"
}
@@ -487,7 +487,7 @@ run_socks() {
hysteria2)
[ "$http_port" != "0" ] && {
http_flag=1
config_file="${config_file//SOCKS/HTTP_SOCKS}"
config_file="${config_file%%.*}+http${config_file#${config_file%%.*}}"
json_add_string "local_http_address" "$bind"
json_add_string "local_http_port" "$http_port"
}
@@ -1003,7 +1003,7 @@ start_socks() {
local log=$(config_n_get $id log 1)
[ "$log" = "0" ] && log_file=""
local http_port=$(config_n_get $id http_port 0)
local http_config_file="HTTP2SOCKS_${id}.json"
local http_config_file="${flag}_http.json"
local enable_autoswitch=$(config_n_get $id enable_autoswitch 0)
local no_rec=0
[ "$enable_autoswitch" = "1" ] && no_rec=1
@@ -1020,16 +1020,16 @@ socks_node_switch() {
local flag new_node
eval_set_val "$@"
[ -n "$flag" ] && [ -n "$new_node" ] && {
local prefix pf filename
local suffix pf filename
# 结束 SS 插件进程
for prefix in "" "HTTP_"; do
pf="$TMP_PATH/${prefix}${flag}_plugin.pid"
for suffix in "" "+http"; do
pf="$TMP_PATH/${flag}${suffix}_plugin.pid"
[ -s "$pf" ] && kill -9 "$(head -n1 "$pf")" >/dev/null 2>&1
done
busybox pgrep -af "$TMP_BIN_PATH" | awk -v P1="${flag}" 'BEGIN{IGNORECASE=1}$0~P1 && !/acl\/|acl_/{print $1}' | xargs kill -9 >/dev/null 2>&1
for prefix in "" "HTTP_" "HTTP2"; do
rm -rf "$TMP_PATH/${prefix}${flag}"*
for suffix in "" "+http" "_http"; do
rm -rf "$TMP_PATH/${flag}${suffix}"*
done
for filename in $(ls ${TMP_SCRIPT_FUNC_PATH}); do
@@ -1045,7 +1045,7 @@ socks_node_switch() {
local log=$(config_n_get $flag log 1)
[ "$log" = "0" ] && log_file=""
local http_port=$(config_n_get $flag http_port 0)
local http_config_file="HTTP2SOCKS_${flag}.json"
local http_config_file="${flag}_http.json"
LOG_FILE="/dev/null"
run_socks flag=$flag node=$new_node bind=$bind socks_port=$port config_file=$config_file http_port=$http_port http_config_file=$http_config_file log_file=$log_file
set_cache_var "${flag}" "$new_node"
@@ -236,15 +236,15 @@ load_acl() {
[ -n "$(get_cache_var "ACL_${sid}_dns_port")" ] && dns_redirect_port=$(get_cache_var "ACL_${sid}_dns_port")
[ -n "$(get_cache_var "ACL_${sid}_fakedns")" ] && use_fakedns=$(get_cache_var "ACL_${sid}_fakedns")
[ -n "$tcp_node" ] && {
if is_socks_wrap "$tcp_node"; then
tcp_node_remark="Socks 配置($(config_n_get ${tcp_node#Socks_} port) 端口)"
if [ "$(config_get_type $tcp_node)" = "socks" ]; then
tcp_node_remark="Socks 配置($(config_n_get $tcp_node port) 端口)"
else
tcp_node_remark=$(config_n_get $tcp_node remarks)
fi
}
[ -n "$udp_node" ] && {
if is_socks_wrap "$udp_node"; then
udp_node_remark="Socks 配置($(config_n_get ${udp_node#Socks_} port) 端口)"
if [ "$(config_get_type $udp_node)" = "socks" ]; then
udp_node_remark="Socks 配置($(config_n_get $udp_node port) 端口)"
else
udp_node_remark=$(config_n_get $udp_node remarks)
fi
@@ -256,13 +256,13 @@ load_acl() {
[ -n "$udp_node" ] && [ "$(config_n_get $udp_node protocol)" = "_shunt" ] && use_shunt_udp=1
[ "${use_global_config}" = "1" ] && {
if is_socks_wrap "$TCP_NODE"; then
tcp_node_remark="Socks 配置($(config_n_get ${TCP_NODE#Socks_} port) 端口)"
if [ "$(config_get_type $TCP_NODE)" = "socks" ]; then
tcp_node_remark="Socks 配置($(config_n_get $TCP_NODE} port) 端口)"
else
tcp_node_remark=$(config_n_get $TCP_NODE remarks)
fi
if is_socks_wrap "$UDP_NODE"; then
udp_node_remark="Socks 配置($(config_n_get ${UDP_NODE#Socks_} port) 端口)"
if [ "$(config_get_type $UDP_NODE)" = "socks" ]; then
udp_node_remark="Socks 配置($(config_n_get $UDP_NODE port) 端口)"
else
udp_node_remark=$(config_n_get $UDP_NODE remarks)
fi
@@ -651,8 +651,8 @@ load_acl() {
# 加载TCP默认代理模式
if [ -n "${TCP_PROXY_MODE}" ]; then
[ -n "$TCP_NODE" ] && {
if is_socks_wrap "$TCP_NODE"; then
msg2="${msg}使用 TCP 节点[Socks 配置($(config_n_get ${TCP_NODE#Socks_} port) 端口)]"
if [ "$(config_get_type $TCP_NODE)" = "socks" ]; then
msg2="${msg}使用 TCP 节点[Socks 配置($(config_n_get $TCP_NODE port) 端口)]"
else
msg2="${msg}使用 TCP 节点[$(config_n_get $TCP_NODE remarks)]"
fi
@@ -710,8 +710,8 @@ load_acl() {
# 加载UDP默认代理模式
if [ -n "${UDP_PROXY_MODE}" ]; then
[ -n "$UDP_NODE" ] || [ "$TCP_UDP" = "1" ] && {
if is_socks_wrap "$UDP_NODE"; then
msg2="${msg}使用 UDP 节点[Socks 配置($(config_n_get ${UDP_NODE#Socks_} port) 端口)](TPROXY:${UDP_REDIR_PORT})"
if [ "$(config_get_type $UDP_NODE)" = "socks" ]; then
msg2="${msg}使用 UDP 节点[Socks 配置($(config_n_get $UDP_NODE port) 端口)](TPROXY:${UDP_REDIR_PORT})"
else
msg2="${msg}使用 UDP 节点[$(config_n_get $UDP_NODE remarks)](TPROXY:${UDP_REDIR_PORT})"
fi
@@ -296,15 +296,15 @@ load_acl() {
[ -n "$(get_cache_var "ACL_${sid}_dns_port")" ] && dns_redirect_port=$(get_cache_var "ACL_${sid}_dns_port")
[ -n "$(get_cache_var "ACL_${sid}_fakedns")" ] && use_fakedns=$(get_cache_var "ACL_${sid}_fakedns")
[ -n "$tcp_node" ] && {
if is_socks_wrap "$tcp_node"; then
tcp_node_remark="Socks 配置($(config_n_get ${tcp_node#Socks_} port) 端口)"
if [ "$(config_get_type $tcp_node)" = "socks" ]; then
tcp_node_remark="Socks 配置($(config_n_get $tcp_node port) 端口)"
else
tcp_node_remark=$(config_n_get $tcp_node remarks)
fi
}
[ -n "$udp_node" ] && {
if is_socks_wrap "$udp_node"; then
udp_node_remark="Socks 配置($(config_n_get ${udp_node#Socks_} port) 端口)"
if [ "$(config_get_type $udp_node)" = "socks" ]; then
udp_node_remark="Socks 配置($(config_n_get $udp_node port) 端口)"
else
udp_node_remark=$(config_n_get $udp_node remarks)
fi
@@ -315,13 +315,13 @@ load_acl() {
[ -n "$udp_node" ] && [ "$(config_n_get $udp_node protocol)" = "_shunt" ] && use_shunt_udp=1
[ "${use_global_config}" = "1" ] && {
if is_socks_wrap "$TCP_NODE"; then
tcp_node_remark="Socks 配置($(config_n_get ${TCP_NODE#Socks_} port) 端口)"
if [ "$(config_get_type $TCP_NODE)" = "socks" ]; then
tcp_node_remark="Socks 配置($(config_n_get $TCP_NODE port) 端口)"
else
tcp_node_remark=$(config_n_get $TCP_NODE remarks)
fi
if is_socks_wrap "$UDP_NODE"; then
udp_node_remark="Socks 配置($(config_n_get ${UDP_NODE#Socks_} port) 端口)"
if [ "$(config_get_type $UDP_NODE)" = "socks" ]; then
udp_node_remark="Socks 配置($(config_n_get $UDP_NODE port) 端口)"
else
udp_node_remark=$(config_n_get $UDP_NODE remarks)
fi
@@ -709,8 +709,8 @@ load_acl() {
# 加载TCP默认代理模式
if [ -n "${TCP_PROXY_MODE}" ]; then
[ -n "$TCP_NODE" ] && {
if is_socks_wrap "$TCP_NODE"; then
msg2="${msg}使用 TCP 节点[Socks 配置($(config_n_get ${TCP_NODE#Socks_} port) 端口)]"
if [ "$(config_get_type $TCP_NODE)" = "socks" ]; then
msg2="${msg}使用 TCP 节点[Socks 配置($(config_n_get $TCP_NODE port) 端口)]"
else
msg2="${msg}使用 TCP 节点[$(config_n_get $TCP_NODE remarks)]"
fi
@@ -773,8 +773,8 @@ load_acl() {
# 加载UDP默认代理模式
if [ -n "${UDP_PROXY_MODE}" ]; then
[ -n "$UDP_NODE" ] || [ "$TCP_UDP" = "1" ] && {
if is_socks_wrap "$UDP_NODE"; then
msg2="${msg}使用 UDP 节点[Socks 配置($(config_n_get ${UDP_NODE#Socks_} port) 端口)](TPROXY:${UDP_REDIR_PORT})"
if [ "$(config_get_type $UDP_NODE)" = "socks" ]; then
msg2="${msg}使用 UDP 节点[Socks 配置($(config_n_get $UDP_NODE port) 端口)](TPROXY:${UDP_REDIR_PORT})"
else
msg2="${msg}使用 UDP 节点[$(config_n_get $UDP_NODE remarks)](TPROXY:${UDP_REDIR_PORT})"
fi