luci-app-passwall: sync upstream
This commit is contained in:
parent
3da2d267bd
commit
b3d36c738e
@ -6,7 +6,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-passwall
|
PKG_NAME:=luci-app-passwall
|
||||||
PKG_VERSION:=4.76-1
|
PKG_VERSION:=4.76-2
|
||||||
PKG_RELEASE:=
|
PKG_RELEASE:=
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS:= \
|
PKG_CONFIG_DEPENDS:= \
|
||||||
|
@ -114,20 +114,25 @@ local api = require "luci.passwall.api"
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
query: function (param, src, default_value, tval = "1", fval = "0") {
|
query: function (param, src, default_value) {
|
||||||
var ret = "&" + param + "=";
|
|
||||||
var obj = this.get(src);
|
var obj = this.get(src);
|
||||||
if (obj) {
|
if (obj) {
|
||||||
|
var ret = "&" + param + "=";
|
||||||
if (obj.type === "checkbox") {
|
if (obj.type === "checkbox") {
|
||||||
return ret + (obj.checked === true ? tval : fval);
|
return ret + (obj.checked === true ? "1" : "0");
|
||||||
} else {
|
} else {
|
||||||
var result = encodeURIComponent(obj.value);
|
var result = encodeURIComponent(obj.value);
|
||||||
if ((result == null || result.trim() == "") && default_value)
|
if (result == null || result.trim() == "") {
|
||||||
result = default_value;
|
if (default_value) {
|
||||||
return ret + result;
|
return ret + default_value;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return ret + result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ""
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
opt.base = "cbid." + urlname + "." + sid;
|
opt.base = "cbid." + urlname + "." + sid;
|
||||||
|
@ -255,7 +255,8 @@ if not fs.access(CACHE_DNS_PATH) then
|
|||||||
fwd_dns = TUN_DNS
|
fwd_dns = TUN_DNS
|
||||||
if USE_DEFAULT_DNS == "chinadns_ng" and CHINADNS_DNS ~= "0" then
|
if USE_DEFAULT_DNS == "chinadns_ng" and CHINADNS_DNS ~= "0" then
|
||||||
fwd_dns = nil
|
fwd_dns = nil
|
||||||
else
|
end
|
||||||
|
if fwd_dns then
|
||||||
local ipset_flag = setflag_4 .. "passwall_gfwlist," .. setflag_6 .. "passwall_gfwlist6"
|
local ipset_flag = setflag_4 .. "passwall_gfwlist," .. setflag_6 .. "passwall_gfwlist6"
|
||||||
if NO_PROXY_IPV6 == "1" then
|
if NO_PROXY_IPV6 == "1" then
|
||||||
ipset_flag = setflag_4 .. "passwall_gfwlist"
|
ipset_flag = setflag_4 .. "passwall_gfwlist"
|
||||||
@ -269,7 +270,11 @@ if not fs.access(CACHE_DNS_PATH) then
|
|||||||
if NO_PROXY_IPV6 == "1" then
|
if NO_PROXY_IPV6 == "1" then
|
||||||
set_domain_address(line, "::")
|
set_domain_address(line, "::")
|
||||||
end
|
end
|
||||||
set_domain_dns(line, fwd_dns)
|
if dnsmasq_default_dns == fwd_dns then
|
||||||
|
fwd_dns = nil
|
||||||
|
else
|
||||||
|
set_domain_dns(line, fwd_dns)
|
||||||
|
end
|
||||||
set_domain_ipset(line, ipset_flag)
|
set_domain_ipset(line, ipset_flag)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -282,12 +287,15 @@ if not fs.access(CACHE_DNS_PATH) then
|
|||||||
if CHN_LIST ~= "0" then
|
if CHN_LIST ~= "0" then
|
||||||
if fs.access("/usr/share/passwall/rules/chnlist") then
|
if fs.access("/usr/share/passwall/rules/chnlist") then
|
||||||
fwd_dns = LOCAL_DNS
|
fwd_dns = LOCAL_DNS
|
||||||
|
if CHN_LIST == "direct" then
|
||||||
|
if USE_DEFAULT_DNS == "chinadns_ng" and CHINADNS_DNS ~= "0" then
|
||||||
|
fwd_dns = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
if CHN_LIST == "proxy" then
|
if CHN_LIST == "proxy" then
|
||||||
fwd_dns = TUN_DNS
|
fwd_dns = TUN_DNS
|
||||||
end
|
end
|
||||||
if CHN_LIST == "direct" and USE_DEFAULT_DNS == "chinadns_ng" and CHINADNS_DNS ~= "0" then
|
if fwd_dns then
|
||||||
fwd_dns = nil
|
|
||||||
else
|
|
||||||
local ipset_flag = setflag_4 .. "passwall_chnroute," .. setflag_6 .. "passwall_chnroute6"
|
local ipset_flag = setflag_4 .. "passwall_chnroute," .. setflag_6 .. "passwall_chnroute6"
|
||||||
if CHN_LIST == "proxy" then
|
if CHN_LIST == "proxy" then
|
||||||
if NO_PROXY_IPV6 == "1" then
|
if NO_PROXY_IPV6 == "1" then
|
||||||
@ -303,7 +311,11 @@ if not fs.access(CACHE_DNS_PATH) then
|
|||||||
if CHN_LIST == "proxy" and NO_PROXY_IPV6 == "1" then
|
if CHN_LIST == "proxy" and NO_PROXY_IPV6 == "1" then
|
||||||
set_domain_address(line, "::")
|
set_domain_address(line, "::")
|
||||||
end
|
end
|
||||||
set_domain_dns(line, fwd_dns)
|
if dnsmasq_default_dns == fwd_dns then
|
||||||
|
fwd_dns = nil
|
||||||
|
else
|
||||||
|
set_domain_dns(line, fwd_dns)
|
||||||
|
end
|
||||||
set_domain_ipset(line, ipset_flag)
|
set_domain_ipset(line, ipset_flag)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -432,7 +444,7 @@ if DNSMASQ_CONF_FILE ~= "nil" then
|
|||||||
conf_out:write("no-poll\n")
|
conf_out:write("no-poll\n")
|
||||||
conf_out:write("no-resolv\n")
|
conf_out:write("no-resolv\n")
|
||||||
conf_out:close()
|
conf_out:close()
|
||||||
log(string.format(" - 以上所列以外及默认:%s", dnsmasq_default_dns))
|
log(string.format(" - 默认:%s", dnsmasq_default_dns))
|
||||||
|
|
||||||
if FLAG == "default" then
|
if FLAG == "default" then
|
||||||
local f_out = io.open("/tmp/etc/passwall/default_DNS", "a")
|
local f_out = io.open("/tmp/etc/passwall/default_DNS", "a")
|
||||||
|
@ -218,6 +218,11 @@ load_acl() {
|
|||||||
[ "${use_global_config}" = "1" ] && {
|
[ "${use_global_config}" = "1" ] && {
|
||||||
tcp_node_remark=$(config_n_get $TCP_NODE remarks)
|
tcp_node_remark=$(config_n_get $TCP_NODE remarks)
|
||||||
udp_node_remark=$(config_n_get $UDP_NODE remarks)
|
udp_node_remark=$(config_n_get $UDP_NODE remarks)
|
||||||
|
use_direct_list=${USE_DIRECT_LIST}
|
||||||
|
use_proxy_list=${USE_PROXY_LIST}
|
||||||
|
use_block_list=${USE_BLOCK_LIST}
|
||||||
|
use_gfw_list=${USE_GFW_LIST}
|
||||||
|
chn_list=${CHN_LIST}
|
||||||
}
|
}
|
||||||
|
|
||||||
for i in $(cat ${TMP_ACL_PATH}/${sid}/rule_list); do
|
for i in $(cat ${TMP_ACL_PATH}/${sid}/rule_list); do
|
||||||
|
@ -253,6 +253,11 @@ load_acl() {
|
|||||||
[ "${use_global_config}" = "1" ] && {
|
[ "${use_global_config}" = "1" ] && {
|
||||||
tcp_node_remark=$(config_n_get $TCP_NODE remarks)
|
tcp_node_remark=$(config_n_get $TCP_NODE remarks)
|
||||||
udp_node_remark=$(config_n_get $UDP_NODE remarks)
|
udp_node_remark=$(config_n_get $UDP_NODE remarks)
|
||||||
|
use_direct_list=${USE_DIRECT_LIST}
|
||||||
|
use_proxy_list=${USE_PROXY_LIST}
|
||||||
|
use_block_list=${USE_BLOCK_LIST}
|
||||||
|
use_gfw_list=${USE_GFW_LIST}
|
||||||
|
chn_list=${CHN_LIST}
|
||||||
}
|
}
|
||||||
|
|
||||||
for i in $(cat ${TMP_ACL_PATH}/${sid}/rule_list); do
|
for i in $(cat ${TMP_ACL_PATH}/${sid}/rule_list); do
|
||||||
|
@ -601,7 +601,9 @@ local function processData(szType, content, add_mode, add_from)
|
|||||||
local params = {}
|
local params = {}
|
||||||
for _, v in pairs(split(query[2], '&')) do
|
for _, v in pairs(split(query[2], '&')) do
|
||||||
local t = split(v, '=')
|
local t = split(v, '=')
|
||||||
params[string.lower(t[1])] = UrlDecode(t[2])
|
if #t > 1 then
|
||||||
|
params[string.lower(t[1])] = UrlDecode(t[2])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- [2001:4860:4860::8888]:443
|
-- [2001:4860:4860::8888]:443
|
||||||
-- 8.8.8.8:443
|
-- 8.8.8.8:443
|
||||||
@ -845,7 +847,9 @@ local function processData(szType, content, add_mode, add_from)
|
|||||||
local params = {}
|
local params = {}
|
||||||
for _, v in pairs(split(query[2], '&')) do
|
for _, v in pairs(split(query[2], '&')) do
|
||||||
local t = split(v, '=')
|
local t = split(v, '=')
|
||||||
params[string.lower(t[1])] = UrlDecode(t[2])
|
if #t > 1 then
|
||||||
|
params[string.lower(t[1])] = UrlDecode(t[2])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- [2001:4860:4860::8888]:443
|
-- [2001:4860:4860::8888]:443
|
||||||
-- 8.8.8.8:443
|
-- 8.8.8.8:443
|
||||||
@ -1193,7 +1197,8 @@ local function parse_link(raw, add_mode, add_from)
|
|||||||
tinsert(node_list, result)
|
tinsert(node_list, result)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end, function ()
|
end, function (err)
|
||||||
|
--log(err)
|
||||||
log(v, "解析错误,跳过此节点。")
|
log(v, "解析错误,跳过此节点。")
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user