PKG_LICENSE:=AGPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
PKG_VERSION:=2025.12.29
-PKG_RELEASE:=1
+PKG_RELEASE:=3
LUCI_TITLE:=DNS Over HTTPS Proxy Web UI
LUCI_URL:=https://github.com/stangri/luci-app-https-dns-proxy/
pkg.Name +
"/" +
(pkg.ReadmeCompat ? pkg.ReadmeCompat + "/" : "") +
- "#Donate"
+ "#donate"
);
},
templateToRegexp: function (template) {
if (template)
return new RegExp(
"^" +
- template
- .split(/(\{\w+\})/g)
- .map((part) => {
- let placeholder = part.match(/^\{(\w+)\}$/);
- if (placeholder) return `(?<${placeholder[1]}>.*?)`;
- else return part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
- })
- .join("") +
- "$"
+ template
+ .split(/(\{\w+\})/g)
+ .map((part) => {
+ let placeholder = part.match(/^\{(\w+)\}$/);
+ if (placeholder) return `(?<${placeholder[1]}>.*?)`;
+ else return part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
+ })
+ .join("") +
+ "$"
);
return new RegExp("");
},
params: ["name"],
});
-const getRuntime = rpc.declare({
- object: "luci." + pkg.Name,
- method: "getRuntime",
- params: ["name"],
+const getServiceInfo = rpc.declare({
+ object: "service",
+ method: "list",
+ params: ["name", "verbose"],
});
const _setInitAction = rpc.declare({
}.bind(this)
);
},
- getRuntime: function (name) {
- getRuntime(name).then(
+ getServiceInfo: function (name, verbose) {
+ getServiceInfo(name, verbose).then(
function (result) {
- this.emit("getRuntime", result);
+ this.emit("getServiceInfo", result);
}.bind(this)
);
},
return Promise.all([
L.resolveDefault(getInitStatus(pkg.Name), {}),
L.resolveDefault(getProviders(pkg.Name), {}),
- L.resolveDefault(getRuntime(pkg.Name), {}),
+ L.resolveDefault(getServiceInfo(pkg.Name, true), {}),
]).then(function (data) {
var text;
var reply = {
version: null,
},
providers: (data[1] && data[1][pkg.Name]) || [{ title: "empty" }],
- runtime: (data[2] && data[2][pkg.Name]) || {
- instances: null,
- triggers: [],
+ ubus: (data[2] && data[2][pkg.Name]) || {
+ instances: {},
},
};
reply.providers.sort(function (a, b) {
]);
var instancesDiv = [];
- if (reply.runtime.instances) {
+ if (reply.ubus.instances && Object.keys(reply.ubus.instances).length > 0) {
var instancesTitle = E(
"label",
{ class: "cbi-value-title" },
);
text = _("See the %sREADME%s for details.").format(
'<a href="' +
- pkg.URL +
- '#a-word-about-default-routing " target="_blank">',
+ pkg.URL +
+ '#a-word-about-default-routing " target="_blank">',
"</a>"
);
var instancesDescr = E("div", { class: "cbi-value-description" }, "");
text = "";
- Object.values(reply.runtime.instances).forEach((element) => {
+ Object.values(reply.ubus.instances).forEach((element) => {
var resolver;
var address;
var port;
getInitStatus: getInitStatus,
getPlatformSupport: getPlatformSupport,
getProviders: getProviders,
- getRuntime: getRuntime,
+ getServiceInfo: getServiceInfo,
});
return Promise.all([
hdp.getInitStatus(pkg.Name),
hdp.getProviders(pkg.Name),
- hdp.getRuntime(pkg.Name),
+ hdp.getServiceInfo(pkg.Name),
]);
},
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:284
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:283
msgid "%s%s%s proxy at %s on port %s.%s"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:276
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:275
msgid "%s%s%s proxy on port %s.%s"
msgstr ""
msgid "Direct"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:408
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:407
msgid "Disable"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:402
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:401
msgid "Disabling %s service"
msgstr ""
msgid "DoH DNS (SB)"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:389
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:388
msgid "Enable"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:383
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:382
msgid "Enabling %s service"
msgstr ""
msgid "Force DNS Ports"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:197
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:196
msgid "Force DNS ports:"
msgstr ""
msgid "HTTPS DNS Proxy - Instances"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:187
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:186
msgid "HTTPS DNS Proxy - Status"
msgstr ""
msgid "Norway"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:213
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:212
msgid "Not installed or not found"
msgstr ""
msgid "Parameter"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:295
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:294
msgid "Please %sdonate%s to support development of this project."
msgstr ""
msgid "Quad 9"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:351
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:350
msgid "Restart"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:345
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:344
msgid "Restarting %s service"
msgstr ""
msgid "Security Filter"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:229
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:228
msgid "See the %sREADME%s for details."
msgstr ""
msgid "Select the DNSMASQ Configs to update"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:434
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:433
msgid "Service Control"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:227
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:226
msgid "Service Instances"
msgstr ""
msgid "Service Options"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:191
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:190
msgid "Service Status"
msgstr ""
msgid "Standard"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:332
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:331
msgid "Start"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:326
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:325
msgid "Starting %s service"
msgstr ""
msgid "Statistic Interval"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:370
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:369
msgid "Stop"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:364
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:363
msgid "Stopping %s service"
msgstr ""
msgid "Variant"
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:195
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:194
msgid "Version %s - Running."
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:207
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:206
msgid "Version %s - Stopped (Disabled)."
msgstr ""
-#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:205
+#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js:204
msgid "Version %s - Stopped."
msgstr ""
# ubus -S call luci.https-dns-proxy getInitStatus '{"name": "https-dns-proxy" }'
# ubus -S call luci.https-dns-proxy getPlatformSupport '{"name": "https-dns-proxy" }'
# ubus -S call luci.https-dns-proxy getProviders '{"name": "https-dns-proxy" }'
-# ubus -S call luci.https-dns-proxy getRuntime '{"name": "https-dns-proxy" }'
readonly packageName="https-dns-proxy"
readonly providersDir="/usr/share/${packageName}/providers"
echo ']}'
}
-get_runtime() { ubus call service list "{ 'verbose': true, 'name': '$1' }"; }
-
set_init_action() {
- local name="$1" action="$2" cmd
- case $action in
+ local action="$2" cmd
+ [ "$(basename "$1")" = "$packageName" ] || { print_json_bool 'result' '0'; return 1; }
+ case $action in
enable|disable|start|stop|restart)
- cmd="/etc/init.d/${name} ${action}"
+ cmd="/etc/init.d/${packageName} ${action}"
;;
esac
if [ -n "$cmd" ] && eval "$cmd" >/dev/null 2>&1; then
- print_json_bool "result" '1'
+ print_json_bool 'result' '1'
else
- print_json_bool "result" '0'
+ print_json_bool 'result' '0'
fi
}
json_add_object "getProviders"
json_add_string 'name' "name"
json_close_object
- json_add_object "getRuntime"
- 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_providers "$name"
;;
- getRuntime)
- read -r input
- json_load "$input"
- json_get_var name "name"
- json_cleanup
- get_runtime "$name"
- ;;
setInitAction)
read -r input
json_load "$input"
"getInitList",
"getInitStatus",
"getPlatformSupport",
- "getProviders",
- "getRuntime"
- ]
+ "getProviders"
+ ],
+ "service": ["list"]
},
- "uci": [
- "dhcp",
- "https-dns-proxy"
- ]
+ "uci": ["dhcp", "https-dns-proxy"]
},
"write": {
- "uci": [
- "https-dns-proxy"
- ],
+ "uci": ["https-dns-proxy"],
"ubus": {
- "luci.https-dns-proxy": [
- "setInitAction"
- ]
+ "luci.https-dns-proxy": ["setInitAction"]
}
}
}