Skip to content

Commit 22401ba

Browse files
committed
adblock: release 4.4.5-1
* hardened the uci config parsing * added a fast, flexible & secure domain validator function, it eliminates > 99 % of garbage inputs - Please note: the "rule" in the feed file now only includes parameters for the domain validator, see readme for details. Please nuke a custom feed file from former versions - they are no longer compatible * readme update * LuCI: fixed a minor issue in the logread template * LuCI: adapted the rule select options in the custom feed editor to use the new domain validator Signed-off-by: Dirk Brenken <dev@brenken.org> (cherry picked from commit b085131)
1 parent b83918c commit 22401ba

File tree

4 files changed

+159
-67
lines changed

4 files changed

+159
-67
lines changed

net/adblock/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
include $(TOPDIR)/rules.mk
77

88
PKG_NAME:=adblock
9-
PKG_VERSION:=4.4.4
10-
PKG_RELEASE:=3
9+
PKG_VERSION:=4.4.5
10+
PKG_RELEASE:=1
1111
PKG_LICENSE:=GPL-3.0-or-later
1212
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
1313

net/adblock/files/README.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ A lot of people already use adblocker plugins within their desktop browsers, but
6363
* Full IPv4 and IPv6 support
6464
* Provides top level domain compression ('tld compression'), this feature removes thousands of needless host entries from the blocklist and lowers the memory footprint for the DNS backend
6565
* Provides a 'DNS Blocklist Shift', where the generated final DNS blocklist is moved to the backup directory and only a soft link to this file is set in memory. As long as your backup directory is located on an external drive, you should activate this option to save valuable RAM.
66-
* Source parsing by fast & flexible regex rulesets, all rules and feed information are placed in an external JSON file ('/etc/adblock/adblock.feeds')
66+
* Feed parsing by a very fast & secure domain validator, all domain rules and feed information are placed in an external JSON file ('/etc/adblock/adblock.feeds')
6767
* Overall duplicate removal in generated blocklist file 'adb_list.overall'
6868
* Additional local allowlist for manual overrides, located in '/etc/adblock/adblock.allowlist' (only exact matches).
6969
* Additional local blocklist for manual overrides, located in '/etc/adblock/adblock.blocklist'
70-
* Quality checks during blocklist update to ensure a reliable DNS backend service
70+
* Connection checks during blocklist update to ensure a reliable DNS backend service
7171
* Minimal status & error logging to syslog, enable debug logging to receive more output
7272
* Procd based init system support ('start', 'stop', 'restart', 'reload', 'enable', 'disable', 'running', 'status', 'suspend', 'resume', 'query', 'report')
7373
* Auto-Startup via procd network interface trigger or via classic time based startup
@@ -76,7 +76,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but
7676
* Provides a detailed DNS Query Report with DNS related information about client requests, top (blocked) domains and more
7777
* Provides a powerful query function to quickly find blocked (sub-)domains, e.g. to allow certain domains
7878
* Includes an option to generate an additional, restrictive 'adb_list.jail' to block access to all domains except those listed in the allowlist file. You can use this restrictive blocklist manually e.g. for guest wifi or kidsafe configurations
79-
* Includes an option to force DNS requests to the local resolver
79+
* Contains an option to route DNS queries to the local resolver via corresponding firewall rules
8080
* Automatic blocklist backup & restore, these backups will be used in case of download errors and during startup
8181
* Send notification E-Mails, see example configuration below
8282
* Add new adblock feeds on your own with the 'Custom Feed Editor' in LuCI or via CLI, see example below
@@ -215,15 +215,16 @@ To get the status in the CLI, just call _/etc/init.d/adblock status_ or _/etc/in
215215
~# /etc/init.d/adblock status
216216
::: adblock runtime information
217217
+ adblock_status : enabled
218-
+ adblock_version : 4.4.2-r1
219-
+ blocked_domains : 914 804
220-
+ active_feeds : 1hosts, adguard, adguard_tracking, certpl, doh_blocklist, hagezi, stevenblack, winspy
221-
+ dns_backend : unbound (1.23.0-r1), /mnt/data/adblock/backup, 355.97 MB
218+
+ frontend_ver : 4.4.5-r1
219+
+ backend_ver : 4.4.5-r1
220+
+ blocked_domains : 575 335
221+
+ active_feeds : 1hosts, adguard, adguard_tracking, bitcoin, certpl, doh_blocklist, hagezi, phishing_army, smarttv_tracking, stevenblack, winspy
222+
+ dns_backend : unbound (1.24.2-r1), /mnt/data/adblock/backup, 232.20 MB
222223
+ run_ifaces : trigger: wan , report: br-lan
223224
+ run_directories : base: /mnt/data/adblock, dns: /var/lib/unbound, backup: /mnt/data/adblock/backup, report: /mnt/data/adblock/report, jail: /tmp
224-
+ run_flags : shift: ✔, custom feed: ✘, force: ✔, flush: ✘, tld: ✔, search: , report: ✔, mail: ✔, jail: ✘
225-
+ last_run : mode: restart, 2025-05-27T20:02:02+02:00, duration: 0m 26s, 1413.00 MB available
226-
+ system_info : cores: 4, fetch: wget, Bananapi BPI-R3, mediatek/filogic, OpenWrt SNAPSHOT r29655-4dc10ec711
225+
+ run_flags : shift: ✔, custom feed: ✘, force: ✔, flush: ✘, tld: ✔, search: , report: ✔, mail: ✔, jail: ✘
226+
+ last_run : mode: reload, 2025-12-13T15:55:59+01:00, duration: 0m 46s, 1411.57 MB available
227+
+ system_info : cores: 4, fetch: curl, Bananapi BPI-R3, mediatek/filogic, OpenWrt SNAPSHOT (r32305-52fa3728e5)
227228
```
228229

229230
<a id="best-practise-and-tweaks"></a>
@@ -311,16 +312,21 @@ A valid JSON source object contains the following information, e.g.:
311312

312313
```
313314
[...]
314-
"adguard": {
315-
"url": "https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt",
316-
"rule": "BEGIN{FS=\"[|^]\"}/^\\|\\|([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+\\^(\\$third-party)?$/{print tolower($3)}",
317-
"size": "L",
318-
"descr": "general"
315+
"stevenblack": {
316+
"url": "https://raw.githubusercontent.com/StevenBlack/hosts/master/",
317+
"rule": "feed 0.0.0.0 2",
318+
"size": "VAR",
319+
"descr": "compilation"
319320
},
320321
[...]
321322
```
322323

323-
Add an unique feed name (no spaces, no special chars) and make the required changes: adapt at least the URL, the regex rule, the size and the description for a new feed.
324+
Add an unique feed name (no spaces, no special chars) and make the required changes: adapt at least the URL, check/change the rule, the size and the description for a new feed.
325+
The rule consist of max. 4 individual, space separated parameters:
326+
1. type: always 'feed' (required)
327+
2. prefix: an optional search term (a string literal, no regex) to identify valid domain list entries, e.g. '0.0.0.0'
328+
3. column: the domain column within the feed file, e.g. '2' (required)
329+
4. separator: an optional field separator, default is the character class '[[:space:]]'
324330

325331
## Support
326332
Please join the adblock discussion in this [forum thread](https://forum.openwrt.org/t/adblock-support-thread/507) or contact me by mail <dev@brenken.org>

net/adblock/files/adblock.feeds

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,187 +1,187 @@
11
{
22
"1hosts": {
33
"url": "https://raw.githubusercontent.com/badmojr/1Hosts/master/",
4-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
4+
"rule": "feed 1",
55
"size": "VAR",
66
"descr": "compilation"
77
},
88
"adguard": {
99
"url": "https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt",
10-
"rule": "BEGIN{FS=\"[|^]\"}/^\\|\\|([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}\\^(\\$third-party)?$/{print tolower($3)}",
10+
"rule": "feed 3 [|^]",
1111
"size": "L",
1212
"descr": "general"
1313
},
1414
"adguard_tracking": {
1515
"url": "https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers_justdomains.txt",
16-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
16+
"rule": "feed 1",
1717
"size": "L",
1818
"descr": "tracking"
1919
},
2020
"android_tracking": {
2121
"url": "https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/android-tracking.txt",
22-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
22+
"rule": "feed 1",
2323
"size": "S",
2424
"descr": "tracking"
2525
},
2626
"andryou": {
2727
"url": "https://gitlab.com/andryou/block/raw/master/kouhai-compressed-domains",
28-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
28+
"rule": "feed 1",
2929
"size": "L",
3030
"descr": "compilation"
3131
},
3232
"anti_ad": {
3333
"url": "https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt",
34-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
34+
"rule": "feed 1",
3535
"size": "L",
3636
"descr": "compilation"
3737
},
3838
"anudeep": {
3939
"url": "https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt",
40-
"rule": "/^(0\\.0\\.0\\.0 ([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($2)}",
40+
"rule": "feed 0.0.0.0 2",
4141
"size": "M",
4242
"descr": "compilation"
4343
},
4444
"bitcoin": {
4545
"url": "https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt",
46-
"rule": "/^(0\\.0\\.0\\.0 ([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($2)}",
46+
"rule": "feed 0.0.0.0 2",
4747
"size": "S",
4848
"descr": "mining"
4949
},
5050
"certpl": {
5151
"url": "https://hole.cert.pl/domains/v2/domains.txt",
52-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
52+
"rule": "feed 1",
5353
"size": "L",
5454
"descr": "phishing"
5555
},
5656
"cpbl": {
5757
"url": "https://raw.githubusercontent.com/bongochong/CombinedPrivacyBlockLists/master/NoFormatting/cpbl-ctld.txt",
58-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
58+
"rule": "feed 1",
5959
"size": "XL",
6060
"descr": "compilation"
6161
},
6262
"disconnect": {
6363
"url": "https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt",
64-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
64+
"rule": "feed 1",
6565
"size": "S",
6666
"descr": "general"
6767
},
6868
"divested": {
6969
"url": "https://divested.dev/hosts-domains-wildcards",
70-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
70+
"rule": "feed 1",
7171
"size": "XXL",
7272
"descr": "compilation"
7373
},
7474
"doh_blocklist": {
7575
"url": "https://raw.githubusercontent.com/dibdot/DoH-IP-blocklists/master/doh-domains_overall.txt",
76-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
76+
"rule": "feed 1",
7777
"size": "S",
7878
"descr": "doh_server"
7979
},
8080
"firetv_tracking": {
8181
"url": "https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/AmazonFireTV.txt",
82-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
82+
"rule": "feed 1",
8383
"size": "S",
8484
"descr": "tracking"
8585
},
8686
"games_tracking": {
8787
"url": "https://raw.githubusercontent.com/KodoPengin/GameIndustry-hosts-Template/master/Main-Template/hosts",
88-
"rule": "/^(0\\.0\\.0\\.0 ([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($2)}",
88+
"rule": "feed 0.0.0.0 2",
8989
"size": "S",
9090
"descr": "tracking"
9191
},
9292
"hblock": {
9393
"url": "https://hblock.molinero.dev/hosts_domains.txt",
94-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
94+
"rule": "feed 1",
9595
"size": "XL",
9696
"descr": "compilation"
9797
},
9898
"hagezi": {
9999
"url": "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/",
100-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)*[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
100+
"rule": "feed 1",
101101
"size": "VAR",
102102
"descr": "compilation"
103103
},
104104
"oisd_big": {
105105
"url": "https://big.oisd.nl/domainswild2",
106-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
106+
"rule": "feed 1",
107107
"size": "XXL",
108108
"descr": "general"
109109
},
110110
"oisd_nsfw": {
111111
"url": "https://nsfw.oisd.nl/domainswild2",
112-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
112+
"rule": "feed 1",
113113
"size": "XXL",
114114
"descr": "porn"
115115
},
116116
"oisd_nsfw_small": {
117117
"url": "https://nsfw-small.oisd.nl/domainswild2",
118-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
118+
"rule": "feed 1",
119119
"size": "M",
120120
"descr": "porn"
121121
},
122122
"oisd_small": {
123123
"url": "https://small.oisd.nl/domainswild2",
124-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
124+
"rule": "feed 1",
125125
"size": "L",
126126
"descr": "general"
127127
},
128128
"phishing_army": {
129129
"url": "https://phishing.army/download/phishing_army_blocklist_extended.txt",
130-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
130+
"rule": "feed 1",
131131
"size": "S",
132132
"descr": "phishing"
133133
},
134134
"smarttv_tracking": {
135135
"url": "https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV.txt",
136-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
136+
"rule": "feed 1",
137137
"size": "S",
138138
"descr": "tracking"
139139
},
140140
"spam404": {
141141
"url": "https://raw.githubusercontent.com/Dawsey21/Lists/master/main-blacklist.txt",
142-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
142+
"rule": "feed 1",
143143
"size": "S",
144144
"descr": "general"
145145
},
146146
"stevenblack": {
147147
"url": "https://raw.githubusercontent.com/StevenBlack/hosts/master/",
148-
"rule": "/^(0\\.0\\.0\\.0 ([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($2)}",
148+
"rule": "feed 0.0.0.0 2",
149149
"size": "VAR",
150150
"descr": "compilation"
151151
},
152152
"stopforumspam": {
153153
"url": "https://www.stopforumspam.com/downloads/toxic_domains_whole.txt",
154-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
154+
"rule": "feed 1",
155155
"size": "S",
156156
"descr": "spam"
157157
},
158158
"utcapitole": {
159159
"url": "https://dsi.ut-capitole.fr/blacklists/download/blacklists.tar.gz",
160-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
160+
"rule": "feed 1",
161161
"size": "VAR",
162162
"descr": "general"
163163
},
164164
"wally3k": {
165165
"url": "https://v.firebog.net/hosts/static/w3kbl.txt",
166-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
166+
"rule": "feed 1",
167167
"size": "S",
168168
"descr": "compilation"
169169
},
170170
"whocares": {
171171
"url": "https://someonewhocares.org/hosts/hosts",
172-
"rule": "/^(127\\.0\\.0\\.1 ([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($2)}",
172+
"rule": "feed 127.0.0.1 2",
173173
"size": "M",
174174
"descr": "general"
175175
},
176176
"winspy": {
177177
"url": "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt",
178-
"rule": "/^(0\\.0\\.0\\.0 ([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($2)}",
178+
"rule": "feed 0.0.0.0 2",
179179
"size": "S",
180180
"descr": "win_telemetry"
181181
},
182182
"yoyo": {
183183
"url": "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml&showintro=0&mimetype=plaintext",
184-
"rule": "/^(([[:alnum:]_-]{1,63}\\.)+[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower($1)}",
184+
"rule": "feed 1",
185185
"size": "S",
186186
"descr": "general"
187187
}

0 commit comments

Comments
 (0)