luci-app-adblock-fast: sync with principal package

Signed-off-by: Stan Grishin <stangri@melmac.ca>
This commit is contained in:
Stan Grishin
2025-08-01 01:42:12 +00:00
parent b7c08475e7
commit c26b8f28fe
7 changed files with 661 additions and 592 deletions

View File

@@ -1,13 +1,13 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright 2023-2025 MOSSDeF, Stan Grishin (stangri@melmac.ca).
# This is free software, licensed under AGPL-3.0-or-later.
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-adblock-fast
PKG_LICENSE:=AGPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
PKG_VERSION:=1.1.3
PKG_RELEASE:=1
PKG_VERSION:=1.1.4
PKG_RELEASE:=4
LUCI_TITLE:=AdBlock-Fast Web UI
LUCI_URL:=https://github.com/stangri/luci-app-adblock-fast/

View File

@@ -1,4 +1,20 @@
# README
# luci-app-adblock-fast
Documentation for this project is available at [https://docs.openwrt.melmac.net/luci-app-adblock-fast/](https://docs.openwrt.melmac.net/luci-app-adblock-fast/).
[![OpenWrt](https://img.shields.io/badge/OpenWrt-Compatible-blueviolet)](https://openwrt.org)
[![Web UI](https://img.shields.io/badge/Web_UI-Available-blue)](https://docs.openwrt.melmac.ca/adblock-fast/)
[![Lightweight](https://img.shields.io/badge/Size-Lightweight-brightgreen)](https://openwrt.org/packages/pkgdata/adblock-fast)
[![License](https://img.shields.io/badge/License-AGPL--3.0--or--later-lightgrey)](https://github.com/stangri/adblock-fast/blob/master/LICENSE)
A WebUI for fast, lightweight DNS-based ad-blocker for OpenWrt that works with dnsmasq, smartdns, or unbound.
It runs once to process and install blocklists, then exits — keeping memory usage low.
## Features of principal package
- Minimal runtime memory use
- Parallel blocklist download and processing
- Persistent cache support
- Optional Web UI for custom block/allow lists
- Reverts if DNS resolution fails after restart
📚 **Full documentation:**
[https://docs.openwrt.melmac.ca/adblock-fast/](https://docs.openwrt.melmac.ca/adblock-fast/)

View File

@@ -11,12 +11,29 @@ var pkg = {
get Name() {
return "adblock-fast";
},
get LuciCompat() {
return 7;
},
get ReadmeCompat() {
return "";
},
get URL() {
return (
"https://docs.openwrt.melmac.net/" + pkg.Name + "/" + pkg.ReadmeCompat
"https://docs.openwrt.melmac.ca/" +
pkg.Name +
"/" +
(pkg.ReadmeCompat ? pkg.ReadmeCompat + "/" : "")
);
},
isVersionMismatch: function (luci, pkg, rpcd) {
return luci !== pkg || pkg !== rpcd || luci !== rpcd;
},
formatMessage: function (info, template) {
if (!template) return _("Unknown message") + "<br />";
return (
(Array.isArray(info)
? template.format(...info)
: template.format(info || " ")) + "<br />"
);
},
humanFileSize: function (bytes, si = false, dp = 2) {
@@ -51,6 +68,12 @@ var getPlatformSupport = rpc.declare({
params: ["name"],
});
var getUbusInfo = rpc.declare({
object: "luci." + pkg.Name,
method: "getUbusInfo",
params: ["name"],
});
var _setInitAction = rpc.declare({
object: "luci." + pkg.Name,
method: "setInitAction",
@@ -87,12 +110,16 @@ var RPC = {
var status = baseclass.extend({
render: function () {
return Promise.all([L.resolveDefault(getInitStatus(pkg.Name), {})]).then(
function (data) {
return Promise.all([
L.resolveDefault(getInitStatus(pkg.Name), {}),
L.resolveDefault(getUbusInfo(pkg.Name), {}),
]).then(function (data) {
var reply = {
status: (data[0] && data[0][pkg.Name]) || {
status: data[0]?.[pkg.Name] || {
enabled: false,
status: null,
packageCompat: 0,
rpcdCompat: 0,
running: null,
version: null,
errors: [],
@@ -109,14 +136,38 @@ var status = baseclass.extend({
outputGzipExists: null,
leds: [],
},
ubus: data[1]?.[pkg.Name]?.instances?.main?.data || {
packageCompat: 0,
errors: [],
warnings: [],
},
};
if (
pkg.isVersionMismatch(
pkg.LuciCompat,
reply.status.packageCompat,
reply.status.rpcdCompat
)
) {
reply.ubus.warnings.push({
code: "warningInternalVersionMismatch",
info: [
reply.ubus.packageCompat,
pkg.LuciCompat,
reply.status.rpcdCompat,
'<a href="' +
pkg.URL +
'#internal_version_mismatch" target="_blank">',
"</a>",
],
});
}
var text = "";
var outputFile = reply.status.outputFile;
var outputCache = reply.status.outputCache;
var statusTable = {
statusNoInstall: _("%s is not installed or not found").format(
pkg.Name
),
statusNoInstall: _("%s is not installed or not found").format(pkg.Name),
statusStopped: _("Stopped"),
statusStarting: _("Starting"),
statusProcessing: _("Processing lists"),
@@ -160,10 +211,7 @@ var status = baseclass.extend({
text += statusTable[reply.status.status] + ".";
} else {
text +=
statusTable[reply.status.status] +
" (" +
_("Disabled") +
").";
statusTable[reply.status.status] + " (" + _("Disabled") + ").";
}
if (reply.status.outputCacheExists) {
text += "<br />" + _("Cache file found.");
@@ -192,8 +240,11 @@ var status = baseclass.extend({
]);
var warningsDiv = [];
if (reply.status.warnings && reply.status.warnings.length) {
if (reply.ubus.warnings && reply.ubus.warnings.length) {
var warningTable = {
warningInternalVersionMismatch: _(
"Internal version mismatch (package: %s, luci app: %s, luci rpcd: %s), you may need to update packages or reboot the device, please check the %sREADME%s."
),
warningExternalDnsmasqConfig: _(
"Use of external dnsmasq config file detected, please set '%s' option to '%s'"
).format("dns", "dnsmasq.conf"),
@@ -210,6 +261,10 @@ var status = baseclass.extend({
"Invalid compressed cache directory '%s'"
),
warningFreeRamCheckFail: _("Can't detect free RAM"),
warningSanityCheckTLD: _("Sanity check discovered TLDs in %s"),
warningSanityCheckLeadingDot: _(
"Sanity check discovered leading dots in %s"
),
};
var warningsTitle = E(
"label",
@@ -217,12 +272,12 @@ var status = baseclass.extend({
_("Service Warnings")
);
var text = "";
reply.status.warnings.forEach((element) => {
if (element.id && warningTable[element.id])
text +=
warningTable[element.id].format(element.extra || " ") +
"<br />";
else text += _("Unknown warning") + "<br />";
reply.ubus.warnings.forEach((element) => {
if (element.code && warningTable[element.code]) {
text += pkg.formatMessage(element.info, warningTable[element.code]);
} else {
text += _("Unknown warning") + "<br />";
}
});
var warningsText = E("div", {}, text);
var warningsField = E(
@@ -237,14 +292,12 @@ var status = baseclass.extend({
}
var errorsDiv = [];
if (reply.status.errors && reply.status.errors.length) {
if (reply.ubus.errors && reply.ubus.errors.length) {
var errorTable = {
errorConfigValidationFail: _(
"Config (%s) validation failure!"
).format("/etc/config/" + pkg.Name),
errorServiceDisabled: _("%s is currently disabled").format(
pkg.Name
),
errorServiceDisabled: _("%s is currently disabled").format(pkg.Name),
errorNoDnsmasqIpset: _(
"The dnsmasq ipset support is enabled, but dnsmasq is either not installed or installed dnsmasq does not support ipset"
),
@@ -257,9 +310,9 @@ var status = baseclass.extend({
errorNoNft: _(
"The dnsmasq nft sets support is enabled, but nft is not installed"
),
errorNoWanGateway: _(
"The %s failed to discover WAN gateway"
).format(pkg.Name),
errorNoWanGateway: _("The %s failed to discover WAN gateway").format(
pkg.Name
),
errorOutputDirCreate: _("Failed to create directory for %s file"),
errorOutputFileCreate: _("Failed to create '%s' file"),
errorFailDNSReload: _("Failed to restart/reload DNS resolver"),
@@ -271,18 +324,14 @@ var status = baseclass.extend({
errorMovingDataFile: _(
"Failed to move temporary data file to '%s'"
).format(outputFile),
errorCreatingCompressedCache: _(
"Failed to create compressed cache"
),
errorCreatingCompressedCache: _("Failed to create compressed cache"),
errorRemovingTempFiles: _("Failed to remove temporary files"),
errorRestoreCompressedCache: _("Failed to unpack compressed cache"),
errorRestoreCache: _("Failed to move '%s' to '%s'").format(
outputCache,
outputFile
),
errorOhSnap: _(
"Failed to create block-list or restart DNS resolver"
),
errorOhSnap: _("Failed to create block-list or restart DNS resolver"),
errorStopping: _("Failed to stop %s").format(pkg.Name),
errorDNSReload: _("Failed to reload/restart DNS resolver"),
errorDownloadingConfigUpdate: _(
@@ -306,6 +355,9 @@ var status = baseclass.extend({
errorDeletingDataFile: _("failed to delete data file %s"),
errorRestoringBackupFile: _("failed to restore backup file %s"),
errorNoOutputFile: _("failed to create final block-list %s"),
errorNoHeartbeat: _(
"Heartbeat domain is not accessible after resolver restart"
),
};
var errorsTitle = E(
"label",
@@ -313,11 +365,12 @@ var status = baseclass.extend({
_("Service Errors")
);
var text = "";
reply.status.errors.forEach((element) => {
if (element.id && errorTable[element.id])
text +=
errorTable[element.id].format(element.extra || " ") + "!<br />";
else text += _("Unknown error") + "<br />";
reply.ubus.errors.forEach((element) => {
if (element.code && errorTable[element.code]) {
text += pkg.formatMessage(element.info, errorTable[element.code]);
} else {
text += _("Unknown error") + "<br />";
}
});
text += _("Errors encountered, please check the %sREADME%s").format(
'<a href="' + pkg.URL + '" target="_blank">',
@@ -516,8 +569,7 @@ var status = baseclass.extend({
errorsDiv,
buttonsDiv,
]);
}
);
});
},
});
@@ -532,4 +584,5 @@ return L.Class.extend({
getInitStatus: getInitStatus,
getFileUrlFilesizes: getFileUrlFilesizes,
getPlatformSupport: getPlatformSupport,
getUbusInfo: getUbusInfo,
});

View File

@@ -175,17 +175,17 @@ return view.extend({
"tab_basic",
form.ListValue,
"dnsmasq_instance_option",
_("Use AdBlocking on the dnsmasq instance(s)"),
_("Use ad-blocking on the dnsmasq instance(s)"),
_(
"You can limit the AdBlocking to the specific dnsmasq instance(s) (%smore information%s)."
"You can limit the ad-blocking to the specific dnsmasq instance(s) (%smore information%s)."
).format(
'<a href="' + pkg.URL + "#dnsmasq_instance" + '" target="_blank">',
"</a>"
)
);
o.value("*", _("AdBlock on all instances"));
o.value("+", _("AdBlock on select instances"));
o.value("-", _("No AdBlock on dnsmasq"));
o.value("*", _("Ad-blocking on all instances"));
o.value("+", _("Ad-blocking on select instances"));
o.value("-", _("No Ad-blocking on dnsmasq"));
o.default = "*";
o.depends("dns", "dnsmasq.addnhosts");
o.depends("dns", "dnsmasq.servers");
@@ -214,7 +214,7 @@ return view.extend({
"tab_basic",
form.MultiValue,
"dnsmasq_instance",
_("Pick the dnsmasq instance(s) for AdBlocking")
_("Pick the dnsmasq instance(s) for ad-blocking")
);
Object.values(L.uci.sections("dhcp", "dnsmasq")).forEach(function (
element
@@ -239,17 +239,17 @@ return view.extend({
"tab_basic",
form.ListValue,
"smartdns_instance_option",
_("Use AdBlocking on the SmartDNS instance(s)"),
_("Use ad-blocking on the SmartDNS instance(s)"),
_(
"You can limit the AdBlocking to the specific SmartDNS instance(s) (%smore information%s)."
"You can limit the ad-blocking to the specific SmartDNS instance(s) (%smore information%s)."
).format(
'<a href="' + pkg.URL + "#smartdns_instance" + '" target="_blank">',
"</a>"
)
);
o.value("*", _("AdBlock on all instances"));
o.value("+", _("AdBlock on select instances"));
o.value("-", _("No AdBlock on SmartDNS"));
o.value("*", _("Ad-blocking on all instances"));
o.value("+", _("Ad-blocking on select instances"));
o.value("-", _("No Ad-blocking on SmartDNS"));
o.default = "*";
o.depends("dns", "smartdns.domainset");
o.retain = true;
@@ -277,7 +277,7 @@ return view.extend({
"tab_basic",
form.MultiValue,
"smartdns_instance",
_("Pick the SmartDNS instance(s) for AdBlocking")
_("Pick the SmartDNS instance(s) for ad-blocking")
);
Object.values(L.uci.sections("smartdns", "smartdns")).forEach(function (
element

View File

@@ -1,11 +1,11 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:245
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:300
msgid "%s is currently disabled"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:117
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:170
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:39
msgid "%s is not installed or not found"
msgstr ""
@@ -22,23 +22,23 @@ msgstr ""
msgid "Action"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:127
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:178
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:49
msgid "Active"
msgstr ""
#: applications/luci-app-adblock-fast/root/usr/share/luci/menu.d/luci-app-adblock-fast.json:3
msgid "AdBlock Fast"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:186
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:250
msgid "AdBlock on all instances"
msgid "Ad-blocking on all instances"
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:251
msgid "AdBlock on select instances"
msgid "Ad-blocking on select instances"
msgstr ""
#: applications/luci-app-adblock-fast/root/usr/share/luci/menu.d/luci-app-adblock-fast.json:3
msgid "AdBlock Fast"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:10
@@ -57,7 +57,7 @@ msgstr ""
msgid "AdBlock-Fast - Configuration"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:130
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:181
msgid "AdBlock-Fast - Status"
msgstr ""
@@ -105,7 +105,7 @@ msgstr ""
msgid "Blocked Domains"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:143
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:194
msgid "Blocking %s domains (with %s)."
msgstr ""
@@ -117,11 +117,11 @@ msgstr ""
msgid "Cache file"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:169
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:217
msgid "Cache file found."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:212
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:263
msgid "Can't detect free RAM"
msgstr ""
@@ -129,15 +129,15 @@ msgstr ""
msgid "Compressed cache"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:148
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:199
msgid "Compressed cache file created."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:171
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:219
msgid "Compressed cache file found."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:243
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:298
msgid "Config (%s) validation failure!"
msgstr ""
@@ -171,7 +171,7 @@ 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:448
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:501
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:347
msgid "Disable"
msgstr ""
@@ -180,11 +180,11 @@ msgstr ""
msgid "Disable Debugging"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:165
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:214
msgid "Disabled"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:442
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:495
msgid "Disabling %s service"
msgstr ""
@@ -208,12 +208,12 @@ msgstr ""
msgid "Download time-out (in seconds)"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:125
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:176
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:45
msgid "Downloading lists"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:429
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:482
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:348
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:502
msgid "Enable"
@@ -228,7 +228,7 @@ msgstr ""
msgid "Enables debug output to /tmp/adblock-fast.log."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:423
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:476
msgid "Enabling %s service"
msgstr ""
@@ -236,7 +236,7 @@ msgstr ""
msgid "Error"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:322
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:375
msgid "Errors encountered, please check the %sREADME%s"
msgstr ""
@@ -244,95 +244,95 @@ msgstr ""
msgid "Fail"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:266
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:319
msgid "Failed to access shared memory"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:264
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:317
msgid "Failed to create '%s' file"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:284
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:334
msgid "Failed to create block-list or restart DNS resolver"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:275
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:327
msgid "Failed to create compressed cache"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:263
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:316
msgid "Failed to create directory for %s file"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:296
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:345
msgid "Failed to create output/cache/gzip file directory"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:298
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:347
msgid "Failed to detect format %s"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:291
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:340
msgid "Failed to download %s"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:289
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:338
msgid "Failed to download Config Update file"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:270
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:323
msgid "Failed to format data file"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:279
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:330
msgid "Failed to move '%s' to '%s'"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:272
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:325
msgid "Failed to move temporary data file to '%s'"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:268
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:321
msgid "Failed to optimize data file"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:293
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:342
msgid "Failed to parse %s"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:292
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:341
msgid "Failed to parse Config Update file"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:269
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:322
msgid "Failed to process allow-list"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:287
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:336
msgid "Failed to reload/restart DNS resolver"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:277
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:328
msgid "Failed to remove temporary files"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:265
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:318
msgid "Failed to restart/reload DNS resolver"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:267
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:320
msgid "Failed to sort data file"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:126
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:177
msgid "Failed to start"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:286
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:335
msgid "Failed to stop %s"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:278
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:329
msgid "Failed to unpack compressed cache"
msgstr ""
@@ -340,11 +340,11 @@ msgstr ""
msgid "Force DNS Ports"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:151
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:202
msgid "Force DNS ports:"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:124
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:175
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:44
msgid "Force Reloading"
msgstr ""
@@ -357,7 +357,7 @@ msgstr ""
msgid "Force Router DNS server to all local devices"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:370
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:423
msgid "Force redownloading %s block lists"
msgstr ""
@@ -365,7 +365,7 @@ msgstr ""
msgid "Forces Router DNS use on local devices, also known as DNS Hijacking."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:303
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:352
msgid "Free ram (%s) is not enough to process all enabled block-lists"
msgstr ""
@@ -373,6 +373,10 @@ msgstr ""
msgid "Grant UCI and file access for luci-app-adblock-fast"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:359
msgid "Heartbeat domain is not accessible after resolver restart"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:355
msgid "IPv6 Support"
msgstr ""
@@ -397,7 +401,14 @@ msgstr ""
msgid "Individual domains to be blocked."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:210
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:246
msgid ""
"Internal version mismatch (package: %s, luci app: %s, luci rpcd: %s), you "
"may need to update packages or reboot the device, please check the "
"%sREADME%s."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:261
msgid "Invalid compressed cache directory '%s'"
msgstr ""
@@ -415,7 +426,7 @@ msgstr ""
msgid "Let local devices use their own DNS servers if set"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:201
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:252
msgid "Missing recommended package: '%s'"
msgstr ""
@@ -428,22 +439,22 @@ msgid "Name/URL"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:252
msgid "No AdBlock on SmartDNS"
msgid "No Ad-blocking on SmartDNS"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:188
msgid "No AdBlock on dnsmasq"
msgid "No Ad-blocking on dnsmasq"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:294
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:343
msgid "No HTTPS/SSL support on device"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:300
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:349
msgid "No blocked list URLs nor blocked-domains enabled"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:185
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:233
msgid "Not installed or not found"
msgstr ""
@@ -451,11 +462,11 @@ msgstr ""
msgid "Output Verbosity Setting"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:391
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:444
msgid "Pause"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:386
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:439
msgid "Pausing %s"
msgstr ""
@@ -468,11 +479,11 @@ msgid "Pick the LED not already used in %sSystem LED Configuration%s."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:280
msgid "Pick the SmartDNS instance(s) for AdBlocking"
msgid "Pick the SmartDNS instance(s) for ad-blocking"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:217
msgid "Pick the dnsmasq instance(s) for AdBlocking"
msgid "Pick the dnsmasq instance(s) for ad-blocking"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:61
@@ -488,33 +499,41 @@ msgstr ""
msgid "Please note that %s is not supported on this system."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:122
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:173
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:42
msgid "Processing lists"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:376
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:429
msgid "Redownload"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:123
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:174
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:43
msgid "Restarting"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:489
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:264
msgid "Sanity check discovered TLDs in %s"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:266
msgid "Sanity check discovered leading dots in %s"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:542
msgid "Service Control"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:313
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:365
msgid "Service Errors"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:134
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:185
msgid "Service Status"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:217
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:272
msgid "Service Warnings"
msgstr ""
@@ -534,16 +553,16 @@ msgstr ""
msgid "Some output"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:357
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:410
msgid "Start"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:121
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:172
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:41
msgid "Starting"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:351
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:404
msgid "Starting %s service"
msgstr ""
@@ -551,7 +570,7 @@ msgstr ""
msgid "Status"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:410
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:463
msgid "Stop"
msgstr ""
@@ -559,12 +578,12 @@ msgstr ""
msgid "Stop the download if it is stalled for set number of seconds."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:120
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:171
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/status/include/70_adblock-fast.js:40
msgid "Stopped"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:404
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:457
msgid "Stopping %s service"
msgstr ""
@@ -580,38 +599,38 @@ msgstr ""
msgid "Suppress output"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:261
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:313
msgid "The %s failed to discover WAN gateway"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:204
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:255
msgid ""
"The WebUI application (luci-app-adblock-fast) is outdated, please update it"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:249
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:302
msgid ""
"The dnsmasq ipset support is enabled, but dnsmasq is either not installed or "
"installed dnsmasq does not support ipset"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:252
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:305
msgid ""
"The dnsmasq ipset support is enabled, but ipset is either not installed or "
"installed ipset does not support '%s' type"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:255
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:308
msgid ""
"The dnsmasq nft set support is enabled, but dnsmasq is either not installed "
"or installed dnsmasq does not support nft set"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:258
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:311
msgid "The dnsmasq nft sets support is enabled, but nft is not installed"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:207
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:258
msgid "The principal package (adblock-fast) is outdated, please update it"
msgstr ""
@@ -634,23 +653,27 @@ msgstr ""
msgid "Unknown"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:320
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:372
msgid "Unknown error"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:225
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:32
msgid "Unknown message"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:279
msgid "Unknown warning"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:242
msgid "Use AdBlocking on the SmartDNS instance(s)"
msgid "Use ad-blocking on the SmartDNS instance(s)"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:178
msgid "Use AdBlocking on the dnsmasq instance(s)"
msgid "Use ad-blocking on the dnsmasq instance(s)"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:198
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:249
msgid ""
"Use of external dnsmasq config file detected, please set '%s' option to '%s'"
msgstr ""
@@ -667,7 +690,7 @@ msgstr ""
msgid "Version"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:137
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:188
msgid "Version %s"
msgstr ""
@@ -677,13 +700,13 @@ msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:244
msgid ""
"You can limit the AdBlocking to the specific SmartDNS instance(s) (%smore "
"You can limit the ad-blocking to the specific SmartDNS instance(s) (%smore "
"information%s)."
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js:180
msgid ""
"You can limit the AdBlocking to the specific dnsmasq instance(s) (%smore "
"You can limit the ad-blocking to the specific dnsmasq instance(s) (%smore "
"information%s)."
msgstr ""
@@ -707,19 +730,19 @@ msgstr ""
msgid "dnsmasq servers file"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:305
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:354
msgid "failed to create backup file %s"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:308
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:357
msgid "failed to create final block-list %s"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:306
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:355
msgid "failed to delete data file %s"
msgstr ""
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:307
#: applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js:356
msgid "failed to restore backup file %s"
msgstr ""

View File

@@ -9,12 +9,13 @@
# ubus -S call luci.adblock-fast getInitList '{"name": "adblock-fast" }'
# ubus -S call luci.adblock-fast getInitStatus '{"name": "adblock-fast" }'
# ubus -S call luci.adblock-fast getPlatformSupport '{"name": "adblock-fast" }'
# ubus -S call luci.adblock-fast getUbusInfo '{"name": "adblock-fast" }'
# ubus -S call luci.adblock-fast setInitAction '{"name": "adblock-fast", "action": "start" }'
# ubus -S call luci.adblock-fast setInitAction '{"name": "adblock-fast", "action": "dl" }'
# ubus -S call luci.adblock-fast setInitAction '{"name": "adblock-fast", "action": "pause" }'
# ubus -S call luci.adblock-fast setInitAction '{"name": "adblock-fast", "action": "stop" }'
readonly luciCompat='4'
readonly rpcdCompat='7'
readonly adbFunctionsFile='/etc/init.d/adblock-fast'
if [ -s "$adbFunctionsFile" ]; then
# shellcheck source=../../../../../adblock-fast/files/etc/init.d/adblock-fast
@@ -100,8 +101,8 @@ get_init_status() {
local name
name="$(basename "$1")"
name="${name:-$packageName}"
local errors warnings ports dns outputFile outputCache outputGzip outputConfig
local i j
local ports dns outputFile outputCache outputGzip outputConfig
local i j k
# shellcheck disable=SC2034
local compressed_cache_dir
config_load "$name"
@@ -113,65 +114,20 @@ get_init_status() {
else
dns="$(uci_get "$packageName" 'config' 'dns' 'dnsmasq.servers')"
fi
dns_set_output_values "$dns"
json_init
json_add_object "$name"
json_add_boolean 'enabled' "$(is_enabled "$name")"
json_add_string 'status' "$(json 'get' 'status')"
json_add_string 'version' "$PKG_VERSION"
json_add_int 'packageCompat' "${packageCompat:-0}"
json_add_int 'rpcdCompat' "${rpcdCompat:-0}"
if is_running "$name"; then
json_add_boolean 'running' '1'
else
json_add_boolean 'running' '0'
fi
json_add_string 'version' "$PKG_VERSION"
errors="$(ubus_get_data errors)"
json_add_array 'errors'
if [ -n "$errors" ]; then
for i in $errors; do
if str_contains "$i" '|'; then
error_extra="${i##*|}"
error_id="${i%|*}"
else
error_id="$i"
unset error_extra
fi
json_add_object
json_add_string 'id' "$error_id"
json_add_string 'extra' "$error_extra"
json_close_object
done
fi
json_close_array
warnings="$(ubus_get_data warnings)"
json_add_array 'warnings'
if [ -n "$warnings" ]; then
for i in $warnings; do
if str_contains "$i" '|'; then
error_extra="${i##*|}"
error_id="${i%|*}"
else
error_id="$i"
unset error_extra
fi
json_add_object
json_add_string 'id' "$error_id"
json_add_string 'extra' "$error_extra"
json_close_object
done
fi
if is_greater "${packageCompat:-0}" "${luciCompat:-0}"; then
json_add_object
json_add_string 'id' 'warningOutdatedLuciPackage'
json_close_object
elif is_greater "${luciCompat:-0}" "${packageCompat:-0}"; then
json_add_object
json_add_string 'id' 'warningOutdatedPrincipalPackage'
json_close_object
fi
json_close_array
ports="$(ubus_get_ports)"
if [ -n "$ports" ]; then
json_add_boolean 'force_dns_active' '1'
@@ -202,7 +158,11 @@ get_init_status() {
json_add_boolean 'outputGzipExists' '0'
fi
json_add_array 'leds'
for i in /sys/class/leds/*; do json_add_string '' "$(basename "$i")"; done
if ls /sys/class/leds/* >/dev/null 2>&1; then
for i in /sys/class/leds/*; do
[ -d "$i" ] && json_add_string '' "$(basename "$i")"
done
fi
json_close_array
json_close_object
json_dump
@@ -268,6 +228,13 @@ get_platform_support() {
json_cleanup
}
get_ubus_info() {
local name
name="$(basename "$1")"
name="${name:-$packageName}"
ubus call service list '{"name":"'"$name"'"}'
}
case "$1" in
list)
json_init
@@ -283,6 +250,9 @@ case "$1" in
json_add_object "getPlatformSupport"
json_add_string 'name' 'name'
json_close_object
json_add_object "getUbusInfo"
json_add_string 'name' 'name'
json_close_object
json_add_object "setInitAction"
json_add_string 'name' 'name'
json_add_string 'action' 'action'
@@ -320,6 +290,13 @@ case "$1" in
json_cleanup
get_platform_support "$name"
;;
getUbusInfo)
read -r input
json_load "$input"
json_get_var name 'name'
json_cleanup
get_ubus_info "$name"
;;
setInitAction)
read -r input
json_load "$input"

View File

@@ -3,16 +3,16 @@
"description": "Grant UCI and file access for luci-app-adblock-fast",
"read": {
"file": {
"/dev/shm/adblock-fast.config": [ "list", "read" ],
"/dev/shm/adblock-fast.error": [ "list", "read" ],
"/dev/shm/adblock-fast.status": [ "list", "read" ]
"/dev/shm/adblock-fast": [ "list", "read" ],
"/dev/shm/adblock-fast.status.json": [ "list", "read" ]
},
"ubus": {
"luci.adblock-fast": [
"getFileUrlFilesizes",
"getInitList",
"getInitStatus",
"getPlatformSupport"
"getPlatformSupport",
"getUbusInfo"
]
},
"uci": [