luci-app-passwall: fix https://github.com/xiaorouji/openwrt-passwall/issues/2132
This commit is contained in:
parent
b3b6b14198
commit
93b55e56ca
@ -211,7 +211,7 @@ if not fs.access(CACHE_DNS_PATH) then
|
||||
local address = t.address
|
||||
if datatypes.hostname(address) then
|
||||
set_domain_dns(address, LOCAL_DNS)
|
||||
set_domain_ipset(address, "vpsiplist,vpsiplist6")
|
||||
set_domain_ipset(address, setflag .. "vpsiplist," .. setflag .. "vpsiplist6")
|
||||
end
|
||||
end)
|
||||
log(string.format(" - 节点列表中的域名(vpsiplist):%s", LOCAL_DNS or "默认"))
|
||||
@ -221,19 +221,19 @@ if not fs.access(CACHE_DNS_PATH) then
|
||||
if line ~= "" and not line:find("#") then
|
||||
add_excluded_domain(line)
|
||||
set_domain_dns(line, LOCAL_DNS)
|
||||
set_domain_ipset(line, "whitelist,whitelist6")
|
||||
set_domain_ipset(line, setflag .. "whitelist," .. setflag .. "whitelist6")
|
||||
end
|
||||
end
|
||||
log(string.format(" - 域名白名单(whitelist):%s", LOCAL_DNS or "默认"))
|
||||
|
||||
local fwd_dns = LOCAL_DNS
|
||||
local ipset_flag = setflag.."whitelist,"..setflag.."whitelist6"
|
||||
local ipset_flag = setflag .. "whitelist," .. setflag .. "whitelist6"
|
||||
local no_ipv6
|
||||
if subscribe_proxy == "1" then
|
||||
fwd_dns = TUN_DNS
|
||||
ipset_flag = setflag.."blacklist,"..setflag.."blacklist6"
|
||||
ipset_flag = setflag .. "blacklist," .. setflag .. "blacklist6"
|
||||
if NO_PROXY_IPV6 == "1" then
|
||||
ipset_flag = setflag.."blacklist"
|
||||
ipset_flag = setflag .. "blacklist"
|
||||
no_ipv6 = true
|
||||
end
|
||||
if not only_global then
|
||||
@ -258,10 +258,10 @@ if not fs.access(CACHE_DNS_PATH) then
|
||||
for line in io.lines("/usr/share/passwall/rules/proxy_host") do
|
||||
if line ~= "" and not line:find("#") then
|
||||
add_excluded_domain(line)
|
||||
local ipset_flag = setflag.."blacklist,"..setflag.."blacklist6"
|
||||
local ipset_flag = setflag .. "blacklist," .. setflag .. "blacklist6"
|
||||
if NO_PROXY_IPV6 == "1" then
|
||||
set_domain_address(line, "::")
|
||||
ipset_flag = setflag.."blacklist"
|
||||
ipset_flag = setflag .. "blacklist"
|
||||
end
|
||||
if REMOTE_FAKEDNS == "1" then
|
||||
ipset_flag = nil
|
||||
@ -289,12 +289,12 @@ if not fs.access(CACHE_DNS_PATH) then
|
||||
|
||||
if _node_id == "_direct" then
|
||||
fwd_dns = LOCAL_DNS
|
||||
ipset_flag = setflag.."whitelist,"..setflag.."whitelist6"
|
||||
ipset_flag = setflag .. "whitelist," .. setflag .. "whitelist6"
|
||||
else
|
||||
fwd_dns = TUN_DNS
|
||||
ipset_flag = setflag.."shuntlist,"..setflag.."shuntlist6"
|
||||
ipset_flag = setflag .. "shuntlist," .. setflag .. "shuntlist6"
|
||||
if NO_PROXY_IPV6 == "1" then
|
||||
ipset_flag = setflag.."shuntlist"
|
||||
ipset_flag = setflag .. "shuntlist"
|
||||
no_ipv6 = true
|
||||
end
|
||||
if not only_global then
|
||||
@ -332,9 +332,9 @@ if not fs.access(CACHE_DNS_PATH) then
|
||||
local gfwlist_str = sys.exec('cat /usr/share/passwall/rules/gfwlist | grep -v -E "^#" | grep -v -E "' .. excluded_domain_str .. '"')
|
||||
for line in string.gmatch(gfwlist_str, "[^\r\n]+") do
|
||||
if line ~= "" then
|
||||
local ipset_flag = setflag.."gfwlist,"..setflag.."gfwlist6"
|
||||
local ipset_flag = setflag .. "gfwlist," .. setflag .. "gfwlist6"
|
||||
if NO_PROXY_IPV6 == "1" then
|
||||
ipset_flag = setflag.."gfwlist"
|
||||
ipset_flag = setflag .. "gfwlist"
|
||||
set_domain_address(line, "::")
|
||||
end
|
||||
if not only_global then
|
||||
@ -360,7 +360,7 @@ if not fs.access(CACHE_DNS_PATH) then
|
||||
for line in string.gmatch(chnlist_str, "[^\r\n]+") do
|
||||
if line ~= "" then
|
||||
set_domain_dns(line, fwd_dns)
|
||||
set_domain_ipset(line, "chnroute,chnroute6")
|
||||
set_domain_ipset(line, setflag .. "chnroute," .. setflag .. "chnroute6")
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -371,9 +371,9 @@ if not fs.access(CACHE_DNS_PATH) then
|
||||
local chnlist_str = sys.exec('cat /usr/share/passwall/rules/chnlist | grep -v -E "^#" | grep -v -E "' .. excluded_domain_str .. '"')
|
||||
for line in string.gmatch(chnlist_str, "[^\r\n]+") do
|
||||
if line ~= "" then
|
||||
local ipset_flag = setflag.."chnroute,"..setflag.."chnroute6"
|
||||
local ipset_flag = setflag .. "chnroute," .. setflag .. "chnroute6"
|
||||
if NO_PROXY_IPV6 == "1" then
|
||||
ipset_flag = setflag.."chnroute"
|
||||
ipset_flag = setflag .. "chnroute"
|
||||
set_domain_address(line, "::")
|
||||
end
|
||||
if not only_global then
|
||||
|
Loading…
Reference in New Issue
Block a user