Skip to content

Commit c29535e

Browse files
authored
Merge pull request #1 from shadowsocks/master
Update to latest
2 parents de7e045 + 67232c3 commit c29535e

File tree

227 files changed

+26276
-8442
lines changed

Some content is hidden

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

227 files changed

+26276
-8442
lines changed

.cargo/config.toml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**/.git
2+
.circleci
3+
.devcontainer
4+
.github
5+
.ssh
6+
.vscode
7+
**/target
8+
dev

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
ignore:
9+
- dependency-name: libc
10+
versions:
11+
- 0.2.92
12+
- dependency-name: tokio
13+
versions:
14+
- 1.4.0
15+
- dependency-name: bloomfilter
16+
versions:
17+
- 1.0.5
18+
- dependency-name: regex
19+
versions:
20+
- 1.4.5
21+
- dependency-name: serde
22+
versions:
23+
- 1.0.124
24+
- dependency-name: tower
25+
versions:
26+
- 0.4.6

.github/workflows/build-and-test.yml

Lines changed: 28 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -8,80 +8,40 @@ on:
88

99
env:
1010
CARGO_TERM_COLOR: always
11-
RUSTFLAGS: "-Ctarget-feature=+aes,+ssse3"
12-
RUST_LOG: "shadowsocks=trace"
11+
RUST_LOG: "trace"
1312

1413
jobs:
15-
build-linux:
16-
runs-on: ubuntu-latest
14+
buid-test-check:
15+
strategy:
16+
matrix:
17+
platform:
18+
- ubuntu-latest
19+
- windows-latest
20+
- macos-latest
21+
runs-on: ${{ matrix.platform }}
1722

