adblock: update 3.8.5

* use raw procd interface trigger as last resort, if the
  adblock config is not available during startup
* fix selective subdomain whitelisting for dnsmasq
* fix a kresd restart issue with 'DNS File Reset'
* fix a suspend/resume cornercase
* disable the tld compression, if the number of blocked domains
  is greater than 'adb_maxtld' (default: 100000)
* made the fw portlist configurable (default '53 853 5353')
* preliminary support for inotify-like autoload features
  of dns backends like kresd in future Turris OS. If 'adb_dnsinotify'
  is set to 'true', all adblock related restarts and the
  'DNS File Reset' will be disabled

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken
2019-09-06 10:18:05 +02:00
parent 0849e32659
commit 45cb0e1023
5 changed files with 163 additions and 136 deletions
+12 -9
View File
@@ -23,7 +23,7 @@ boot()
start_service()
{
if [ $("${adb_init}" enabled; printf "%u" ${?}) -eq 0 ]
if [ "$("${adb_init}" enabled; printf "%u" ${?})" -eq 0 ]
then
if [ -n "${adb_boot}" ]
then
@@ -33,11 +33,11 @@ start_service()
return 0
fi
fi
local nice="$(uci_get adblock extra adb_nice)"
local nice="$(uci_get adblock extra adb_nice "0")"
procd_open_instance "adblock"
procd_set_param command "${adb_script}" "${@}"
procd_set_param pidfile "${adb_pidfile}"
procd_set_param nice ${nice:-0}
procd_set_param nice "${nice}"
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
@@ -85,9 +85,9 @@ report()
status()
{
local key keylist value rtfile="$(uci_get adblock extra adb_rtfile)"
local key keylist value
local rtfile="$(uci_get adblock extra adb_rtfile "/tmp/adb_runtime.json")"
rtfile="${rtfile:-"/tmp/adb_runtime.json"}"
if [ -s "${rtfile}" ]
then
printf "%s\\n" "::: adblock runtime information"
@@ -106,13 +106,16 @@ status()
service_triggers()
{
local trigger="$(uci_get adblock global adb_trigger)"
local delay="$(uci_get adblock extra adb_triggerdelay)"
local trigger="$(uci_get adblock global adb_trigger)"
local delay="$(uci_get adblock extra adb_triggerdelay "2")"
if [ "${trigger}" != "none" ] && [ "${trigger}" != "timed" ]
PROCD_RELOAD_DELAY=$((delay*1000))
if [ -n "${trigger}" ] && [ "${trigger}" != "none" ] && [ "${trigger}" != "timed" ]
then
PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
procd_add_interface_trigger "interface.*.up" "${trigger}" "${adb_init}" start
elif [ -z "${trigger}" ]
then
procd_add_raw_trigger "interface.*.up" ${PROCD_RELOAD_DELAY} "${adb_init}" start
fi
procd_add_reload_trigger "adblock"
}