Browse Source

adblock: 2.3.0 (package release 2)

* update readme regarding unbound integration
* cosmetics

Signed-off-by: Dirk Brenken <dev@brenken.org>
lilik-openwrt-22.03
Dirk Brenken 8 years ago
parent
commit
1e7a1b380b
3 changed files with 11 additions and 21 deletions
  1. +1
    -1
      net/adblock/Makefile
  2. +3
    -5
      net/adblock/files/README.md
  3. +7
    -15
      net/adblock/files/adblock.sh

+ 1
- 1
net/adblock/Makefile View File

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


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

@ -125,12 +125,10 @@ A lot of people already use adblocker plugins within their desktop browsers, but
**change default dns backend to 'unbound':** **change default dns backend to 'unbound':**
<pre><code> <pre><code>
switch to 'manual' unbound config in /etc/config/unbound:
[...]
option manual_conf '1'
Adblock detects the presence of an active unbound dns backend and the block lists will be automatically pulled in by unbound.
The adblock script deposits the sorted and filtered block lists in '/var/lib/unbound' where unbound can find them in its jail.
If you use manual configuration for unbound, then just include the following line in your 'server:' clause:
include adblock lists in /etc/unbound/unbound.conf:
[...]
include: "/var/lib/unbound/adb_list.*" include: "/var/lib/unbound/adb_list.*"
</code></pre> </code></pre>


+ 7
- 15
net/adblock/files/adblock.sh View File

@ -10,10 +10,11 @@
# #
LC_ALL=C LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin" PATH="/usr/sbin:/usr/bin:/sbin:/bin"
adb_ver="2.3.0"
adb_ver="2.3.0-2"
adb_enabled=1 adb_enabled=1
adb_debug=0 adb_debug=0
adb_backup=0 adb_backup=0
adb_backupdir="/mnt"
adb_whitelist="/etc/adblock/adblock.whitelist" adb_whitelist="/etc/adblock/adblock.whitelist"
adb_whitelist_rset="\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}" adb_whitelist_rset="\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}"
adb_fetch="/usr/bin/wget" adb_fetch="/usr/bin/wget"
@ -170,26 +171,17 @@ f_rmtemp()
{ {
rm -f "${adb_tmpload}" rm -f "${adb_tmpload}"
rm -f "${adb_tmpfile}" rm -f "${adb_tmpfile}"
if [ -d "${adb_tmpdir}" ]
then
rm -rf "${adb_tmpdir}"
fi
rm -rf "${adb_tmpdir}"
} }
# f_rmdns: remove dns related files & directories # f_rmdns: remove dns related files & directories
# #
f_rmdns() f_rmdns()
{ {
if [ -d "${adb_dnsdir}" ]
if [ -n "${adb_dns}" ]
then then
rm -f "${adb_dnsdir}/${adb_dnsprefix}"* rm -f "${adb_dnsdir}/${adb_dnsprefix}"*
fi
if [ -d "${adb_backupdir}" ]
then
rm -f "${adb_backupdir}/${adb_dnsprefix}"*.gz rm -f "${adb_backupdir}/${adb_dnsprefix}"*.gz
fi
if [ -d "${adb_dnshidedir}" ]
then
rm -rf "${adb_dnshidedir}" rm -rf "${adb_dnshidedir}"
fi fi
ubus call service delete "{\"name\":\"adblock_stats\",\"instances\":\"statistics\"}" 2>/dev/null ubus call service delete "{\"name\":\"adblock_stats\",\"instances\":\"statistics\"}" 2>/dev/null
@ -386,7 +378,7 @@ f_main()
# basic pre-checks # basic pre-checks
# #
if [ "${enabled}" = "0" ] || [ -z "${url}" ] || [ -z "${src_rset}" ]
if [ ! "${enabled}" = "1" ] || [ -z "${url}" ] || [ -z "${src_rset}" ]
then then
f_list remove f_list remove
continue continue
@ -444,7 +436,7 @@ f_main()
fi fi
f_log "debug" "loop_2 ::: name: ${src_name}, rc: ${rc}" f_log "debug" "loop_2 ::: name: ${src_name}, rc: ${rc}"
# remove whitelist domains, sort and make them unique, final list preparation
# remove whitelist domains, final list preparation
# #
if [ ${rc} -eq 0 ] && [ -s "${adb_tmpfile}" ] if [ ${rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
then then
@ -465,7 +457,7 @@ f_main()
f_log "debug" "loop_3 ::: name: ${src_name}, rc: ${rc}" f_log "debug" "loop_3 ::: name: ${src_name}, rc: ${rc}"
done done
# sort block lists
# sort/unique overall
# #
for src_name in $(ls -dASr "${adb_tmpdir}/${adb_dnsprefix}"* 2>/dev/null) for src_name in $(ls -dASr "${adb_tmpdir}/${adb_dnsprefix}"* 2>/dev/null)
do do


Loading…
Cancel
Save