🎉 Sync 2026-08-28 01:19:01

This commit is contained in:
github-actions[bot] committed 2026-08-28 01:19:01 +08:00
1 parent 3ebef8b234
commit a0bd643038
27 files changed
+202 -141

No files matched your search

+25 -1
View File
@@ -2048,4 +2048,28 @@ function gen_wireguard_key()
public_key = public_key
}
end
end
end
function parseDNS(dns)
if not dns then return nil end
if true then
-- IPv6
-- [::1]:5053
local address, port = dns:match("%[(.-)%]:([0-9]+)$")
if address and datatypes.ip6addr(address) and datatypes.port(port) then
return address, port
end
-- [::1]
if is_ipv6(dns) then
return get_ipv6_only(dns), 53
end
end
if true then
-- 1.1.1.1:5053
local h, p = dns:match("^([^:]+):([^:]+)$")
if (h and p and datatypes.ip4addr(h) and datatypes.port(p)) then
return h, p
end
end
return dns, 53
end
@@ -1623,8 +1623,6 @@ function gen_config(var)
end
end)
end
local _remote_dns_ip = nil
local _remote_dns = {
tag = remote_dns_tag,
@@ -1635,14 +1633,15 @@ function gen_config(var)
_remote_dns.address = remote_dns_udp_server
_remote_dns.port = tonumber(remote_dns_udp_port) or 53
_remote_dns_proto = "udp"
_remote_dns_ip = remote_dns_udp_server
end
if remote_dns_tcp_server then
if api.is_ipv6(remote_dns_tcp_server) then
remote_dns_tcp_server = api.get_ipv6_full(remote_dns_tcp_server)
end
_remote_dns.address = "tcp://" .. remote_dns_tcp_server .. ":" .. tonumber(remote_dns_tcp_port) or 53
_remote_dns.port = tonumber(remote_dns_tcp_port) or 53
_remote_dns_proto = "tcp"
_remote_dns_ip = remote_dns_tcp_server
end
if remote_dns_doh_url and remote_dns_doh_host then
@@ -1651,7 +1650,6 @@ function gen_config(var)
end
_remote_dns.address = remote_dns_doh_url
_remote_dns.port = tonumber(remote_dns_doh_port) or 443
_remote_dns_ip = remote_dns_doh_ip
end
if _remote_dns.address then