adblock: update to 4.1.5-7
authorDirk Brenken <dev@brenken.org>
Mon, 20 Mar 2023 19:27:19 +0000 (20:27 +0100)
committerDirk Brenken <dev@brenken.org>
Mon, 20 Mar 2023 19:27:49 +0000 (20:27 +0100)
* fix cornercase issue with duplicate entries in black- and whitelist
* change cpbl source URL
* firewall redirects now blocks IPv4 and IPv6 (set family to "any")

Signed-off-by: Dirk Brenken <dev@brenken.org>
net/adblock/Makefile
net/adblock/files/adblock.sh
net/adblock/files/adblock.sources

index 22a59a926ada529e90766656b94f295e27f3f0af..6eda908a4f86914d34824dfbe046a1c370fbbe0f 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock
 PKG_VERSION:=4.1.5
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index 2647df093c6a5cff08309b970597d6bedbf1d86f..e76e81450703d997d78e2da6ac6ec341d578b690 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # dns based ad/abuse domain blocking
-# Copyright (c) 2015-2022 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2015-2023 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 
 # disable (s)hellcheck in release
@@ -566,6 +566,7 @@ f_extconf() {
                                                set firewall."adblock_${zone}${port}".src_dport="${port}"
                                                set firewall."adblock_${zone}${port}".dest_port="${port}"
                                                set firewall."adblock_${zone}${port}".target="DNAT"
+                                               set firewall."adblock_${zone}${port}".family="any"
                                        EOC
                                fi
                                fwcfg="${fwcfg/adblock_${zone}${port}[ |\$]/}"
@@ -686,8 +687,13 @@ f_list() {
                        src_name="${mode}"
                        if [ "${src_name}" = "blacklist" ] && [ -f "${adb_blacklist}" ]; then
                                rset="/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}"
-                               "${adb_awk}" "${rset}" "${adb_blacklist}" |
-                                       "${adb_awk}" 'BEGIN{FS="."}{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' >"${adb_tmpdir}/tmp.raw.${src_name}"
+                               "${adb_awk}" "${rset}" "${adb_blacklist}" >"${adb_tmpdir}/tmp.raw.${src_name}"
+                               if [ -s "${adb_whitelist}" ]; then
+                                       "${adb_awk}" 'NR==FNR{member[$1];next}!($1 in member)' "${adb_whitelist}" "${adb_tmpdir}/tmp.raw.${src_name}" >"${adb_tmpdir}/tmp.deduplicate.${src_name}"
+                               else
+                                       cat "${adb_tmpdir}/tmp.raw.${src_name}" >"${adb_tmpdir}/tmp.deduplicate.${src_name}"
+                               fi
+                               "${adb_awk}" 'BEGIN{FS="."}{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' "${adb_tmpdir}/tmp.deduplicate.${src_name}" >"${adb_tmpdir}/tmp.raw.${src_name}"
                                "${adb_sort}" ${adb_srtopts} -u "${adb_tmpdir}/tmp.raw.${src_name}" 2>/dev/null >"${adb_tmpfile}.${src_name}"
                                out_rc="${?}"
                                rm -f "${adb_tmpdir}/tmp.raw.${src_name}"
index d6f56f6d4eaf08201627e7b5ee2c6a18b0c50901..85af8602b4ab497393eeb8dede15e20cbd4e8381 100644 (file)
@@ -63,7 +63,7 @@
                "descurl": "https://github.com/hoshsadiq/adblock-nocoin-list"
        },
        "cpbl": {
-               "url": "https://raw.githubusercontent.com/bongochong/CombinedPrivacyBlockLists/master/NoFormatting/BlacklistedDomains.txt",
+               "url": "https://raw.githubusercontent.com/bongochong/CombinedPrivacyBlockLists/master/NoFormatting/cpbl-ctld.txt",
                "rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}",
                "size": "XL",
                "focus": "compilation",