From 4eb7efe5fcdb13ca8f72e78224658eff92bfb00a Mon Sep 17 00:00:00 2001 From: "Sijie.Sun" Date: Thu, 4 Apr 2024 10:33:53 +0800 Subject: [PATCH] use workspace, prepare for config server and gui (#48) --- .github/workflows/rust.yml | 4 +- Cargo.toml | 148 +----------------- README.md | 8 +- README_CN.md | 8 +- easytier/Cargo.toml | 145 +++++++++++++++++ easytier/README.md | 1 + easytier/README_CN.md | 1 + easytier/assets | 1 + build.rs => easytier/build.rs | 2 +- {proto => easytier/proto}/cli.proto | 0 {src => easytier/src}/arch/mod.rs | 0 {src => easytier/src}/arch/windows.rs | 0 {src => easytier/src}/common/config.rs | 0 {src => easytier/src}/common/constants.rs | 0 {src => easytier/src}/common/error.rs | 0 {src => easytier/src}/common/global_ctx.rs | 0 {src => easytier/src}/common/ifcfg.rs | 0 {src => easytier/src}/common/mod.rs | 0 {src => easytier/src}/common/netns.rs | 0 {src => easytier/src}/common/network.rs | 0 {src => easytier/src}/common/rkyv_util.rs | 0 {src => easytier/src}/common/stun.rs | 0 .../src}/common/stun_codec_ext.rs | 0 {src => easytier/src}/connector/direct.rs | 0 {src => easytier/src}/connector/manual.rs | 0 {src => easytier/src}/connector/mod.rs | 0 .../src}/connector/udp_hole_punch.rs | 0 {src => easytier/src}/easytier-cli.rs | 0 {src => easytier/src}/easytier-core.rs | 0 {src => easytier/src}/gateway/icmp_proxy.rs | 0 {src => easytier/src}/gateway/mod.rs | 0 {src => easytier/src}/gateway/tcp_proxy.rs | 0 {src => easytier/src}/gateway/udp_proxy.rs | 0 {src => easytier/src}/instance/instance.rs | 0 {src => easytier/src}/instance/listeners.rs | 0 {src => easytier/src}/instance/mod.rs | 0 {src => easytier/src}/instance/tun_codec.rs | 0 {src => easytier/src}/instance/virtual_nic.rs | 0 {src => easytier/src}/peer_center/instance.rs | 0 {src => easytier/src}/peer_center/mod.rs | 0 {src => easytier/src}/peer_center/server.rs | 0 {src => easytier/src}/peer_center/service.rs | 0 .../src}/peers/foreign_network_client.rs | 0 .../src}/peers/foreign_network_manager.rs | 0 {src => easytier/src}/peers/mod.rs | 0 {src => easytier/src}/peers/packet.rs | 0 {src => easytier/src}/peers/peer.rs | 0 {src => easytier/src}/peers/peer_conn.rs | 0 {src => easytier/src}/peers/peer_manager.rs | 0 {src => easytier/src}/peers/peer_map.rs | 0 .../src}/peers/peer_ospf_route.rs | 0 {src => easytier/src}/peers/peer_rip_route.rs | 0 {src => easytier/src}/peers/peer_rpc.rs | 0 {src => easytier/src}/peers/route_trait.rs | 0 {src => easytier/src}/peers/rpc_service.rs | 0 {src => easytier/src}/peers/tests.rs | 0 {src => easytier/src}/rpc/cli.rs | 0 {src => easytier/src}/rpc/mod.rs | 0 {src => easytier/src}/rpc/peer.rs | 0 {src => easytier/src}/tests/mod.rs | 0 {src => easytier/src}/tests/three_node.rs | 0 {src => easytier/src}/tunnels/codec.rs | 0 {src => easytier/src}/tunnels/common.rs | 0 {src => easytier/src}/tunnels/mod.rs | 0 {src => easytier/src}/tunnels/ring_tunnel.rs | 0 {src => easytier/src}/tunnels/stats.rs | 0 {src => easytier/src}/tunnels/tcp_tunnel.rs | 0 .../src}/tunnels/tunnel_filter.rs | 0 {src => easytier/src}/tunnels/udp_tunnel.rs | 0 {src => easytier/src}/tunnels/wireguard.rs | 0 {src => easytier/src}/vpn_portal/mod.rs | 0 {src => easytier/src}/vpn_portal/wireguard.rs | 0 .../third_party}/Packet.dll | Bin .../third_party}/Packet.lib | Bin .../third_party}/wintun.dll | Bin scripts/deploy.sh | 29 ---- scripts/local_init.sh | 10 -- 77 files changed, 162 insertions(+), 195 deletions(-) create mode 100644 easytier/Cargo.toml create mode 120000 easytier/README.md create mode 120000 easytier/README_CN.md create mode 120000 easytier/assets rename build.rs => easytier/build.rs (97%) rename {proto => easytier/proto}/cli.proto (100%) rename {src => easytier/src}/arch/mod.rs (100%) rename {src => easytier/src}/arch/windows.rs (100%) rename {src => easytier/src}/common/config.rs (100%) rename {src => easytier/src}/common/constants.rs (100%) rename {src => easytier/src}/common/error.rs (100%) rename {src => easytier/src}/common/global_ctx.rs (100%) rename {src => easytier/src}/common/ifcfg.rs (100%) rename {src => easytier/src}/common/mod.rs (100%) rename {src => easytier/src}/common/netns.rs (100%) rename {src => easytier/src}/common/network.rs (100%) rename {src => easytier/src}/common/rkyv_util.rs (100%) rename {src => easytier/src}/common/stun.rs (100%) rename {src => easytier/src}/common/stun_codec_ext.rs (100%) rename {src => easytier/src}/connector/direct.rs (100%) rename {src => easytier/src}/connector/manual.rs (100%) rename {src => easytier/src}/connector/mod.rs (100%) rename {src => easytier/src}/connector/udp_hole_punch.rs (100%) rename {src => easytier/src}/easytier-cli.rs (100%) rename {src => easytier/src}/easytier-core.rs (100%) rename {src => easytier/src}/gateway/icmp_proxy.rs (100%) rename {src => easytier/src}/gateway/mod.rs (100%) rename {src => easytier/src}/gateway/tcp_proxy.rs (100%) rename {src => easytier/src}/gateway/udp_proxy.rs (100%) rename {src => easytier/src}/instance/instance.rs (100%) rename {src => easytier/src}/instance/listeners.rs (100%) rename {src => easytier/src}/instance/mod.rs (100%) rename {src => easytier/src}/instance/tun_codec.rs (100%) rename {src => easytier/src}/instance/virtual_nic.rs (100%) rename {src => easytier/src}/peer_center/instance.rs (100%) rename {src => easytier/src}/peer_center/mod.rs (100%) rename {src => easytier/src}/peer_center/server.rs (100%) rename {src => easytier/src}/peer_center/service.rs (100%) rename {src => easytier/src}/peers/foreign_network_client.rs (100%) rename {src => easytier/src}/peers/foreign_network_manager.rs (100%) rename {src => easytier/src}/peers/mod.rs (100%) rename {src => easytier/src}/peers/packet.rs (100%) rename {src => easytier/src}/peers/peer.rs (100%) rename {src => easytier/src}/peers/peer_conn.rs (100%) rename {src => easytier/src}/peers/peer_manager.rs (100%) rename {src => easytier/src}/peers/peer_map.rs (100%) rename {src => easytier/src}/peers/peer_ospf_route.rs (100%) rename {src => easytier/src}/peers/peer_rip_route.rs (100%) rename {src => easytier/src}/peers/peer_rpc.rs (100%) rename {src => easytier/src}/peers/route_trait.rs (100%) rename {src => easytier/src}/peers/rpc_service.rs (100%) rename {src => easytier/src}/peers/tests.rs (100%) rename {src => easytier/src}/rpc/cli.rs (100%) rename {src => easytier/src}/rpc/mod.rs (100%) rename {src => easytier/src}/rpc/peer.rs (100%) rename {src => easytier/src}/tests/mod.rs (100%) rename {src => easytier/src}/tests/three_node.rs (100%) rename {src => easytier/src}/tunnels/codec.rs (100%) rename {src => easytier/src}/tunnels/common.rs (100%) rename {src => easytier/src}/tunnels/mod.rs (100%) rename {src => easytier/src}/tunnels/ring_tunnel.rs (100%) rename {src => easytier/src}/tunnels/stats.rs (100%) rename {src => easytier/src}/tunnels/tcp_tunnel.rs (100%) rename {src => easytier/src}/tunnels/tunnel_filter.rs (100%) rename {src => easytier/src}/tunnels/udp_tunnel.rs (100%) rename {src => easytier/src}/tunnels/wireguard.rs (100%) rename {src => easytier/src}/vpn_portal/mod.rs (100%) rename {src => easytier/src}/vpn_portal/wireguard.rs (100%) rename {third_party => easytier/third_party}/Packet.dll (100%) rename {third_party => easytier/third_party}/Packet.lib (100%) rename {third_party => easytier/third_party}/wintun.dll (100%) delete mode 100644 scripts/deploy.sh delete mode 100644 scripts/local_init.sh diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 172bdde..3b6558d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -95,8 +95,8 @@ jobs: # windows is the only OS using a different convention for executable file name if [[ $OS =~ ^windows.*$ ]]; then SUFFIX=.exe - cp third_party/Packet.dll ./artifacts/objects/ - cp third_party/wintun.dll ./artifacts/objects/ + cp easytier/third_party/Packet.dll ./artifacts/objects/ + cp easytier/third_party/wintun.dll ./artifacts/objects/ fi if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then TAG=$GITHUB_REF_NAME diff --git a/Cargo.toml b/Cargo.toml index 1210bbc..d0f3be3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,148 +1,6 @@ -[package] -name = "easytier" -description = "A full meshed p2p VPN, connecting all your devices in one network with one command." -homepage = "https://github.com/KKRainbow/EasyTier" -repository = "https://github.com/KKRainbow/EasyTier" -version = "0.1.2" -edition = "2021" -authors = ["kkrainbow"] -keywords = ["vpn", "p2p", "network", "easytier"] -categories = ["network-programming", "command-line-utilities"] -rust-version = "1.75" -license-file = "LICENSE" -readme = "README.md" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[[bin]] -name = "easytier-core" -path = "src/easytier-core.rs" - -[[bin]] -name = "easytier-cli" -path = "src/easytier-cli.rs" -test = false - -[dependencies] -tracing = { version = "0.1", features = ["log"] } -tracing-subscriber = { version = "0.3", features = [ - "env-filter", - "local-time", - "time", -] } -tracing-appender = "0.2.3" -log = "0.4" -thiserror = "1.0" -auto_impl = "1.1.0" -crossbeam = "0.8.4" -time = "0.3" -toml = "0.8.12" -chrono = "0.4.35" - -gethostname = "0.4.3" - -futures = "0.3" - -tokio = { version = "1", features = ["full"] } -tokio-stream = "0.1" -tokio-util = { version = "0.7.9", features = ["codec", "net"] } - -async-stream = "0.3.5" -async-trait = "0.1.74" - -dashmap = "5.5.3" -timedmap = "=1.0.1" - -# for tap device -tun = { version = "0.6.1", features = ["async"] } -# for net ns -nix = { version = "0.27", features = ["sched", "socket", "ioctl"] } - -uuid = { version = "1.5.0", features = [ - "v4", - "fast-rng", - "macro-diagnostics", - "serde", -] } - -# for ring tunnel -crossbeam-queue = "0.3" -once_cell = "1.18.0" - -# for packet -rkyv = { "version" = "0.7.42", features = [ - "validation", - "archive_le", - "strict", - "copy_unsafe", - "arbitrary_enum_discriminant", -] } -postcard = { "version" = "1.0.8", features = ["alloc"] } - -# for rpc -tonic = "0.10" -prost = "0.12" -anyhow = "1.0" -tarpc = { version = "0.32", features = ["tokio1", "serde1"] } - -url = { version = "2.5", features = ["serde"] } -percent-encoding = "2.3.1" - -# for tun packet -byteorder = "1.5.0" - -# for proxy -cidr = { version = "0.2.2", features = ["serde"] } -socket2 = "0.5.5" - -# for hole punching -stun_codec = "0.3.4" -bytecodec = "0.4.15" -rand = "0.8.5" - -serde = { version = "1.0", features = ["derive"] } -pnet = { version = "0.34.0", features = ["serde"] } -public-ip = { version = "0.2", features = ["default"] } - -clap = { version = "4.4.8", features = ["unicode", "derive", "wrap_help"] } - -async-recursion = "1.0.5" - -network-interface = "1.1.1" - -# for ospf route -pathfinding = "4.9.1" - -# for encryption -boringtun = { version = "0.6.0" } - -# for cli -tabled = "0.15.*" -humansize = "2.1.3" - -base64 = "0.21.7" - -derivative = "2.2.0" - -[target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.52", features = [ - "Win32_Networking_WinSock", - "Win32_NetworkManagement_IpHelper", - "Win32_Foundation", - "Win32_System_IO", -] } - -[build-dependencies] -tonic-build = "0.10" - -[target.'cfg(windows)'.build-dependencies] -reqwest = { version = "0.11", features = ["blocking"] } -zip = "0.6.6" - - -[dev-dependencies] -serial_test = "3.0.0" -rstest = "0.18.2" +[workspace] +resolver = "2" +members = ["easytier"] [profile.dev] panic = "unwind" diff --git a/README.md b/README.md index a72b90b..69694d5 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ ``` Successful execution of the command will print the following. - ![alt text](assets/image-2.png) + ![alt text](/assets/image-2.png) 2. Execute on Node B ```sh @@ -85,11 +85,11 @@ ```sh easytier-cli peer ``` - ![alt text](assets/image.png) + ![alt text](/assets/image.png) ```sh easytier-cli route ``` - ![alt text](assets/image-1.png) + ![alt text](/assets/image-1.png) --- @@ -139,7 +139,7 @@ ```sh easytier-cli route ``` - ![alt text](assets/image-3.png) + ![alt text](/assets/image-3.png) 2. Test whether Node A can access nodes under the proxied subnet diff --git a/README_CN.md b/README_CN.md index 1fb4cb8..38f38fa 100644 --- a/README_CN.md +++ b/README_CN.md @@ -67,7 +67,7 @@ nodea <-----> nodeb ``` 命令执行成功会有如下打印。 - ![alt text](assets/image-2.png) + ![alt text](/assets/image-2.png) 2. 在节点 B 执行 ```sh @@ -85,11 +85,11 @@ nodea <-----> nodeb ```sh easytier-cli peer ``` - ![alt text](assets/image.png) + ![alt text](/assets/image.png) ```sh easytier-cli route ``` - ![alt text](assets/image-1.png) + ![alt text](/assets/image-1.png) --- @@ -139,7 +139,7 @@ sudo easytier-core --ipv4 10.144.144.2 -n 10.1.1.0/24 ```sh easytier-cli route ``` - ![alt text](assets/image-3.png) + ![alt text](/assets/image-3.png) 2. 测试节点 A 是否可访问被代理子网下的节点 diff --git a/easytier/Cargo.toml b/easytier/Cargo.toml new file mode 100644 index 0000000..d1123c0 --- /dev/null +++ b/easytier/Cargo.toml @@ -0,0 +1,145 @@ +[package] +name = "easytier" +description = "A full meshed p2p VPN, connecting all your devices in one network with one command." +homepage = "https://github.com/KKRainbow/EasyTier" +repository = "https://github.com/KKRainbow/EasyTier" +version = "0.1.2" +edition = "2021" +authors = ["kkrainbow"] +keywords = ["vpn", "p2p", "network", "easytier"] +categories = ["network-programming", "command-line-utilities"] +rust-version = "1.75" +license-file = "LICENSE" +readme = "README.md" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[[bin]] +name = "easytier-core" +path = "src/easytier-core.rs" + +[[bin]] +name = "easytier-cli" +path = "src/easytier-cli.rs" +test = false + +[dependencies] +tracing = { version = "0.1", features = ["log"] } +tracing-subscriber = { version = "0.3", features = [ + "env-filter", + "local-time", + "time", +] } +tracing-appender = "0.2.3" +log = "0.4" +thiserror = "1.0" +auto_impl = "1.1.0" +crossbeam = "0.8.4" +time = "0.3" +toml = "0.8.12" +chrono = "0.4.35" + +gethostname = "0.4.3" + +futures = "0.3" + +tokio = { version = "1", features = ["full"] } +tokio-stream = "0.1" +tokio-util = { version = "0.7.9", features = ["codec", "net"] } + +async-stream = "0.3.5" +async-trait = "0.1.74" + +dashmap = "5.5.3" +timedmap = "=1.0.1" + +# for tap device +tun = { version = "0.6.1", features = ["async"] } +# for net ns +nix = { version = "0.27", features = ["sched", "socket", "ioctl"] } + +uuid = { version = "1.5.0", features = [ + "v4", + "fast-rng", + "macro-diagnostics", + "serde", +] } + +# for ring tunnel +crossbeam-queue = "0.3" +once_cell = "1.18.0" + +# for packet +rkyv = { "version" = "0.7.42", features = [ + "validation", + "archive_le", + "strict", + "copy_unsafe", + "arbitrary_enum_discriminant", +] } +postcard = { "version" = "1.0.8", features = ["alloc"] } + +# for rpc +tonic = "0.10" +prost = "0.12" +anyhow = "1.0" +tarpc = { version = "0.32", features = ["tokio1", "serde1"] } + +url = { version = "2.5", features = ["serde"] } +percent-encoding = "2.3.1" + +# for tun packet +byteorder = "1.5.0" + +# for proxy +cidr = { version = "0.2.2", features = ["serde"] } +socket2 = "0.5.5" + +# for hole punching +stun_codec = "0.3.4" +bytecodec = "0.4.15" +rand = "0.8.5" + +serde = { version = "1.0", features = ["derive"] } +pnet = { version = "0.34.0", features = ["serde"] } +public-ip = { version = "0.2", features = ["default"] } + +clap = { version = "4.4.8", features = ["unicode", "derive", "wrap_help"] } + +async-recursion = "1.0.5" + +network-interface = "1.1.1" + +# for ospf route +pathfinding = "4.9.1" + +# for encryption +boringtun = { version = "0.6.0" } + +# for cli +tabled = "0.15.*" +humansize = "2.1.3" + +base64 = "0.21.7" + +derivative = "2.2.0" + +[target.'cfg(windows)'.dependencies] +windows-sys = { version = "0.52", features = [ + "Win32_Networking_WinSock", + "Win32_NetworkManagement_IpHelper", + "Win32_Foundation", + "Win32_System_IO", +] } + +[build-dependencies] +tonic-build = "0.10" + +[target.'cfg(windows)'.build-dependencies] +reqwest = { version = "0.11", features = ["blocking"] } +zip = "0.6.6" + + +[dev-dependencies] +serial_test = "3.0.0" +rstest = "0.18.2" diff --git a/easytier/README.md b/easytier/README.md new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/easytier/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/easytier/README_CN.md b/easytier/README_CN.md new file mode 120000 index 0000000..d7212ef --- /dev/null +++ b/easytier/README_CN.md @@ -0,0 +1 @@ +../README_CN.md \ No newline at end of file diff --git a/easytier/assets b/easytier/assets new file mode 120000 index 0000000..ec2e4be --- /dev/null +++ b/easytier/assets @@ -0,0 +1 @@ +../assets \ No newline at end of file diff --git a/build.rs b/easytier/build.rs similarity index 97% rename from build.rs rename to easytier/build.rs index e39d77a..f62dc81 100644 --- a/build.rs +++ b/easytier/build.rs @@ -75,7 +75,7 @@ impl WindowsBuild { pub fn check_for_win() { // add third_party dir to link search path - println!("cargo:rustc-link-search=native=third_party/"); + println!("cargo:rustc-link-search=native=easytier/third_party/"); let protoc_path = if let Some(o) = Self::check_protoc_exist() { println!("cargo:info=use os exist protoc: {:?}", o); o diff --git a/proto/cli.proto b/easytier/proto/cli.proto similarity index 100% rename from proto/cli.proto rename to easytier/proto/cli.proto diff --git a/src/arch/mod.rs b/easytier/src/arch/mod.rs similarity index 100% rename from src/arch/mod.rs rename to easytier/src/arch/mod.rs diff --git a/src/arch/windows.rs b/easytier/src/arch/windows.rs similarity index 100% rename from src/arch/windows.rs rename to easytier/src/arch/windows.rs diff --git a/src/common/config.rs b/easytier/src/common/config.rs similarity index 100% rename from src/common/config.rs rename to easytier/src/common/config.rs diff --git a/src/common/constants.rs b/easytier/src/common/constants.rs similarity index 100% rename from src/common/constants.rs rename to easytier/src/common/constants.rs diff --git a/src/common/error.rs b/easytier/src/common/error.rs similarity index 100% rename from src/common/error.rs rename to easytier/src/common/error.rs diff --git a/src/common/global_ctx.rs b/easytier/src/common/global_ctx.rs similarity index 100% rename from src/common/global_ctx.rs rename to easytier/src/common/global_ctx.rs diff --git a/src/common/ifcfg.rs b/easytier/src/common/ifcfg.rs similarity index 100% rename from src/common/ifcfg.rs rename to easytier/src/common/ifcfg.rs diff --git a/src/common/mod.rs b/easytier/src/common/mod.rs similarity index 100% rename from src/common/mod.rs rename to easytier/src/common/mod.rs diff --git a/src/common/netns.rs b/easytier/src/common/netns.rs similarity index 100% rename from src/common/netns.rs rename to easytier/src/common/netns.rs diff --git a/src/common/network.rs b/easytier/src/common/network.rs similarity index 100% rename from src/common/network.rs rename to easytier/src/common/network.rs diff --git a/src/common/rkyv_util.rs b/easytier/src/common/rkyv_util.rs similarity index 100% rename from src/common/rkyv_util.rs rename to easytier/src/common/rkyv_util.rs diff --git a/src/common/stun.rs b/easytier/src/common/stun.rs similarity index 100% rename from src/common/stun.rs rename to easytier/src/common/stun.rs diff --git a/src/common/stun_codec_ext.rs b/easytier/src/common/stun_codec_ext.rs similarity index 100% rename from src/common/stun_codec_ext.rs rename to easytier/src/common/stun_codec_ext.rs diff --git a/src/connector/direct.rs b/easytier/src/connector/direct.rs similarity index 100% rename from src/connector/direct.rs rename to easytier/src/connector/direct.rs diff --git a/src/connector/manual.rs b/easytier/src/connector/manual.rs similarity index 100% rename from src/connector/manual.rs rename to easytier/src/connector/manual.rs diff --git a/src/connector/mod.rs b/easytier/src/connector/mod.rs similarity index 100% rename from src/connector/mod.rs rename to easytier/src/connector/mod.rs diff --git a/src/connector/udp_hole_punch.rs b/easytier/src/connector/udp_hole_punch.rs similarity index 100% rename from src/connector/udp_hole_punch.rs rename to easytier/src/connector/udp_hole_punch.rs diff --git a/src/easytier-cli.rs b/easytier/src/easytier-cli.rs similarity index 100% rename from src/easytier-cli.rs rename to easytier/src/easytier-cli.rs diff --git a/src/easytier-core.rs b/easytier/src/easytier-core.rs similarity index 100% rename from src/easytier-core.rs rename to easytier/src/easytier-core.rs diff --git a/src/gateway/icmp_proxy.rs b/easytier/src/gateway/icmp_proxy.rs similarity index 100% rename from src/gateway/icmp_proxy.rs rename to easytier/src/gateway/icmp_proxy.rs diff --git a/src/gateway/mod.rs b/easytier/src/gateway/mod.rs similarity index 100% rename from src/gateway/mod.rs rename to easytier/src/gateway/mod.rs diff --git a/src/gateway/tcp_proxy.rs b/easytier/src/gateway/tcp_proxy.rs similarity index 100% rename from src/gateway/tcp_proxy.rs rename to easytier/src/gateway/tcp_proxy.rs diff --git a/src/gateway/udp_proxy.rs b/easytier/src/gateway/udp_proxy.rs similarity index 100% rename from src/gateway/udp_proxy.rs rename to easytier/src/gateway/udp_proxy.rs diff --git a/src/instance/instance.rs b/easytier/src/instance/instance.rs similarity index 100% rename from src/instance/instance.rs rename to easytier/src/instance/instance.rs diff --git a/src/instance/listeners.rs b/easytier/src/instance/listeners.rs similarity index 100% rename from src/instance/listeners.rs rename to easytier/src/instance/listeners.rs diff --git a/src/instance/mod.rs b/easytier/src/instance/mod.rs similarity index 100% rename from src/instance/mod.rs rename to easytier/src/instance/mod.rs diff --git a/src/instance/tun_codec.rs b/easytier/src/instance/tun_codec.rs similarity index 100% rename from src/instance/tun_codec.rs rename to easytier/src/instance/tun_codec.rs diff --git a/src/instance/virtual_nic.rs b/easytier/src/instance/virtual_nic.rs similarity index 100% rename from src/instance/virtual_nic.rs rename to easytier/src/instance/virtual_nic.rs diff --git a/src/peer_center/instance.rs b/easytier/src/peer_center/instance.rs similarity index 100% rename from src/peer_center/instance.rs rename to easytier/src/peer_center/instance.rs diff --git a/src/peer_center/mod.rs b/easytier/src/peer_center/mod.rs similarity index 100% rename from src/peer_center/mod.rs rename to easytier/src/peer_center/mod.rs diff --git a/src/peer_center/server.rs b/easytier/src/peer_center/server.rs similarity index 100% rename from src/peer_center/server.rs rename to easytier/src/peer_center/server.rs diff --git a/src/peer_center/service.rs b/easytier/src/peer_center/service.rs similarity index 100% rename from src/peer_center/service.rs rename to easytier/src/peer_center/service.rs diff --git a/src/peers/foreign_network_client.rs b/easytier/src/peers/foreign_network_client.rs similarity index 100% rename from src/peers/foreign_network_client.rs rename to easytier/src/peers/foreign_network_client.rs diff --git a/src/peers/foreign_network_manager.rs b/easytier/src/peers/foreign_network_manager.rs similarity index 100% rename from src/peers/foreign_network_manager.rs rename to easytier/src/peers/foreign_network_manager.rs diff --git a/src/peers/mod.rs b/easytier/src/peers/mod.rs similarity index 100% rename from src/peers/mod.rs rename to easytier/src/peers/mod.rs diff --git a/src/peers/packet.rs b/easytier/src/peers/packet.rs similarity index 100% rename from src/peers/packet.rs rename to easytier/src/peers/packet.rs diff --git a/src/peers/peer.rs b/easytier/src/peers/peer.rs similarity index 100% rename from src/peers/peer.rs rename to easytier/src/peers/peer.rs diff --git a/src/peers/peer_conn.rs b/easytier/src/peers/peer_conn.rs similarity index 100% rename from src/peers/peer_conn.rs rename to easytier/src/peers/peer_conn.rs diff --git a/src/peers/peer_manager.rs b/easytier/src/peers/peer_manager.rs similarity index 100% rename from src/peers/peer_manager.rs rename to easytier/src/peers/peer_manager.rs diff --git a/src/peers/peer_map.rs b/easytier/src/peers/peer_map.rs similarity index 100% rename from src/peers/peer_map.rs rename to easytier/src/peers/peer_map.rs diff --git a/src/peers/peer_ospf_route.rs b/easytier/src/peers/peer_ospf_route.rs similarity index 100% rename from src/peers/peer_ospf_route.rs rename to easytier/src/peers/peer_ospf_route.rs diff --git a/src/peers/peer_rip_route.rs b/easytier/src/peers/peer_rip_route.rs similarity index 100% rename from src/peers/peer_rip_route.rs rename to easytier/src/peers/peer_rip_route.rs diff --git a/src/peers/peer_rpc.rs b/easytier/src/peers/peer_rpc.rs similarity index 100% rename from src/peers/peer_rpc.rs rename to easytier/src/peers/peer_rpc.rs diff --git a/src/peers/route_trait.rs b/easytier/src/peers/route_trait.rs similarity index 100% rename from src/peers/route_trait.rs rename to easytier/src/peers/route_trait.rs diff --git a/src/peers/rpc_service.rs b/easytier/src/peers/rpc_service.rs similarity index 100% rename from src/peers/rpc_service.rs rename to easytier/src/peers/rpc_service.rs diff --git a/src/peers/tests.rs b/easytier/src/peers/tests.rs similarity index 100% rename from src/peers/tests.rs rename to easytier/src/peers/tests.rs diff --git a/src/rpc/cli.rs b/easytier/src/rpc/cli.rs similarity index 100% rename from src/rpc/cli.rs rename to easytier/src/rpc/cli.rs diff --git a/src/rpc/mod.rs b/easytier/src/rpc/mod.rs similarity index 100% rename from src/rpc/mod.rs rename to easytier/src/rpc/mod.rs diff --git a/src/rpc/peer.rs b/easytier/src/rpc/peer.rs similarity index 100% rename from src/rpc/peer.rs rename to easytier/src/rpc/peer.rs diff --git a/src/tests/mod.rs b/easytier/src/tests/mod.rs similarity index 100% rename from src/tests/mod.rs rename to easytier/src/tests/mod.rs diff --git a/src/tests/three_node.rs b/easytier/src/tests/three_node.rs similarity index 100% rename from src/tests/three_node.rs rename to easytier/src/tests/three_node.rs diff --git a/src/tunnels/codec.rs b/easytier/src/tunnels/codec.rs similarity index 100% rename from src/tunnels/codec.rs rename to easytier/src/tunnels/codec.rs diff --git a/src/tunnels/common.rs b/easytier/src/tunnels/common.rs similarity index 100% rename from src/tunnels/common.rs rename to easytier/src/tunnels/common.rs diff --git a/src/tunnels/mod.rs b/easytier/src/tunnels/mod.rs similarity index 100% rename from src/tunnels/mod.rs rename to easytier/src/tunnels/mod.rs diff --git a/src/tunnels/ring_tunnel.rs b/easytier/src/tunnels/ring_tunnel.rs similarity index 100% rename from src/tunnels/ring_tunnel.rs rename to easytier/src/tunnels/ring_tunnel.rs diff --git a/src/tunnels/stats.rs b/easytier/src/tunnels/stats.rs similarity index 100% rename from src/tunnels/stats.rs rename to easytier/src/tunnels/stats.rs diff --git a/src/tunnels/tcp_tunnel.rs b/easytier/src/tunnels/tcp_tunnel.rs similarity index 100% rename from src/tunnels/tcp_tunnel.rs rename to easytier/src/tunnels/tcp_tunnel.rs diff --git a/src/tunnels/tunnel_filter.rs b/easytier/src/tunnels/tunnel_filter.rs similarity index 100% rename from src/tunnels/tunnel_filter.rs rename to easytier/src/tunnels/tunnel_filter.rs diff --git a/src/tunnels/udp_tunnel.rs b/easytier/src/tunnels/udp_tunnel.rs similarity index 100% rename from src/tunnels/udp_tunnel.rs rename to easytier/src/tunnels/udp_tunnel.rs diff --git a/src/tunnels/wireguard.rs b/easytier/src/tunnels/wireguard.rs similarity index 100% rename from src/tunnels/wireguard.rs rename to easytier/src/tunnels/wireguard.rs diff --git a/src/vpn_portal/mod.rs b/easytier/src/vpn_portal/mod.rs similarity index 100% rename from src/vpn_portal/mod.rs rename to easytier/src/vpn_portal/mod.rs diff --git a/src/vpn_portal/wireguard.rs b/easytier/src/vpn_portal/wireguard.rs similarity index 100% rename from src/vpn_portal/wireguard.rs rename to easytier/src/vpn_portal/wireguard.rs diff --git a/third_party/Packet.dll b/easytier/third_party/Packet.dll similarity index 100% rename from third_party/Packet.dll rename to easytier/third_party/Packet.dll diff --git a/third_party/Packet.lib b/easytier/third_party/Packet.lib similarity index 100% rename from third_party/Packet.lib rename to easytier/third_party/Packet.lib diff --git a/third_party/wintun.dll b/easytier/third_party/wintun.dll similarity index 100% rename from third_party/wintun.dll rename to easytier/third_party/wintun.dll diff --git a/scripts/deploy.sh b/scripts/deploy.sh deleted file mode 100644 index ecd5f81..0000000 --- a/scripts/deploy.sh +++ /dev/null @@ -1,29 +0,0 @@ -CWD=$(dirname `cargo locate-project | jq '.root' -r`) -cargo build --release --all-targets - -TARGET_HOSTS=("root@public.kkrainbow.top" "root@47.242.85.82" "root@192.168.60.162") -CARGO_BUILD_OUTPUT_DIR="$CWD/target/release" - -copy_bin_to_remote() { - local TARGET_HOST=$1 - scp ${CARGO_BUILD_OUTPUT_DIR}/easytier-core $TARGET_HOST:/tmp/easytier-core & - scp ${CARGO_BUILD_OUTPUT_DIR}/easytier-cli $TARGET_HOST:/tmp/easytier-cli & -} - - -for TARGET_HOST in ${TARGET_HOSTS[@]}; do - ssh $TARGET_HOST "killall easytier-core" - copy_bin_to_remote $TARGET_HOST -done - -wait - -run_with_args() { - local TARGET_HOST=$1 - local ARGS=$2 - ssh $TARGET_HOST "nohup /tmp/easytier-core $ARGS > /tmp/easytier-core.log 2>&1 &" -} - -run_with_args "root@192.168.60.162" "--ipv4 10.144.144.10 --peers tcp://public.kkrainbow.top:11010" -run_with_args "root@public.kkrainbow.top" "--ipv4 10.144.144.20" -run_with_args "root@47.242.85.82" "--ipv4 10.144.144.30 --peers tcp://public.kkrainbow.top:11010" diff --git a/scripts/local_init.sh b/scripts/local_init.sh deleted file mode 100644 index 4d7f420..0000000 --- a/scripts/local_init.sh +++ /dev/null @@ -1,10 +0,0 @@ -ip netns add net_a -ip netns add net_b -ip netns add net_c -ip link add veth0 type veth peer name veth1 -ip link set veth0 netns net_a -ip link set veth1 netns net_b -ip netns exec net_a ip addr add 10.144.145.1/24 dev veth0 -ip netns exec net_b ip addr add 10.144.145.2/24 dev veth1 -ip netns exec net_a ip link set veth0 up -ip netns exec net_b ip link set veth1 up