mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 10:51:55 +00:00
adblock: update 4.5.0-5
* add 'blocklist-referral' to the hagezi selection * add minor report/map tweaks Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=adblock
|
||||
PKG_VERSION:=4.5.0
|
||||
PKG_RELEASE:=4
|
||||
PKG_RELEASE:=5
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ hag;threat-intelligence;wildcard/tif-onlydomains.txt
|
||||
hag;threat-intelligence.medium;wildcard/tif.medium-onlydomains.txt
|
||||
hag;threat-intelligence.mini;wildcard/tif.mini-onlydomains.txt
|
||||
hag;anti.piracy;wildcard/anti.piracy-onlydomains.txt
|
||||
hag;blocklist-referral;wildcard/blocklist-referral-onlydomains.txt
|
||||
hag;doh;wildcard/doh-onlydomains.txt
|
||||
hag;doh-vpn-proxy-bypass;wildcard/doh-vpn-proxy-bypass-onlydomains.txt
|
||||
hag;dyndns;wildcard/dyndns-onlydomains.txt
|
||||
|
||||
@@ -1527,7 +1527,7 @@ f_report() {
|
||||
# build report
|
||||
#
|
||||
if [ "${action}" != "json" ]; then
|
||||
: >"${report_raw}" >"${report_srt}" >"${report_txt}" >"${report_jsn}"
|
||||
: >"${report_raw}" >"${report_srt}" >"${report_txt}" >"${report_jsn}" >"${map_jsn}"
|
||||
: >"${top_tmpclients}" >"${top_tmpdomains}" >"${top_tmpblocked}"
|
||||
[ "${adb_represolve}" = "1" ] && resolve=""
|
||||
for file in "${adb_reportdir}/adb_report.pcap"*; do
|
||||
@@ -1570,7 +1570,7 @@ f_report() {
|
||||
next
|
||||
}
|
||||
# ok answer
|
||||
/[0-9]+[[:space:]]+[0-9]+\/[0-9]+\/[0-9]+[[:space:]]+(A|AAAA|CNAME)[[:space:]]/ {
|
||||
/ (A|AAAA|CNAME) / && !/NXDomain/ && !/ServFail/ {
|
||||
if (pending) {
|
||||
printf "%s\t%s\t%s\t%s\t%s\t%s\tOK\n",
|
||||
last_date, last_time, last_client, last_interface, last_qtype, last_domain
|
||||
@@ -1766,28 +1766,31 @@ f_report() {
|
||||
#
|
||||
if [ "${adb_map}" = "1" ] && [ -s "${report_jsn}" ]; then
|
||||
cnt="1"
|
||||
network_find_wan iface_v4
|
||||
network_get_ipaddr ip_v4 "${iface_v4}"
|
||||
network_find_wan6 iface_v6
|
||||
network_get_ipaddr6 ip_v6 "${iface_v6}"
|
||||
printf "%s" ",[{}" >"${map_jsn}"
|
||||
f_fetch
|
||||
network_find_wan iface_v4 && network_get_ipaddr ip_v4 "${iface_v4}"
|
||||
network_find_wan6 iface_v6 && network_get_ipaddr6 ip_v6 "${iface_v6}"
|
||||
if [ -n "${ip_v4}" ] || [ -n "${ip_v6}" ]; then
|
||||
f_fetch
|
||||
printf "%s" ",[{}" >"${map_jsn}"
|
||||
fi
|
||||
for ip in ${ip_v4} ${ip_v6}; do
|
||||
"${adb_fetchcmd}" ${adb_geoparm} "${adb_geourl}/${ip}" 2>/dev/null |
|
||||
"${adb_awkcmd}" -v feed="homeIP" '{printf ",{\"%s\": %s}\n",feed,$0}' >>"${map_jsn}"
|
||||
(
|
||||
"${adb_fetchcmd}" ${adb_geoparm} "${adb_geourl}/${ip}" 2>/dev/null |
|
||||
"${adb_awkcmd}" -v feed="homeIP" '{printf ",{\"%s\": %s}\n",feed,$0}' >>"${map_jsn}"
|
||||
) &
|
||||
[ "${cnt}" -gt "${adb_cores}" ] && wait -n
|
||||
cnt="$((cnt + 1))"
|
||||
done
|
||||
if [ -s "${map_jsn}" ] && [ "${cnt}" -lt "45" ] && [ "$("${adb_catcmd}" "${map_jsn}")" != ",[{}" ]; then
|
||||
wait
|
||||
if [ -s "${map_jsn}" ] && [ "${cnt}" -lt "45" ]; then
|
||||
json_init
|
||||
if json_load_file "${report_jsn}" >/dev/null 2>&1; then
|
||||
json_select "requests" >/dev/null 2>&1
|
||||
json_get_keys requests >/dev/null 2>&1
|
||||
for request in ${requests}; do
|
||||
json_select "${request}" >/dev/null 2>&1
|
||||
json_get_keys details >/dev/null 2>&1
|
||||
json_get_var rc "rc" >/dev/null 2>&1
|
||||
json_get_var domain "domain" >/dev/null 2>&1
|
||||
if [ "${rc}" = "NX" ] && ! "${adb_catcmd}" "${map_jsn}" 2>/dev/null | "${adb_grepcmd}" -qxF "${domain}"; then
|
||||
if [ "${rc}" = "NX" ] && ! "${adb_grepcmd}" -q "\"${domain}\":" "${map_jsn}"; then
|
||||
(
|
||||
"${adb_fetchcmd}" ${adb_geoparm} "${adb_geourl}/${domain}" 2>/dev/null |
|
||||
"${adb_awkcmd}" -v feed="${domain}" '{printf ",{\"%s\": %s}\n",feed,$0}' >>"${map_jsn}"
|
||||
@@ -1864,7 +1867,7 @@ f_report() {
|
||||
printf "%s\n" "${content}"
|
||||
;;
|
||||
"json")
|
||||
if [ "${adb_map}" = "1" ]; then
|
||||
if [ "${adb_map}" = "1" ] && [ -s "${map_jsn}" ]; then
|
||||
jsn="$("${adb_catcmd}" ${report_jsn} ${map_jsn} 2>/dev/null)"
|
||||
[ -n "${jsn}" ] && printf "[%s]]\n" "${jsn}"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user