From c71ab7543f5b2f75c014aeefec6bf9a38278600a Mon Sep 17 00:00:00 2001 From: Luna Yao <40349250+ZnqbuZ@users.noreply.github.com> Date: Sat, 18 Apr 2026 21:26:20 +0200 Subject: [PATCH] remove accept_dns --- easytier/locales/app.yml | 6 ------ easytier/src/common/config.rs | 3 ++- easytier/src/core.rs | 14 -------------- easytier/src/launcher.rs | 6 ------ easytier/src/proto/api_manage.proto | 2 +- easytier/src/proto/common.proto | 2 +- 6 files changed, 4 insertions(+), 29 deletions(-) diff --git a/easytier/locales/app.yml b/easytier/locales/app.yml index bc6cb7d3..7c7b0115 100644 --- a/easytier/locales/app.yml +++ b/easytier/locales/app.yml @@ -205,12 +205,6 @@ core_clap: port_forward: en: "forward local port to remote port in virtual network. e.g.: udp://0.0.0.0:12345/10.126.126.1:23456, means forward local udp port 12345 to 10.126.126.1:23456 in the virtual network. can specify multiple." zh-CN: "将本地端口转发到虚拟网络中的远程端口。例如:udp://0.0.0.0:12345/10.126.126.1:23456,表示将本地UDP端口12345转发到虚拟网络中的10.126.126.1:23456。可以指定多个。" - accept_dns: - en: "if true, enable magic dns. with magic dns, you can access other nodes with a domain name, e.g.: .et.net. magic dns will modify your system dns settings, enable it carefully." - zh-CN: "如果为true,则启用魔法DNS。使用魔法DNS,您可以使用域名访问其他节点,例如:.et.net。魔法DNS将修改您的系统DNS设置,请谨慎启用。" - tld_dns_zone: - en: "specify the top-level domain zone for magic DNS. if not provided, defaults to the value from dns_server module (et.net.). only used when accept_dns is true." - zh-CN: "指定魔法DNS的顶级域名区域。如果未提供,默认使用dns_server模块中的值(et.net.)。仅在accept_dns为true时使用。" private_mode: en: "if true, foreign networks are only allowed when this node can verify they use the same network secret, or when a foreign credential node is already trusted via admin-issued credential propagation; different or missing secrets are otherwise rejected." zh-CN: "如果为true,则仅允许两类 foreign network 接入:本节点能验证其使用相同 network secret 的节点,或已通过 foreign network 管理节点传播而被信任的 credential 节点;否则 secret 不同或缺失时会被拒绝。" diff --git a/easytier/src/common/config.rs b/easytier/src/common/config.rs index e7ce8bd9..d8bfdcf1 100644 --- a/easytier/src/common/config.rs +++ b/easytier/src/common/config.rs @@ -31,6 +31,8 @@ pub fn gen_default_flags() -> Flags { #[allow(deprecated)] quic_listen_port: u32::MAX, #[allow(deprecated)] + accept_dns: false, + #[allow(deprecated)] tld_dns_zone: "".to_string(), default_protocol: "tcp".to_string(), @@ -57,7 +59,6 @@ pub fn gen_default_flags() -> Flags { disable_kcp_input: false, disable_relay_kcp: false, enable_relay_foreign_network_kcp: false, - accept_dns: false, private_mode: false, enable_quic_proxy: false, disable_quic_input: false, diff --git a/easytier/src/core.rs b/easytier/src/core.rs index bdc0f0f9..40e9cd24 100644 --- a/easytier/src/core.rs +++ b/easytier/src/core.rs @@ -535,19 +535,6 @@ struct NetworkOptions { )] port_forward: Vec, - #[arg( - long, - env = "ET_ACCEPT_DNS", - help = t!("core_clap.accept_dns").to_string(), - )] - accept_dns: Option, - - #[arg( - long = "tld-dns-zone", - env = "ET_TLD_DNS_ZONE", - help = t!("core_clap.tld_dns_zone").to_string())] - tld_dns_zone: Option, - #[arg( long, env = "ET_PRIVATE_MODE", @@ -1071,7 +1058,6 @@ impl NetworkOptions { f.disable_kcp_input = self.disable_kcp_input.unwrap_or(f.disable_kcp_input); f.enable_quic_proxy = self.enable_quic_proxy.unwrap_or(f.enable_quic_proxy); f.disable_quic_input = self.disable_quic_input.unwrap_or(f.disable_quic_input); - f.accept_dns = self.accept_dns.unwrap_or(f.accept_dns); f.private_mode = self.private_mode.unwrap_or(f.private_mode); f.foreign_relay_bps_limit = self .foreign_relay_bps_limit diff --git a/easytier/src/launcher.rs b/easytier/src/launcher.rs index a5dc001f..b43fbb83 100644 --- a/easytier/src/launcher.rs +++ b/easytier/src/launcher.rs @@ -805,10 +805,6 @@ impl NetworkConfig { flags.disable_sym_hole_punching = disable_sym_hole_punching; } - if let Some(enable_magic_dns) = self.enable_magic_dns { - flags.accept_dns = enable_magic_dns; - } - if let Some(mtu) = self.mtu { flags.mtu = mtu as u32; } @@ -958,7 +954,6 @@ impl NetworkConfig { result.disable_tcp_hole_punching = Some(flags.disable_tcp_hole_punching); result.disable_udp_hole_punching = Some(flags.disable_udp_hole_punching); result.disable_sym_hole_punching = Some(flags.disable_sym_hole_punching); - result.enable_magic_dns = Some(flags.accept_dns); result.mtu = Some(flags.mtu as i32); result.instance_recv_bps_limit = (flags.instance_recv_bps_limit != u64::MAX).then_some(flags.instance_recv_bps_limit); @@ -1222,7 +1217,6 @@ mod tests { flags.enable_encryption = rng.gen_bool(0.8); flags.disable_tcp_hole_punching = rng.gen_bool(0.2); flags.disable_udp_hole_punching = rng.gen_bool(0.2); - flags.accept_dns = rng.gen_bool(0.6); flags.mtu = rng.gen_range(1200..1500); flags.private_mode = rng.gen_bool(0.3); diff --git a/easytier/src/proto/api_manage.proto b/easytier/src/proto/api_manage.proto index b79ff5d7..85d850c7 100644 --- a/easytier/src/proto/api_manage.proto +++ b/easytier/src/proto/api_manage.proto @@ -65,7 +65,7 @@ message NetworkConfig { optional int32 mtu = 40; repeated string mapped_listeners = 41; - optional bool enable_magic_dns = 42; + optional bool enable_magic_dns = 42 [deprecated = true]; optional bool enable_private_mode = 43; // repeated string rpc_portal_whitelists = 44; diff --git a/easytier/src/proto/common.proto b/easytier/src/proto/common.proto index 8a025d35..d9ae4739 100644 --- a/easytier/src/proto/common.proto +++ b/easytier/src/proto/common.proto @@ -33,7 +33,7 @@ message FlagsInConfig { bool proxy_forward_by_system = 21; // enable magic dns or not - bool accept_dns = 22; + bool accept_dns = 22 [deprecated = true]; // enable private mode bool private_mode = 23;