diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index 184c14a77..d0221d553 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall -PKG_VERSION:=25.5.8 +PKG_VERSION:=25.5.15 PKG_RELEASE:=1 PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index 663314a5f..e204a6238 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -84,6 +84,7 @@ function gen_outbound(flag, node, tag, proxy_table) local run_socks_instance = true if proxy_table ~= nil and type(proxy_table) == "table" then proxy_tag = proxy_table.tag or nil + run_socks_instance = proxy_table.run_socks_instance end if node.type ~= "sing-box" then diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index c2c1eea89..bf79aa3cb 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -62,6 +62,7 @@ function gen_outbound(flag, node, tag, proxy_table) proxy_tag = proxy_table.tag or nil fragment = proxy_table.fragment or nil noise = proxy_table.noise or nil + run_socks_instance = proxy_table.run_socks_instance end if node.type ~= "Xray" then @@ -735,7 +736,7 @@ function gen_config(var) end if is_new_blc_node then local blc_node = uci:get_all(appname, blc_node_id) - local outbound = gen_outbound(flag, blc_node, blc_node_tag, { fragment = xray_settings.fragment == "1" or nil, noise = xray_settings.noise == "1" or nil }) + 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 table.insert(outbounds, outbound) @@ -761,7 +762,7 @@ function gen_config(var) if is_new_node then local fallback_node = uci:get_all(appname, fallback_node_id) 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 }) + 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 table.insert(outbounds, outbound) @@ -1140,7 +1141,7 @@ function gen_config(var) sys.call(string.format("mkdir -p %s && touch %s/%s", api.TMP_IFACE_PATH, api.TMP_IFACE_PATH, node.iface)) end else - local outbound = gen_outbound(flag, node, nil, { fragment = xray_settings.fragment == "1" or nil, noise = xray_settings.fragment == "1" or nil }) + local outbound = gen_outbound(flag, node, nil, { fragment = xray_settings.fragment == "1" or nil, noise = xray_settings.fragment == "1" or nil, run_socks_instance = not no_run }) if outbound then outbound.tag = outbound.tag .. ":" .. node.remarks COMMON.default_outbound_tag, last_insert_outbound = set_outbound_detour(node, outbound, outbounds) diff --git a/luci-app-passwall/root/usr/share/passwall/test.sh b/luci-app-passwall/root/usr/share/passwall/test.sh index 2da810894..980fd9c07 100755 --- a/luci-app-passwall/root/usr/share/passwall/test.sh +++ b/luci-app-passwall/root/usr/share/passwall/test.sh @@ -95,40 +95,11 @@ url_test_node() { [ "${chn_list}" = "proxy" ] && probeUrl="www.baidu.com" result=$(${_curl} --max-time 5 -o /dev/null -I -skL -x ${curlx} ${curl_arg}${probeUrl}) pgrep -af "url_test_${node_id}" | awk '! /test\.sh/{print $1}' | xargs kill -9 >/dev/null 2>&1 - rm -rf "/tmp/etc/${CONFIG}/url_test_${node_id}"*.json + rm -rf /tmp/etc/${CONFIG}/*url_test_${node_id}*.json } echo $result } -test_node() { - local node_id=$1 - local _type=$(echo $(config_n_get ${node_id} type) | tr 'A-Z' 'a-z') - [ -n "${_type}" ] && { - if [ "${_type}" == "socks" ]; then - local _address=$(config_n_get ${node_id} address) - local _port=$(config_n_get ${node_id} port) - [ -n "${_address}" ] && [ -n "${_port}" ] && { - local curlx="socks5h://${_address}:${_port}" - local _username=$(config_n_get ${node_id} username) - local _password=$(config_n_get ${node_id} password) - [ -n "${_username}" ] && [ -n "${_password}" ] && curlx="socks5h://${_username}:${_password}@${_address}:${_port}" - } - else - local _tmp_port=$(/usr/share/${CONFIG}/app.sh get_new_port 61080 tcp) - /usr/share/${CONFIG}/app.sh run_socks flag="test_node_${node_id}" node=${node_id} bind=127.0.0.1 socks_port=${_tmp_port} config_file=test_node_${node_id}.json - local curlx="socks5h://127.0.0.1:${_tmp_port}" - fi - sleep 1s - _proxy_status=$(test_url "https://www.google.com/generate_204" ${retry_num} ${connect_timeout} "-x $curlx") - pgrep -af "test_node_${node_id}" | awk '! /test\.sh/{print $1}' | xargs kill -9 >/dev/null 2>&1 - rm -rf "/tmp/etc/${CONFIG}/test_node_${node_id}.json" - if [ "${_proxy_status}" -eq 200 ]; then - return 0 - fi - } - return 1 -} - arg1=$1 shift case $arg1 in