update 2025-01-05 12:22:41

This commit is contained in:
kenzok8 2025-01-05 12:22:41 +08:00
parent 5d2f2d4bdb
commit 020816f6bf
5 changed files with 32 additions and 21 deletions

View File

@ -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

View File

@ -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://"

View File

@ -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

View File

@ -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
}

View File

@ -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",