mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 10:14:35 +00:00
bump version 262 (#2158)
This commit is contained in:
@@ -11,7 +11,7 @@ on:
|
|||||||
image_tag:
|
image_tag:
|
||||||
description: 'Tag for this image build'
|
description: 'Tag for this image build'
|
||||||
type: string
|
type: string
|
||||||
default: 'v2.6.1'
|
default: 'v2.6.2'
|
||||||
required: true
|
required: true
|
||||||
mark_latest:
|
mark_latest:
|
||||||
description: 'Mark this image as latest'
|
description: 'Mark this image as latest'
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ on:
|
|||||||
version:
|
version:
|
||||||
description: 'Version for this release'
|
description: 'Version for this release'
|
||||||
type: string
|
type: string
|
||||||
default: 'v2.6.1'
|
default: 'v2.6.2'
|
||||||
required: true
|
required: true
|
||||||
make_latest:
|
make_latest:
|
||||||
description: 'Mark this release as latest'
|
description: 'Mark this release as latest'
|
||||||
|
|||||||
Generated
+3
-3
@@ -2229,7 +2229,7 @@ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "easytier"
|
name = "easytier"
|
||||||
version = "2.6.1"
|
version = "2.6.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@@ -2404,7 +2404,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "easytier-gui"
|
name = "easytier-gui"
|
||||||
version = "2.6.1"
|
version = "2.6.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -2484,7 +2484,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "easytier-web"
|
name = "easytier-web"
|
||||||
version = "2.6.1"
|
version = "2.6.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|||||||
@@ -108,9 +108,9 @@ After successful execution, you can check the network status using `easytier-cli
|
|||||||
```text
|
```text
|
||||||
| ipv4 | hostname | cost | lat_ms | loss_rate | rx_bytes | tx_bytes | tunnel_proto | nat_type | id | version |
|
| ipv4 | hostname | cost | lat_ms | loss_rate | rx_bytes | tx_bytes | tunnel_proto | nat_type | id | version |
|
||||||
| ------------ | -------------- | ----- | ------ | --------- | -------- | -------- | ------------ | -------- | ---------- | --------------- |
|
| ------------ | -------------- | ----- | ------ | --------- | -------- | -------- | ------------ | -------- | ---------- | --------------- |
|
||||||
| 10.126.126.1 | abc-1 | Local | * | * | * | * | udp | FullCone | 439804259 | 2.6.1-70e69a38~ |
|
| 10.126.126.1 | abc-1 | Local | * | * | * | * | udp | FullCone | 439804259 | 2.6.2-70e69a38~ |
|
||||||
| 10.126.126.2 | abc-2 | p2p | 3.452 | 0 | 17.33 kB | 20.42 kB | udp | FullCone | 390879727 | 2.6.1-70e69a38~ |
|
| 10.126.126.2 | abc-2 | p2p | 3.452 | 0 | 17.33 kB | 20.42 kB | udp | FullCone | 390879727 | 2.6.2-70e69a38~ |
|
||||||
| | PublicServer_a | p2p | 27.796 | 0.000 | 50.01 kB | 67.46 kB | tcp | Unknown | 3771642457 | 2.6.1-70e69a38~ |
|
| | PublicServer_a | p2p | 27.796 | 0.000 | 50.01 kB | 67.46 kB | tcp | Unknown | 3771642457 | 2.6.2-70e69a38~ |
|
||||||
```
|
```
|
||||||
|
|
||||||
You can test connectivity between nodes:
|
You can test connectivity between nodes:
|
||||||
|
|||||||
+3
-3
@@ -108,9 +108,9 @@ sudo easytier-core -d --network-name abc --network-secret abc -p tcp://<共享
|
|||||||
```text
|
```text
|
||||||
| ipv4 | hostname | cost | lat_ms | loss_rate | rx_bytes | tx_bytes | tunnel_proto | nat_type | id | version |
|
| ipv4 | hostname | cost | lat_ms | loss_rate | rx_bytes | tx_bytes | tunnel_proto | nat_type | id | version |
|
||||||
| ------------ | -------------- | ----- | ------ | --------- | -------- | -------- | ------------ | -------- | ---------- | --------------- |
|
| ------------ | -------------- | ----- | ------ | --------- | -------- | -------- | ------------ | -------- | ---------- | --------------- |
|
||||||
| 10.126.126.1 | abc-1 | Local | * | * | * | * | udp | FullCone | 439804259 | 2.6.1-70e69a38~ |
|
| 10.126.126.1 | abc-1 | Local | * | * | * | * | udp | FullCone | 439804259 | 2.6.2-70e69a38~ |
|
||||||
| 10.126.126.2 | abc-2 | p2p | 3.452 | 0 | 17.33 kB | 20.42 kB | udp | FullCone | 390879727 | 2.6.1-70e69a38~ |
|
| 10.126.126.2 | abc-2 | p2p | 3.452 | 0 | 17.33 kB | 20.42 kB | udp | FullCone | 390879727 | 2.6.2-70e69a38~ |
|
||||||
| | PublicServer_a | p2p | 27.796 | 0.000 | 50.01 kB | 67.46 kB | tcp | Unknown | 3771642457 | 2.6.1-70e69a38~ |
|
| | PublicServer_a | p2p | 27.796 | 0.000 | 50.01 kB | 67.46 kB | tcp | Unknown | 3771642457 | 2.6.2-70e69a38~ |
|
||||||
```
|
```
|
||||||
|
|
||||||
您可以测试节点之间的连通性:
|
您可以测试节点之间的连通性:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
id=easytier_magisk
|
id=easytier_magisk
|
||||||
name=EasyTier_Magisk
|
name=EasyTier_Magisk
|
||||||
version=v2.6.1
|
version=v2.6.2
|
||||||
versionCode=1
|
versionCode=1
|
||||||
author=EasyTier
|
author=EasyTier
|
||||||
description=easytier magisk module @EasyTier(https://github.com/EasyTier/EasyTier)
|
description=easytier magisk module @EasyTier(https://github.com/EasyTier/EasyTier)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "easytier-gui",
|
"name": "easytier-gui",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "2.6.1",
|
"version": "2.6.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@9.12.1+sha512.e5a7e52a4183a02d5931057f7a0dbff9d5e9ce3161e33fa68ae392125b79282a8a8a470a51dfc8a0ed86221442eb2fb57019b0990ed24fab519bf0e1bc5ccfc4",
|
"packageManager": "pnpm@9.12.1+sha512.e5a7e52a4183a02d5931057f7a0dbff9d5e9ce3161e33fa68ae392125b79282a8a8a470a51dfc8a0ed86221442eb2fb57019b0990ed24fab519bf0e1bc5ccfc4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "easytier-gui"
|
name = "easytier-gui"
|
||||||
version = "2.6.1"
|
version = "2.6.2"
|
||||||
description = "EasyTier GUI"
|
description = "EasyTier GUI"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"createUpdaterArtifacts": false
|
"createUpdaterArtifacts": false
|
||||||
},
|
},
|
||||||
"productName": "easytier-gui",
|
"productName": "easytier-gui",
|
||||||
"version": "2.6.1",
|
"version": "2.6.2",
|
||||||
"identifier": "com.kkrainbow.easytier",
|
"identifier": "com.kkrainbow.easytier",
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"shell": {
|
"shell": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "easytier-web"
|
name = "easytier-web"
|
||||||
version = "2.6.1"
|
version = "2.6.2"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
description = "Config server for easytier. easytier-core gets config from this and web frontend use it as restful api server."
|
description = "Config server for easytier. easytier-core gets config from this and web frontend use it as restful api server."
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ name = "easytier"
|
|||||||
description = "A full meshed p2p VPN, connecting all your devices in one network with one command."
|
description = "A full meshed p2p VPN, connecting all your devices in one network with one command."
|
||||||
homepage = "https://github.com/EasyTier/EasyTier"
|
homepage = "https://github.com/EasyTier/EasyTier"
|
||||||
repository = "https://github.com/EasyTier/EasyTier"
|
repository = "https://github.com/EasyTier/EasyTier"
|
||||||
version = "2.6.1"
|
version = "2.6.2"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
rust-version.workspace = true
|
rust-version.workspace = true
|
||||||
authors = ["kkrainbow"]
|
authors = ["kkrainbow"]
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ use std::{
|
|||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
|
|
||||||
use anyhow::{Context, anyhow, bail};
|
use anyhow::{Context, anyhow, bail};
|
||||||
use igd_next::{
|
use igd_next::{
|
||||||
AddAnyPortError, PortMappingProtocol, SearchOptions,
|
AddAnyPortError, PortMappingProtocol, SearchOptions,
|
||||||
@@ -35,6 +38,19 @@ const PORT_MAPPING_BACKEND_IGD: &str = "igd";
|
|||||||
|
|
||||||
type TokioGateway = Gateway<Tokio>;
|
type TokioGateway = Gateway<Tokio>;
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
static UDP_PORT_MAPPING_ATTEMPTS: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
pub(crate) fn reset_udp_port_mapping_attempts_for_test() {
|
||||||
|
UDP_PORT_MAPPING_ATTEMPTS.store(0, Ordering::Relaxed);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
pub(crate) fn udp_port_mapping_attempts_for_test() -> usize {
|
||||||
|
UDP_PORT_MAPPING_ATTEMPTS.load(Ordering::Relaxed)
|
||||||
|
}
|
||||||
|
|
||||||
enum PortMappingBackend {
|
enum PortMappingBackend {
|
||||||
NatPmp { gateway: Ipv4Addr },
|
NatPmp { gateway: Ipv4Addr },
|
||||||
Igd { gateway: TokioGateway },
|
Igd { gateway: TokioGateway },
|
||||||
@@ -262,6 +278,9 @@ async fn try_start_udp_port_mapping(
|
|||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
UDP_PORT_MAPPING_ATTEMPTS.fetch_add(1, Ordering::Relaxed);
|
||||||
|
|
||||||
let mapping = discover_udp_port_mapping(global_ctx.clone(), local_listener.clone()).await?;
|
let mapping = discover_udp_port_mapping(global_ctx.clone(), local_listener.clone()).await?;
|
||||||
tracing::info!(
|
tracing::info!(
|
||||||
%local_listener,
|
%local_listener,
|
||||||
|
|||||||
@@ -113,25 +113,7 @@ impl PunchConeHoleClient {
|
|||||||
|
|
||||||
let global_ctx = self.peer_mgr.get_global_ctx();
|
let global_ctx = self.peer_mgr.get_global_ctx();
|
||||||
let udp_array = UdpSocketArray::new(1, global_ctx.net_ns.clone());
|
let udp_array = UdpSocketArray::new(1, global_ctx.net_ns.clone());
|
||||||
let local_socket = {
|
|
||||||
let _g = self.peer_mgr.get_global_ctx().net_ns.guard();
|
|
||||||
Arc::new(UdpSocket::bind("0.0.0.0:0").await?)
|
|
||||||
};
|
|
||||||
let local_addr = local_socket
|
|
||||||
.local_addr()
|
|
||||||
.with_context(|| "failed to get local addr from udp punch socket")?;
|
|
||||||
let local_listener: url::Url = format!("udp://0.0.0.0:{}", local_addr.port())
|
|
||||||
.parse()
|
|
||||||
.unwrap();
|
|
||||||
let (local_mapped_addr, _local_port_mapping_lease) = upnp::resolve_udp_public_addr(
|
|
||||||
global_ctx.clone(),
|
|
||||||
&local_listener,
|
|
||||||
local_socket.clone(),
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.with_context(|| "failed to resolve udp public addr for cone hole punch")?;
|
|
||||||
|
|
||||||
// client -> server: tell server the mapped port, server will return the mapped address of listening port.
|
|
||||||
let rpc_stub = self
|
let rpc_stub = self
|
||||||
.peer_mgr
|
.peer_mgr
|
||||||
.get_peer_rpc_mgr()
|
.get_peer_rpc_mgr()
|
||||||
@@ -158,6 +140,24 @@ impl PunchConeHoleClient {
|
|||||||
"select_punch_listener response missing listener_mapped_addr"
|
"select_punch_listener response missing listener_mapped_addr"
|
||||||
))?;
|
))?;
|
||||||
|
|
||||||
|
let local_socket = {
|
||||||
|
let _g = self.peer_mgr.get_global_ctx().net_ns.guard();
|
||||||
|
Arc::new(UdpSocket::bind("0.0.0.0:0").await?)
|
||||||
|
};
|
||||||
|
let local_addr = local_socket
|
||||||
|
.local_addr()
|
||||||
|
.with_context(|| "failed to get local addr from udp punch socket")?;
|
||||||
|
let local_listener: url::Url = format!("udp://0.0.0.0:{}", local_addr.port())
|
||||||
|
.parse()
|
||||||
|
.unwrap();
|
||||||
|
let (local_mapped_addr, _local_port_mapping_lease) = upnp::resolve_udp_public_addr(
|
||||||
|
global_ctx.clone(),
|
||||||
|
&local_listener,
|
||||||
|
local_socket.clone(),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.with_context(|| "failed to resolve udp public addr for cone hole punch")?;
|
||||||
|
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
?local_mapped_addr,
|
?local_mapped_addr,
|
||||||
?remote_mapped_addr,
|
?remote_mapped_addr,
|
||||||
@@ -245,10 +245,15 @@ impl PunchConeHoleClient {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub mod tests {
|
pub mod tests {
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
common::upnp::{
|
||||||
|
reset_udp_port_mapping_attempts_for_test, udp_port_mapping_attempts_for_test,
|
||||||
|
},
|
||||||
connector::udp_hole_punch::{
|
connector::udp_hole_punch::{
|
||||||
UdpHolePunchConnector, tests::create_mock_peer_manager_with_mock_stun,
|
UdpHolePunchConnector, cone::PunchConeHoleClient,
|
||||||
|
tests::create_mock_peer_manager_with_mock_stun,
|
||||||
},
|
},
|
||||||
peers::tests::{connect_peer_manager, wait_route_appear, wait_route_appear_with_cost},
|
peers::tests::{connect_peer_manager, wait_route_appear, wait_route_appear_with_cost},
|
||||||
proto::common::NatType,
|
proto::common::NatType,
|
||||||
@@ -279,4 +284,27 @@ pub mod tests {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
println!("{:?}", p_a.list_routes().await);
|
println!("{:?}", p_a.list_routes().await);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn cone_hole_punch_does_not_create_upnp_mapping_before_listener_rpc_succeeds() {
|
||||||
|
let p_a = create_mock_peer_manager_with_mock_stun(NatType::Restricted).await;
|
||||||
|
let p_b = create_mock_peer_manager_with_mock_stun(NatType::PortRestricted).await;
|
||||||
|
let p_c = create_mock_peer_manager_with_mock_stun(NatType::Restricted).await;
|
||||||
|
connect_peer_manager(p_a.clone(), p_b.clone()).await;
|
||||||
|
connect_peer_manager(p_b.clone(), p_c.clone()).await;
|
||||||
|
wait_route_appear(p_a.clone(), p_c.clone()).await.unwrap();
|
||||||
|
|
||||||
|
let mut flags = p_a.get_global_ctx().get_flags();
|
||||||
|
flags.disable_upnp = false;
|
||||||
|
p_a.get_global_ctx().set_flags(flags);
|
||||||
|
|
||||||
|
reset_udp_port_mapping_attempts_for_test();
|
||||||
|
|
||||||
|
let ret = PunchConeHoleClient::new(p_a.clone(), Arc::new(timedmap::TimedMap::new()))
|
||||||
|
.do_hole_punching(p_c.my_peer_id())
|
||||||
|
.await;
|
||||||
|
|
||||||
|
assert!(ret.is_err());
|
||||||
|
assert_eq!(udp_port_mapping_attempts_for_test(), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -7,7 +7,7 @@
|
|||||||
Copies binaries to the install directory and updates the system PATH.
|
Copies binaries to the install directory and updates the system PATH.
|
||||||
|
|
||||||
.PARAMETER Version
|
.PARAMETER Version
|
||||||
Target version: "latest", "stable", or a specific tag like "v2.6.1".
|
Target version: "latest", "stable", or a specific tag like "v2.6.2".
|
||||||
Default: "latest"
|
Default: "latest"
|
||||||
|
|
||||||
.PARAMETER InstallDir
|
.PARAMETER InstallDir
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
.\install.ps1
|
.\install.ps1
|
||||||
.\install.ps1 -Version v2.6.1
|
.\install.ps1 -Version v2.6.2
|
||||||
.\install.ps1 -InstallDir "C:\EasyTier"
|
.\install.ps1 -InstallDir "C:\EasyTier"
|
||||||
|
|
||||||
.NOTES
|
.NOTES
|
||||||
|
|||||||
Reference in New Issue
Block a user