Browse Source

adblock: small update

* add adguard_tracking source (list with cname trackers)
* optimize/sort output of active sources in status
* optimize log output in EMails

Signed-off-by: Dirk Brenken <dev@brenken.org>
lilik-openwrt-22.03
Dirk Brenken 4 years ago
parent
commit
f91e5cc666
No known key found for this signature in database GPG Key ID: 9D71CD547BFAE684
5 changed files with 18 additions and 10 deletions
  1. +1
    -1
      net/adblock/Makefile
  2. +3
    -1
      net/adblock/files/README.md
  3. +3
    -6
      net/adblock/files/adblock.mail
  4. +4
    -2
      net/adblock/files/adblock.sh
  5. +7
    -0
      net/adblock/files/adblock.sources

+ 1
- 1
net/adblock/Makefile View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=adblock PKG_NAME:=adblock
PKG_VERSION:=4.1.0 PKG_VERSION:=4.1.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org> PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>


+ 3
- 1
net/adblock/files/README.md View File

@ -12,9 +12,10 @@ A lot of people already use adblocker plugins within their desktop browsers, but
| :------------------ | :-----: | :--- | :--------------- | :-------------------------------------------------------------------------------- | | :------------------ | :-----: | :--- | :--------------- | :-------------------------------------------------------------------------------- |
| adaway | x | S | mobile | [Link](https://github.com/AdAway/adaway.github.io) | | adaway | x | S | mobile | [Link](https://github.com/AdAway/adaway.github.io) |
| adguard | x | L | general | [Link](https://adguard.com) | | adguard | x | L | general | [Link](https://adguard.com) |
| anti_ad | | L | compilation | [Link](https://github.com/privacy-protection-tools/anti-AD/blob/master/README.md) |
| adguard_tracking | | S | tracking | [Link](https://github.com/AdguardTeam/cname-trackers) |
| android_tracking | | S | tracking | [Link](https://github.com/Perflyst/PiHoleBlocklist) | | android_tracking | | S | tracking | [Link](https://github.com/Perflyst/PiHoleBlocklist) |
| andryou | | L | compilation | [Link](https://gitlab.com/andryou/block/-/blob/master/readme.md) | | andryou | | L | compilation | [Link](https://gitlab.com/andryou/block/-/blob/master/readme.md) |
| anti_ad | | L | compilation | [Link](https://github.com/privacy-protection-tools/anti-AD/blob/master/README.md) |
| anudeep | | M | compilation | [Link](https://github.com/anudeepND/blacklist) | | anudeep | | M | compilation | [Link](https://github.com/anudeepND/blacklist) |
| bitcoin | | S | mining | [Link](https://github.com/hoshsadiq/adblock-nocoin-list) | | bitcoin | | S | mining | [Link](https://github.com/hoshsadiq/adblock-nocoin-list) |
| disconnect | x | S | general | [Link](https://disconnect.me) | | disconnect | x | S | general | [Link](https://disconnect.me) |
@ -61,6 +62,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but
<b>S</b> (-10k), <b>M</b> (10k-30k) and <b>L</b> (30k-80k) should work for 128 MByte devices, <b>S</b> (-10k), <b>M</b> (10k-30k) and <b>L</b> (30k-80k) should work for 128 MByte devices,
<b>XL</b> (80k-200k) should work for 256-512 MByte devices, <b>XL</b> (80k-200k) should work for 256-512 MByte devices,
<b>XXL</b> (200k-) needs more RAM and Multicore support, e.g. x86 or raspberry devices. <b>XXL</b> (200k-) needs more RAM and Multicore support, e.g. x86 or raspberry devices.
<b>VAR</b> (50k-500k) variable size depending on the selection.
* Zero-conf like automatic installation & setup, usually no manual changes needed * Zero-conf like automatic installation & setup, usually no manual changes needed
* Simple but yet powerful adblock engine: adblock does not use error prone external iptables rulesets, http pixel server instances and things like that * Simple but yet powerful adblock engine: adblock does not use error prone external iptables rulesets, http pixel server instances and things like that
* Supports five different DNS backend formats: dnsmasq, unbound, named (bind), kresd or raw (e.g. used by dnscrypt-proxy) * Supports five different DNS backend formats: dnsmasq, unbound, named (bind), kresd or raw (e.g. used by dnscrypt-proxy)


+ 3
- 6
net/adblock/files/adblock.mail View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# send mail script for adblock notifications # send mail script for adblock notifications
# Copyright (c) 2015-2020 Dirk Brenken (dev@brenken.org)
# Copyright (c) 2015-2021 Dirk Brenken (dev@brenken.org)
# This is free software, licensed under the GNU General Public License v3. # This is free software, licensed under the GNU General Public License v3.
# Please note: you have to manually install and configure the package 'msmtp' before using this script # Please note: you have to manually install and configure the package 'msmtp' before using this script
@ -55,12 +55,9 @@ adb_mailhead="From: ${adb_mailsender}\\nTo: ${adb_mailreceiver}\\nSubject: ${adb
# #
sys_info="$(strings /etc/banner 2>/dev/null; ubus call system board | sed -e 's/\"release\": {//' | sed -e 's/^[ \t]*//' | sed -e 's/[{}\",]//g' | sed -e 's/[ ]/ \t/' | sed '/^$/d' 2>/dev/null)" sys_info="$(strings /etc/banner 2>/dev/null; ubus call system board | sed -e 's/\"release\": {//' | sed -e 's/^[ \t]*//' | sed -e 's/[{}\",]//g' | sed -e 's/[ ]/ \t/' | sed '/^$/d' 2>/dev/null)"
adb_info="$(/etc/init.d/adblock status 2>/dev/null)" adb_info="$(/etc/init.d/adblock status 2>/dev/null)"
if [ -f "/var/log/messages" ]
if [ -x "${adb_logread}" ]
then then
log_info="$(awk '/adblock-/{NR=1;max=79;if(length($0)>max+1)while($0){if(NR==1){print substr($0,1,max),"&#8629;"} else {print " ",substr($0,1,max)}{$0=substr($0,max+1);NR=NR+1}}else print}' /var/log/messages)"
elif [ -x "${adb_logread}" ]
then
log_info="$("${adb_logread}" -e "adblock-" | awk '{NR=1;max=79;if(length($0)>max+1)while($0){if(NR==1){print substr($0,1,max),"&#8629;"} else {print " ",substr($0,1,max)}{$0=substr($0,max+1);NR=NR+1}}else print}')"
log_info="$("${adb_logread}" -l 100 -e "adblock-" | awk '{NR=1;max=120;if(length($0)>max+1)while($0){if(NR==1){print substr($0,1,max)}else{print substr($0,1,max)}{$0=substr($0,max+1);NR=NR+1}}else print}')"
fi fi
# mail body # mail body


+ 4
- 2
net/adblock/files/adblock.sh View File

@ -1082,7 +1082,7 @@ f_query()
# #
f_jsnup() f_jsnup()
{ {
local runtime utils memory bg_pid status="${1:-"enabled"}"
local entry sources runtime utils memory bg_pid status="${1:-"enabled"}"
case "${status}" in case "${status}" in
"enabled"|"error") "enabled"|"error")
@ -1125,6 +1125,8 @@ f_jsnup()
json_get_var runtime "last_run" json_get_var runtime "last_run"
fi fi
fi fi
sources="$(printf "%s\n" ${adb_sources} | "${adb_sort}" | "${adb_awk}" '{ORS=" ";print $0}')"
> "${adb_rtfile}" > "${adb_rtfile}"
json_load_file "${adb_rtfile}" >/dev/null 2>&1 json_load_file "${adb_rtfile}" >/dev/null 2>&1
json_init json_init
@ -1132,7 +1134,7 @@ f_jsnup()
json_add_string "adblock_version" "${adb_ver}" json_add_string "adblock_version" "${adb_ver}"
json_add_string "blocked_domains" "${adb_cnt:-0}" json_add_string "blocked_domains" "${adb_cnt:-0}"
json_add_array "active_sources" json_add_array "active_sources"
for entry in ${adb_sources}
for entry in ${sources}
do do
json_add_object json_add_object
json_add_string "source" "${entry}" json_add_string "source" "${entry}"


+ 7
- 0
net/adblock/files/adblock.sources View File

@ -13,6 +13,13 @@
"focus": "general", "focus": "general",
"descurl": "https://adguard.com" "descurl": "https://adguard.com"
}, },
"adguard_tracking": {
"url": "https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/combined_disguised_trackers_justdomains.txt",
"rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}",
"size": "S",
"focus": "tracking",
"descurl": "https://github.com/AdguardTeam/cname-trackers"
},
"android_tracking": { "android_tracking": {
"url": "https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/android-tracking.txt", "url": "https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/android-tracking.txt",
"rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}", "rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}",


Loading…
Cancel
Save