From db6f7fc97199da658dfa599176e4491142c9e729 Mon Sep 17 00:00:00 2001 From: sbwml Date: Thu, 30 Mar 2023 17:05:49 +0800 Subject: [PATCH] Revert "luci-app-mosdns: Add http/3 support for local DNS" This reverts commit c8b320b8a08bb95bea05ff9f1e361f9065b12368. * Mainland China does not seem to have a public DNS that supports the DoH/3 protocol --- luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua | 7 +------ luci-app-mosdns/po/zh-cn/mosdns.po | 14 ++++---------- luci-app-mosdns/root/etc/config/mosdns | 3 +-- luci-app-mosdns/root/etc/init.d/mosdns | 10 ++++------ 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua b/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua index b0d2e1f..1b51488 100644 --- a/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua +++ b/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua @@ -114,12 +114,7 @@ o.rmempty = false o.default = false o:depends("configfile", "/etc/mosdns/config.yaml") -o = s:taboption("advanced", Flag, "enable_http3_local", translate("Local DNS Enable HTTP/3"), translate("Enable DoH HTTP/3 protocol for Local DNS, Upstream DNS server support is required (Experimental)")) -o.rmempty = false -o.default = false -o:depends("custom_local_dns", "1") - -o = s:taboption("advanced", Flag, "enable_http3_remote", translate("Remote DNS Enable HTTP/3"), translate("Enable DoH HTTP/3 protocol for Remote DNS, Upstream DNS server support is required (Experimental)")) +o = s:taboption("advanced", Flag, "enable_http3", translate("Enable HTTP/3"), translate("Enable DoH HTTP/3 protocol support for remote DNS, Upstream DNS server support is required (Experimental)")) o.rmempty = false o.default = false o:depends("configfile", "/etc/mosdns/config.yaml") diff --git a/luci-app-mosdns/po/zh-cn/mosdns.po b/luci-app-mosdns/po/zh-cn/mosdns.po index 39ccfe2..c0e92cc 100644 --- a/luci-app-mosdns/po/zh-cn/mosdns.po +++ b/luci-app-mosdns/po/zh-cn/mosdns.po @@ -187,17 +187,11 @@ msgstr "禁用 TLS 证书" msgid "Disable TLS Servers certificate validation, Can be useful if system CA certificate expires or the system time is out of order" msgstr "禁用 TLS 服务器证书验证,当系统 CA 证书过期或系统时间错乱时,本选项可能会有用" -msgid "Local DNS Enable HTTP/3" -msgstr "本地 DNS 启用 HTTP/3" +msgid "Enable HTTP/3" +msgstr "启用 HTTP/3" -msgid "Enable DoH HTTP/3 protocol for Local DNS, Upstream DNS server support is required (Experimental)" -msgstr "本地 DNS 启用 DoH HTTP/3 协议,需要上游 DNS 服务器支持(实验性,谨慎启用该功能)" - -msgid "Remote DNS Enable HTTP/3" -msgstr "远程 DNS 启用 HTTP/3" - -msgid "Enable DoH HTTP/3 protocol for Remote DNS, Upstream DNS server support is required (Experimental)" -msgstr "远程 DNS 启用 DoH HTTP/3 协议,需要上游 DNS 服务器支持(实验性,谨慎启用该功能)" +msgid "Enable DoH HTTP/3 protocol support for remote DNS, Upstream DNS server support is required (Experimental)" +msgstr "为远程 DNS 启用 DoH HTTP/3 协议支持,需要上游 DNS 服务器支持(实验性,谨慎启用该功能)" msgid "Enable EDNS client subnet" msgstr "启用 EDNS 客户端子网" diff --git a/luci-app-mosdns/root/etc/config/mosdns b/luci-app-mosdns/root/etc/config/mosdns index 510ff31..a7e31a7 100644 --- a/luci-app-mosdns/root/etc/config/mosdns +++ b/luci-app-mosdns/root/etc/config/mosdns @@ -21,8 +21,7 @@ config mosdns 'config' option custom_local_dns '0' option enable_pipeline '0' option insecure_skip_verify '0' - option enable_http3_local '0' - option enable_http3_remote '0' + option enable_http3 '0' option listen_port_api '9091' option bootstrap_dns '119.29.29.29' list remote_dns 'tls://8.8.8.8' diff --git a/luci-app-mosdns/root/etc/init.d/mosdns b/luci-app-mosdns/root/etc/init.d/mosdns index df44e8e..5025aa9 100755 --- a/luci-app-mosdns/root/etc/init.d/mosdns +++ b/luci-app-mosdns/root/etc/init.d/mosdns @@ -57,8 +57,7 @@ get_config() { config_get max_conns $1 max_conns 2 config_get insecure_skip_verify $1 insecure_skip_verify 0 config_get idle_timeout $1 idle_timeout 30 - config_get enable_http3_local $1 enable_http3_local 0 - config_get enable_http3_remote $1 enable_http3_remote 0 + config_get enable_http3 $1 enable_http3 0 config_get enable_ecs_remote $1 enable_ecs_remote 0 } @@ -67,12 +66,11 @@ init_yaml() { adlist=$($MOSDNS_SCRIPT ad) [ $enable_pipeline -eq 1 ] && enable_pipeline=true || enable_pipeline=false [ $insecure_skip_verify -eq 1 ] && insecure_skip_verify=true || insecure_skip_verify=false - [ $enable_http3_local -eq 1 ] && enable_http3_local=true || enable_http3_local=false - [ $enable_http3_remote -eq 1 ] && enable_http3_remote=true || enable_http3_remote=false + [ $enable_http3 -eq 1 ] && enable_http3=true || enable_http3=false [ "$custom_local_dns" -eq 1 ] && \ - local_dns=$($MOSDNS_SCRIPT dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s bootstrap: '${bootstrap_dns}'\n%s enable_pipeline: '${enable_pipeline}'\n%s max_conns: '${max_conns}'\n%s insecure_skip_verify: '${insecure_skip_verify}'\n%s idle_timeout: '${idle_timeout}'\n%s enable_http3: '${enable_http3_local}'\n",s,$i,s,s,s,s,s,s}' s=' ') || \ + local_dns=$($MOSDNS_SCRIPT dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s bootstrap: '${bootstrap_dns}'\n%s enable_pipeline: '${enable_pipeline}'\n%s max_conns: '${max_conns}'\n%s insecure_skip_verify: '${insecure_skip_verify}'\n%s idle_timeout: '${idle_timeout}'\n",s,$i,s,s,s,s,s}' s=' ') || \ local_dns=$($MOSDNS_SCRIPT dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n",s,$i,s}' s=' ') - remote_dns=$(echo $remote_dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s bootstrap: '${bootstrap_dns}'\n%s enable_pipeline: '${enable_pipeline}'\n%s max_conns: '${max_conns}'\n%s insecure_skip_verify: '${insecure_skip_verify}'\n%s idle_timeout: '${idle_timeout}'\n%s enable_http3: '${enable_http3_remote}'\n",s,$i,s,s,s,s,s,s}' s=' ') + remote_dns=$(echo $remote_dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s bootstrap: '${bootstrap_dns}'\n%s enable_pipeline: '${enable_pipeline}'\n%s max_conns: '${max_conns}'\n%s insecure_skip_verify: '${insecure_skip_verify}'\n%s idle_timeout: '${idle_timeout}'\n%s enable_http3: '${enable_http3}'\n",s,$i,s,s,s,s,s,s}' s=' ') sed "s,log_level,$log_level,g;s,log_file,$log_file,g; \ s,listen_port,$listen_port,g;s,cache_size,$cache_size,g; \ s,cache_survival_time,$cache_survival_time,g; \