Skip to content

Commit a147b62

Browse files
committed
Merge branch 'dev' into main_bak
# Conflicts: # .github/origin_wfs/core.yml # .github/origin_wfs/docker.yml # .github/origin_wfs/install_rust.sh # .github/origin_wfs/release.yml # CONTRIBUTING.md # CONTRIBUTING_zh.md # Cargo.lock # EasyTier.code-workspace # README.md # README_CN.md # easytier-contrib/easytier-ffi/src/lib.rs # easytier-contrib/easytier-magisk/module.prop # easytier-contrib/easytier-ohrs/Cargo.lock # easytier-gui/package.json # easytier-gui/src-tauri/Cargo.toml # easytier-gui/src-tauri/src/lib.rs # easytier-gui/src-tauri/tauri.conf.json # easytier-rpc-build/Cargo.toml # easytier-web/Cargo.toml # easytier/Cargo.toml # easytier/locales/app.yml # easytier/src/common/acl_processor.rs # easytier/src/common/config.rs # easytier/src/common/global_ctx.rs # easytier/src/common/ifcfg/win/luid.rs # easytier/src/common/ifcfg/win/mod.rs # easytier/src/common/ifcfg/win/netsh.rs # easytier/src/common/ifcfg/win/types.rs # easytier/src/common/token_bucket.rs # easytier/src/connector/direct.rs # easytier/src/connector/manual.rs # easytier/src/easytier-cli.rs # easytier/src/easytier-core.rs # easytier/src/easytier_core.rs # easytier/src/gateway/socks5.rs # easytier/src/gateway/tcp_proxy.rs # easytier/src/helper.rs # easytier/src/instance/instance.rs # easytier/src/instance/virtual_nic.rs # easytier/src/launcher.rs # easytier/src/lib.rs # easytier/src/peer_center/instance.rs # easytier/src/peers/acl_filter.rs # easytier/src/peers/foreign_network_manager.rs # easytier/src/peers/peer_manager.rs # easytier/src/peers/peer_map.rs # easytier/src/peers/peer_ospf_route.rs # easytier/src/peers/route_trait.rs # easytier/src/peers/rpc_service.rs # easytier/src/proto/cli.proto # easytier/src/proto/common.proto # easytier/src/proto/common.rs # easytier/src/tests/three_node.rs # easytier/src/tunnel/quic.rs # easytier/src/tunnel/ring.rs # flake.lock # flake.nix # pnpm-lock.yaml
2 parents 6be72fe + 5323ce5 commit a147b62

180 files changed

Lines changed: 7349 additions & 1641 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ SYSROOT = "/usr/local/ohos-sdk/linux/native/sysroot"
1919
linker = "aarch64-unknown-linux-musl-gcc"
2020
rustflags = ["-C", "target-feature=+crt-static"]
2121

22+
[target.riscv64gc-unknown-linux-musl]
23+
linker = "riscv64-unknown-linux-musl-gcc"
24+
rustflags = ["-C", "target-feature=+crt-static"]
25+
2226
[target.'cfg(all(windows, target_env = "msvc"))']
2327
rustflags = ["-C", "target-feature=+crt-static"]
2428

