From 83d1ecc4dacba52cfbfdccb9e0c16521c7a9b4eb Mon Sep 17 00:00:00 2001 From: "Sijie.Sun" Date: Sun, 18 May 2025 16:45:39 +0800 Subject: [PATCH] bump version to v2.3.0 (#859) also some improvements: 1. add magic dns option in gui. 2. allow icmp proxy fail on android 3. when no_tun is enabled, android do not start vpn service Co-authored-by: Your Name --- .github/workflows/docker.yml | 2 +- .github/workflows/release.yml | 2 +- Cargo.lock | 134 ++++++++---------- easytier-gui/src-tauri/Cargo.toml | 4 +- easytier-gui/src-tauri/build.rs | 5 +- easytier-gui/src-tauri/tauri.conf.json | 2 +- easytier-gui/src/composables/mobile_vpn.ts | 8 ++ easytier-gui/src/stores/network.ts | 7 + easytier-gui/src/styles.css | 8 ++ easytier-web/Cargo.toml | 2 +- .../frontend-lib/src/components/Config.vue | 1 + easytier-web/frontend-lib/src/locales/cn.yaml | 4 + easytier-web/frontend-lib/src/locales/en.yaml | 4 + .../frontend-lib/src/types/network.ts | 3 + easytier/Cargo.toml | 2 +- easytier/src/instance/instance.rs | 8 +- easytier/src/launcher.rs | 4 + easytier/src/proto/web.proto | 2 + 18 files changed, 122 insertions(+), 80 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 57b425b..675841f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,7 +11,7 @@ on: image_tag: description: 'Tag for this image build' type: string - default: 'v2.2.4' + default: 'v2.3.0' required: true mark_latest: description: 'Mark this image as latest' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e9ffb5..0aac7b9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ on: version: description: 'Version for this release' type: string - default: 'v2.2.4' + default: 'v2.3.0' required: true make_latest: description: 'Mark this release as latest' diff --git a/Cargo.lock b/Cargo.lock index 785346c..03a89df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -301,17 +301,6 @@ dependencies = [ "slab", ] -[[package]] -name = "async-fs" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" -dependencies = [ - "async-lock", - "blocking", - "futures-lite", -] - [[package]] name = "async-io" version = "2.3.4" @@ -825,7 +814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" dependencies = [ "once_cell", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.87", @@ -1938,7 +1927,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "easytier" -version = "2.2.4" +version = "2.3.0" dependencies = [ "aes-gcm", "anyhow", @@ -2066,7 +2055,7 @@ dependencies = [ [[package]] name = "easytier-gui" -version = "2.2.4" +version = "2.3.0" dependencies = [ "anyhow", "chrono", @@ -2112,7 +2101,7 @@ dependencies = [ [[package]] name = "easytier-web" -version = "2.2.4" +version = "2.3.0" dependencies = [ "anyhow", "async-trait", @@ -2581,9 +2570,9 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ "fastrand", "futures-core", @@ -4643,6 +4632,19 @@ dependencies = [ "memoffset", ] +[[package]] +name = "nix" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +dependencies = [ + "bitflags 2.8.0", + "cfg-if", + "cfg_aliases", + "libc", + "memoffset", +] + [[package]] name = "no-std-net" version = "0.6.0" @@ -4796,7 +4798,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 2.0.87", @@ -5796,11 +5798,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.22.20", ] [[package]] @@ -8206,16 +8208,16 @@ dependencies = [ [[package]] name = "tauri-plugin-single-instance" -version = "2.0.0-rc.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de552151b4c9ba9ff72c7244dccaadd47f88d1f0d5caa2603c5c1c12b7636edc" +checksum = "1320af4d866a7fb5f5721d299d14d0dd9e4e6bc0359ff3e263124a2bf6814efa" dependencies = [ - "log", "serde", "serde_json", "tauri", - "thiserror 1.0.63", - "windows-sys 0.52.0", + "thiserror 2.0.11", + "tracing", + "windows-sys 0.59.0", "zbus", ] @@ -8655,17 +8657,6 @@ dependencies = [ "winnow 0.5.40", ] -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.7.1", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.20" @@ -9961,6 +9952,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.10.1" @@ -10130,16 +10130,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "xdg-home" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" -dependencies = [ - "libc", - "windows-sys 0.59.0", -] - [[package]] name = "xml-rs" version = "0.8.22" @@ -10187,13 +10177,12 @@ dependencies = [ [[package]] name = "zbus" -version = "4.4.0" +version = "5.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" +checksum = "88232b74ba057a0c85472ec1bae8a17569960be17da2d5e5ad30d5efe7ea6719" dependencies = [ "async-broadcast", "async-executor", - "async-fs", "async-io", "async-lock", "async-process", @@ -10204,20 +10193,16 @@ dependencies = [ "enumflags2", "event-listener", "futures-core", - "futures-sink", - "futures-util", + "futures-lite", "hex", - "nix 0.29.0", + "nix 0.30.1", "ordered-stream", - "rand 0.8.5", "serde", "serde_repr", - "sha1", - "static_assertions", "tracing", "uds_windows", - "windows-sys 0.52.0", - "xdg-home", + "windows-sys 0.59.0", + "winnow 0.7.10", "zbus_macros", "zbus_names", "zvariant", @@ -10225,25 +10210,28 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "4.4.0" +version = "5.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" +checksum = "6969c06899233334676e60da1675740539cf034ee472a6c5b5c54e50a0a554c9" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.87", + "zbus_names", + "zvariant", "zvariant_utils", ] [[package]] name = "zbus_names" -version = "3.0.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" dependencies = [ "serde", "static_assertions", + "winnow 0.7.10", "zvariant", ] @@ -10400,24 +10388,25 @@ dependencies = [ [[package]] name = "zvariant" -version = "4.2.0" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" +checksum = "9d30786f75e393ee63a21de4f9074d4c038d52c5b1bb4471f955db249f9dffb1" dependencies = [ "endi", "enumflags2", "serde", - "static_assertions", + "winnow 0.7.10", "zvariant_derive", + "zvariant_utils", ] [[package]] name = "zvariant_derive" -version = "4.2.0" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" +checksum = "75fda702cd42d735ccd48117b1630432219c0e9616bf6cb0f8350844ee4d9580" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.87", @@ -10426,11 +10415,14 @@ dependencies = [ [[package]] name = "zvariant_utils" -version = "2.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" +checksum = "e16edfee43e5d7b553b77872d99bc36afdda75c223ca7ad5e3fbecd82ca5fc34" dependencies = [ "proc-macro2", "quote", + "serde", + "static_assertions", "syn 2.0.87", + "winnow 0.7.10", ] diff --git a/easytier-gui/src-tauri/Cargo.toml b/easytier-gui/src-tauri/Cargo.toml index 80259ef..899f83a 100644 --- a/easytier-gui/src-tauri/Cargo.toml +++ b/easytier-gui/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "easytier-gui" -version = "2.2.4" +version = "2.3.0" description = "EasyTier GUI" authors = ["you"] edition = "2021" @@ -60,4 +60,4 @@ tauri-plugin-autostart = "2.0" custom-protocol = ["tauri/custom-protocol"] [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] -tauri-plugin-single-instance = "2.0.0-rc.0" +tauri-plugin-single-instance = "2.2.3" diff --git a/easytier-gui/src-tauri/build.rs b/easytier-gui/src-tauri/build.rs index e8fc4ec..2fda40f 100644 --- a/easytier-gui/src-tauri/build.rs +++ b/easytier-gui/src-tauri/build.rs @@ -1,7 +1,10 @@ fn main() { // enable thunk-rs when target os is windows and arch is x86_64 or i686 #[cfg(target_os = "windows")] - if !std::env::var("TARGET").unwrap_or_default().contains("aarch64"){ + if !std::env::var("TARGET") + .unwrap_or_default() + .contains("aarch64") + { thunk::thunk(); } diff --git a/easytier-gui/src-tauri/tauri.conf.json b/easytier-gui/src-tauri/tauri.conf.json index b3efb4b..18d36f5 100644 --- a/easytier-gui/src-tauri/tauri.conf.json +++ b/easytier-gui/src-tauri/tauri.conf.json @@ -17,7 +17,7 @@ "createUpdaterArtifacts": false }, "productName": "easytier-gui", - "version": "2.2.4", + "version": "2.3.0", "identifier": "com.kkrainbow.easytier", "plugins": {}, "app": { diff --git a/easytier-gui/src/composables/mobile_vpn.ts b/easytier-gui/src/composables/mobile_vpn.ts index 5e31a75..a1058cc 100644 --- a/easytier-gui/src/composables/mobile_vpn.ts +++ b/easytier-gui/src/composables/mobile_vpn.ts @@ -132,6 +132,14 @@ async function onNetworkInstanceChange() { return } + // if use no tun mode, stop the vpn service + const no_tun = networkStore.isNoTunEnabled(insts[0]) + if (no_tun) { + console.error('no tun mode, stop vpn service') + await doStopVpn() + return + } + let network_length = curNetworkInfo?.my_node_info?.virtual_ipv4.network_length if (!network_length) { network_length = 24 diff --git a/easytier-gui/src/stores/network.ts b/easytier-gui/src/stores/network.ts index a9fe181..5859a1d 100644 --- a/easytier-gui/src/stores/network.ts +++ b/easytier-gui/src/stores/network.ts @@ -128,6 +128,13 @@ export const useNetworkStore = defineStore('networkStore', { } this.saveAutoStartInstIdsToLocalStorage() }, + + isNoTunEnabled(instanceId: string): boolean { + const cfg = this.networkList.find((cfg) => cfg.instance_id === instanceId) + if (!cfg) + return false + return cfg.no_tun ?? false + }, }, }) diff --git a/easytier-gui/src/styles.css b/easytier-gui/src/styles.css index a708290..e10cdc8 100644 --- a/easytier-gui/src/styles.css +++ b/easytier-gui/src/styles.css @@ -45,3 +45,11 @@ border-radius: 4px; background-color: #0000005d; } + +.p-password { + width: 100%; +} + +.p-password>input { + width: 100%; +} \ No newline at end of file diff --git a/easytier-web/Cargo.toml b/easytier-web/Cargo.toml index 2049157..12bbcee 100644 --- a/easytier-web/Cargo.toml +++ b/easytier-web/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "easytier-web" -version = "2.2.4" +version = "2.3.0" edition = "2021" description = "Config server for easytier. easytier-core gets config from this and web frontend use it as restful api server." diff --git a/easytier-web/frontend-lib/src/components/Config.vue b/easytier-web/frontend-lib/src/components/Config.vue index 2112a81..6b4e27a 100644 --- a/easytier-web/frontend-lib/src/components/Config.vue +++ b/easytier-web/frontend-lib/src/components/Config.vue @@ -156,6 +156,7 @@ const bool_flags: BoolFlag[] = [ { field: 'proxy_forward_by_system', help: 'proxy_forward_by_system_help' }, { field: 'disable_encryption', help: 'disable_encryption_help' }, { field: 'disable_udp_hole_punching', help: 'disable_udp_hole_punching_help' }, + { field: 'enable_magic_dns', help: 'enable_magic_dns_help' }, ] diff --git a/easytier-web/frontend-lib/src/locales/cn.yaml b/easytier-web/frontend-lib/src/locales/cn.yaml index 754c1c5..0b35776 100644 --- a/easytier-web/frontend-lib/src/locales/cn.yaml +++ b/easytier-web/frontend-lib/src/locales/cn.yaml @@ -112,6 +112,10 @@ disable_encryption_help: 禁用对等节点通信的加密,默认为false, disable_udp_hole_punching: 禁用UDP打洞 disable_udp_hole_punching_help: 禁用UDP打洞功能 +enable_magic_dns: 启用魔法DNS +enable_magic_dns_help: | + 启用魔法DNS,允许通过EasyTier的DNS服务器访问其他节点的虚拟IPv4地址, 如 node1.et.net。 + relay_network_whitelist: 网络白名单 relay_network_whitelist_help: | 仅转发白名单网络的流量,支持通配符字符串。多个网络名称间可以使用英文空格间隔。 diff --git a/easytier-web/frontend-lib/src/locales/en.yaml b/easytier-web/frontend-lib/src/locales/en.yaml index 237df2c..4b9268d 100644 --- a/easytier-web/frontend-lib/src/locales/en.yaml +++ b/easytier-web/frontend-lib/src/locales/en.yaml @@ -111,6 +111,10 @@ disable_encryption_help: Disable encryption for peers communication, default is disable_udp_hole_punching: Disable UDP Hole Punching disable_udp_hole_punching_help: Disable udp hole punching +enable_magic_dns: Enable Magic DNS +enable_magic_dns_help: | + Enable magic dns, all nodes in the network can access each other by domain name, e.g.: node1.et.net. + relay_network_whitelist: Network Whitelist relay_network_whitelist_help: | Only forward traffic from the whitelist networks, supporting wildcard strings, multiple network names can be separated by spaces. diff --git a/easytier-web/frontend-lib/src/types/network.ts b/easytier-web/frontend-lib/src/types/network.ts index c6a0bf9..c9bc174 100644 --- a/easytier-web/frontend-lib/src/types/network.ts +++ b/easytier-web/frontend-lib/src/types/network.ts @@ -62,6 +62,8 @@ export interface NetworkConfig { mtu: number | null mapped_listeners: string[] + + enable_magic_dns?: boolean } export function DEFAULT_NETWORK_CONFIG(): NetworkConfig { @@ -118,6 +120,7 @@ export function DEFAULT_NETWORK_CONFIG(): NetworkConfig { socks5_port: 1080, mtu: null, mapped_listeners: [], + enable_magic_dns: false, } } diff --git a/easytier/Cargo.toml b/easytier/Cargo.toml index 6076f71..ad1a492 100644 --- a/easytier/Cargo.toml +++ b/easytier/Cargo.toml @@ -3,7 +3,7 @@ name = "easytier" description = "A full meshed p2p VPN, connecting all your devices in one network with one command." homepage = "https://github.com/EasyTier/EasyTier" repository = "https://github.com/EasyTier/EasyTier" -version = "2.2.4" +version = "2.3.0" edition = "2021" authors = ["kkrainbow"] keywords = ["vpn", "p2p", "network", "easytier"] diff --git a/easytier/src/instance/instance.rs b/easytier/src/instance/instance.rs index 3e6bc50..0b3d455 100644 --- a/easytier/src/instance/instance.rs +++ b/easytier/src/instance/instance.rs @@ -80,7 +80,13 @@ impl IpProxy { self.started.store(true, Ordering::Relaxed); self.tcp_proxy.start(true).await?; - self.icmp_proxy.start().await?; + if let Err(e) = self.icmp_proxy.start().await { + tracing::error!("start icmp proxy failed: {:?}", e); + if cfg!(not(target_os = "android")) { + // android may not support icmp proxy + return Err(e); + } + } self.udp_proxy.start().await?; Ok(()) } diff --git a/easytier/src/launcher.rs b/easytier/src/launcher.rs index cd70a66..5a4480e 100644 --- a/easytier/src/launcher.rs +++ b/easytier/src/launcher.rs @@ -668,6 +668,10 @@ impl NetworkConfig { flags.disable_udp_hole_punching = disable_udp_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; } diff --git a/easytier/src/proto/web.proto b/easytier/src/proto/web.proto index f6c999f..1c5a9ee 100644 --- a/easytier/src/proto/web.proto +++ b/easytier/src/proto/web.proto @@ -63,6 +63,8 @@ message NetworkConfig { optional bool disable_udp_hole_punching = 39; optional int32 mtu = 40; repeated string mapped_listeners = 41; + + optional bool enable_magic_dns = 42; } message MyNodeInfo {