https-dns-proxy: bugfixes
authorStan Grishin <stangri@melmac.ca>
Tue, 18 Feb 2025 00:13:29 +0000 (00:13 +0000)
committerStan Grishin <stangri@melmac.ca>
Tue, 18 Feb 2025 18:23:20 +0000 (10:23 -0800)
* No more `/sbin/uci: Invalid argument output` when set to not update
  dnsmasq instances (thanks @tmcqueen-materials for investigation!)
* Do not wait for interface.up on boot, hopefully this resolves the
  boot-up start for everyone

Signed-off-by: Stan Grishin <stangri@melmac.ca>
net/https-dns-proxy/Makefile
net/https-dns-proxy/files/etc/init.d/https-dns-proxy

index 454ab9e1d9b4c85c936760e94061d2f8af945599..2150c8e7ff03a3527417edbe37f88448894f580d 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=https-dns-proxy
 PKG_VERSION:=2023.12.26
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/
index a061ad09c47b787bbe24ab041073216e89d38ca4..d04ed7376fef1330b186df272964afbcff697afe 100755 (executable)
@@ -33,6 +33,7 @@ readonly canaryDomainsiCloud='mask.icloud.com mask-h2.icloud.com'
 hdp_boot_flag=
 
 dnsmasq_restart() { [ -x /etc/init.d/dnsmasq ] || return 1; /etc/init.d/dnsmasq restart >/dev/null 2>&1; }
+is_alnum() { case "$1" in (*[![:alnum:]_@]*|"") return 1;; esac; }
 is_fw4_restart_needed() { [ "$(uci_get "$packageName" 'config' 'force_dns' '1')" = '1' ]; }
 is_mac_address() { expr "$1" : '[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]$' >/dev/null; }
 is_ipv4() { expr "$1" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; }
@@ -133,7 +134,7 @@ append_bootstrap() {
 }
 
 boot() {
-       ubus -t 30 wait_for network.interface 2>/dev/null
+#      ubus -t 30 wait_for network.interface 2>/dev/null
        rc_procd start_service 'on_boot' && service_started 'on_boot'
        if ! is_resolver_working; then
                hdp_boot_flag=1
@@ -168,7 +169,7 @@ start_instance() {
                config_load 'dhcp'
                config_foreach dnsmasq_doh_server 'dnsmasq' 'add' "${listen_addr}" "${listen_port}"
                config_foreach dnsmasq_instance_append_force_dns_port 'dnsmasq'
-       elif [ -n "$dnsmasq_config_update" ]; then
+       elif is_alnum "$dnsmasq_config_update"; then
                for i in $dnsmasq_config_update; do
                        dnsmasq_doh_server "@dnsmasq[$i]" 'add' "${listen_addr}" "${listen_port}" || \
                                dnsmasq_doh_server "${i}" 'add' "${listen_addr}" "${listen_port}"