1823
steps:
19-
- uses: actions/checkout@v2
20-
- uses: actions/cache@v2
21-
with:
22-
path: |
23-
~/.cargo/registry
24-
~/.cargo/git
25-
target
26-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
27-
- name: Install Rust nightly
28-
uses: actions-rs/toolchain@v1
29-
with:
30-
profile: minimal
31-
- name: Build & Test (Default)
32-
run: cargo test --verbose --no-fail-fast
33-
- name: Build & Test (--no-default-features)
34-
run: cargo test --verbose --no-default-features --no-fail-fast
35-
- name: Build with All Features Enabled
36-
run: cargo build --verbose --features "local-redir local-dns dns-over-tls dns-over-https stream-cipher"
37-
38-
build-windows:
39-
runs-on: windows-latest
40-
41-
steps:
42-
- uses: actions/checkout@v2
43-
- uses: actions/cache@v2
44-
with:
45-
path: |
46-
~/.cargo/registry
47-
~/.cargo/git
48-
target
49-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
50-
- name: Install Rust nightly
51-
uses: actions-rs/toolchain@v1
52-
with:
53-
profile: minimal
54-
- name: Build & Test (Default)
55-
run: cargo test --verbose --no-fail-fast
56-
- name: Build & Test (--no-default-features)
57-
run: cargo test --verbose --no-default-features --no-fail-fast
58-
- name: Build with All Features Enabled
59-
run: cargo build --verbose --features "local-dns dns-over-tls dns-over-https stream-cipher"
60-
61-
build-macos:
62-
runs-on: macos-latest
63-
64-
steps:
65-
- uses: actions/checkout@v2
66-
- name: Install GNU tar
24+
- uses: actions/checkout@v3
25+
- uses: Swatinem/rust-cache@v2
26+
- name: Install Rust
6727
run: |
68-
brew install gnu-tar
69-
# echo "::add-path::/usr/local/opt/gnu-tar/libexec/gnubin"
70-
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
71-
- uses: actions/cache@v2
72-
with:
73-
path: |
74-
~/.cargo/registry
75-
~/.cargo/git
76-
target
77-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
78-
- name: Install Rust nightly
79-
uses: actions-rs/toolchain@v1
80-
with:
81-
profile: minimal
28+
rustup set profile minimal
29+
rustup toolchain install stable
30+
rustup default stable
31+
rustup override set stable
8232
- name: Build & Test (Default)
8333
run: cargo test --verbose --no-fail-fast
34+
- name: Build & Test (Default) - shadowsocks
35+
run: cargo test --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --no-fail-fast
8436
- name: Build & Test (--no-default-features)
8537
run: cargo test --verbose --no-default-features --no-fail-fast
86-
- name: Build with All Features Enabled
87-
run: cargo build --verbose --features "local-redir local-dns dns-over-tls dns-over-https stream-cipher"
38+
- name: Build & Test (--no-default-features) - shadowsocks
39+
run: cargo test --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --no-default-features --no-fail-fast
40+
- name: Build with All Features Enabled (Unix)
41+
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
42+
run: cargo build --verbose --features "local-http-rustls local-redir local-dns local-tun dns-over-tls dns-over-https stream-cipher aead-cipher-2022"
43+
- name: Build with All Features Enabled (Windows)
44+
if: ${{ runner.os == 'Windows' }}
45+
run: cargo build --verbose --features "local-http-rustls local-dns dns-over-tls dns-over-https stream-cipher aead-cipher-2022"
46+
- name: Build with All Features Enabled - shadowsocks
47+
run: cargo build --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --features "stream-cipher aead-cipher-2022"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Docker Images
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
bin:
12+
- ssserver
13+
- sslocal
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
- name: Setup Docker Buildx
18+
uses: docker/setup-buildx-action@v2
19+
- name: Login to GitHub Container Registry
20+
uses: docker/login-action@v2
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.repository_owner }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Docker metadata
26+
id: metadata
27+
uses: docker/metadata-action@v4
28+
with:
29+
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.bin }}-rust
30+
- name: Build and release Docker images
31+
uses: docker/build-push-action@v3
32+
with:
33+
platforms: linux/386,linux/amd64,linux/arm64/v8
34+
target: ${{ matrix.bin }}
35+
tags: ${{ steps.metadata.outputs.tags }}
36+
push: true
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Build Nightly Releases
2+
on:
3+
push:
4+
branches: [master]
5+
6+
env:
7+
CARGO_TERM_COLOR: always
8+
9+
jobs:
10+
build-cross:
11+
runs-on: ubuntu-latest
12+
env:
13+
RUST_BACKTRACE: full
14+
strategy:
15+
matrix:
16+
target:
17+
- x86_64-unknown-linux-musl
18+
- aarch64-unknown-linux-musl
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Install Rust
24+
run: |
25+
rustup set profile minimal
26+
rustup toolchain install stable
27+
rustup default stable
28+
rustup override set stable
29+
rustup target add --toolchain stable ${{ matrix.target }}
30+
31+
- name: Setup Zig
32+
uses: goto-bus-stop/setup-zig@v2
33+
34+
- name: Install cargo-zigbuild
35+
run: cargo install cargo-zigbuild
36+
37+
- name: Build ${{ matrix.target }}
38+
timeout-minutes: 120
39+
run: |
40+
compile_target=${{ matrix.target }}
41+
42+
if [[ "$compile_target" == *"-linux-"* || "$compile_target" == *"-apple-"* ]]; then
43+
compile_features="-f local-redir -f local-tun"
44+
fi
45+
46+
if [[ "$compile_target" == "mips-"* || "$compile_target" == "mipsel-"* || "$compile_target" == "mips64-"* || "$compile_target" == "mips64el-"* ]]; then
47+
sudo apt-get update -y && sudo apt-get install -y upx;
48+
if [[ "$?" == "0" ]]; then
49+
compile_compress="-u"
50+
fi
51+
fi
52+
53+
cd build
54+
./build-release-zigbuild -t ${{ matrix.target }} $compile_features $compile_compress
55+
56+
- name: Upload Artifacts
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: ${{ matrix.target }}
60+
path: build/release/*
61+
62+
build-unix:
63+
runs-on: ${{ matrix.os }}
64+
env:
65+
BUILD_EXTRA_FEATURES: "local-redir local-tun"
66+
RUST_BACKTRACE: full
67+
strategy:
68+
matrix:
69+
os: [macos-latest]
70+
target:
71+
- x86_64-apple-darwin
72+
- aarch64-apple-darwin
73+
steps:
74+
- uses: actions/checkout@v3
75+
76+
- name: Install GNU tar
77+
if: runner.os == 'macOS'
78+
run: |
79+
brew install gnu-tar
80+
# echo "::add-path::/usr/local/opt/gnu-tar/libexec/gnubin"
81+
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
82+
83+
- name: Install Rust
84+
run: |
85+
rustup set profile minimal
86+
rustup toolchain install stable
87+
rustup default stable
88+
rustup override set stable
89+
rustup target add --toolchain stable ${{ matrix.target }}
90+
91+
- name: Build release
92+
shell: bash
93+
run: |
94+
./build/build-host-release -t ${{ matrix.target }}
95+
96+
- name: Upload Artifacts
97+
uses: actions/upload-artifact@v3
98+
with:
99+
name: ${{ matrix.target }}
100+
path: build/release/*
101+
102+
build-windows:
103+
runs-on: windows-latest
104+
env:
105+
RUSTFLAGS: "-C target-feature=+crt-static"
106+
RUST_BACKTRACE: full
107+
steps:
108+
- uses: actions/checkout@v3
109+
110+
- name: Install Rust
111+
run: |
112+
rustup set profile minimal
113+
rustup toolchain install stable
114+
rustup default stable
115+
rustup override set stable
116+
117+
- name: Build release
118+
run: |
119+
pwsh ./build/build-host-release.ps1
120+
121+
- name: Upload Artifacts
122+
uses: actions/upload-artifact@v3
123+
with:
124+
name: windows-native
125+
path: build/release/*

0 commit comments

Comments
 (0)