From bd5cb1dd66c5a79e36e7fd2960bfc70e73fad686 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Mon, 12 May 2025 02:08:33 +0000 Subject: [PATCH] luci-app-https-dns-proxy: update to 2025.05.11 * fixes https://github.com/openwrt/luci/issues/7763 * fixes https://github.com/stangri/luci-app-https-dns-proxy/issues/9 * fix README link Signed-off-by: Stan Grishin --- .../luci-app-https-dns-proxy/Makefile | 4 +- .../luci-app-https-dns-proxy/README.md | 3 +- .../view/https-dns-proxy/overview.js | 120 +++++++++--------- .../po/templates/https-dns-proxy.pot | 82 ++++++------ .../usr/libexec/rpcd/luci.https-dns-proxy | 6 +- 5 files changed, 110 insertions(+), 105 deletions(-) diff --git a/applications/luci-app-https-dns-proxy/Makefile b/applications/luci-app-https-dns-proxy/Makefile index a5807e3329..c69723037d 100644 --- a/applications/luci-app-https-dns-proxy/Makefile +++ b/applications/luci-app-https-dns-proxy/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-https-dns-proxy PKG_LICENSE:=AGPL-3.0-or-later PKG_MAINTAINER:=Stan Grishin -PKG_VERSION:=2023.12.26 -PKG_RELEASE:=4 +PKG_VERSION:=2025.05.11 +PKG_RELEASE:=1 LUCI_TITLE:=DNS Over HTTPS Proxy Web UI LUCI_URL:=https://github.com/stangri/luci-app-https-dns-proxy/ diff --git a/applications/luci-app-https-dns-proxy/README.md b/applications/luci-app-https-dns-proxy/README.md index a9e965270b..a874eb07cd 100644 --- a/applications/luci-app-https-dns-proxy/README.md +++ b/applications/luci-app-https-dns-proxy/README.md @@ -1,4 +1,3 @@ # README -Documentation for this project is available at [https://docs.openwrt.melmac.net/luci-app-https-dns-proxy/](https://docs.openwrt.melmac.net/luci-app-https-dns-proxy/). - +Documentation for this project is available at [https://docs.openwrt.melmac.net/https-dns-proxy/](https://docs.openwrt.melmac.net/https-dns-proxy/). diff --git a/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js b/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js index b6f7f30090..2f4b202013 100644 --- a/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js +++ b/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js @@ -49,65 +49,71 @@ return view.extend({ s = m.section(form.NamedSection, "config", pkg.Name); - o = s.option( - form.ListValue, - "dnsmasq_config_update_option", - _("Update DNSMASQ Config on Start/Stop"), - _( - "If update option is selected, the %s'DNS Forwards' section of DHCP and DNS%s will be automatically updated to use selected DoH providers (%smore information%s)." - ).format( - '', - "", - '', - "" - ) - ); - o.value("*", _("Update all configs")); - o.value("+", _("Update select configs")); - o.value("-", _("Do not update configs")); - o.default = "*"; - o.retain = true; - o.cfgvalue = function (section_id) { - let val = this.map.data.get( - this.map.config, - section_id, - "dnsmasq_config_update" + var dhcp_dnsmasq_values = Object.values(L.uci.sections("dhcp", "dnsmasq")); + function isEmpty(obj) { + return Object.keys(obj).length === 0; + } + + if (!isEmpty(dhcp_dnsmasq_values)) { + o = s.option( + form.ListValue, + "dnsmasq_config_update_option", + _("Update DNSMASQ Config on Start/Stop"), + _( + "If update option is selected, the %s'DNS Forwards' section of DHCP and DNS%s will be automatically updated to use selected DoH providers (%smore information%s)." + ).format( + '', + "", + '', + "" + ) ); - if (val && val[0]) { - switch (val[0]) { - case "*": - case "-": - return val[0]; - default: - return "+"; - } - } else return "*"; - }; - o.write = function (section_id, formvalue) { - L.uci.set(pkg.Name, section_id, "dnsmasq_config_update", formvalue); - }; + o.value("*", _("Update all configs")); + o.value("+", _("Update select configs")); + o.value("-", _("Do not update configs")); + o.default = "*"; + o.retain = true; + o.cfgvalue = function (section_id) { + let val = this.map.data.get( + this.map.config, + section_id, + "dnsmasq_config_update" + ); + if (val && val[0]) { + switch (val[0]) { + case "*": + case "-": + return val[0]; + default: + return "+"; + } + } else return "*"; + }; + o.write = function (section_id, formvalue) { + L.uci.set(pkg.Name, section_id, "dnsmasq_config_update", formvalue); + }; - o = s.option( - form.MultiValue, - "dnsmasq_config_update", - _("Select the DNSMASQ Configs to update") - ); - Object.values(L.uci.sections("dhcp", "dnsmasq")).forEach(function ( - element - ) { - var description; - var key; - if (element[".name"] === L.uci.resolveSID("dhcp", element[".name"])) { - key = element[".index"]; - description = "dnsmasq[" + element[".index"] + "]"; - } else { - key = element[".name"]; - description = element[".name"]; - } - o.value(key, description); - }); - o.depends("dnsmasq_config_update_option", "+"); - o.retain = true; + o = s.option( + form.MultiValue, + "dnsmasq_config_update", + _("Select the DNSMASQ Configs to update") + ); + + dhcp_dnsmasq_values.forEach(function (element) { + var description; + var key; + if (element[".name"] === L.uci.resolveSID("dhcp", element[".name"])) { + key = element[".index"]; + description = "dnsmasq[" + element[".index"] + "]"; + } else { + key = element[".name"]; + description = element[".name"]; + } + o.value(key, description); + }); + o.depends("dnsmasq_config_update_option", "+"); + o.retain = true; + } o = s.option( form.ListValue, diff --git a/applications/luci-app-https-dns-proxy/po/templates/https-dns-proxy.pot b/applications/luci-app-https-dns-proxy/po/templates/https-dns-proxy.pot index 45017a6047..6b67b2bbd6 100644 --- a/applications/luci-app-https-dns-proxy/po/templates/https-dns-proxy.pot +++ b/applications/luci-app-https-dns-proxy/po/templates/https-dns-proxy.pot @@ -74,19 +74,19 @@ msgstr "" msgid "BlahDNS" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:148 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:154 msgid "" "Blocks access to Mozilla Encrypted resolvers, forcing local devices to use " "router for DNS resolution (%smore information%s)." msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:132 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:138 msgid "" "Blocks access to iCloud Private Relay resolvers, forcing local devices to " "use router for DNS resolution (%smore information%s)." msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:328 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:334 msgid "Bootstrap DNS" msgstr "" @@ -98,11 +98,11 @@ msgstr "" msgid "CIRA Canadian Shield" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:146 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:152 msgid "Canary Domains Mozilla" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:130 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:136 msgid "Canary Domains iCloud" msgstr "" @@ -142,7 +142,7 @@ msgstr "" msgid "DNSlify DNS" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:355 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:361 msgid "DSCP Codepoint" msgstr "" @@ -170,7 +170,7 @@ msgstr "" msgid "Disabling %s service" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:67 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:73 msgid "Do not update configs" msgstr "" @@ -224,25 +224,25 @@ msgstr "" msgid "Force DNS ports:" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:115 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:121 msgid "Force Router DNS" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:124 -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:139 -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:158 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:130 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:145 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:164 msgid "Force Router DNS server to all local devices" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:388 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:394 msgid "Force use of HTTP/1" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:400 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:406 msgid "Force use of IPv6 DNS resolvers" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:117 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:123 msgid "" "Forces Router DNS use on local devices, also known as DNS Hijacking. Only " "works on `lan` interface by default (%smore information%s)." @@ -268,7 +268,7 @@ msgstr "" msgid "HTTPS DNS Proxy - Configuration" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:185 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:191 msgid "HTTPS DNS Proxy - Instances" msgstr "" @@ -292,7 +292,7 @@ msgstr "" msgid "IIJ Public DNS (JP)" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:57 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:63 msgid "" "If update option is selected, the %s'DNS Forwards' section of DHCP and DNS%s " "will be automatically updated to use selected DoH providers (%smore " @@ -315,15 +315,15 @@ msgstr "" msgid "Lelux DNS (FI)" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:157 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:163 msgid "Let local devices use Mozilla Private Relay" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:138 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:144 msgid "Let local devices use iCloud Private Relay" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:123 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:129 msgid "Let local devices use their own DNS servers if set" msgstr "" @@ -331,12 +331,12 @@ msgstr "" msgid "LibreDNS (GR)" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:333 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:339 #: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/status/include/71_https-dns-proxy.js:56 msgid "Listen Address" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:339 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:345 #: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/status/include/71_https-dns-proxy.js:57 msgid "Listen Port" msgstr "" @@ -346,11 +346,11 @@ msgstr "" msgid "Location" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:367 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:373 msgid "Logging File Path" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:361 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:367 msgid "Logging Verbosity" msgstr "" @@ -394,13 +394,13 @@ msgstr "" msgid "OpenDNS" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:261 -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:293 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:267 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:299 msgid "Parameter" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:166 -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:175 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:172 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:181 msgid "" "Please note that %s is not supported on this system (%smore information%s)." msgstr "" @@ -409,7 +409,7 @@ msgstr "" msgid "Poland" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:372 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:378 msgid "Polling Interval" msgstr "" @@ -421,11 +421,11 @@ msgstr "" msgid "Protected Filter" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:227 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:233 msgid "Provider" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:378 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:384 msgid "Proxy Server" msgstr "" @@ -457,11 +457,11 @@ msgstr "" msgid "RubyFish (CN)" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:350 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:356 msgid "Run As Group" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:345 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:351 msgid "Run As User" msgstr "" @@ -486,7 +486,7 @@ msgstr "" msgid "See the %sREADME%s for details." msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:93 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:99 msgid "Select the DNSMASQ Configs to update" msgstr "" @@ -572,7 +572,7 @@ msgstr "" msgid "Unfiltered" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:223 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:229 msgid "Unknown" msgstr "" @@ -580,31 +580,31 @@ msgstr "" msgid "Unsecured" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:55 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:61 msgid "Update DNSMASQ Config on Start/Stop" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:65 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:71 msgid "Update all configs" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:66 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:72 msgid "Update select configs" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:383 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:389 msgid "Use HTTP/1" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:394 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:400 msgid "Use IPv6 resolvers" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:399 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:405 msgid "Use any family DNS resolvers" msgstr "" -#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:387 +#: applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js:393 msgid "Use negotiated HTTP version" msgstr "" diff --git a/applications/luci-app-https-dns-proxy/root/usr/libexec/rpcd/luci.https-dns-proxy b/applications/luci-app-https-dns-proxy/root/usr/libexec/rpcd/luci.https-dns-proxy index 3a05b33a3a..e6bff4d9cf 100755 --- a/applications/luci-app-https-dns-proxy/root/usr/libexec/rpcd/luci.https-dns-proxy +++ b/applications/luci-app-https-dns-proxy/root/usr/libexec/rpcd/luci.https-dns-proxy @@ -19,9 +19,9 @@ readonly providersDir="/usr/share/${packageName}/providers" is_enabled() { "/etc/init.d/${1}" enabled; } is_running() { [ "$(ubus call service list "{ 'name': '$1' }" | jsonfilter -q -e "@['$1'].instances[*].running" | uniq)" = 'true' ]; } -get_version() { /usr/sbin/https-dns-proxy -V; } -check_http2() { curl --version | grep -q 'nghttp2'; } -check_http3() { curl --version | grep -q 'nghttp3'; } +get_version() { /usr/sbin/https-dns-proxy -V | head -1; } +check_http2() { /usr/sbin/https-dns-proxy -V | grep -q 'nghttp2'; } +check_http3() { /usr/sbin/https-dns-proxy -V | grep -q 'nghttp3'; } ubus_get_ports() { ubus call service list "{ 'name': '$packageName' }" | jsonfilter -e "@['${packageName}'].instances[*].data.firewall.*.dest_port"; } logger() { /usr/bin/logger -t "$packageName" "$@"; } print_json_bool() { json_init; json_add_boolean "$1" "$2"; json_dump; json_cleanup; } -- 2.30.2