PKG_NAME:=dnsproxy
PKG_VERSION:=0.52.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)?
$(INSTALL_CONF) $(CURDIR)/files/dnsproxy.config $(1)/etc/config/dnsproxy
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) $(CURDIR)/files/dnsproxy.init $(1)/etc/init.d/dnsproxy
+ $(INSTALL_DIR) $(1)/etc/uci-defaults/
+ $(INSTALL_BIN) $(CURDIR)/files/dnsproxy.defaults $(1)/etc/uci-defaults/80-dnsproxy-migration
endef
define Package/dnsproxy/conffiles
config dnsproxy 'global'
option enabled '0'
- option listen_addr '127.0.0.1'
- option listen_port '5353'
+ list listen_addr '127.0.0.1'
+ list listen_addr '::1'
+ list listen_port '5353'
option log_file ''
option all_servers '0'
option fastest_addr '0'
+ option http3 '0'
option insecure '0'
option ipv6_disabled '0'
+ option timeout ''
option max_go_routines ''
option rate_limit ''
option refuse_any '0'
--- /dev/null
+#!/bin/sh
+
+[ -s "/etc/config/dnsproxy" ] || exit 0
+
+#Migrate options 'listen_addr' 'listen_port' to list type
+sed -i -e "s,option listen_addr,list listen_addr,g" \
+ -e "s,option listen_port,list listen_port,g" "/etc/config/dnsproxy"
+exit 0
load_config_arg() {
append_param_bool "$1" "all_servers"
append_param_bool "$1" "fastest_addr"
+ append_param_bool "$1" "http3"
append_param_bool "$1" "insecure"
append_param_bool "$1" "ipv6_disabled"
append_param_bool "$1" "refuse_any"
}
load_config_list() {
+ if is_empty "global" "listen_addr"; then
+ append_param "--listen" "127.0.0.1"
+ else
+ config_list_foreach "global" "listen_addr" "append_param '--listen'"
+ fi
+
+ if is_empty "global" "listen_port"; then
+ append_param "--port" "5353"
+ else
+ config_list_foreach "global" "listen_port" "append_param '--port'"
+ fi
+
is_empty "bogus_nxdomain" "ip_addr" || config_list_foreach "bogus_nxdomain" "ip_addr" "append_param '--bogus-nxdomain'"
for i in "bootstrap" "fallback" "upstream"; do
}
load_config_param() {
- append_param_arg "global" "listen_addr" "--listen" "127.0.0.1"
- append_param_arg "global" "listen_port" "--port" "5353"
append_param_arg "global" "log_file" "--output"
+ append_param_arg "global" "timeout" "--timeout"
append_param_arg "global" "max_go_routines" "--max-go-routines"
append_param_arg "global" "rate_limit" "--ratelimit"
append_param_arg "global" "udp_buf_size" "--udp-buf-size"