mirror of
https://github.com/kenzok8/small-package
synced 2025-01-08 13:27:36 +08:00
update 2023-11-10 16:21:28
This commit is contained in:
parent
77752541db
commit
29eaa696f7
@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsproxy
|
||||
PKG_VERSION:=0.56.2
|
||||
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)?
|
||||
@ -49,6 +49,8 @@ define Package/dnsproxy/install
|
||||
$(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
|
||||
|
@ -3,13 +3,16 @@
|
||||
|
||||
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'
|
||||
|
8
dnsproxy/files/dnsproxy.defaults
Normal file
8
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() {
|
||||
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"
|
||||
@ -51,6 +52,18 @@ load_config_arg() {
|
||||
}
|
||||
|
||||
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
|
||||
@ -59,9 +72,8 @@ load_config_list() {
|
||||
}
|
||||
|
||||
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"
|
||||
|
Loading…
Reference in New Issue
Block a user