From 875fcf3f125f857c515fd83894ed643466b84785 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Sun, 11 Aug 2024 09:31:29 +0200 Subject: [PATCH] adblock: update to 4.2.1 * added full 1Hosts feed support (4 categories) * changed the OISD list sources to alternate wildcard domains syntax * used only the adguard source in default config * fixed a needless reload delay plus a few cosmetics Signed-off-by: Dirk Brenken --- net/adblock/Makefile | 2 +- net/adblock/files/README.md | 9 +++++---- net/adblock/files/adblock.categories | 6 +++++- net/adblock/files/adblock.conf | 3 --- net/adblock/files/adblock.init | 4 +++- net/adblock/files/adblock.sh | 13 +++++++++---- net/adblock/files/adblock.sources | 19 +++++++++++++------ 7 files changed, 36 insertions(+), 20 deletions(-) diff --git a/net/adblock/Makefile b/net/adblock/Makefile index 13e6fea1b4..550fa36a5c 100644 --- a/net/adblock/Makefile +++ b/net/adblock/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock -PKG_VERSION:=4.2.0 +PKG_VERSION:=4.2.1 PKG_RELEASE:=1 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Dirk Brenken diff --git a/net/adblock/files/README.md b/net/adblock/files/README.md index 9cef9e78f5..fcfb5709a3 100644 --- a/net/adblock/files/README.md +++ b/net/adblock/files/README.md @@ -10,7 +10,8 @@ A lot of people already use adblocker plugins within their desktop browsers, but | Source | Enabled | Size | Focus | Information | | :------------------ | :-----: | :--- | :--------------- | :-------------------------------------------------------------------------------- | -| adaway | x | S | mobile | [Link](https://github.com/AdAway/adaway.github.io) | +| 1Hosts | | VAR | compilation | [Link](https://github.com/badmojr/1Hosts) | +| adaway | | S | mobile | [Link](https://github.com/AdAway/adaway.github.io) | | adguard | x | L | general | [Link](https://adguard.com) | | adguard_tracking | | L | tracking | [Link](https://github.com/AdguardTeam/cname-trackers) | | android_tracking | | S | tracking | [Link](https://github.com/Perflyst/PiHoleBlocklist) | @@ -20,7 +21,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but | anudeep | | M | compilation | [Link](https://github.com/anudeepND/blacklist) | | bitcoin | | S | mining | [Link](https://github.com/hoshsadiq/adblock-nocoin-list) | | cpbl | | XL | compilation | [Link](https://github.com/bongochong/CombinedPrivacyBlockLists) | -| disconnect | x | S | general | [Link](https://disconnect.me) | +| disconnect | | S | general | [Link](https://disconnect.me) | | doh_blocklist | | S | doh_server | [Link](https://github.com/dibdot/DoH-IP-blocklists) | | easylist | | M | compilation | [Link](https://easylist.to) | | easyprivacy | | M | tracking | [Link](https://easylist.to) | @@ -60,7 +61,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but | whocares | | M | general | [Link](https://someonewhocares.org) | | winhelp | | S | general | [Link](https://winhelp2002.mvps.org) | | winspy | | S | win_telemetry | [Link](https://github.com/crazy-max/WindowsSpyBlocker) | -| yoyo | x | S | general | [Link](https://pgl.yoyo.org/adservers) | +| yoyo | | S | general | [Link](https://pgl.yoyo.org/adservers) | * List of supported and fully pre-configured adblock sources, already active sources are pre-selected. To avoid OOM errors, please do not select too many lists! @@ -134,7 +135,7 @@ Available commands: resume Resume adblock processing query <domain> Query active blocklists and backups for a specific domain report [<search>] Print DNS statistics with an optional search parameter - list [<add>|<add_utc>|<add_eng>|<add_stb>|<remove>|<remove_utc>|<remove_eng>|<remove_stb>] <source(s)> List/Edit available sources + list List available sources timer [<add> <tasks> <hour> [<minute>] [<weekday>]]|[<remove> <line no.>] List/Edit cron update intervals version Print version information running Check if service is running diff --git a/net/adblock/files/adblock.categories b/net/adblock/files/adblock.categories index 3aadc53ac0..21aa2f7acc 100644 --- a/net/adblock/files/adblock.categories +++ b/net/adblock/files/adblock.categories @@ -1,7 +1,7 @@ hag;multi-light;light-onlydomains.txt hag;multi-normal;multi-onlydomains.txt hag;multi-pro;pro-onlydomains.txt -hag;multi-pro;pro.mini-onlydomains.txt +hag;multi-pro.mini;pro.mini-onlydomains.txt hag;multi-pro.plus;pro.plus-onlydomains.txt hag;multi-pro.mini;pro.plus.mini-onlydomains.txt hag;multi-ultimate;ultimate-onlydomains.txt @@ -30,6 +30,10 @@ hag;native.winoffice;native.winoffice-onlydomains.txt hag;native.xiaomi;native.xiaomi-onlydomains.txt hag;nosafesearch;nosafesearch-onlydomains.txt hag;popupads;popupads-onlydomains.txt +hst;mini;mini/domains.wildcards +hst;lite;Lite/domains.wildcards +hst;pro;Pro/domains.wildcards +hst;xtra;Xtra/domains.wildcards stb;standard;hosts stb;standard-fakenews;alternates/fakenews/hosts stb;standard-fakenews-gambling;alternates/fakenews-gambling/hosts diff --git a/net/adblock/files/adblock.conf b/net/adblock/files/adblock.conf index aeceb500f2..28a77738d6 100644 --- a/net/adblock/files/adblock.conf +++ b/net/adblock/files/adblock.conf @@ -8,7 +8,4 @@ config adblock 'global' option adb_mail '0' option adb_report '0' option adb_backup '1' - list adb_sources 'adaway' list adb_sources 'adguard' - list adb_sources 'disconnect' - list adb_sources 'yoyo' diff --git a/net/adblock/files/adblock.init b/net/adblock/files/adblock.init index 051ecb2b12..f1acb456f2 100755 --- a/net/adblock/files/adblock.init +++ b/net/adblock/files/adblock.init @@ -201,8 +201,10 @@ service_triggers() { iface="$(uci_get adblock global adb_trigger)" delay="$(uci_get adblock global adb_triggerdelay "5")" - PROCD_RELOAD_DELAY="$((delay * 1000))" + PROCD_RELOAD_DELAY="$((delay * 1000))" [ -n "${iface}" ] && procd_add_interface_trigger "interface.*.up" "${iface}" "${adb_init}" "start" + + PROCD_RELOAD_DELAY="$((2 * 1000))" procd_add_reload_trigger "adblock" } diff --git a/net/adblock/files/adblock.sh b/net/adblock/files/adblock.sh index a3b0e96ba0..084a3ad6e2 100755 --- a/net/adblock/files/adblock.sh +++ b/net/adblock/files/adblock.sh @@ -11,7 +11,7 @@ export LC_ALL=C export PATH="/usr/sbin:/usr/bin:/sbin:/bin" -adb_ver="4.2.0" +adb_ver="4.2.1" adb_enabled="0" adb_debug="0" adb_forcedns="0" @@ -185,6 +185,8 @@ f_conf() { eval "${option}=\"$(printf "%s" "${adb_sources}") ${value}\"" elif [ "${option}" = "adb_hag_sources" ]; then eval "${option}=\"$(printf "%s" "${adb_hag_sources}") ${value}\"" + elif [ "${option}" = "adb_hst_sources" ]; then + eval "${option}=\"$(printf "%s" "${adb_hst_sources}") ${value}\"" elif [ "${option}" = "adb_stb_sources" ]; then eval "${option}=\"$(printf "%s" "${adb_stb_sources}") ${value}\"" elif [ "${option}" = "adb_utc_sources" ]; then @@ -1211,11 +1213,14 @@ f_main() { ) & fi else - if [ "${src_name}" = "stevenblack" ] && [ -n "${adb_stb_sources}" ]; then - src_cat="${adb_stb_sources}" + if [ "${src_name}" = "1hosts" ] && [ -n "${adb_hst_sources}" ]; then + src_cat="${adb_hst_sources}" elif [ "${src_name}" = "hagezi" ] && [ -n "${adb_hag_sources}" ]; then src_cat="${adb_hag_sources}" - elif { [ "${src_name}" = "hagezi" ] && [ -z "${adb_hag_sources}" ]; } || + elif [ "${src_name}" = "stevenblack" ] && [ -n "${adb_stb_sources}" ]; then + src_cat="${adb_stb_sources}" + elif { [ "${src_name}" = "1hosts" ] && [ -z "${adb_hst_sources}" ]; } || + { [ "${src_name}" = "hagezi" ] && [ -z "${adb_hag_sources}" ]; } || { [ "${src_name}" = "stevenblack" ] && [ -z "${adb_stb_sources}" ]; }; then continue fi diff --git a/net/adblock/files/adblock.sources b/net/adblock/files/adblock.sources index 189f5742c4..4851d0077a 100644 --- a/net/adblock/files/adblock.sources +++ b/net/adblock/files/adblock.sources @@ -1,4 +1,11 @@ { + "1hosts": { + "url": "https://raw.githubusercontent.com/badmojr/1Hosts/master/", + "rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}", + "size": "VAR", + "focus": "compilation", + "descurl": "https://github.com/badmojr/1Hosts" + }, "adaway": { "url": "https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt", "rule": "/^127\\.0\\.0\\.1[[:space:]]+([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($2)}", @@ -140,22 +147,22 @@ "descurl": "https://github.com/notracking/hosts-blocklists" }, "oisd_big": { - "url": "https://big.oisd.nl/domainswild", - "rule": "BEGIN{FS=\"\\\\*.\"}/^\\*\\.([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($2)}", + "url": "https://big.oisd.nl/domainswild2", + "rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}", "size": "XXL", "focus": "general", "descurl": "https://oisd.nl" }, "oisd_nsfw": { - "url": "https://nsfw.oisd.nl/domainswild", - "rule": "BEGIN{FS=\"\\\\*.\"}/^\\*\\.([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($2)}", + "url": "https://nsfw.oisd.nl/domainswild2", + "rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}", "size": "XXL", "focus": "porn", "descurl": "https://oisd.nl" }, "oisd_small": { - "url": "https://small.oisd.nl/domainswild", - "rule": "BEGIN{FS=\"\\\\*.\"}/^\\*\\.([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($2)}", + "url": "https://small.oisd.nl/domainswild2", + "rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}", "size": "L", "focus": "general", "descurl": "https://oisd.nl" -- 2.30.2