.github/origin_wfs/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ WORKDIR /tmp/output
88
RUN ARTIFACT_ARCH=""; \
99
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
1010
ARTIFACT_ARCH="x86_64"; \
11+
elif [ "$TARGETPLATFORM" = "linux/arm/v6" ]; then \
12+
ARTIFACT_ARCH="armhf"; \
13+
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
14+
ARTIFACT_ARCH="armv7hf"; \
1115
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
1216
ARTIFACT_ARCH="aarch64"; \
17+
elif [ "$TARGETPLATFORM" = "linux/riscv64" ]; then \
18+
ARTIFACT_ARCH="riscv64"; \
1319
else \
14-
echo "Unsupported architecture: $TARGETARCH"; \
20+
echo "Unsupported architecture: $TARGETPLATFORM"; \
1521
exit 1; \
1622
fi; \
1723
cp /tmp/artifacts/easytier-linux-${ARTIFACT_ARCH}/* /tmp/output;

.github/origin_wfs/core.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ jobs:
229229
230230
rustup set auto-self-update disable
231231
232-
rustup install 1.87
233-
rustup default 1.87
232+
rustup install 1.89
233+
rustup default 1.89
234234
235235
export CC=clang
236236
export CXX=clang++

.github/origin_wfs/docker.yml

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ on:
1111
image_tag:
1212
description: 'Tag for this image build'
1313
type: string
14-
default: 'v2.4.0'
14+
default: 'v2.4.2'
1515
required: true
1616
mark_latest:
1717
description: 'Mark this image as latest'
1818
type: boolean
1919
default: false
2020
required: true
21+
mark_unstable:
22+
description: 'Mark this image as unstable'
23+
type: boolean
24+
default: false
25+
required: true
2126

2227
jobs:
2328
docker:
@@ -27,6 +32,13 @@ jobs:
2732
-
2833
name: Checkout
2934
uses: actions/checkout@v4
35+
-
36+
name: Validate inputs
37+
run: |
38+
if [[ "${{ inputs.mark_latest }}" == "true" && "${{ inputs.mark_unstable }}" == "true" ]]; then
39+
echo "Error: mark_latest and mark_unstable cannot both be true"
40+
exit 1
41+
fi
3042
-
3143
name: Set up QEMU
3244
uses: docker/setup-qemu-action@v3
@@ -56,14 +68,36 @@ jobs:
5668
- name: List files
5769
run: |
5870
ls -l -R .
71+
- name: Prepare Docker tags
72+
id: tags
73+
run: |
74+
# Base tags with version
75+
DOCKERHUB_TAGS="easytier/easytier:${{ inputs.image_tag }}"
76+
GHCR_TAGS="ghcr.io/easytier/easytier:${{ inputs.image_tag }}"
77+
78+
# Add latest tags if requested
79+
if [[ "${{ inputs.mark_latest }}" == "true" ]]; then
80+
DOCKERHUB_TAGS="${DOCKERHUB_TAGS},easytier/easytier:latest"
81+
GHCR_TAGS="${GHCR_TAGS},ghcr.io/easytier/easytier:latest"
82+
fi
83+
84+
# Add unstable tags if requested
85+
if [[ "${{ inputs.mark_unstable }}" == "true" ]]; then
86+
DOCKERHUB_TAGS="${DOCKERHUB_TAGS},easytier/easytier:unstable"
87+
GHCR_TAGS="${GHCR_TAGS},ghcr.io/easytier/easytier:unstable"
88+
fi
89+
90+
# Combine all tags
91+
ALL_TAGS="${DOCKERHUB_TAGS},${GHCR_TAGS}"
92+
93+
echo "tags=${ALL_TAGS}" >> $GITHUB_OUTPUT
94+
echo "Generated tags: ${ALL_TAGS}"
5995
-
6096
name: Build and push
6197
uses: docker/build-push-action@v6
6298
with:
6399
context: ./docker_context
64-
platforms: linux/amd64,linux/arm64
100+
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/riscv64
65101
push: true
66102
file: .github/workflows/Dockerfile
67-
tags: |
68-
easytier/easytier:${{ inputs.image_tag }}${{ inputs.mark_latest && ',easytier/easytier:latest' || '' }},
69-
ghcr.io/easytier/easytier:${{ inputs.image_tag }}${{ inputs.mark_latest && ',easytier/easytier:latest' || '' }},
103+
tags: ${{ steps.tags.outputs.tags }}

.github/origin_wfs/gui.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
concurrent_skipping: 'same_content_newer'
3030
skip_after_successful_duplicate: 'true'
3131
cancel_others: 'true'
32-
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", "easytier-gui/**", ".github/workflows/gui.yml", ".github/workflows/install_rust.sh"]'
32+
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", "easytier-gui/**", ".github/workflows/gui.yml", ".github/workflows/install_rust.sh", ".github/workflows/install_gui_dep.sh"]'
3333
build-gui:
3434
strategy:
3535
fail-fast: false
@@ -78,20 +78,11 @@ jobs:
7878
needs: pre_job
7979
if: needs.pre_job.outputs.should_skip != 'true'
8080
steps:
81+
- uses: actions/checkout@v3
82+
8183
- name: Install GUI dependencies (x86 only)
8284
if: ${{ matrix.TARGET == 'x86_64-unknown-linux-musl' }}
83-
run: |
84-
sudo apt update
85-
sudo apt install -qq libwebkit2gtk-4.1-dev \
86-
build-essential \
87-
curl \
88-
wget \
89-
file \
90-
libgtk-3-dev \
91-
librsvg2-dev \
92-
libxdo-dev \
93-
libssl-dev \
94-
patchelf
85+
run: bash ./.github/workflows/install_gui_dep.sh
9586

9687
- name: Install GUI cross compile (aarch64 only)
9788
if: ${{ matrix.TARGET == 'aarch64-unknown-linux-musl' }}
@@ -128,8 +119,6 @@ jobs:
128119
echo "PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/" >> "$GITHUB_ENV"
129120
echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/" >> "$GITHUB_ENV"
130121
131-
- uses: actions/checkout@v3
132-
133122
- name: Set current ref as env variable
134123
run: |
135124
echo "GIT_DESC=$(git log -1 --format=%cd.%h --date=format:%Y-%m-%d_%H:%M:%S)" >> $GITHUB_ENV

.github/origin_wfs/install_rust.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ fi
3131

3232
# see https://github.com/rust-lang/rustup/issues/3709
3333
rustup set auto-self-update disable
34-
rustup install 1.87
35-
rustup default 1.87
34+
rustup install 1.89
35+
rustup default 1.89
3636

3737
# mips/mipsel cannot add target from rustup, need compile by ourselves
3838
if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then

.github/origin_wfs/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
version:
2222
description: 'Version for this release'
2323
type: string
24-
default: 'v2.4.0'
24+
default: 'v2.4.2'
2525
required: true
2626
make_latest:
2727
description: 'Mark this release as latest'

.github/origin_wfs/test.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
# All of these options are optional, so you can remove them if you are happy with the defaults
2929
concurrent_skipping: 'never'
3030
skip_after_successful_duplicate: 'true'
31-
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", ".github/workflows/test.yml"]'
31+
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", ".github/workflows/test.yml", ".github/workflows/install_gui_dep.sh", ".github/workflows/install_rust.sh"]'
3232
test:
3333
runs-on: ubuntu-22.04
3434
needs: pre_job
@@ -89,6 +89,24 @@ jobs:
8989
./target
9090
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
9191

92+
- name: Install GUI dependencies (Used by clippy)
93+
run: |
94+
bash ./.github/workflows/install_gui_dep.sh
95+
bash ./.github/workflows/install_rust.sh
96+
rustup component add rustfmt
97+
rustup component add clippy
98+
99+
- name: Check formatting
100+
if: ${{ !cancelled() }}
101+
run: cargo fmt --all -- --check
102+
103+
- name: Check Clippy
104+
if: ${{ !cancelled() }}
105+
# NOTE: tauri need `dist` dir in build.rs
106+
run: |
107+
mkdir -p easytier-gui/dist
108+
cargo clippy --all-targets --all-features --all -- -D warnings
109+
92110
- name: Run tests
93111
run: |
94112
sudo prlimit --pid $$ --nofile=1048576:1048576
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sudo apt update
2+
sudo apt install -qq libwebkit2gtk-4.1-dev \
3+
build-essential \
4+
curl \
5+
wget \
6+
file \
7+
libgtk-3-dev \
8+
librsvg2-dev \
9+
libxdo-dev \
10+
libssl-dev \
11+
patchelf

.github/workflows/ohos.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: EasyTier OHOS
2+
3+
on:
4+
push:
5+
branches: ["develop", "main", "releases/**"]
6+
pull_request:
7+
branches: ["develop", "main"]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
defaults:
13+
run:
14+
# necessary for windows
15+
shell: bash
16+
17+
jobs:
18+
pre_job:
19+
# continue-on-error: true # Uncomment once integration is finished
20+
runs-on: ubuntu-latest
21+
# Map a step output to a job output
22+
outputs:
23+
# do not skip push on branch starts with releases/
24+
should_skip: ${{ steps.skip_check.outputs.should_skip == 'true' && !startsWith(github.ref_name, 'releases/') }}
25+
steps:
26+
- id: skip_check
27+
uses: fkirc/skip-duplicate-actions@v5
28+
with:
29+
# All of these options are optional, so you can remove them if you are happy with the defaults
30+
concurrent_skipping: 'same_content_newer'
31+
skip_after_successful_duplicate: 'true'
32+
cancel_others: 'true'
33+
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", "easytier-contrib/easytier-ohrs/**", ".github/workflows/ohos.yml", ".github/workflows/install_rust.sh"]'
34+
build-ohos:
35+
runs-on: ubuntu-latest
36+
needs: pre_job
37+
if: needs.pre_job.outputs.should_skip != 'true'
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Install dependencies
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y \
44+
build-essential \
45+
wget \
46+
unzip \
47+
git \
48+
pkg-config
49+
sudo apt-get clean
50+
51+
- name: Download and extract native SDK
52+
working-directory: ../../../
53+
run: |
54+
echo $PWD
55+
wget -q \
56+
https://github.com/openharmony-rs/ohos-sdk/releases/download/v5.1.0/ohos-sdk-windows_linux-public.tar.gz.aa
57+
wget -q \
58+
https://github.com/openharmony-rs/ohos-sdk/releases/download/v5.1.0/ohos-sdk-windows_linux-public.tar.gz.ab
59+
cat ohos-sdk-windows_linux-public.tar.gz.aa ohos-sdk-windows_linux-public.tar.gz.ab > sdk.tar.gz
60+
echo "Extracting native..."
61+
mkdir sdk
62+
tar -xzf sdk.tar.gz ohos-sdk/linux/native-linux-x64-5.1.0.107-Release.zip
63+
tar -xzf sdk.tar.gz ohos-sdk/linux/toolchains-linux-x64-5.1.0.107-Release.zip
64+
unzip -qq ohos-sdk/linux/native-linux-x64-5.1.0.107-Release.zip -d sdk
65+
unzip -qq ohos-sdk/linux/toolchains-linux-x64-5.1.0.107-Release.zip -d sdk
66+
ls -la sdk/native/llvm/bin/
67+
rm -rf ohos-sdk-windows_linux-public.tar.gz.aa ohos-sdk-windows_linux-public.tar.gz.ab ohos-sdk/
68+
69+
- name: Download and Extract Custom SDK
70+
run: |
71+
wget https://github.com/FrankHan052176/Easytier-OHOS-sdk/releases/download/v1/ohos-sdk.zip -O /tmp/ohos-sdk.zip
72+
sudo unzip -o /tmp/ohos-sdk.zip -d /tmp/custom-sdk
73+
sudo cp -rf /tmp/custom-sdk/linux/native/* $HOME/sdk/native
74+
echo "Custom SDK files deployed to $HOME/sdk/native"
75+
ls -a $HOME/sdk/native
76+
77+
- name: Setup build environment
78+
run: |
79+
echo "OHOS_NDK_HOME=$HOME/sdk" >> $GITHUB_ENV
80+
echo "TARGET_ARCH=aarch64-linux-ohos" >> $GITHUB_ENV
81+
82+
- name: Create clang wrapper script
83+
run: |
84+
sudo mkdir -p $OHOS_NDK_HOME/native/llvm
85+
sudo tee $OHOS_NDK_HOME/native/llvm/aarch64-unknown-linux-ohos-clang.sh > /dev/null <<'EOF'
86+
#!/bin/sh
87+
exec $OHOS_NDK_HOME/native/llvm/bin/clang \
88+
-target aarch64-linux-ohos \
89+
--sysroot=$OHOS_NDK_HOME/native/sysroot \
90+
-D__MUSL__ \
91+
"$@"
92+
EOF
93+
sudo chmod +x $OHOS_NDK_HOME/native/llvm/aarch64-unknown-linux-ohos-clang.sh
94+
95+
- name: Build
96+
working-directory: ./easytier-contrib/easytier-ohrs
97+
run: |
98+
sudo apt-get install -y llvm clang lldb lld
99+
sudo apt-get install -y protobuf-compiler
100+
bash ../../.github/workflows/install_rust.sh
101+
source env.sh
102+
cargo install ohrs
103+
rustup target add aarch64-unknown-linux-ohos
104+
cargo update easytier
105+
ohrs doctor
106+
ohrs build --release --arch aarch
107+
108+
- name: Upload artifact
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: easytier-ohos
112+
path: ./easytier-contrib/easytier-ohrs/dist/arm64-v8a/libeasytier_ohrs.so
113+
retention-days: 5
114+
if-no-files-found: error

0 commit comments

Comments
 (0)