adblock: update 1.4.5 3071/head
authorDirk Brenken <dev@brenken.org>
Tue, 16 Aug 2016 06:54:21 +0000 (08:54 +0200)
committerDirk Brenken <dev@brenken.org>
Tue, 16 Aug 2016 06:59:34 +0000 (08:59 +0200)
* change the default hphosts list source to ad and tracking servers
only, the overall list includes to many false positives
* new optional config parm 'adb_hotplugif' to restrict hotplug support
to a certain wan interface or to disable it at all
* documentation update
* cosmetics

Signed-off-by: Dirk Brenken <dev@brenken.org>
net/adblock/Makefile
net/adblock/files/README.md
net/adblock/files/adblock-helper.sh
net/adblock/files/adblock-update.sh
net/adblock/files/adblock.conf
net/adblock/files/adblock.hotplug

index d5e84c13af264bad1b0ff6dce37023709d66d645..293d6028116bf4fea410f13c1674bd47656b31b8 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock
-PKG_VERSION:=1.4.4
+PKG_VERSION:=1.4.5
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
index 9bb8495267b89ca8329193d31aa731620e1c7af1..6b9b0b20675fb0a89a5786441324a6d7240d0162 100644 (file)
@@ -16,7 +16,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but
     * [feodotracker](https://feodotracker.abuse.ch)
     * => daily updates, approx. 0-10 entries
     * [hphosts](https://hosts-file.net)
-    * => monthly updates, approx. 390.000 entries
+    * => monthly updates, approx. 50.000 entries
     * [malwaredomains](http://malwaredomains.com)
     * => daily updates, approx. 16.000 entries
     * [malwaredomainlist](http://www.malwaredomainlist.com)
@@ -61,7 +61,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but
 * use two dynamic uhttpd instances as adblock pixel server, separated for ads delivered on port 80 and on port 443
 * use dynamic iptables chains/rulesets for adblock related redirects/rejects
 * init system support (start/stop/restart/reload/toggle/stats/cfgup)
-* hotplug support, the adblock start will be triggered by wan 'ifup' event
+* hotplug support, the adblock start will be triggered by wan 'ifup' event, this can be restricted to a certain wan interface or disabled at all (see config options below)
 * toggle to quickly switch adblock 'on' or 'off'
 * optional: automatic adblock list backup/restore, backups will be (de-)compressed on the fly (disabled by default)
 * optional: add new adblock sources via uci config (see example below)
@@ -101,6 +101,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but
 * **white-/blacklist:** add domain white- or blacklist entries to always-allow or -deny certain (sub) domains, by default both lists are located in _/etc/adblock_. Please add one domain per line - ip addresses, wildcards & regex are _not_ allowed (see example below)
 * **backup/restore:** enable the backup/restore feature, to restore automatically the latest compressed backup of your adblock lists in case of any processing error (i.e. a single blocklist source is down). Please use an (external) solid partition and _not_ your volatile router temp directory for this
 * **list updates:** for a scheduled call of the adblock service add an appropriate crontab entry (see example below)
+* **hotplug fine tuning:** to restrict hotplug support to a certain wan interface or to disable it at all, you can set 'adb\_hotplugif' to an existing interface like 'wan' or to a non-existing 'dummy' interface
 * **new list sources:** you could add new blocklist sources on your own via uci config, all you need is a source url and an awk one-liner (see example below)
 * **AP mode:** in 'AP mode' adblock uses automatically the local router ip as nullip address. To make sure that your LuCI interface will be still accessible, you have to change the local uhttpd instance to ports <> 80/443 (see example below)
 * **restricted mode:** to disable flash writes with adblock status information to the adblock config file (used by LuCI frontend), please set 'adb\_restricted' to '1'
@@ -122,6 +123,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but
     * adb\_forcedns => redirect all local DNS queries to the local dnsmasq resolver (default: '1', enabled / always disabled in 'AP mode')
     * adb\_fetchttl => set the timeout for list downloads (default: '5' seconds)
     * adb\_restricted => disable updates of the adblock config file (no flash writes) during runtime (default: '0', disabled)
+    * adb\_hotplugif => restrict hotplug support to a certain wan interface or disable it at all (default: '', disabled)
 
 ## Examples
 
index 88ad5e818e4a65c5bf120b942c74cc68605b88b1..e500c92b504a3bb77139fbb50416128b70005d20 100644 (file)
@@ -6,6 +6,7 @@
 #
 LC_ALL=C
 PATH="/usr/sbin:/usr/bin:/sbin:/bin"
+adb_hotplugif=""
 adb_lanif="lan"
 adb_nullport="65534"
 adb_nullportssl="65535"
index 0afd9b5b281af0890d66ea315943bba82b1bf269..1d08333cfcc123b0d5af538b2e0002d5dbf25b01 100755 (executable)
@@ -10,8 +10,8 @@
 #
 adb_pid="${$}"
 adb_pidfile="/var/run/adblock.pid"
-adb_scriptver="1.4.4"
-adb_mincfgver="2.3"
+adb_scriptver="1.4.5"
+adb_mincfgver="2.4"
 adb_scriptdir="${0%/*}"
 if [ -r "${adb_pidfile}" ]
 then
@@ -97,7 +97,7 @@ do
     then
         if [ "${src_name}" = "blacklist" ]
         then
-            tmp_domains="$(cat "${url}" | strings -n 1)"
+            tmp_domains="$(strings -n 1 "${url}")"
         elif [ "${src_name}" = "shalla" ]
         then
             shalla_archive="${adb_tmpdir}/shallalist.tar.gz"
@@ -117,7 +117,7 @@ do
                         break
                     fi
                 done
-                tmp_domains="$(cat "${shalla_file}" | strings -n 1)"
+                tmp_domains="$(strings -n 1 "${shalla_file}")"
                 rm -rf "${adb_tmpdir}/BL"
                 rm -f "${shalla_archive}"
                 rm -f "${shalla_file}"
index 5fdf224e1fc8d8a89a66bab3a8d243f97594e4b1..401a0a5ff2eb97370b8c69c99860f55e9a5d35db 100644 (file)
@@ -3,7 +3,7 @@
 
 config adblock 'global'
        option adb_enabled '1'
-       option adb_cfgver '2.3'
+       option adb_cfgver '2.4'
        option adb_whitelist '/etc/adblock/adblock.whitelist'
        option adb_whitelist_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}'
        option adb_forcedns '1'
@@ -44,9 +44,9 @@ config source 'feodo'
 
 config source 'hphosts'
        option enabled '0'
-       option adb_src 'https://hosts-file.net/download/hosts.txt'
+       option adb_src 'https://hosts-file.net/ad_servers.txt'
        option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-       option adb_src_desc 'broad blocklist against ad-, tracking- and other malicious hosts, monthly updates, approx. 390.000 entries'
+       option adb_src_desc 'broad blocklist against ad- and tracking hosts, monthly updates, approx. 50.000 entries'
 
 config source 'malware'
        option enabled '0'
index 8ea8a1835089d66d665f66db37183adb4199bfca..33377b5e6cc88af5c829f57d277ad870c61cf7a0 100644 (file)
@@ -15,6 +15,9 @@ f_envload
 
 if [ "${INTERFACE}" = "${adb_wanif4}" ] || [ "${INTERFACE}" = "${adb_wanif6}" ]
 then
-    /etc/init.d/adblock start
-    f_log "adblock service started due to '${ACTION}' of '${INTERFACE}' interface"
+    if [ -z "${adb_hotplugif}" ] || [ "${INTERFACE}" = "${adb_hotplugif}" ]
+    then
+        /etc/init.d/adblock start
+        f_log "adblock service started due to '${ACTION}' of '${INTERFACE}' interface"
+    fi
 fi