+# SPDX-License-Identifier: AGPL-3.0-or-later
-# 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_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/
-# 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/).
+[](https://openwrt.org)
+[](https://docs.openwrt.melmac.ca/adblock-fast/)
+[](https://openwrt.org/packages/pkgdata/adblock-fast)
+[](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/)
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) {
params: ["name"],
});
+var getUbusInfo = rpc.declare({
+ object: "luci." + pkg.Name,
+ method: "getUbusInfo",
+ params: ["name"],
+});
+
var _setInitAction = rpc.declare({
object: "luci." + pkg.Name,
method: "setInitAction",
var status = baseclass.extend({
render: function () {
- return Promise.all([L.resolveDefault(getInitStatus(pkg.Name), {})]).then(
- function (data) {
- var reply = {
- status: (data[0] && data[0][pkg.Name]) || {
- enabled: false,
- status: null,
- running: null,
- version: null,
- errors: [],
- warnings: [],
- force_dns_active: null,
- force_dns_ports: [],
- entries: null,
- dns: null,
- outputFile: null,
- outputCache: null,
- outputGzip: null,
- outputFileExists: null,
- outputCacheExists: null,
- outputGzipExists: null,
- leds: [],
- },
+ return Promise.all([
+ L.resolveDefault(getInitStatus(pkg.Name), {}),
+ L.resolveDefault(getUbusInfo(pkg.Name), {}),
+ ]).then(function (data) {
+ var reply = {
+ status: data[0]?.[pkg.Name] || {
+ enabled: false,
+ status: null,
+ packageCompat: 0,
+ rpcdCompat: 0,
+ running: null,
+ version: null,
+ errors: [],
+ warnings: [],
+ force_dns_active: null,
+ force_dns_ports: [],
+ entries: null,
+ dns: null,
+ outputFile: null,
+ outputCache: null,
+ outputGzip: null,
+ outputFileExists: null,
+ outputCacheExists: null,
+ 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),
+ statusStopped: _("Stopped"),
+ statusStarting: _("Starting"),
+ statusProcessing: _("Processing lists"),
+ statusRestarting: _("Restarting"),
+ statusForceReloading: _("Force Reloading"),
+ statusDownloading: _("Downloading lists"),
+ statusFail: _("Failed to start"),
+ statusSuccess: _("Active"),
+ };
+
+ var header = E("h2", {}, _("AdBlock-Fast - Status"));
+ var statusTitle = E(
+ "label",
+ { class: "cbi-value-title" },
+ _("Service Status")
+ );
+ if (reply.status.version) {
+ text += _("Version %s").format(reply.status.version) + " - ";
+ switch (reply.status.status) {
+ case "statusSuccess":
+ text += statusTable[reply.status.status] + ".";
+ text +=
+ "<br />" +
+ _("Blocking %s domains (with %s).").format(
+ reply.status.entries,
+ reply.status.dns
+ );
+ if (reply.status.outputGzipExists) {
+ text += "<br />" + _("Compressed cache file created.");
+ }
+ if (reply.status.force_dns_active) {
+ text += "<br />" + _("Force DNS ports:");
+ reply.status.force_dns_ports.forEach((element) => {
+ text += " " + element;
+ });
+ text += ".";
+ }
+ break;
+ case "statusStopped":
+ if (reply.status.enabled) {
+ text += statusTable[reply.status.status] + ".";
+ } else {
+ text +=
+ statusTable[reply.status.status] + " (" + _("Disabled") + ").";
+ }
+ if (reply.status.outputCacheExists) {
+ text += "<br />" + _("Cache file found.");
+ } else if (reply.status.outputGzipExists) {
+ text += "<br />" + _("Compressed cache file found.");
+ }
+ break;
+ case "statusRestarting":
+ case "statusForceReloading":
+ case "statusDownloading":
+ case "statusProcessing":
+ text += statusTable[reply.status.status] + "...";
+ break;
+ default:
+ text += statusTable[reply.status.status] + ".";
+ break;
+ }
+ } else {
+ text = _("Not installed or not found");
+ }
+ var statusText = E("div", {}, text);
+ var statusField = E("div", { class: "cbi-value-field" }, statusText);
+ var statusDiv = E("div", { class: "cbi-value" }, [
+ statusTitle,
+ statusField,
+ ]);
+
+ var warningsDiv = [];
+ 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"),
+ warningMissingRecommendedPackages: _(
+ "Missing recommended package: '%s'"
+ ),
+ warningOutdatedLuciPackage: _(
+ "The WebUI application (luci-app-adblock-fast) is outdated, please update it"
+ ),
+ warningOutdatedPrincipalPackage: _(
+ "The principal package (adblock-fast) is outdated, please update it"
+ ),
+ warningInvalidCompressedCacheDir: _(
+ "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",
+ { class: "cbi-value-title" },
+ _("Service Warnings")
+ );
var text = "";
- var outputFile = reply.status.outputFile;
- var outputCache = reply.status.outputCache;
- var statusTable = {
- statusNoInstall: _("%s is not installed or not found").format(
+ 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(
+ "div",
+ { class: "cbi-value-field" },
+ warningsText
+ );
+ warningsDiv = E("div", { class: "cbi-value" }, [
+ warningsTitle,
+ warningsField,
+ ]);
+ }
+
+ var errorsDiv = [];
+ 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),
+ errorNoDnsmasqIpset: _(
+ "The dnsmasq ipset support is enabled, but dnsmasq is either not installed or installed dnsmasq does not support ipset"
+ ),
+ errorNoIpset: _(
+ "The dnsmasq ipset support is enabled, but ipset is either not installed or installed ipset does not support '%s' type"
+ ).format("hash:net"),
+ errorNoDnsmasqNftset: _(
+ "The dnsmasq nft set support is enabled, but dnsmasq is either not installed or installed dnsmasq does not support nft set"
+ ),
+ errorNoNft: _(
+ "The dnsmasq nft sets support is enabled, but nft is not installed"
+ ),
+ errorNoWanGateway: _("The %s failed to discover WAN gateway").format(
pkg.Name
),
- statusStopped: _("Stopped"),
- statusStarting: _("Starting"),
- statusProcessing: _("Processing lists"),
- statusRestarting: _("Restarting"),
- statusForceReloading: _("Force Reloading"),
- statusDownloading: _("Downloading lists"),
- statusFail: _("Failed to start"),
- statusSuccess: _("Active"),
+ errorOutputDirCreate: _("Failed to create directory for %s file"),
+ errorOutputFileCreate: _("Failed to create '%s' file"),
+ errorFailDNSReload: _("Failed to restart/reload DNS resolver"),
+ errorSharedMemory: _("Failed to access shared memory"),
+ errorSorting: _("Failed to sort data file"),
+ errorOptimization: _("Failed to optimize data file"),
+ errorAllowListProcessing: _("Failed to process allow-list"),
+ errorDataFileFormatting: _("Failed to format data file"),
+ errorMovingDataFile: _(
+ "Failed to move temporary data file to '%s'"
+ ).format(outputFile),
+ 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"),
+ errorStopping: _("Failed to stop %s").format(pkg.Name),
+ errorDNSReload: _("Failed to reload/restart DNS resolver"),
+ errorDownloadingConfigUpdate: _(
+ "Failed to download Config Update file"
+ ),
+ errorDownloadingList: _("Failed to download %s"),
+ errorParsingConfigUpdate: _("Failed to parse Config Update file"),
+ errorParsingList: _("Failed to parse %s"),
+ errorNoSSLSupport: _("No HTTPS/SSL support on device"),
+ errorCreatingDirectory: _(
+ "Failed to create output/cache/gzip file directory"
+ ),
+ errorDetectingFileType: _("Failed to detect format %s"),
+ errorNothingToDo: _(
+ "No blocked list URLs nor blocked-domains enabled"
+ ),
+ errorTooLittleRam: _(
+ "Free ram (%s) is not enough to process all enabled block-lists"
+ ),
+ errorCreatingBackupFile: _("failed to create backup file %s"),
+ 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 header = E("h2", {}, _("AdBlock-Fast - Status"));
- var statusTitle = E(
+ var errorsTitle = E(
"label",
{ class: "cbi-value-title" },
- _("Service Status")
+ _("Service Errors")
);
- if (reply.status.version) {
- text += _("Version %s").format(reply.status.version) + " - ";
- switch (reply.status.status) {
- case "statusSuccess":
- text += statusTable[reply.status.status] + ".";
- text +=
- "<br />" +
- _("Blocking %s domains (with %s).").format(
- reply.status.entries,
- reply.status.dns
- );
- if (reply.status.outputGzipExists) {
- text += "<br />" + _("Compressed cache file created.");
- }
- if (reply.status.force_dns_active) {
- text += "<br />" + _("Force DNS ports:");
- reply.status.force_dns_ports.forEach((element) => {
- text += " " + element;
- });
- text += ".";
- }
- break;
- case "statusStopped":
- if (reply.status.enabled) {
- text += statusTable[reply.status.status] + ".";
- } else {
- text +=
- statusTable[reply.status.status] +
- " (" +
- _("Disabled") +
- ").";
- }
- if (reply.status.outputCacheExists) {
- text += "<br />" + _("Cache file found.");
- } else if (reply.status.outputGzipExists) {
- text += "<br />" + _("Compressed cache file found.");
- }
- break;
- case "statusRestarting":
- case "statusForceReloading":
- case "statusDownloading":
- case "statusProcessing":
- text += statusTable[reply.status.status] + "...";
- break;
- default:
- text += statusTable[reply.status.status] + ".";
- break;
+ var text = "";
+ reply.ubus.errors.forEach((element) => {
+ if (element.code && errorTable[element.code]) {
+ text += pkg.formatMessage(element.info, errorTable[element.code]);
+ } else {
+ text += _("Unknown error") + "<br />";
}
- } else {
- text = _("Not installed or not found");
- }
- var statusText = E("div", {}, text);
- var statusField = E("div", { class: "cbi-value-field" }, statusText);
- var statusDiv = E("div", { class: "cbi-value" }, [
- statusTitle,
- statusField,
+ });
+ text += _("Errors encountered, please check the %sREADME%s").format(
+ '<a href="' + pkg.URL + '" target="_blank">',
+ "</a>!<br />"
+ );
+ var errorsText = E("div", {}, text);
+ var errorsField = E("div", { class: "cbi-value-field" }, errorsText);
+ errorsDiv = E("div", { class: "cbi-value" }, [
+ errorsTitle,
+ errorsField,
]);
+ }
- var warningsDiv = [];
- if (reply.status.warnings && reply.status.warnings.length) {
- var warningTable = {
- warningExternalDnsmasqConfig: _(
- "Use of external dnsmasq config file detected, please set '%s' option to '%s'"
- ).format("dns", "dnsmasq.conf"),
- warningMissingRecommendedPackages: _(
- "Missing recommended package: '%s'"
- ),
- warningOutdatedLuciPackage: _(
- "The WebUI application (luci-app-adblock-fast) is outdated, please update it"
- ),
- warningOutdatedPrincipalPackage: _(
- "The principal package (adblock-fast) is outdated, please update it"
- ),
- warningInvalidCompressedCacheDir: _(
- "Invalid compressed cache directory '%s'"
- ),
- warningFreeRamCheckFail: _("Can't detect free RAM"),
- };
- var warningsTitle = E(
- "label",
- { class: "cbi-value-title" },
- _("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 />";
- });
- var warningsText = E("div", {}, text);
- var warningsField = E(
- "div",
- { class: "cbi-value-field" },
- warningsText
- );
- warningsDiv = E("div", { class: "cbi-value" }, [
- warningsTitle,
- warningsField,
- ]);
- }
-
- var errorsDiv = [];
- if (reply.status.errors && reply.status.errors.length) {
- var errorTable = {
- errorConfigValidationFail: _(
- "Config (%s) validation failure!"
- ).format("/etc/config/" + 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"
- ),
- errorNoIpset: _(
- "The dnsmasq ipset support is enabled, but ipset is either not installed or installed ipset does not support '%s' type"
- ).format("hash:net"),
- errorNoDnsmasqNftset: _(
- "The dnsmasq nft set support is enabled, but dnsmasq is either not installed or installed dnsmasq does not support nft set"
- ),
- errorNoNft: _(
- "The dnsmasq nft sets support is enabled, but nft is not installed"
- ),
- 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"),
- errorSharedMemory: _("Failed to access shared memory"),
- errorSorting: _("Failed to sort data file"),
- errorOptimization: _("Failed to optimize data file"),
- errorAllowListProcessing: _("Failed to process allow-list"),
- errorDataFileFormatting: _("Failed to format data file"),
- errorMovingDataFile: _(
- "Failed to move temporary data file to '%s'"
- ).format(outputFile),
- 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"
- ),
- errorStopping: _("Failed to stop %s").format(pkg.Name),
- errorDNSReload: _("Failed to reload/restart DNS resolver"),
- errorDownloadingConfigUpdate: _(
- "Failed to download Config Update file"
- ),
- errorDownloadingList: _("Failed to download %s"),
- errorParsingConfigUpdate: _("Failed to parse Config Update file"),
- errorParsingList: _("Failed to parse %s"),
- errorNoSSLSupport: _("No HTTPS/SSL support on device"),
- errorCreatingDirectory: _(
- "Failed to create output/cache/gzip file directory"
- ),
- errorDetectingFileType: _("Failed to detect format %s"),
- errorNothingToDo: _(
- "No blocked list URLs nor blocked-domains enabled"
- ),
- errorTooLittleRam: _(
- "Free ram (%s) is not enough to process all enabled block-lists"
- ),
- errorCreatingBackupFile: _("failed to create backup file %s"),
- errorDeletingDataFile: _("failed to delete data file %s"),
- errorRestoringBackupFile: _("failed to restore backup file %s"),
- errorNoOutputFile: _("failed to create final block-list %s"),
- };
- var errorsTitle = E(
- "label",
- { class: "cbi-value-title" },
- _("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 />";
- });
- text += _("Errors encountered, please check the %sREADME%s").format(
- '<a href="' + pkg.URL + '" target="_blank">',
- "</a>!<br />"
- );
- var errorsText = E("div", {}, text);
- var errorsField = E("div", { class: "cbi-value-field" }, errorsText);
- errorsDiv = E("div", { class: "cbi-value" }, [
- errorsTitle,
- errorsField,
- ]);
- }
-
- var btn_gap = E("span", {}, "  ");
- var btn_gap_long = E(
- "span",
- {},
- "        "
- );
+ var btn_gap = E("span", {}, "  ");
+ var btn_gap_long = E(
+ "span",
+ {},
+ "        "
+ );
- var btn_start = E(
- "button",
- {
- class: "btn cbi-button cbi-button-apply",
- disabled: true,
- click: function (ev) {
- ui.showModal(null, [
- E(
- "p",
- { class: "spinning" },
- _("Starting %s service").format(pkg.Name)
- ),
- ]);
- return RPC.setInitAction(pkg.Name, "start");
- },
+ var btn_start = E(
+ "button",
+ {
+ class: "btn cbi-button cbi-button-apply",
+ disabled: true,
+ click: function (ev) {
+ ui.showModal(null, [
+ E(
+ "p",
+ { class: "spinning" },
+ _("Starting %s service").format(pkg.Name)
+ ),
+ ]);
+ return RPC.setInitAction(pkg.Name, "start");
},
- _("Start")
- );
+ },
+ _("Start")
+ );
- var btn_action_dl = E(
- "button",
- {
- class: "btn cbi-button cbi-button-apply",
- disabled: true,
- click: function (ev) {
- ui.showModal(null, [
- E(
- "p",
- { class: "spinning" },
- _("Force redownloading %s block lists").format(pkg.Name)
- ),
- ]);
- return RPC.setInitAction(pkg.Name, "dl");
- },
+ var btn_action_dl = E(
+ "button",
+ {
+ class: "btn cbi-button cbi-button-apply",
+ disabled: true,
+ click: function (ev) {
+ ui.showModal(null, [
+ E(
+ "p",
+ { class: "spinning" },
+ _("Force redownloading %s block lists").format(pkg.Name)
+ ),
+ ]);
+ return RPC.setInitAction(pkg.Name, "dl");
},
- _("Redownload")
- );
+ },
+ _("Redownload")
+ );
- var btn_action_pause = E(
- "button",
- {
- class: "btn cbi-button cbi-button-apply",
- disabled: true,
- click: function (ev) {
- ui.showModal(null, [
- E("p", { class: "spinning" }, _("Pausing %s").format(pkg.Name)),
- ]);
- return RPC.setInitAction(pkg.Name, "pause");
- },
+ var btn_action_pause = E(
+ "button",
+ {
+ class: "btn cbi-button cbi-button-apply",
+ disabled: true,
+ click: function (ev) {
+ ui.showModal(null, [
+ E("p", { class: "spinning" }, _("Pausing %s").format(pkg.Name)),
+ ]);
+ return RPC.setInitAction(pkg.Name, "pause");
},
- _("Pause")
- );
+ },
+ _("Pause")
+ );
- var btn_stop = E(
- "button",
- {
- class: "btn cbi-button cbi-button-reset",
- disabled: true,
- click: function (ev) {
- ui.showModal(null, [
- E(
- "p",
- { class: "spinning" },
- _("Stopping %s service").format(pkg.Name)
- ),
- ]);
- return RPC.setInitAction(pkg.Name, "stop");
- },
+ var btn_stop = E(
+ "button",
+ {
+ class: "btn cbi-button cbi-button-reset",
+ disabled: true,
+ click: function (ev) {
+ ui.showModal(null, [
+ E(
+ "p",
+ { class: "spinning" },
+ _("Stopping %s service").format(pkg.Name)
+ ),
+ ]);
+ return RPC.setInitAction(pkg.Name, "stop");
},
- _("Stop")
- );
+ },
+ _("Stop")
+ );
- var btn_enable = E(
- "button",
- {
- class: "btn cbi-button cbi-button-apply",
- disabled: true,
- click: function (ev) {
- ui.showModal(null, [
- E(
- "p",
- { class: "spinning" },
- _("Enabling %s service").format(pkg.Name)
- ),
- ]);
- return RPC.setInitAction(pkg.Name, "enable");
- },
+ var btn_enable = E(
+ "button",
+ {
+ class: "btn cbi-button cbi-button-apply",
+ disabled: true,
+ click: function (ev) {
+ ui.showModal(null, [
+ E(
+ "p",
+ { class: "spinning" },
+ _("Enabling %s service").format(pkg.Name)
+ ),
+ ]);
+ return RPC.setInitAction(pkg.Name, "enable");
},
- _("Enable")
- );
+ },
+ _("Enable")
+ );
- var btn_disable = E(
- "button",
- {
- class: "btn cbi-button cbi-button-reset",
- disabled: true,
- click: function (ev) {
- ui.showModal(null, [
- E(
- "p",
- { class: "spinning" },
- _("Disabling %s service").format(pkg.Name)
- ),
- ]);
- return RPC.setInitAction(pkg.Name, "disable");
- },
+ var btn_disable = E(
+ "button",
+ {
+ class: "btn cbi-button cbi-button-reset",
+ disabled: true,
+ click: function (ev) {
+ ui.showModal(null, [
+ E(
+ "p",
+ { class: "spinning" },
+ _("Disabling %s service").format(pkg.Name)
+ ),
+ ]);
+ return RPC.setInitAction(pkg.Name, "disable");
},
- _("Disable")
- );
-
- if (reply.status.enabled) {
- btn_enable.disabled = true;
- btn_disable.disabled = false;
- switch (reply.status.status) {
- case "statusSuccess":
- btn_start.disabled = true;
- btn_action_dl.disabled = false;
- btn_action_pause.disabled = false;
- btn_stop.disabled = false;
- break;
- case "statusStopped":
- btn_start.disabled = false;
- btn_action_dl.disabled = true;
- btn_action_pause.disabled = true;
- btn_stop.disabled = true;
- break;
- default:
- btn_start.disabled = false;
- btn_action_dl.disabled = true;
- btn_action_pause.disabled = true;
- btn_stop.disabled = false;
- btn_enable.disabled = true;
- btn_disable.disabled = true;
- break;
- }
- } else {
- btn_start.disabled = true;
- btn_action_dl.disabled = true;
- btn_action_pause.disabled = true;
- btn_stop.disabled = true;
- btn_enable.disabled = false;
- btn_disable.disabled = true;
- }
+ },
+ _("Disable")
+ );
- var buttonsDiv = [];
- var buttonsTitle = E(
- "label",
- { class: "cbi-value-title" },
- _("Service Control")
- );
- var buttonsText = E("div", {}, [
- btn_start,
- btn_gap,
- // btn_action_pause,
- // btn_gap,
- btn_action_dl,
- btn_gap,
- btn_stop,
- btn_gap_long,
- btn_enable,
- btn_gap,
- btn_disable,
- ]);
- var buttonsField = E("div", { class: "cbi-value-field" }, buttonsText);
- if (reply.status.version) {
- buttonsDiv = E("div", { class: "cbi-value" }, [
- buttonsTitle,
- buttonsField,
- ]);
+ if (reply.status.enabled) {
+ btn_enable.disabled = true;
+ btn_disable.disabled = false;
+ switch (reply.status.status) {
+ case "statusSuccess":
+ btn_start.disabled = true;
+ btn_action_dl.disabled = false;
+ btn_action_pause.disabled = false;
+ btn_stop.disabled = false;
+ break;
+ case "statusStopped":
+ btn_start.disabled = false;
+ btn_action_dl.disabled = true;
+ btn_action_pause.disabled = true;
+ btn_stop.disabled = true;
+ break;
+ default:
+ btn_start.disabled = false;
+ btn_action_dl.disabled = true;
+ btn_action_pause.disabled = true;
+ btn_stop.disabled = false;
+ btn_enable.disabled = true;
+ btn_disable.disabled = true;
+ break;
}
+ } else {
+ btn_start.disabled = true;
+ btn_action_dl.disabled = true;
+ btn_action_pause.disabled = true;
+ btn_stop.disabled = true;
+ btn_enable.disabled = false;
+ btn_disable.disabled = true;
+ }
- return E("div", {}, [
- header,
- statusDiv,
- warningsDiv,
- errorsDiv,
- buttonsDiv,
+ var buttonsDiv = [];
+ var buttonsTitle = E(
+ "label",
+ { class: "cbi-value-title" },
+ _("Service Control")
+ );
+ var buttonsText = E("div", {}, [
+ btn_start,
+ btn_gap,
+ // btn_action_pause,
+ // btn_gap,
+ btn_action_dl,
+ btn_gap,
+ btn_stop,
+ btn_gap_long,
+ btn_enable,
+ btn_gap,
+ btn_disable,
+ ]);
+ var buttonsField = E("div", { class: "cbi-value-field" }, buttonsText);
+ if (reply.status.version) {
+ buttonsDiv = E("div", { class: "cbi-value" }, [
+ buttonsTitle,
+ buttonsField,
]);
}
- );
+
+ return E("div", {}, [
+ header,
+ statusDiv,
+ warningsDiv,
+ errorsDiv,
+ buttonsDiv,
+ ]);
+ });
},
});
getInitStatus: getInitStatus,
getFileUrlFilesizes: getFileUrlFilesizes,
getPlatformSupport: getPlatformSupport,
+ getUbusInfo: getUbusInfo,
});
"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");
"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
"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;
"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
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 ""
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
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 ""
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 ""
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 ""
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 ""
"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 ""
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 ""
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"
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
#: 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 ""
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 ""
# 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
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"
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_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'
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
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
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'
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"
"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": [