luci-app-passwall: sync with upstream source
This commit is contained in:
parent
9cce728e3e
commit
8d3b3f5ccb
@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=3.5
|
||||
PKG_RELEASE:=11
|
||||
PKG_RELEASE:=12
|
||||
PKG_DATA:=20200217
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@ -100,36 +100,37 @@ for i = 1, socks5_node_num, 1 do
|
||||
for _, key in pairs(key_table) do o:value(key, n[key]) end
|
||||
end
|
||||
|
||||
---- China DNS Server
|
||||
o = s:option(Value, "up_china_dns", translate("China DNS Server") .. "(UDP)",
|
||||
translate(
|
||||
"If you want to work with other DNS acceleration services, use the default.<br />Example: 127.0.0.1#6053 ,Represents DNS on using 127.0.0.1 the 6053 port. such as SmartDNS, AdGuard Home...<br />Only use two at most, english comma separation, If you do not fill in the # and the following port, you are using port 53.<br />If you use custom, unless you know what you're doing, setting it up incorrectly can cause your stuck to crash !"))
|
||||
o.default = "default"
|
||||
o:value("default", translate("default"))
|
||||
o:value("dnsbyisp", translate("dnsbyisp"))
|
||||
o:value("223.5.5.5", "223.5.5.5 (" .. translate("Ali") .. "DNS)")
|
||||
o:value("223.6.6.6", "223.6.6.6 (" .. translate("Ali") .. "DNS)")
|
||||
o:value("114.114.114.114", "114.114.114.114 (114DNS)")
|
||||
o:value("114.114.115.115", "114.114.115.115 (114DNS)")
|
||||
o:value("119.29.29.29", "119.29.29.29 (DNSPOD DNS)")
|
||||
o:value("182.254.116.116", "182.254.116.116 (DNSPOD DNS)")
|
||||
o:value("1.2.4.8", "1.2.4.8 (CNNIC DNS)")
|
||||
o:value("210.2.4.8", "210.2.4.8 (CNNIC DNS)")
|
||||
o:value("180.76.76.76", "180.76.76.76 (" .. translate("Baidu") .. "DNS)")
|
||||
if tonumber(api.uci_get_type("global_other", "wangejibadns", 0)) == 1 then
|
||||
o = s:option(Value, "up_china_dns", translate("China DNS Server") .. "(UDP)",
|
||||
translate(
|
||||
"If you want to work with other DNS acceleration services, use the default.<br />Example: 127.0.0.1#6053 ,Represents DNS on using 127.0.0.1 the 6053 port. such as SmartDNS, AdGuard Home...<br />Only use two at most, english comma separation, If you do not fill in the # and the following port, you are using port 53.<br />If you use custom, unless you know what you're doing, setting it up incorrectly can cause your stuck to crash !"))
|
||||
o.default = "default"
|
||||
o:value("default", translate("default"))
|
||||
o:value("dnsbyisp", translate("dnsbyisp"))
|
||||
o:value("223.5.5.5", "223.5.5.5 (" .. translate("Ali") .. "DNS)")
|
||||
o:value("223.6.6.6", "223.6.6.6 (" .. translate("Ali") .. "DNS)")
|
||||
o:value("114.114.114.114", "114.114.114.114 (114DNS)")
|
||||
o:value("114.114.115.115", "114.114.115.115 (114DNS)")
|
||||
o:value("119.29.29.29", "119.29.29.29 (DNSPOD DNS)")
|
||||
o:value("182.254.116.116", "182.254.116.116 (DNSPOD DNS)")
|
||||
o:value("1.2.4.8", "1.2.4.8 (CNNIC DNS)")
|
||||
o:value("210.2.4.8", "210.2.4.8 (CNNIC DNS)")
|
||||
o:value("180.76.76.76", "180.76.76.76 (" .. translate("Baidu") .. "DNS)")
|
||||
end
|
||||
|
||||
---- DNS Forward Mode
|
||||
o = s:option(ListValue, "dns_mode", translate("DNS Mode"), translate(
|
||||
"if has problem, please try another mode.<br />if you use no patterns are used, DNS of wan will be used by default as upstream of dnsmasq."))
|
||||
o.rmempty = false
|
||||
o:reset_values()
|
||||
if is_finded("chinadns-ng") then o:value("chinadns-ng", "ChinaDNS-NG") end
|
||||
if is_finded("chinadns-ng") and tonumber(api.uci_get_type("global_other", "wangejibadns", 0)) == 1 then o:value("chinadns-ng", "ChinaDNS-NG") end
|
||||
if is_installed("pdnsd") or is_installed("pdnsd-alt") or is_finded("pdnsd") then
|
||||
o:value("pdnsd", "pdnsd")
|
||||
end
|
||||
if is_finded("dns2socks") then
|
||||
o:value("dns2socks",
|
||||
"dns2socks + " .. translate("Use Socks5 Node Resolve DNS"))
|
||||
end
|
||||
if is_installed("pdnsd") or is_installed("pdnsd-alt") or is_finded("pdnsd") then
|
||||
o:value("pdnsd", "pdnsd")
|
||||
end
|
||||
o:value("local_7913", translate("Use local port 7913 as DNS"))
|
||||
o:value("nonuse", translate("No patterns are used"))
|
||||
|
||||
|
||||
@ -215,6 +215,11 @@ load_config() {
|
||||
LOCALHOST_PROXY_MODE=$(config_t_get global localhost_proxy_mode default)
|
||||
[ "$LOCALHOST_PROXY_MODE" == "default" ] && LOCALHOST_PROXY_MODE=$PROXY_MODE
|
||||
UP_CHINA_DNS=$(config_t_get global up_china_dns dnsbyisp)
|
||||
wangejibadns=$(config_t_get global_other wangejibadns 0)
|
||||
[ "$wangejibadns" == "0" ] && {
|
||||
UP_CHINA_DNS="default"
|
||||
[ "$DNS_MODE" == "chinadns-ng" ] && DNS_MODE="pdnsd" && use_udp_node_resolve_dns=0
|
||||
}
|
||||
[ "$UP_CHINA_DNS" == "default" ] && IS_DEFAULT_CHINA_DNS=1
|
||||
[ ! -f "$RESOLVFILE" -o ! -s "$RESOLVFILE" ] && RESOLVFILE=/tmp/resolv.conf.auto
|
||||
[ "$UP_CHINA_DNS" == "dnsbyisp" -o "$UP_CHINA_DNS" == "default" ] && {
|
||||
|
||||
@ -44,7 +44,7 @@ local function split(full, sep)
|
||||
full = full:gsub("%z", "") -- 这里不是很清楚 有时候结尾带个\0
|
||||
local off, result = 1, {}
|
||||
while true do
|
||||
local nEnd = full:find(sep, off)
|
||||
local nStart, nEnd = full:find(sep, off)
|
||||
if not nEnd then
|
||||
local res = ssub(full, off, slen(full))
|
||||
if #res > 0 then -- 过滤掉 \0
|
||||
@ -52,8 +52,8 @@ local function split(full, sep)
|
||||
end
|
||||
break
|
||||
else
|
||||
tinsert(result, ssub(full, off, nEnd - 1))
|
||||
off = nEnd + slen(sep)
|
||||
tinsert(result, ssub(full, off, nStart - 1))
|
||||
off = nEnd + 1
|
||||
end
|
||||
end
|
||||
return result
|
||||
@ -113,7 +113,7 @@ local function processData(szType, content, add_mode)
|
||||
is_sub = (add_mode and add_mode == "导入") and 0 or 1
|
||||
}
|
||||
if szType == 'ssr' then
|
||||
local dat = split(content, "/\\?")
|
||||
local dat = split(content, "/%?")
|
||||
local hostInfo = split(dat[1], ':')
|
||||
result.type = "SSR"
|
||||
result.address = hostInfo[1]
|
||||
@ -127,7 +127,7 @@ local function processData(szType, content, add_mode)
|
||||
local t = split(v, '=')
|
||||
params[t[1]] = t[2]
|
||||
end
|
||||
result.obfs_param = base64Decode(params.bfsparam)
|
||||
result.obfs_param = base64Decode(params.obfsparam)
|
||||
result.protocol_param = base64Decode(params.protoparam)
|
||||
local group = base64Decode(params.group)
|
||||
if group then
|
||||
@ -199,22 +199,22 @@ local function processData(szType, content, add_mode)
|
||||
result.remarks = UrlDecode(alias)
|
||||
result.type = "SS"
|
||||
result.address = host[1]
|
||||
if host[2]:find("/\\?") then
|
||||
local query = split(host[2], "/\\?")
|
||||
if host[2]:find("/%?") then
|
||||
local query = split(host[2], "/%?")
|
||||
result.port = query[1]
|
||||
local params = {}
|
||||
for _, v in pairs(split(query[2], '&')) do
|
||||
local t = split(v, '=')
|
||||
params[t[1]] = t[2]
|
||||
end
|
||||
if params.lugin then
|
||||
local plugin_info = UrlDecode(params.lugin)
|
||||
if params.plugin then
|
||||
local plugin_info = UrlDecode(params.plugin)
|
||||
local idx_pn = plugin_info:find(";")
|
||||
if idx_pn then
|
||||
result.ss_plugin = plugin_info:sub(1, idx_pn - 1)
|
||||
result.ss_plugin_opts = plugin_info:sub(idx_pn + 1, #plugin_info)
|
||||
result.ss_plugin = plugin_info:sub(1, idx_pn - 1)
|
||||
result.ss_plugin_opts = plugin_info:sub(idx_pn + 1, #plugin_info)
|
||||
else
|
||||
result.ss_plugin = plugin_info
|
||||
result.ss_plugin = plugin_info
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user