luci-app-mosdns: add optional prefer_ipv4
for remote dns
Signed-off-by: sbwml <admin@cooluc.com>
This commit is contained in:
parent
ce08474f7c
commit
e79a991d75
@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-mosdns
|
PKG_NAME:=luci-app-mosdns
|
||||||
PKG_VERSION:=1.5.16
|
PKG_VERSION:=1.5.17
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
LUCI_TITLE:=LuCI Support for mosdns
|
LUCI_TITLE:=LuCI Support for mosdns
|
||||||
|
@ -47,6 +47,10 @@ o:depends("configfile", "/etc/mosdns/config.yaml")
|
|||||||
o = s:taboption("basic", Flag, "redirect", translate("DNS Forward"), translate("Forward Dnsmasq Domain Name resolution requests to MosDNS"))
|
o = s:taboption("basic", Flag, "redirect", translate("DNS Forward"), translate("Forward Dnsmasq Domain Name resolution requests to MosDNS"))
|
||||||
o.default = true
|
o.default = true
|
||||||
|
|
||||||
|
o = s:taboption("basic", Flag, "prefer_ipv4", translate("Remote DNS prefer IPv4"), translate("IPv4 is preferred for remote DNS resolution of dual-stack addresses, and is not affected when the destination is IPv6 only"))
|
||||||
|
o:depends( "configfile", "/etc/mosdns/config.yaml")
|
||||||
|
o.default = true
|
||||||
|
|
||||||
o = s:taboption("basic", Flag, "custom_local_dns", translate("Custom China DNS"), translate("Follow WAN interface DNS if not enabled"))
|
o = s:taboption("basic", Flag, "custom_local_dns", translate("Custom China DNS"), translate("Follow WAN interface DNS if not enabled"))
|
||||||
o:depends( "configfile", "/etc/mosdns/config.yaml")
|
o:depends( "configfile", "/etc/mosdns/config.yaml")
|
||||||
o.default = false
|
o.default = false
|
||||||
|
@ -160,6 +160,12 @@ msgstr "自定义"
|
|||||||
msgid "Log File"
|
msgid "Log File"
|
||||||
msgstr "日志文件"
|
msgstr "日志文件"
|
||||||
|
|
||||||
|
msgid "Remote DNS prefer IPv4"
|
||||||
|
msgstr "远程 DNS 首选 IPv4"
|
||||||
|
|
||||||
|
msgid "IPv4 is preferred for remote DNS resolution of dual-stack addresses, and is not affected when the destination is IPv6 only"
|
||||||
|
msgstr "远程 DNS 解析双栈地址时首选 IPv4,目标仅 IPv6 时不受影响"
|
||||||
|
|
||||||
msgid "Custom China DNS"
|
msgid "Custom China DNS"
|
||||||
msgstr "自定义国内 DNS"
|
msgstr "自定义国内 DNS"
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ config mosdns 'config'
|
|||||||
option geo_update_week_time '*'
|
option geo_update_week_time '*'
|
||||||
option geo_update_day_time '2'
|
option geo_update_day_time '2'
|
||||||
option redirect '1'
|
option redirect '1'
|
||||||
|
option prefer_ipv4 '1'
|
||||||
option adblock '0'
|
option adblock '0'
|
||||||
option configfile '/etc/mosdns/config.yaml'
|
option configfile '/etc/mosdns/config.yaml'
|
||||||
option log_level 'info'
|
option log_level 'info'
|
||||||
|
@ -49,6 +49,7 @@ get_config() {
|
|||||||
config_get maximum_ttl_custom $1 maximum_ttl 0
|
config_get maximum_ttl_custom $1 maximum_ttl 0
|
||||||
config_get minimal_ttl_custom $1 minimal_ttl 0
|
config_get minimal_ttl_custom $1 minimal_ttl 0
|
||||||
config_get redirect $1 redirect 0
|
config_get redirect $1 redirect 0
|
||||||
|
config_get prefer_ipv4 $1 prefer_ipv4 0
|
||||||
config_get remote_dns $1 remote_dns "tls://8.8.8.8 tls://1.1.1.1"
|
config_get remote_dns $1 remote_dns "tls://8.8.8.8 tls://1.1.1.1"
|
||||||
config_get custom_local_dns $1 custom_local_dns 0
|
config_get custom_local_dns $1 custom_local_dns 0
|
||||||
config_get apple_optimization $1 apple_optimization 0
|
config_get apple_optimization $1 apple_optimization 0
|
||||||
@ -111,6 +112,8 @@ init_yaml() {
|
|||||||
sed -i -e '/- addr: local_dns/{r '$TMPDIR/local_dns.txt -e';d};/- addr: remote_dns/{r '$TMPDIR/remote_dns.txt -e';d}' $CONF
|
sed -i -e '/- addr: local_dns/{r '$TMPDIR/local_dns.txt -e';d};/- addr: remote_dns/{r '$TMPDIR/remote_dns.txt -e';d}' $CONF
|
||||||
# Convert HTTP/3 prefix format
|
# Convert HTTP/3 prefix format
|
||||||
sed -i 's/h3:\/\//https:\/\//g' $CONF
|
sed -i 's/h3:\/\//https:\/\//g' $CONF
|
||||||
|
# Prefer IPv4
|
||||||
|
[ $prefer_ipv4 -ne 1 ] && sed -i "/prefer_ipv4/d" $CONF
|
||||||
# Cache dump
|
# Cache dump
|
||||||
[ "$dump_file" -eq 1 ] && sed -i "/lazy_cache_ttl/a\ dump_file: $DUMP_FILE\n dump_interval: $dump_interval" $CONF
|
[ "$dump_file" -eq 1 ] && sed -i "/lazy_cache_ttl/a\ dump_file: $DUMP_FILE\n dump_interval: $dump_interval" $CONF
|
||||||
[ "$dump_file" -eq 1 ] && [ ! -f $DUMP_FILE ] && cp -a $DUMP_FILE_DEFAULT $DUMP_FILE
|
[ "$dump_file" -eq 1 ] && [ ! -f $DUMP_FILE ] && cp -a $DUMP_FILE_DEFAULT $DUMP_FILE
|
||||||
|
Loading…
Reference in New Issue
Block a user