diff --git a/luci-app-passwall/luasrc/controller/passwall.lua b/luci-app-passwall/luasrc/controller/passwall.lua index 4a46e1eb9..f5a412974 100644 --- a/luci-app-passwall/luasrc/controller/passwall.lua +++ b/luci-app-passwall/luasrc/controller/passwall.lua @@ -291,7 +291,7 @@ function connect_status() local socks_server = api.get_cache_var("GLOBAL_TCP_SOCKS_server") -- 兼容 curl 8.6 time_starttransfer 错误 - local curl_ver = luci.sys.exec("curl -V 2>/dev/null | head -n 1 | awk '{print $2}' | cut -d. -f1,2") or "0" + local curl_ver = luci.sys.exec("curl -V 2>/dev/null | head -n 1 | awk '{print $2}' | cut -d. -f1,2 | tr -d ' \n'") or "0" url = (curl_ver == "8.6") and "-w %{http_code}:%{time_appconnect} https://" .. url or "-w %{http_code}:%{time_starttransfer} http://" .. url diff --git a/luci-app-passwall/root/usr/share/passwall/test.sh b/luci-app-passwall/root/usr/share/passwall/test.sh index 0ac24e569..3c54f9805 100755 --- a/luci-app-passwall/root/usr/share/passwall/test.sh +++ b/luci-app-passwall/root/usr/share/passwall/test.sh @@ -74,7 +74,7 @@ url_test_node() { fi sleep 1s # 兼容 curl 8.6 time_starttransfer 错误 - local curl_ver=$(curl -V 2>/dev/null | head -n 1 | awk '{print $2}' | cut -d. -f1,2) + local curl_ver=$(curl -V 2>/dev/null | head -n 1 | awk '{print $2}' | cut -d. -f1,2 | tr -d ' \n') local curl_arg="-w %{http_code}:%{time_starttransfer} http://" [ "${curl_ver}" = "8.6" ] && curl_arg="-w %{http_code}:%{time_appconnect} https://" diff --git a/luci-app-xray/README.md b/luci-app-xray/README.md index 306872cbe..e2d17a942 100644 --- a/luci-app-xray/README.md +++ b/luci-app-xray/README.md @@ -44,6 +44,7 @@ Fork this repository and: * 2024-11-26 chore: bump status version * 2024-11-27 chore: use OpenWrt SDK 23.05.5 to avoid using apk +* 2025-01-05 fix: direct output; remove unused check of geoip direct list ## Changelog since 3.4.0 diff --git a/luci-app-xray/core/root/usr/share/xray/firewall_include.ut b/luci-app-xray/core/root/usr/share/xray/firewall_include.ut index 45a4194ff..31320f28c 100644 --- a/luci-app-xray/core/root/usr/share/xray/firewall_include.ut +++ b/luci-app-xray/core/root/usr/share/xray/firewall_include.ut @@ -471,6 +471,18 @@ meta mark 0x000000fe {{ counter }} accept comment "Xray non-IP DNS query outbound" meta mark {{ sprintf("0x%08x", general_mark) }} {{ counter }} accept comment "Xray specified mark {{ general_mark }} outbound" {{ counter }} jump tp_spec_lan_mf +{% if (!tcp4_enabled): %} + ip protocol tcp {{ counter }} accept +{% endif %} +{% if (!udp4_enabled): %} + ip protocol udp {{ counter }} accept +{% endif %} +{% if (!tcp6_enabled): %} + ip6 nexthdr tcp {{ counter }} accept +{% endif %} +{% if (!udp6_enabled): %} + ip6 nexthdr udp {{ counter }} accept +{% endif %} {{ counter }} goto tp_spec_lan_ac } diff --git a/luci-app-xray/core/root/usr/share/xray/gen_config.uc b/luci-app-xray/core/root/usr/share/xray/gen_config.uc index baa79aabb..86768df90 100644 --- a/luci-app-xray/core/root/usr/share/xray/gen_config.uc +++ b/luci-app-xray/core/root/usr/share/xray/gen_config.uc @@ -124,25 +124,23 @@ function rules(proxy, bridge, manual_tproxy, extra_inbound, fakedns) { ...function () { let direct_rules = []; if (geoip_existence) { - if (proxy["geoip_direct_code_list"] != null) { - const geoip_direct_code_list = map(proxy["geoip_direct_code_list"] || [], v => index(v, ":") > 0 ? v : `geoip:${v}`); - if (length(geoip_direct_code_list) > 0) { - push(direct_rules, { - type: "field", - inboundTag: [...built_in_tcp_inbounds, ...built_in_udp_inbounds], - outboundTag: "direct", - ip: geoip_direct_code_list - }); - } - const geoip_direct_code_list_v6 = map(proxy["geoip_direct_code_list_v6"] || [], v => index(v, ":") > 0 ? v : `geoip:${v}`); - if (length(geoip_direct_code_list_v6) > 0) { - push(direct_rules, { - type: "field", - inboundTag: [...tproxy_tcp_inbound_v6_tags, ...tproxy_udp_inbound_v6_tags], - outboundTag: "direct", - ip: geoip_direct_code_list_v6 - }); - } + const geoip_direct_code_list = map(proxy["geoip_direct_code_list"] || [], v => index(v, ":") > 0 ? v : `geoip:${v}`); + if (length(geoip_direct_code_list) > 0) { + push(direct_rules, { + type: "field", + inboundTag: [...built_in_tcp_inbounds, ...built_in_udp_inbounds], + outboundTag: "direct", + ip: geoip_direct_code_list + }); + } + const geoip_direct_code_list_v6 = map(proxy["geoip_direct_code_list_v6"] || [], v => index(v, ":") > 0 ? v : `geoip:${v}`); + if (length(geoip_direct_code_list_v6) > 0) { + push(direct_rules, { + type: "field", + inboundTag: [...tproxy_tcp_inbound_v6_tags, ...tproxy_udp_inbound_v6_tags], + outboundTag: "direct", + ip: geoip_direct_code_list_v6 + }); } push(direct_rules, { type: "field",