diff --git a/luci-app-godproxy/rulesupdate.log b/luci-app-godproxy/rulesupdate.log index e217694ad..9495f9bae 100644 --- a/luci-app-godproxy/rulesupdate.log +++ b/luci-app-godproxy/rulesupdate.log @@ -1,47 +1,51 @@ -2021-11-20 11:38:33: ------------------- 规则更新 ----------------------- -2021-11-20 11:38:33: ==================================================== -2021-11-20 11:38:33: 开始更新koolproxy的规则,请等待... -2021-11-20 11:38:33: --------------------------------------------------------------------------------------- -2021-11-20 11:38:34: ABP规则的本地版本号: 202111201046 -2021-11-20 11:38:34: ABP规则的在线版本号: 202111201126 -2021-11-20 11:38:34: 检测到 ABP规则 已更新,现在开始更新... -2021-11-20 11:38:34: 将临时的ABP规则文件移动到指定位置 -2021-11-20 11:38:34: --------------------------------------------------------------------------------------- -2021-11-20 11:38:35: Fanboy规则本地版本号: 202111201050 -2021-11-20 11:38:35: Fanboy规则在线版本号: 202111201100 -2021-11-20 11:38:35: 检测到新版本 Fanboy规则 列表,开始更新... -2021-11-20 11:38:35: 将临时文件覆盖到原始 Fanboy规则 文件 -2021-11-20 11:38:36: --------------------------------------------------------------------------------------- -2021-11-20 11:38:36: Yhosts规则本地版本号: 202111082343 -2021-11-20 11:38:36: Yhosts规则在线版本号: 202111082343 -2021-11-20 11:38:36: 检测到Yhosts本地版本号和在线版本号相同,那还更新个毛啊! -2021-11-20 11:38:36: --------------------------------------------------------------------------------------- -2021-11-20 11:38:36: Antiad规则本地版本号: 20211120024124 -2021-11-20 11:38:36: Antiad规则在线版本号: 20211120024124 -2021-11-20 11:38:36: 检测到 Antiad规则 本地版本号和在线版本号相同,那还更新个毛啊! -2021-11-20 11:38:36: --------------------------------------------------------------------------------------- -2021-11-20 11:38:36: StevenBlack规则本地版本号: 18 November 2021 -2021-11-20 11:38:36: StevenBlack规则在线版本号: 18 November 2021 -2021-11-20 11:38:36: 检测到 StevenBlack规则 本地版本号和在线版本号相同,那还更新个毛啊! -2021-11-20 11:38:36: --------------------------------------------------------------------------------------- -2021-11-20 11:38:36: AdGuard DNS规则本地版本号: 2021-11-20T06:05:15.020Z -2021-11-20 11:38:36: AdGuard DNS规则在线版本号: 2021-11-20T06:05:15.020Z -2021-11-20 11:38:36: 检测到 AdGuard DNS规则 本地版本号和在线版本号相同,那还更新个毛啊! -2021-11-20 11:38:36: 正在优化 ABP规则。。。。。 -2021-11-20 11:38:48: 正在优化 Fanboy规则。。。。。 -2021-11-20 11:38:53: 跳过优化 补充规则Yhosts。。。。。 -2021-11-20 11:38:53: 跳过优化 补充规则Antiad。。。。。 -2021-11-20 11:38:53: 跳过优化 补充规则StevenBlack。。。。。 -2021-11-20 11:38:53: 跳过优化 补充规则 AdGuard DNS。。。。。 -2021-11-20 11:38:53: 所有规则更新并优化完毕! -2021-11-20 11:38:53: ==================================================== -2021-11-20 11:38:55: -------------------ABP规则 version 202111201126 -2021-11-20 11:38:55: -------------------Fanboy规则 version 202111201100 -2021-11-20 11:38:55: -------------------Yhosts规则 version 202111082343 -2021-11-20 11:38:55: -------------------Antiad规则 version 20211120024124 -2021-11-20 11:38:55: -------------------AdGuard DNS规则 version 2021-11-20T06:05:15.020Z -2021-11-20 11:38:55: -------------------StevenBlack规则 version 18 November 2021 -2021-11-20 11:38:55: -------------------静态规则 version 2021-10-07 18:00 -2021-11-20 11:38:55: -------------------乘风视频 version 202111131 -2021-11-20 11:38:55: ------------------- 内置规则更新成功! ------------------- -2021-11-20 11:38:55: ------------------- 规则更新成功! ------------------- +2021-11-20 16:32:28: ------------------- 规则更新 ----------------------- +2021-11-20 16:32:28: ==================================================== +2021-11-20 16:32:28: 开始更新koolproxy的规则,请等待... +2021-11-20 16:32:28: --------------------------------------------------------------------------------------- +2021-11-20 16:32:30: ABP规则的本地版本号: 202111201616 +2021-11-20 16:32:30: ABP规则的在线版本号: 202111201616 +2021-11-20 16:32:30: 检测到 ABP规则本地版本号和在线版本号相同,那还更新个毛啊! +2021-11-20 16:32:30: --------------------------------------------------------------------------------------- +2021-11-20 16:32:31: Fanboy规则本地版本号: 202111201600 +2021-11-20 16:32:31: Fanboy规则在线版本号: 202111201600 +2021-11-20 16:32:31: 检测到 Fanboy规则 本地版本号和在线版本号相同,那还更新个毛啊! +2021-11-20 16:32:31: --------------------------------------------------------------------------------------- +2021-11-20 16:32:31: Yhosts规则本地版本号: 202111082343 +2021-11-20 16:32:31: Yhosts规则在线版本号: 202111082343 +2021-11-20 16:32:31: 检测到Yhosts本地版本号和在线版本号相同,那还更新个毛啊! +2021-11-20 16:32:31: --------------------------------------------------------------------------------------- +2021-11-20 16:32:31: Antiad规则本地版本号: 20211120024124 +2021-11-20 16:32:31: Antiad规则在线版本号: 20211120024124 +2021-11-20 16:32:31: 检测到 Antiad规则 本地版本号和在线版本号相同,那还更新个毛啊! +2021-11-20 16:32:31: --------------------------------------------------------------------------------------- +2021-11-20 16:32:31: StevenBlack规则本地版本号: 18 November 2021 +2021-11-20 16:32:31: StevenBlack规则在线版本号: 18 November 2021 +2021-11-20 16:32:31: 检测到 StevenBlack规则 本地版本号和在线版本号相同,那还更新个毛啊! +2021-11-20 16:32:31: --------------------------------------------------------------------------------------- +2021-11-20 16:32:31: AdGuard DNS规则本地版本号: 2021-11-20T12:07:18.124Z +2021-11-20 16:32:31: AdGuard DNS规则在线版本号: 2021-11-20T12:07:18.124Z +2021-11-20 16:32:31: 检测到 AdGuard DNS规则 本地版本号和在线版本号相同,那还更新个毛啊! +2021-11-20 16:32:31: --------------------------------------------------------------------------------------- +2021-11-20 16:32:32: ADgk规则本地版本号: +2021-11-20 16:32:32: ADgk规则在线版本号: 20211120183731 +2021-11-20 16:32:32: 检测到新版本 ADgk规则 列表,开始更新... +2021-11-20 16:32:32: 将临时文件覆盖到原始 ADgk规则 文件 +2021-11-20 16:32:32: 跳过优化 ABP规则。。。。。 +2021-11-20 16:32:32: 跳过优化 Fanboy规则。。。。。 +2021-11-20 16:32:32: 跳过优化 补充规则Yhosts。。。。。 +2021-11-20 16:32:32: 跳过优化 补充规则Antiad。。。。。 +2021-11-20 16:32:32: 跳过优化 补充规则StevenBlack。。。。。 +2021-11-20 16:32:32: 跳过优化 补充规则 AdGuard DNS。。。。。 +2021-11-20 16:32:32: 正在优化 ADgk规则。。。。。 +2021-11-20 16:32:43: 所有规则更新并优化完毕! +2021-11-20 16:32:43: ==================================================== +2021-11-20 16:32:44: -------------------ABP规则 version 202111201616 +2021-11-20 16:32:44: -------------------Fanboy规则 version 202111201600 +2021-11-20 16:32:44: -------------------Yhosts规则 version 202111082343 +2021-11-20 16:32:44: -------------------Antiad规则 version 20211120024124 +2021-11-20 16:32:44: -------------------AdGuard DNS规则 version +2021-11-20 16:32:44: -------------------StevenBlack规则 version 18 November 2021 +2021-11-20 16:32:44: -------------------静态规则 version 2021-10-07 18:00 +2021-11-20 16:32:44: -------------------乘风视频 version 202111131 +2021-11-20 16:32:44: ------------------- 内置规则更新成功! ------------------- +2021-11-20 16:32:44: ------------------- 规则更新成功! ------------------- diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua index da2711c48..4a9dd675e 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua @@ -36,19 +36,15 @@ sys.net.mac_hints(function(e, t) } end) -o = s:option(DummyValue, "_source", translate("Source")) +o = s:option(DummyValue, "sources", translate("Source")) o.rawhtml = true o.cfgvalue = function(t, n) local e = '' - local v = '' - local source = m:get(n, "source") or "ip_mac" - v = m:get(n, source) or "" + local v = Value.cfgvalue(t, n) or '' string.gsub(v, '[^' .. " " .. ']+', function(w) local a = w - if source == "ip_mac" and mac_t[w] then + if mac_t[w] then a = a .. ' (' .. mac_t[w].ip .. ')' - elseif source == "ipset" then - a = 'ipset: ' .. a end if #e > 0 then e = e .. "
" diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua index 0c23c6e86..bee188241 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua @@ -49,21 +49,6 @@ o = s:option(Value, "remarks", translate("Remarks")) o.default = arg[1] o.rmempty = true ----- Source -source = s:option(ListValue, "source", translate("Source Type")) -source.rmempty = false -source.default = "ip_mac" -source:value("ip_mac", translate("IP/MAC")) -if os.execute("lsmod | grep -i iprange >/dev/null") == 0 then - source:value("iprange", translate("IP range")) -end -source:value("ipset", "IPSet") - -source_ip_mac = s:option(DynamicList, "ip_mac", translate("IP/MAC")) -source_ip_mac.datatype = "or(ip4addr,macaddr)" -source_ip_mac.cast = "string" -source_ip_mac:depends("source", "ip_mac") - local mac_t = {} sys.net.mac_hints(function(e, t) mac_t[#mac_t + 1] = { @@ -83,39 +68,72 @@ table.sort(mac_t, function(a,b) end return false end) -for _, key in pairs(mac_t) do - source_ip_mac:value(key.mac, "%s (%s)" % {key.mac, key.ip}) -end -source_ip_mac.write = dynamicList_write -source_iprange = s:option(DynamicList, "iprange", translate("IP range")) -source_iprange.cast = "string" -source_iprange:depends("source", "iprange") -source_iprange.write = dynamicList_write -source_iprange.validate = function(self, value, t) +---- Source +sources = s:option(DynamicList, "sources", translate("Source")) +sources.description = "" +sources.cast = "string" +for _, key in pairs(mac_t) do + sources:value(key.mac, "%s (%s)" % {key.mac, key.ip}) +end +sources.cfgvalue = function(self, section) + local value + if self.tag_error[section] then + value = self:formvalue(section) + else + value = self.map:get(section, self.option) + if type(value) == "string" then + local value2 = {} + string.gsub(value, '[^' .. " " .. ']+', function(w) table.insert(value2, w) end) + value = value2 + end + end + return value +end +sources.validate = function(self, value, t) + local err = {} for _, v in ipairs(value) do - if not api.iprange(v) then - return nil, v .. " " .. translate("Not valid IP range format, please re-enter!") + local flag = false + if v:find("ipset:") and v:find("ipset:") == 1 then + local ipset = v:gsub("ipset:", "") + if ipset and ipset ~= "" then + flag = true + end + end + + if flag == false and datatypes.macaddr(v) then + flag = true + end + + if flag == false and datatypes.ip4addr(v) then + flag = true + end + + if flag == false and api.iprange(v) then + flag = true + end + + if flag == false then + err[#err + 1] = v end end - return value -end -source_ipset = s:option(DynamicList, "ipset", "IPSet") -source_ipset.cast = "string" -source_ipset:depends("source", "ipset") -source_ipset.write = dynamicList_write - -source.validate = function(self, value) - if value == "ip_mac" then - source_ip_mac.rmempty = false - elseif value == "iprange" then - source_iprange.rmempty = false - elseif value == "ipset" then - source_ipset.rmempty = false + if #err > 0 then + self:add_error(t, "invalid", translate("Not true format, please re-enter!")) + for _, v in ipairs(err) do + self:add_error(t, "invalid", v) + end end + return value end +sources.write = dynamicList_write ---- TCP Proxy Mode tcp_proxy_mode = s:option(ListValue, "tcp_proxy_mode", translatef("%s Proxy Mode", "TCP")) diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index ea51117d1..543d4f5b0 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -916,8 +916,8 @@ msgstr "访问控制" msgid "ACLs is a tools which used to designate specific IP proxy mode." msgstr "访问控制列表是用于指定特殊IP代理模式的工具。" -msgid "Source Type" -msgstr "来源类型" +msgid "Example:" +msgstr "例:" msgid "IP range" msgstr "IP 范围" @@ -979,8 +979,8 @@ msgstr "不是有效IPv4格式,请重新输入!" msgid "Not valid IPv6 format, please re-enter!" msgstr "不是有效IPv6格式,请重新输入!" -msgid "Not valid IP range format, please re-enter!" -msgstr "不是有效IP范围格式,请重新输入!" +msgid "Not true format, please re-enter!" +msgstr "不是正确的格式,请重新输入!" msgid "Plaintext: If this string matches any part of the targeting domain, this rule takes effet. Example: rule 'sina.com' matches targeting domain 'sina.com', 'sina.com.cn' and 'www.sina.com', but not 'sina.cn'." msgstr "纯字符串: 当此字符串匹配目标域名中任意部分,该规则生效。比如'sina.com'可以匹配'sina.com'、'sina.com.cn'和'www.sina.com',但不匹配'sina.cn'。" diff --git a/luci-app-passwall/root/usr/share/passwall/iptables.sh b/luci-app-passwall/root/usr/share/passwall/iptables.sh index 44f529ef5..748ec0139 100755 --- a/luci-app-passwall/root/usr/share/passwall/iptables.sh +++ b/luci-app-passwall/root/usr/share/passwall/iptables.sh @@ -162,34 +162,28 @@ load_acl() { dnsmasq_port=11400 echolog "访问控制:" for item in $items; do - local enabled sid remarks source ip_mac iprange ipset tcp_proxy_mode udp_proxy_mode tcp_no_redir_ports udp_no_redir_ports tcp_redir_ports udp_redir_ports tcp_node udp_node dns_mode dns_forward v2ray_dns_mode dns_doh dns_client_ip dns_query_strategy + local enabled sid remarks sources tcp_proxy_mode udp_proxy_mode tcp_no_redir_ports udp_no_redir_ports tcp_redir_ports udp_redir_ports tcp_node udp_node dns_mode dns_forward v2ray_dns_mode dns_doh dns_client_ip dns_query_strategy local _ip _mac _iprange _ipset _ip_or_mac rule_list tcp_port udp_port tcp_node_remark udp_node_remark config_file sid=$(uci -q show "${CONFIG}.${item}" | grep "=acl_rule" | awk -F '=' '{print $1}' | awk -F '.' '{print $2}') eval $(uci -q show "${CONFIG}.${item}" | cut -d'.' -sf 3-) [ "$enabled" = "1" ] || continue - if [ "$source" = "iprange" ]; then - for i in ${iprange}; do - is_iprange=$(lua_api "iprange(\"${i}\")") - if [ "${is_iprange}" = "true" ]; then - rule_list="${rule_list}\niprange:${i}" - fi - done - elif [ "$source" = "ipset" ]; then - for i in ${ipset}; do - rule_list="${rule_list}\nipset:${i}" - done - else - [ -z "${ip_mac}" ] && continue - for i in ${ip_mac}; do - _ip_or_mac=$(lua_api "ip_or_mac(\"${i}\")") + [ -z "${sources}" ] && continue + for s in $sources; do + is_iprange=$(lua_api "iprange(\"${s}\")") + if [ "${is_iprange}" = "true" ]; then + rule_list="${rule_list}\niprange:${s}" + elif [ -n "$(echo ${s} | grep '^ipset:')" ]; then + rule_list="${rule_list}\nipset:${s}" + else + _ip_or_mac=$(lua_api "ip_or_mac(\"${s}\")") if [ "${_ip_or_mac}" = "ip" ]; then - rule_list="${rule_list}\nip:${i}" + rule_list="${rule_list}\nip:${s}" elif [ "${_ip_or_mac}" = "mac" ]; then - rule_list="${rule_list}\nmac:${i}" + rule_list="${rule_list}\nmac:${s}" fi - done - fi + fi + done [ -z "${rule_list}" ] && continue tcp_proxy_mode=${tcp_proxy_mode:-default} @@ -423,7 +417,7 @@ load_acl() { $ipt_m -A PSW $(comment "$remarks") ${_ipt_source} -p udp -j RETURN $ip6t_m -A PSW $(comment "$remarks") ${_ipt_source} -p udp -j RETURN 2>/dev/null done - unset enabled sid remarks source ip_mac iprange ipset tcp_proxy_mode udp_proxy_mode tcp_no_redir_ports udp_no_redir_ports tcp_redir_ports udp_redir_ports tcp_node udp_node dns_mode dns_forward v2ray_dns_mode dns_doh dns_client_ip dns_query_strategy + unset enabled sid remarks sources tcp_proxy_mode udp_proxy_mode tcp_no_redir_ports udp_no_redir_ports tcp_redir_ports udp_redir_ports tcp_node udp_node dns_mode dns_forward v2ray_dns_mode dns_doh dns_client_ip dns_query_strategy unset _ip _mac _iprange _ipset _ip_or_mac rule_list tcp_port udp_port tcp_node_remark udp_node_remark config_file unset ipt_tmp msg msg2 unset redirect_dns_port diff --git a/luci-app-wizard/htdocs/luci-static/resources/view/wizard/initsetup.js b/luci-app-wizard/htdocs/luci-static/resources/view/wizard/initsetup.js index 2884e1df7..d2209ae3c 100644 --- a/luci-app-wizard/htdocs/luci-static/resources/view/wizard/initsetup.js +++ b/luci-app-wizard/htdocs/luci-static/resources/view/wizard/initsetup.js @@ -70,6 +70,7 @@ return view.extend({ o = s.taboption('wansetup', form.Flag, 'ipv6', _('Enable IPv6'), _('Enable/Disable IPv6')); o.default = o.enabled; + o.rmempty = false; if (has_wifi) { o = s.taboption('wifisetup', form.Value, 'wifi_ssid', _('ESSID')); @@ -94,6 +95,7 @@ return view.extend({ o.cast = 'string'; o = s.taboption('lansetup', form.Flag, 'siderouter', _('Siderouter')); + o.rmempty = false; o = s.taboption('lansetup', form.Value, 'lan_gateway', _('IPv4 gateway')); o.depends('siderouter', '1'); diff --git a/luci-app-wizard/root/etc/init.d/wizard b/luci-app-wizard/root/etc/init.d/wizard index 9e890aab3..ce4e27466 100644 --- a/luci-app-wizard/root/etc/init.d/wizard +++ b/luci-app-wizard/root/etc/init.d/wizard @@ -94,11 +94,11 @@ add_wizard() { config_get dhcp "$cfg" dhcp config_get lan_dns "$cfg" lan_dns - if [ -n "${siderouter}" ]; then + if [ "${siderouter}" == "1" ]; then uci -q set network.lan.gateway="${lan_gateway}" [ -n "$lan_dns" ] && uci -q set network.lan.dns="${lan_dns}" || uci -q set network.lan.dns='223.5.5.5' [ -n "$dhcp" ] && uci -q set dhcp.lan.ignore="1" || uci -q del dhcp.lan.ignore - else + elif [ "${siderouter}" == "0" ]; then uci -q del network.lan.gateway uci -q del dhcp.lan.ignore uci -q set network.lan.dns="${lan_dns}" @@ -106,7 +106,7 @@ add_wizard() { config_get ipv6 "$cfg" ipv6 - test -n "${ipv6}" && { + if [ "${ipv6}" == "0" ]; then uci -q delete dhcp.lan.ra uci -q delete dhcp.lan.dhcpv6 uci -q set network.lan.delegate='0' @@ -115,7 +115,7 @@ add_wizard() { uci commit dhcp /etc/init.d/odhcpd disable /etc/init.d/odhcpd stop - } || { + elif [ "${ipv6}" == "1" ]; then uci -q set dhcp.lan.ra='hybrid' uci -q set dhcp.lan.dhcpv6='hybrid' uci -q del network.lan.delegate @@ -123,7 +123,7 @@ add_wizard() { uci commit dhcp /etc/init.d/odhcpd enable /etc/init.d/odhcpd start - } + fi uci commit network uci commit wireless diff --git a/naiveproxy/Makefile b/naiveproxy/Makefile index 19c8850f3..7933acd03 100644 --- a/naiveproxy/Makefile +++ b/naiveproxy/Makefile @@ -80,7 +80,9 @@ PGO_VER:=4664-1636557077-6e390f4e505916531ca2ab0c895d5903ab4d88a9 PGO_FILE:=chrome-linux-$(PGO_VER).profdata define Download/PGO_PROF URL:=https://storage.googleapis.com.cnpmjs.org/chromium-optimization-profiles/pgo_profiles \ - https://storage.googleapis.com/chromium-optimization-profiles/pgo_profiles + https://storage.googleapis.com/chromium-optimization-profiles/pgo_profiles \ + https://mirror01.download.immortalwrt.eu.org \ + https://mirror02.download.immortalwrt.eu.org URL_FILE:=$(PGO_FILE) FILE:=$(PGO_FILE) HASH:=8dcf5973033d40c9a7b15e571dea3832e7b67976aad9113369e22d43808c603f