From 8db9af146acc0e4d5a0aa026636943d3f28468f2 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Tue, 5 Dec 2023 08:26:34 +0000 Subject: [PATCH] luci-app-adblock-fast: update to 1.1.0-1 Signed-off-by: Stan Grishin --- applications/luci-app-adblock-fast/Makefile | 2 +- .../resources/view/adblock-fast/overview.js | 75 +++++--- .../po/templates/adblock-fast.pot | 163 ++++++++++-------- .../root/usr/libexec/rpcd/luci.adblock-fast | 35 ++-- .../rpcd/acl.d/luci-app-adblock-fast.json | 3 +- 5 files changed, 171 insertions(+), 107 deletions(-) diff --git a/applications/luci-app-adblock-fast/Makefile b/applications/luci-app-adblock-fast/Makefile index b3b1d4ed61..42d238d991 100644 --- a/applications/luci-app-adblock-fast/Makefile +++ b/applications/luci-app-adblock-fast/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Stan Grishin -PKG_VERSION:=1.0.1-2 +PKG_VERSION:=1.1.0-1 LUCI_TITLE:=AdBlock-Fast Web UI LUCI_DESCRIPTION:=Provides Web UI for adblock-fast service. diff --git a/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js b/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js index ab36223983..ae8a4f2a08 100644 --- a/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js +++ b/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js @@ -5,7 +5,6 @@ "use strict"; "require form"; -"require uci"; "require view"; "require adblock-fast.status as adb"; @@ -26,8 +25,9 @@ return view.extend({ return Promise.all([ L.resolveDefault(adb.getFileUrlFilesizes(pkg.Name), {}), L.resolveDefault(adb.getPlatformSupport(pkg.Name), {}), - uci.load(pkg.Name), - uci.load("dhcp"), + L.uci.load(pkg.Name), + L.uci.load("dhcp"), + L.uci.load("smartdns"), ]); }, @@ -95,6 +95,14 @@ return view.extend({ ); } } + if (!reply.platform.smartdns_installed) { + text = + text + + "
" + + _("Please note that %s is not supported on this system.").format( + "smartdns.domainset" + ); + } if (!reply.platform.unbound_installed) { text = text + @@ -122,6 +130,9 @@ return view.extend({ } o.value("dnsmasq.servers", _("dnsmasq servers file")); } + if (reply.platform.smartdns_installed) { + o.value("smartdns.domainset", _("smartdns domain set")); + } if (reply.platform.unbound_installed) { o.value("unbound.adb_list", _("unbound adblock list")); } @@ -155,27 +166,12 @@ return view.extend({ ); o.value("*", _("AdBlock on all instances")); - // Object.values(L.uci.sections("dhcp", "dnsmasq")).forEach(function ( - // val, - // index - // ) { - // const nameValueMap = new Map(Object.entries(val)); - // so.value( - // nameValueMap.get(".name"), - // "%s (Name: %s, Domain: %s, Local: %s)".format( - // nameValueMap.get(".index"), - // nameValueMap.get(".name") || "noname", - // val.domain || "unset", - // val.local || "unset" - // ) - // ); - // }); - - var sections = uci.sections("dhcp", "dnsmasq"); - sections.forEach((element) => { + Object.values(L.uci.sections("dhcp", "dnsmasq")).forEach(function ( + element + ) { var description; var key; - if (element[".name"] === uci.resolveSID("dhcp", element[".name"])) { + if (element[".name"] === L.uci.resolveSID("dhcp", element[".name"])) { key = element[".index"]; description = "dnsmasq[" + element[".index"] + "]"; } else { @@ -190,6 +186,39 @@ return view.extend({ o.depends("dns", "dnsmasq.servers"); o.retain = true; + o = s1.taboption( + "tab_basic", + form.ListValue, + "smartdns_instance", + _("Use AdBlocking on the SmartDNS instance(s)"), + _( + "You can limit the AdBlocking to a specific SmartDNS instance(s) (%smore information%s)." + ).format( + '', + "" + ) + ); + o.value("*", _("AdBlock on all instances")); + + Object.values(L.uci.sections("smartdns", "smartdns")).forEach(function ( + element + ) { + var description; + var key; + if (element[".name"] === L.uci.resolveSID("smartdns", element[".name"])) { + key = element[".index"]; + description = "smartdns[" + element[".index"] + "]"; + } else { + key = element[".name"]; + description = element[".name"]; + } + o.value(key, _("AdBlock on %s only").format(description)); + }); + o.value("-", _("No AdBlock on SmartDNS")); + o.default = "*"; + o.depends("dns", "smartdns.domainset"); + o.retain = true; + o = s1.taboption( "tab_basic", form.ListValue, @@ -381,7 +410,7 @@ return view.extend({ o = s3.option(form.DummyValue, "_size", _("Size")); o.modalonly = false; o.cfgvalue = function (section_id) { - let url = uci.get(pkg.Name, section_id, "url"); + let url = L.uci.get(pkg.Name, section_id, "url"); let ret = _("Unknown"); reply.sizes.forEach((element) => { if (element.url === url) { diff --git a/applications/luci-app-adblock-fast/po/templates/adblock-fast.pot b/applications/luci-app-adblock-fast/po/templates/adblock-fast.pot index 7df0c2bdce..5f9386f0df 100644 --- a/applications/luci-app-adblock-fast/po/templates/adblock-fast.pot +++ b/applications/luci-app-adblock-fast/po/templates/adblock-fast.pot @@ -18,7 +18,7 @@ msgstr "" msgid "-" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:398 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:427 msgid "Action" msgstr "" @@ -31,11 +31,13 @@ msgstr "" msgid "AdBlock Fast" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:185 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:181 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:215 msgid "AdBlock on %s only" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:156 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:167 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:201 msgid "AdBlock on all instances" msgstr "" @@ -43,11 +45,11 @@ msgstr "" msgid "AdBlock-Fast" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:349 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:378 msgid "AdBlock-Fast - Allowed and Blocked Domains" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:373 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:402 msgid "AdBlock-Fast - Allowed and Blocked Lists URLs" msgstr "" @@ -59,11 +61,11 @@ msgstr "" msgid "AdBlock-Fast - Status" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:251 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:280 msgid "Add IPv6 entries" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:248 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:277 msgid "Add IPv6 entries to block-list." msgstr "" @@ -71,21 +73,21 @@ msgstr "" msgid "Advanced Configuration" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:399 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:404 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:428 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:433 msgid "Allow" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:357 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:386 msgid "Allowed Domains" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:312 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:341 msgid "" "Attempt to create a compressed cache of block-list in the persistent memory." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:236 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:265 msgid "Automatic Config Update" msgstr "" @@ -93,12 +95,12 @@ msgstr "" msgid "Basic Configuration" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:400 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:404 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:429 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:433 msgid "Block" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:365 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:394 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:87 msgid "Blocked Domains" msgstr "" @@ -139,19 +141,19 @@ msgstr "" msgid "Config (%s) validation failure!" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:209 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:238 msgid "Controls system log and console output verbosity." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:285 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:314 msgid "Curl download retry" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:272 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:301 msgid "Curl maximum file size (in bytes)" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:111 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:119 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:86 msgid "DNS Service" msgstr "" @@ -160,21 +162,21 @@ msgstr "" msgid "DNS resolution option, see the %sREADME%s for details." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:323 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:352 msgid "Directory for compressed cache file" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:325 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:354 msgid "" "Directory for compressed cache file of block-list in the persistent memory." msgstr "" #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:424 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:239 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:268 msgid "Disable" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:341 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:370 msgid "Disable Debugging" msgstr "" @@ -186,23 +188,23 @@ msgstr "" msgid "Disabling %s service" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:134 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:145 msgid "Dnsmasq Config File URL" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:250 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:279 msgid "Do not add IPv6 entries" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:315 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:344 msgid "Do not store compressed cache" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:302 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:331 msgid "Do not use simultaneous processing" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:262 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:291 msgid "Download time-out (in seconds)" msgstr "" @@ -212,17 +214,17 @@ msgid "Downloading lists" msgstr "" #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:405 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:240 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:394 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:269 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:423 msgid "Enable" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:338 -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:342 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:367 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:371 msgid "Enable Debugging" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:339 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:368 msgid "Enables debug output to /tmp/adblock-fast.log." msgstr "" @@ -347,11 +349,11 @@ msgstr "" msgid "Force Reloading" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:197 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:226 msgid "Force Router DNS" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:201 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:230 msgid "Force Router DNS server to all local devices" msgstr "" @@ -359,7 +361,7 @@ msgstr "" msgid "Force redownloading %s block lists" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:198 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:227 msgid "Forces Router DNS use on local devices, also known as DNS Hijacking." msgstr "" @@ -371,27 +373,27 @@ msgstr "" msgid "Grant UCI and file access for luci-app-adblock-fast" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:247 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:276 msgid "IPv6 Support" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:274 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:303 msgid "" "If curl is installed and detected, it would not download files bigger than " "this." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:287 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:316 msgid "" "If curl is installed and detected, it would retry download this many times " "on timeout/fail." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:358 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:387 msgid "Individual domains to be allowed." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:366 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:395 msgid "Individual domains to be blocked." msgstr "" @@ -399,21 +401,25 @@ msgstr "" msgid "Invalid compressed cache directory '%s'" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:221 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:250 msgid "LED to indicate status" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:299 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:328 msgid "" "Launch all lists downloads and processing simultaneously, reducing service " "start time." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:200 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:229 msgid "Let local devices use their own DNS servers if set" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:187 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:217 +msgid "No AdBlock on SmartDNS" +msgstr "" + +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:183 msgid "No AdBlock on dnsmasq" msgstr "" @@ -429,7 +435,7 @@ msgstr "" msgid "Not installed or not found" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:208 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:237 msgid "Output Verbosity Setting" msgstr "" @@ -441,11 +447,11 @@ msgstr "" msgid "Pausing %s" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:237 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:266 msgid "Perform config update before downloading the block/allow-lists." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:223 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:252 msgid "Pick the LED not already used in %sSystem LED Configuration%s." msgstr "" @@ -456,6 +462,7 @@ msgstr "" #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:86 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:93 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:102 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:110 msgid "Please note that %s is not supported on this system." msgstr "" @@ -489,19 +496,19 @@ msgstr "" msgid "Service Warnings" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:297 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:326 msgid "Simultaneous processing" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:381 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:410 msgid "Size" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:391 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:420 msgid "Size: %s" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:212 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:241 msgid "Some output" msgstr "" @@ -530,7 +537,7 @@ msgstr "" msgid "Stop" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:263 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:292 msgid "Stop the download if it is stalled for set number of seconds." msgstr "" @@ -543,15 +550,15 @@ msgstr "" msgid "Stopping %s service" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:316 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:345 msgid "Store compressed cache" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:310 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:339 msgid "Store compressed cache file on router" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:211 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:240 msgid "Suppress output" msgstr "" @@ -581,25 +588,29 @@ msgstr "" msgid "The dnsmasq nft sets support is enabled, but nft is not installed" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:407 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:436 msgid "URL" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:136 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:147 msgid "" "URL to the external dnsmasq config file, see the %sREADME%s for details." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:374 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:403 msgid "URLs to file(s) containing lists to be allowed or blocked." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:385 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:414 #: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:95 msgid "Unknown" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:148 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:193 +msgid "Use AdBlocking on the SmartDNS instance(s)" +msgstr "" + +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:159 msgid "Use AdBlocking on the dnsmasq instance(s)" msgstr "" @@ -608,11 +619,11 @@ msgid "" "Use of external dnsmasq config file detected, please set '%s' option to '%s'" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:303 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:332 msgid "Use simultaneous processing" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:213 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:242 msgid "Verbose output" msgstr "" @@ -628,36 +639,46 @@ msgstr "" msgid "Warning" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:150 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:195 +msgid "" +"You can limit the AdBlocking to a specific SmartDNS instance(s) (%smore " +"information%s)." +msgstr "" + +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:161 msgid "" "You can limit the AdBlocking to a specific dnsmasq instance(s) (%smore " "information%s)." msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:115 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:123 msgid "dnsmasq additional hosts" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:116 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:124 msgid "dnsmasq config" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:118 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:126 msgid "dnsmasq ipset" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:121 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:129 msgid "dnsmasq nft set" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:123 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:131 msgid "dnsmasq servers file" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:226 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:255 msgid "none" msgstr "" -#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:126 +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:134 +msgid "smartdns domain set" +msgstr "" + +#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:137 msgid "unbound adblock list" msgstr "" diff --git a/applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast b/applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast index 1285bb80e8..699b286d84 100755 --- a/applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast +++ b/applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast @@ -73,13 +73,18 @@ set_init_action() { fi case $action in enable) - cmd="uci -q set ${name}.config.enabled=1 && uci commit $name";; + cmd="/etc/init.d/${name} ${action}" + cmd="${cmd} && uci_set ${name} config enabled 1 && uci_commit $name" + ;; disable) - cmd="uci -q set ${name}.config.enabled=0 && uci commit $name";; + cmd="/etc/init.d/${name} ${action}" + cmd="${cmd} && uci_set ${name} config enabled 0 && uci_commit $name" + ;; start|stop|reload|restart|dl|pause) - cmd="/etc/init.d/${name} ${action}";; + cmd="/etc/init.d/${name} ${action}" + ;; esac - if [ -n "$cmd" ] && eval "${cmd}" >/dev/null 2>&1; then + if [ -n "$cmd" ] && eval "$cmd" >/dev/null 2>&1; then print_json_bool "result" '1' else print_json_bool "result" '0' @@ -96,15 +101,12 @@ get_init_status() { local compressed_cache_dir config_load "$name" config_get compressed_cache_dir 'config' 'compressed_cache_dir' '/etc' - if [ -n "$(sanitize_dir "$compressed_cache_dir")" ]; then - compressed_cache_dir="$(sanitize_dir "$compressed_cache_dir")" - else - compressed_cache_dir="/etc" - fi - if [ -n "$(uci -q get $packageName.config.dnsmasq_config_file_url)" ]; then + compressed_cache_dir="$(sanitize_dir "$compressed_cache_dir")" + compressed_cache_dir="${compressed_cache_dir:-/etc}" + if [ -n "$(uci_get "$packageName" 'config' 'dnsmasq_config_file_url')" ]; then dns="dnsmasq.conf" else - dns="$(uci -q get $packageName.config.dns)" + dns="$(uci_get "$packageName" 'config' 'dns')" fi case "$dns" in dnsmasq.addnhosts) @@ -132,6 +134,12 @@ get_init_status() { outputCache="$dnsmasqServersCache" outputGzip="${compressed_cache_dir}/${dnsmasqServersGzip}" ;; + smartdns.domainset) + outputFilter="$smartdnsDomainSetFilter" + outputFile="$smartdnsDomainSetFile" + outputCache="$smartdnsDomainSetCache" + outputGzip="${compressed_cache_dir}/${smartdnsDomainSetGzip}" + ;; unbound.adb_list) outputFile="$unboundFile" outputCache="$unboundCache" @@ -243,6 +251,11 @@ get_platform_support() { else json_add_boolean 'dnsmasq_installed' '0' fi + if check_smartdns; then + json_add_boolean 'smartdns_installed' '1' + else + json_add_boolean 'smartdns_installed' '0' + fi if check_unbound; then json_add_boolean 'unbound_installed' '1' else diff --git a/applications/luci-app-adblock-fast/root/usr/share/rpcd/acl.d/luci-app-adblock-fast.json b/applications/luci-app-adblock-fast/root/usr/share/rpcd/acl.d/luci-app-adblock-fast.json index 4ae446af6f..310fd8618c 100644 --- a/applications/luci-app-adblock-fast/root/usr/share/rpcd/acl.d/luci-app-adblock-fast.json +++ b/applications/luci-app-adblock-fast/root/usr/share/rpcd/acl.d/luci-app-adblock-fast.json @@ -15,7 +15,8 @@ }, "uci": [ "adblock-fast", - "dhcp" + "dhcp", + "smartdns" ] }, "write": { -- 2.30.2