diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index 3066fb679..50231c67e 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall -PKG_VERSION:=4.76-1 +PKG_VERSION:=4.76-2 PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm b/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm index cdda644f9..f6a209a00 100644 --- a/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm +++ b/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm @@ -114,20 +114,25 @@ local api = require "luci.passwall.api" } return ret; }, - query: function (param, src, default_value, tval = "1", fval = "0") { - var ret = "&" + param + "="; + query: function (param, src, default_value) { var obj = this.get(src); if (obj) { + var ret = "&" + param + "="; if (obj.type === "checkbox") { - return ret + (obj.checked === true ? tval : fval); + return ret + (obj.checked === true ? "1" : "0"); } else { var result = encodeURIComponent(obj.value); - if ((result == null || result.trim() == "") && default_value) - result = default_value; - return ret + result; + if (result == null || result.trim() == "") { + if (default_value) { + return ret + default_value; + } + return ""; + } else { + return ret + result; + } } } - return "" + return ""; } } opt.base = "cbid." + urlname + "." + sid; diff --git a/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq_add.lua b/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq_add.lua index c7f2c677c..0ea219e05 100644 --- a/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq_add.lua +++ b/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq_add.lua @@ -255,7 +255,8 @@ if not fs.access(CACHE_DNS_PATH) then fwd_dns = TUN_DNS if USE_DEFAULT_DNS == "chinadns_ng" and CHINADNS_DNS ~= "0" then fwd_dns = nil - else + end + if fwd_dns then local ipset_flag = setflag_4 .. "passwall_gfwlist," .. setflag_6 .. "passwall_gfwlist6" if NO_PROXY_IPV6 == "1" then ipset_flag = setflag_4 .. "passwall_gfwlist" @@ -269,7 +270,11 @@ if not fs.access(CACHE_DNS_PATH) then if NO_PROXY_IPV6 == "1" then set_domain_address(line, "::") 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) end end @@ -282,12 +287,15 @@ if not fs.access(CACHE_DNS_PATH) then if CHN_LIST ~= "0" then if fs.access("/usr/share/passwall/rules/chnlist") then 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 fwd_dns = TUN_DNS end - if CHN_LIST == "direct" and USE_DEFAULT_DNS == "chinadns_ng" and CHINADNS_DNS ~= "0" then - fwd_dns = nil - else + if fwd_dns then local ipset_flag = setflag_4 .. "passwall_chnroute," .. setflag_6 .. "passwall_chnroute6" if CHN_LIST == "proxy" 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 set_domain_address(line, "::") 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) end end @@ -432,7 +444,7 @@ if DNSMASQ_CONF_FILE ~= "nil" then conf_out:write("no-poll\n") conf_out:write("no-resolv\n") conf_out:close() - log(string.format(" - 以上所列以外及默认:%s", dnsmasq_default_dns)) + log(string.format(" - 默认:%s", dnsmasq_default_dns)) if FLAG == "default" then local f_out = io.open("/tmp/etc/passwall/default_DNS", "a") diff --git a/luci-app-passwall/root/usr/share/passwall/iptables.sh b/luci-app-passwall/root/usr/share/passwall/iptables.sh index 1fdb34ac8..397927adf 100755 --- a/luci-app-passwall/root/usr/share/passwall/iptables.sh +++ b/luci-app-passwall/root/usr/share/passwall/iptables.sh @@ -218,6 +218,11 @@ load_acl() { [ "${use_global_config}" = "1" ] && { tcp_node_remark=$(config_n_get $TCP_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 diff --git a/luci-app-passwall/root/usr/share/passwall/nftables.sh b/luci-app-passwall/root/usr/share/passwall/nftables.sh index 009af8764..68a4d1c1c 100755 --- a/luci-app-passwall/root/usr/share/passwall/nftables.sh +++ b/luci-app-passwall/root/usr/share/passwall/nftables.sh @@ -253,6 +253,11 @@ load_acl() { [ "${use_global_config}" = "1" ] && { tcp_node_remark=$(config_n_get $TCP_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 diff --git a/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/luci-app-passwall/root/usr/share/passwall/subscribe.lua index f6fe91483..7e36858ac 100755 --- a/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -601,7 +601,9 @@ local function processData(szType, content, add_mode, add_from) local params = {} for _, v in pairs(split(query[2], '&')) do 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 -- [2001:4860:4860::8888]:443 -- 8.8.8.8:443 @@ -845,7 +847,9 @@ local function processData(szType, content, add_mode, add_from) local params = {} for _, v in pairs(split(query[2], '&')) do 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 -- [2001:4860:4860::8888]:443 -- 8.8.8.8:443 @@ -1193,7 +1197,8 @@ local function parse_link(raw, add_mode, add_from) tinsert(node_list, result) end end - end, function () + end, function (err) + --log(err) log(v, "解析错误,跳过此节点。") end )