mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 23:34:31 +04:00
dnsproxy: new features
1. Add new options:
--http3 Enable HTTP/3 support (H3 first)
--timeout Timeout for outbound DNS queries to remote upstream servers in a human-readable form (default: 10s)
2. Allows listen on multiple interfaces and ports
Signed-off-by: Anya Lin <hukk1996@gmail.com>
(cherry picked from commit 47b4ebc5cb)
Signed-off-by: Anya Lin <hukk1996@gmail.com>
This commit is contained in:
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=dnsproxy
|
PKG_NAME:=dnsproxy
|
||||||
PKG_VERSION:=0.52.0
|
PKG_VERSION:=0.52.0
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)?
|
||||||
@@ -49,6 +49,8 @@ define Package/dnsproxy/install
|
|||||||
$(INSTALL_CONF) $(CURDIR)/files/dnsproxy.config $(1)/etc/config/dnsproxy
|
$(INSTALL_CONF) $(CURDIR)/files/dnsproxy.config $(1)/etc/config/dnsproxy
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||||
$(INSTALL_BIN) $(CURDIR)/files/dnsproxy.init $(1)/etc/init.d/dnsproxy
|
$(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
|
endef
|
||||||
|
|
||||||
define Package/dnsproxy/conffiles
|
define Package/dnsproxy/conffiles
|
||||||
|
|||||||
@@ -3,13 +3,16 @@
|
|||||||
|
|
||||||
config dnsproxy 'global'
|
config dnsproxy 'global'
|
||||||
option enabled '0'
|
option enabled '0'
|
||||||
option listen_addr '127.0.0.1'
|
list listen_addr '127.0.0.1'
|
||||||
option listen_port '5353'
|
list listen_addr '::1'
|
||||||
|
list listen_port '5353'
|
||||||
option log_file ''
|
option log_file ''
|
||||||
option all_servers '0'
|
option all_servers '0'
|
||||||
option fastest_addr '0'
|
option fastest_addr '0'
|
||||||
|
option http3 '0'
|
||||||
option insecure '0'
|
option insecure '0'
|
||||||
option ipv6_disabled '0'
|
option ipv6_disabled '0'
|
||||||
|
option timeout ''
|
||||||
option max_go_routines ''
|
option max_go_routines ''
|
||||||
option rate_limit ''
|
option rate_limit ''
|
||||||
option refuse_any '0'
|
option refuse_any '0'
|
||||||
|
|||||||
8
net/dnsproxy/files/dnsproxy.defaults
Normal file
8
net/dnsproxy/files/dnsproxy.defaults
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/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
|
||||||
@@ -44,6 +44,7 @@ append_param_bool() {
|
|||||||
load_config_arg() {
|
load_config_arg() {
|
||||||
append_param_bool "$1" "all_servers"
|
append_param_bool "$1" "all_servers"
|
||||||
append_param_bool "$1" "fastest_addr"
|
append_param_bool "$1" "fastest_addr"
|
||||||
|
append_param_bool "$1" "http3"
|
||||||
append_param_bool "$1" "insecure"
|
append_param_bool "$1" "insecure"
|
||||||
append_param_bool "$1" "ipv6_disabled"
|
append_param_bool "$1" "ipv6_disabled"
|
||||||
append_param_bool "$1" "refuse_any"
|
append_param_bool "$1" "refuse_any"
|
||||||
@@ -51,6 +52,18 @@ load_config_arg() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
load_config_list() {
|
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'"
|
is_empty "bogus_nxdomain" "ip_addr" || config_list_foreach "bogus_nxdomain" "ip_addr" "append_param '--bogus-nxdomain'"
|
||||||
|
|
||||||
for i in "bootstrap" "fallback" "upstream"; do
|
for i in "bootstrap" "fallback" "upstream"; do
|
||||||
@@ -59,9 +72,8 @@ load_config_list() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
load_config_param() {
|
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" "log_file" "--output"
|
||||||
|
append_param_arg "global" "timeout" "--timeout"
|
||||||
append_param_arg "global" "max_go_routines" "--max-go-routines"
|
append_param_arg "global" "max_go_routines" "--max-go-routines"
|
||||||
append_param_arg "global" "rate_limit" "--ratelimit"
|
append_param_arg "global" "rate_limit" "--ratelimit"
|
||||||
append_param_arg "global" "udp_buf_size" "--udp-buf-size"
|
append_param_arg "global" "udp_buf_size" "--udp-buf-size"
|
||||||
|
|||||||
Reference in New Issue
Block a user