mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-15 04:53:00 +08:00
✨ Sync 2026-04-11 23:43:05
This commit is contained in:
1 parent
7ecb8c8453
commit
198ffd908e
14 files changed
+233
-150
No files matched your search
@@ -1094,7 +1094,7 @@ function gen_config(var)
|
||||
end
|
||||
|
||||
function parse_rule_set(w, rs)
|
||||
-- Format: remote:https://raw.githubusercontent.com/lyc8503/sing-box-rules/rule-set-geosite/geosite-netflix.srs'
|
||||
-- Format: remote:https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-netflix.srs'
|
||||
-- Format: local:/usr/share/sing-box/geosite-netflix.srs'
|
||||
local result = nil
|
||||
if w and #w > 0 then
|
||||
@@ -1768,7 +1768,25 @@ function gen_config(var)
|
||||
reverse_mapping = true, -- After responding to a DNS query, a reverse mapping of the IP address is stored to provide the domain name for routing purposes.
|
||||
}
|
||||
|
||||
table.insert(dns.servers, {
|
||||
type = "local",
|
||||
tag = "local"
|
||||
})
|
||||
|
||||
if direct_dns_udp_server then
|
||||
table.insert(dns.servers, {
|
||||
tag = "direct",
|
||||
type = "udp",
|
||||
server = direct_dns_udp_server,
|
||||
server_port = tonumber(direct_dns_udp_port) or 53,
|
||||
detour = "direct",
|
||||
})
|
||||
end
|
||||
|
||||
for i, v in pairs(GLOBAL.DNS_SERVER) do
|
||||
if direct_dns_udp_server then
|
||||
v.server.domain_resolver = "direct"
|
||||
end
|
||||
table.insert(dns.servers, v.server)
|
||||
table.insert(dns.rules, {
|
||||
action = "route",
|
||||
@@ -1777,11 +1795,6 @@ function gen_config(var)
|
||||
})
|
||||
end
|
||||
|
||||
table.insert(dns.servers, {
|
||||
type = "local",
|
||||
tag = "local"
|
||||
})
|
||||
|
||||
local direct_strategy = "prefer_ipv6"
|
||||
if direct_dns_query_strategy == "UseIPv4" then
|
||||
direct_strategy = "ipv4_only"
|
||||
@@ -1836,6 +1849,20 @@ function gen_config(var)
|
||||
end
|
||||
end
|
||||
|
||||
if direct_dns_udp_server then
|
||||
local nodes_domain = {}
|
||||
local nodes_domain_text = sys.exec('uci show passwall2 | grep ".address=" | cut -d "\'" -f 2 | grep "[a-zA-Z]$" | sort -u')
|
||||
string.gsub(nodes_domain_text, '[^' .. "\r\n" .. ']+', function(w)
|
||||
table.insert(nodes_domain, w)
|
||||
end)
|
||||
if #nodes_domain > 0 then
|
||||
table.insert(dns_domain_rules, 1, {
|
||||
domain = nodes_domain,
|
||||
outboundTag = "direct"
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
remote_strategy = "prefer_ipv6"
|
||||
if remote_dns_query_strategy == "UseIPv4" then
|
||||
remote_strategy = "ipv4_only"
|
||||
@@ -1913,30 +1940,6 @@ function gen_config(var)
|
||||
}
|
||||
end
|
||||
|
||||
if direct_dns_udp_server then
|
||||
local domain = {}
|
||||
local nodes_domain_text = sys.exec('uci show passwall2 | grep ".address=" | cut -d "\'" -f 2 | grep "[a-zA-Z]$" | sort -u')
|
||||
string.gsub(nodes_domain_text, '[^' .. "\r\n" .. ']+', function(w)
|
||||
table.insert(domain, w)
|
||||
end)
|
||||
if #domain > 0 then
|
||||
table.insert(dns_domain_rules, 1, {
|
||||
domain = domain,
|
||||
outboundTag = "direct"
|
||||
})
|
||||
end
|
||||
|
||||
local server_port = tonumber(direct_dns_udp_port) or 53
|
||||
|
||||
table.insert(dns.servers, {
|
||||
tag = "direct",
|
||||
type = "udp",
|
||||
server = direct_dns_udp_server,
|
||||
server_port = server_port,
|
||||
detour = "direct",
|
||||
})
|
||||
end
|
||||
|
||||
local default_dns_flag = "remote"
|
||||
if node_id and redir_port then
|
||||
local node = get_node_by_id(node_id)
|
||||
|
||||
Reference in new issue
Block a user