From 8822046be5658ac380abee02d0b3966a3b4297d5 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Fri, 15 Sep 2017 14:51:14 +0200 Subject: [PATCH] adblock: update 3.0.2 * better system information * several kresd related documentation fixes Signed-off-by: Dirk Brenken --- net/adblock/Makefile | 2 +- net/adblock/files/README.md | 43 +++++++++++++++++++----------------- net/adblock/files/adblock.sh | 21 +++++++++++++++--- 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/net/adblock/Makefile b/net/adblock/Makefile index f311972cdc..2efc54af88 100644 --- a/net/adblock/Makefile +++ b/net/adblock/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock -PKG_VERSION:=3.0.1 +PKG_VERSION:=3.0.2 PKG_RELEASE:=1 PKG_LICENSE:=GPL-3.0+ PKG_MAINTAINER:=Dirk Brenken diff --git a/net/adblock/files/README.md b/net/adblock/files/README.md index 55dc570705..610bad7738 100644 --- a/net/adblock/files/README.md +++ b/net/adblock/files/README.md @@ -129,19 +129,19 @@ A lot of people already use adblocker plugins within their desktop browsers, but * adb\_manmode => do not automatically update block lists during startup, use backups instead (default: '0', disabled) ## Examples -**change default dns backend to 'unbound':** -

+**change default dns backend to 'unbound':**  
+
 Adblock deposits the sorted and filtered block list (adb_list.overall) 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: "/var/lib/unbound/adb_list.overall"
 
-**change default dns backend to 'named' (bind):** -

+**change default dns backend to 'named' (bind):**  
+
 Adblock deposits the sorted and filtered block list (adb_list.overall) in '/var/lib/bind' where bind can find them.
 To use the block list please modify the following bind configuration files:
-
+

 change '/etc/bind/named.conf', in the 'options' namespace add:
   response-policy { zone "rpz"; };
 
@@ -162,30 +162,33 @@ create the new file '/etc/bind/db.rpz' and add:
   $INCLUDE /var/lib/bind/adb_list.overall
 
-**change default dns backend to 'kresd':** -

+**change default dns backend to 'kresd':**  
+
 The knot-resolver (kresd) is only available on turris omnia devices. Currently there's no package for kresd in the official LEDE / OpenWrt package repository.
 Adblock deposits the sorted and filtered block list (adb_list.overall) in '/etc/kresd' where kresd can find them.
 To use the block list please create/modify the following kresd configuration files:
+

+TurrisOS > 3.6:
+  edit '/etc/config/resolver' and change / uncomment the following options:
+    forward_upstream '0'
+    list rpz_file '/etc/kresd/adb_list.overall'
 
-edit '/etc/config/resolver' and uncomment the following option:
-  option include_config '/etc/kresd/custom.conf'
+TurrisOS < 3.6:
+  edit '/etc/config/resolver' and change / uncomment the following options:
+   forward_upstream '0'
+   option include_config '/etc/kresd/custom.conf'
 
-in the same file change the 'forward_upstream' option like that:
-  forward_upstream '0'
-
-create '/etc/kresd/custom.conf' and add:
-  policy.add(policy.rpz(policy.DENY, '/etc/kresd/adb_list.overall'))
-  policy.add(policy.all(policy.FORWARD('8.8.8.8')))
-  policy.add(policy.all(policy.FORWARD('8.8.4.4')))
+  create '/etc/kresd/custom.conf' and add:
+    policy.add(policy.rpz(policy.DENY, '/etc/kresd/adb_list.overall'))
+    policy.add(policy.all(policy.FORWARD({'8.8.8.8', '8.8.4.4'})))
 
-**change default dns backend to 'dnscrypt-proxy':** -

+**change default dns backend to 'dnscrypt-proxy':**  
+
 Adblock deposits the sorted and filtered block list (adb_list.overall) by default in '/tmp' where DNSCrypt-Proxy can find them.
 The blacklist option is not supported by default, because DNSCrypt-Proxy is compiled without plugins support.
 Take a custom LEDE build with plugins support to use this feature:
-
+

 edit '/etc/config/dnscrypt-proxy' and add the following option per dnscrypt-proxy instance:
   list blacklist 'domains:/tmp/adb_list.overall'
 
diff --git a/net/adblock/files/adblock.sh b/net/adblock/files/adblock.sh index 3f8e13a96c..6eb36fa58c 100755 --- a/net/adblock/files/adblock.sh +++ b/net/adblock/files/adblock.sh @@ -10,8 +10,8 @@ # LC_ALL=C PATH="/usr/sbin:/usr/bin:/sbin:/bin" -adb_ver="3.0.1" -adb_sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')" +adb_ver="3.0.2" +adb_sysver="unknown" adb_enabled=0 adb_debug=0 adb_manmode=0 @@ -34,7 +34,22 @@ adb_rc=0 # f_envload() { - local dns_up cnt=0 + local dns_up sys_call sys_desc sys_model sys_ver cnt=0 + + # get system information + # + sys_call="$(ubus -S call system board 2>/dev/null)" + if [ -n "${sys_call}" ] + then + sys_desc="$(printf '%s' "${sys_call}" | jsonfilter -e '@.release.description')" + sys_model="$(printf '%s' "${sys_call}" | jsonfilter -e '@.model')" + sys_ver="$(cat /etc/turris-version 2>/dev/null)" + if [ -n "${sys_ver}" ] + then + sys_desc="${sys_desc}/${sys_ver}" + fi + adb_sysver="${sys_model}, ${sys_desc}" + fi # source in system libraries #