mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-05 01:44:16 +08:00
🎁 Sync 2026-04-09 04:39:26
This commit is contained in:
1 parent
a9bf61bd5e
commit
a4e69b8f7b
7 files changed
+69
-24
No files matched your search
@@ -566,7 +566,7 @@ o = s:taboption("DNS", DynamicList, "ad_url", translate("Anti-AD Rules Subscribe
|
|||||||
o:value("https://cdn.jsdelivr.net/gh/217heidai/adblockfilters@main/rules/adblockdomainlite.txt", translate("AdBlock DNS Filters"))
|
o:value("https://cdn.jsdelivr.net/gh/217heidai/adblockfilters@main/rules/adblockdomainlite.txt", translate("AdBlock DNS Filters"))
|
||||||
o:value("https://cdn.jsdelivr.net/gh/privacy-protection-tools/anti-AD/anti-ad-domains.txt", translate("anti-AD"))
|
o:value("https://cdn.jsdelivr.net/gh/privacy-protection-tools/anti-AD/anti-ad-domains.txt", translate("anti-AD"))
|
||||||
o.default = "https://cdn.jsdelivr.net/gh/217heidai/adblockfilters@main/rules/adblockdomainlite.txt"
|
o.default = "https://cdn.jsdelivr.net/gh/217heidai/adblockfilters@main/rules/adblockdomainlite.txt"
|
||||||
o.description = translate("Support Domain / Dnsmasq / Hosts format list")
|
o.description = translate("Support Domain / Dnsmasq / AdGuardHome / Hosts format list")
|
||||||
o:depends("adblock",1)
|
o:depends("adblock",1)
|
||||||
|
|
||||||
s:tab("Proxy", translate("Mode"))
|
s:tab("Proxy", translate("Mode"))
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ msgstr "上一次规则更新时间"
|
|||||||
msgid "Subscribe Rules Data"
|
msgid "Subscribe Rules Data"
|
||||||
msgstr "去广告规则"
|
msgstr "去广告规则"
|
||||||
|
|
||||||
msgid "Support Domain / Dnsmasq / Hosts format list"
|
msgid "Support Domain / Dnsmasq / AdGuardHome / Hosts format list"
|
||||||
msgstr "支持 域名/Dnsmasq/Hosts 格式的过滤列表"
|
msgstr "支持 域名/Dnsmasq/AdGuardHome/Hosts 格式的过滤列表"
|
||||||
|
|
||||||
msgid "Anti-AD Rules Subscribe"
|
msgid "Anti-AD Rules Subscribe"
|
||||||
msgstr "广告过滤列表URL"
|
msgstr "广告过滤列表URL"
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ process_url() {
|
|||||||
if (fmt == "" && $0 ~ /^\|\|[a-zA-Z0-9]/) fmt = "adguard"
|
if (fmt == "" && $0 ~ /^\|\|[a-zA-Z0-9]/) fmt = "adguard"
|
||||||
if (fmt == "" && $0 ~ /^(0\.0\.0\.0|127\.0\.0\.1)[[:space:]]/)
|
if (fmt == "" && $0 ~ /^(0\.0\.0\.0|127\.0\.0\.1)[[:space:]]/)
|
||||||
fmt = "hosts"
|
fmt = "hosts"
|
||||||
if (fmt == "" && $0 ~ /^[a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?)+$/)
|
if (fmt == "" && $0 ~ /^[a-zA-Z0-9]([a-zA-Z0-9.\-]*[a-zA-Z0-9])?\.[a-zA-Z]{2,}$/)
|
||||||
fmt = "plain"
|
fmt = "plain"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -722,6 +722,7 @@ o = s:option(ListValue, _n("domain_resolver"), translate("Domain DNS Resolve"),
|
|||||||
o:value("", translate("Auto"))
|
o:value("", translate("Auto"))
|
||||||
o:value("tcp", "TCP")
|
o:value("tcp", "TCP")
|
||||||
o:value("udp", "UDP")
|
o:value("udp", "UDP")
|
||||||
|
o:value("https", "HTTPS")
|
||||||
|
|
||||||
o = s:option(Value, _n("domain_resolver_dns"), "DNS")
|
o = s:option(Value, _n("domain_resolver_dns"), "DNS")
|
||||||
o.datatype = "or(ipaddr,ipaddrport)"
|
o.datatype = "or(ipaddr,ipaddrport)"
|
||||||
@@ -731,6 +732,12 @@ o.default = o.keylist[1]
|
|||||||
o:depends({ [_n("domain_resolver")] = "tcp" })
|
o:depends({ [_n("domain_resolver")] = "tcp" })
|
||||||
o:depends({ [_n("domain_resolver")] = "udp" })
|
o:depends({ [_n("domain_resolver")] = "udp" })
|
||||||
|
|
||||||
|
o = s:option(Value, _n("domain_resolver_dns_https"), "DNS")
|
||||||
|
o:value("https://120.53.53.53/dns-query", "DNSPod")
|
||||||
|
o:value("https://223.5.5.5/dns-query", "AliDNS")
|
||||||
|
o.default = o.keylist[1]
|
||||||
|
o:depends({ [_n("domain_resolver")] = "https" })
|
||||||
|
|
||||||
o = s:option(ListValue, _n("domain_strategy"), translate("Domain Strategy"), translate("If is domain name, The requested domain name will be resolved to IP before connect."))
|
o = s:option(ListValue, _n("domain_strategy"), translate("Domain Strategy"), translate("If is domain name, The requested domain name will be resolved to IP before connect."))
|
||||||
o.default = ""
|
o.default = ""
|
||||||
o:value("", translate("Auto"))
|
o:value("", translate("Auto"))
|
||||||
|
|||||||
@@ -780,6 +780,7 @@ o = s:option(ListValue, _n("domain_resolver"), translate("Domain DNS Resolve"),
|
|||||||
o:value("", translate("Auto"))
|
o:value("", translate("Auto"))
|
||||||
o:value("tcp", "TCP")
|
o:value("tcp", "TCP")
|
||||||
o:value("udp", "UDP")
|
o:value("udp", "UDP")
|
||||||
|
o:value("https", "HTTPS")
|
||||||
|
|
||||||
o = s:option(Value, _n("domain_resolver_dns"), "DNS")
|
o = s:option(Value, _n("domain_resolver_dns"), "DNS")
|
||||||
o.datatype = "or(ipaddr,ipaddrport)"
|
o.datatype = "or(ipaddr,ipaddrport)"
|
||||||
@@ -789,6 +790,12 @@ o.default = o.keylist[1]
|
|||||||
o:depends({ [_n("domain_resolver")] = "tcp" })
|
o:depends({ [_n("domain_resolver")] = "tcp" })
|
||||||
o:depends({ [_n("domain_resolver")] = "udp" })
|
o:depends({ [_n("domain_resolver")] = "udp" })
|
||||||
|
|
||||||
|
o = s:option(Value, _n("domain_resolver_dns_https"), "DNS")
|
||||||
|
o:value("https://120.53.53.53/dns-query", "DNSPod")
|
||||||
|
o:value("https://223.5.5.5/dns-query", "AliDNS")
|
||||||
|
o.default = o.keylist[1]
|
||||||
|
o:depends({ [_n("domain_resolver")] = "https" })
|
||||||
|
|
||||||
o = s:option(ListValue, _n("domain_strategy"), translate("Domain Strategy"), translate("If is domain name, The requested domain name will be resolved to IP before connect."))
|
o = s:option(ListValue, _n("domain_strategy"), translate("Domain Strategy"), translate("If is domain name, The requested domain name will be resolved to IP before connect."))
|
||||||
o.default = ""
|
o.default = ""
|
||||||
o:value("", translate("Auto"))
|
o:value("", translate("Auto"))
|
||||||
|
|||||||
@@ -163,15 +163,31 @@ function gen_outbound(flag, node, tag, proxy_table)
|
|||||||
detour = node.detour,
|
detour = node.detour,
|
||||||
}
|
}
|
||||||
|
|
||||||
if api.datatypes.hostname(node.address) and (node.domain_resolver == "tcp" or node.domain_resolver == "udp") and node.domain_resolver_dns then
|
if api.datatypes.hostname(node.address) and node.domain_resolver and (node.domain_resolver_dns or node.domain_resolver_dns_https) then
|
||||||
local dns_tag = node_id .. "_dns"
|
local dns_tag = node_id .. "_dns"
|
||||||
local dns_proto = node.domain_resolver
|
local dns_proto = node.domain_resolver
|
||||||
local server_address = node.domain_resolver_dns
|
local server_address
|
||||||
local server_port = 53
|
local server_port
|
||||||
local split = api.split(server_address, ":")
|
local server_path
|
||||||
if #split > 1 then
|
if dns_proto == "https" then
|
||||||
server_address = split[1]
|
local _a = api.parseURL(node.domain_resolver_dns_https)
|
||||||
server_port = tonumber(split[#split])
|
if _a then
|
||||||
|
server_address = _a.hostname
|
||||||
|
if _a.port then
|
||||||
|
server_port = _a.port
|
||||||
|
else
|
||||||
|
server_port = 443
|
||||||
|
end
|
||||||
|
server_path = _a.pathname
|
||||||
|
end
|
||||||
|
else
|
||||||
|
server_address = node.domain_resolver_dns
|
||||||
|
server_port = 53
|
||||||
|
local split = api.split(server_address, ":")
|
||||||
|
if #split > 1 then
|
||||||
|
server_address = split[1]
|
||||||
|
server_port = tonumber(split[#split])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
GLOBAL.DNS_SERVER[node_id] = {
|
GLOBAL.DNS_SERVER[node_id] = {
|
||||||
server = {
|
server = {
|
||||||
@@ -179,6 +195,8 @@ function gen_outbound(flag, node, tag, proxy_table)
|
|||||||
type = dns_proto,
|
type = dns_proto,
|
||||||
server = server_address,
|
server = server_address,
|
||||||
server_port = server_port,
|
server_port = server_port,
|
||||||
|
path = server_path,
|
||||||
|
domain_resolver = "local",
|
||||||
detour = "direct"
|
detour = "direct"
|
||||||
},
|
},
|
||||||
domain = node.address
|
domain = node.address
|
||||||
|
|||||||
@@ -399,25 +399,39 @@ function gen_outbound(flag, node, tag, proxy_table)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if api.datatypes.hostname(node.address) and (node.domain_resolver == "tcp" or node.domain_resolver == "udp") and node.domain_resolver_dns then
|
if api.datatypes.hostname(node.address) and node.domain_resolver and (node.domain_resolver_dns or node.domain_resolver_dns_https) then
|
||||||
local dns_tag = node_id .. "_dns"
|
local dns_tag = node_id .. "_dns"
|
||||||
local dns_proto = node.domain_resolver
|
local dns_proto = node.domain_resolver
|
||||||
local server_address = node.domain_resolver_dns
|
local config_address
|
||||||
local server_port = 53
|
local config_port
|
||||||
local split = api.split(server_address, ":")
|
if dns_proto == "https" then
|
||||||
if #split > 1 then
|
local _a = api.parseURL(node.domain_resolver_dns_https)
|
||||||
server_address = split[1]
|
if _a then
|
||||||
server_port = tonumber(split[#split])
|
config_address = node.domain_resolver_dns_https
|
||||||
end
|
if _a.port then
|
||||||
local config_address = server_address
|
config_port = _a.port
|
||||||
if dns_proto == "tcp" then
|
else
|
||||||
config_address = dns_proto .. "://" .. server_address .. ":" .. server_port
|
config_port = 443
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local server_address = node.domain_resolver_dns
|
||||||
|
local config_port = 53
|
||||||
|
local split = api.split(server_address, ":")
|
||||||
|
if #split > 1 then
|
||||||
|
server_address = split[1]
|
||||||
|
config_port = tonumber(split[#split])
|
||||||
|
end
|
||||||
|
config_address = server_address
|
||||||
|
if dns_proto == "tcp" then
|
||||||
|
config_address = dns_proto .. "://" .. server_address .. ":" .. config_port
|
||||||
|
end
|
||||||
end
|
end
|
||||||
GLOBAL.DNS_SERVER[node_id] = {
|
GLOBAL.DNS_SERVER[node_id] = {
|
||||||
tag = dns_tag,
|
tag = dns_tag,
|
||||||
queryStrategy = node.domain_strategy or "UseIP",
|
queryStrategy = node.domain_strategy or "UseIP",
|
||||||
address = config_address,
|
address = config_address,
|
||||||
port = server_port,
|
port = config_port,
|
||||||
domains = {"full:" .. node.address}
|
domains = {"full:" .. node.address}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -1674,7 +1688,6 @@ function gen_config(var)
|
|||||||
dns_server = nil
|
dns_server = nil
|
||||||
end
|
end
|
||||||
if dns_server then
|
if dns_server then
|
||||||
dns_server.finalQuery = true
|
|
||||||
dns_server.domains = value.domain
|
dns_server.domains = value.domain
|
||||||
if value.shunt_rule_name then
|
if value.shunt_rule_name then
|
||||||
dns_server.tag = "dns-in-" .. value.shunt_rule_name
|
dns_server.tag = "dns-in-" .. value.shunt_rule_name
|
||||||
|
|||||||
Reference in new issue
Block a user