Skip to content

Commit cfdf0e9

Browse files
M09Icclaude
andcommitted
feat: rem community edition — clean initial release
Community edition with all pro features and references thoroughly removed: Excluded modules: - WASM/browser extension (cmd/wasm, wasmext, wasmfetch, wasmws) - Graph/Teams/SharePoint/OneDrive (simplex backends, tests, comments) - TinyGo (cmd/tinygo, netdev, *_tinygo.go) - TLS variants (utls, shadowtls, reality) - Advance mode (age encryption, advance tunnel) - UI (webui, desktop, mobile) - Fetch proxy (protocol/serve/fetch/) Included: - Core serves: HTTP, SOCKS5, Shadowsocks, Trojan, Raw, PortForward, ExternalC2 - Core tunnels: TCP, UDP, HTTP, HTTP/2, StreamHTTP, WebSocket, Unix, ICMP, Memory, WireGuard - Simplex transport: OSS, DNS, HTTP, File backends - ARQ reliable transport, KCP, Yamux - Full wrapper/cryptor support - Standard TLS (crypto/tls) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 parents  commit cfdf0e9

291 files changed

Lines changed: 72701 additions & 0 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.

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Force LF line endings for all Go source files.
2+
# This ensures gofmt, go vet, and CI tools work correctly regardless of OS.
3+
*.go text eol=lf
4+
*.sh text eol=lf
5+
*.yml text eol=lf
6+
*.yaml text eol=lf
7+
*.md text eol=lf
8+
*.mod text eol=lf
9+
*.sum text eol=lf
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: nightly-release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
workflow_dispatch: # 允许手动触发
9+
10+
jobs:
11+
nightly:
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- name: Install dependencies
21+
run: |
22+
sudo dpkg --add-architecture i386
23+
sudo apt-get update
24+
sudo apt-get install -y \
25+
gcc-multilib \
26+
g++-multilib \
27+
libc6-dev-i386 \
28+
upx \
29+
zip \
30+
mingw-w64 \
31+
gcc-mingw-w64-i686 \
32+
gcc-mingw-w64-x86-64
33+
34+
- name: Set up Go
35+
uses: actions/setup-go@v3
36+
with:
37+
go-version: 1.18
38+
39+
- name: Set Version Info
40+
run: |
41+
echo "NIGHTLY_VERSION=nightly-$(date +'%Y%m%d')" >> $GITHUB_ENV
42+
echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
43+
44+
- name: Run GoReleaser
45+
uses: goreleaser/goreleaser-action@v4
46+
with:
47+
distribution: goreleaser
48+
version: latest
49+
args: release --snapshot --clean --skip=publish
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
VERSION: ${{ env.NIGHTLY_VERSION }}
53+
GOPATH: "/home/runner/go"
54+
COMMIT: ${{ env.COMMIT }}
55+
CGO_ENABLED: 0
56+
57+
- name: Build Libraries
58+
run: |
59+
# 编译动态库
60+
bash build.sh -buildmode c-shared -o "windows/amd64,windows/386,linux/amd64,linux/386"
61+
# 编译静态库
62+
bash build.sh -buildmode c-archive -o "windows/amd64,linux/amd64"
63+
64+
- name: Build Full
65+
run: |
66+
bash build.sh --full
67+
# 创建dist目录并移动文件
68+
mkdir -p dist
69+
for file in rem_*; do
70+
if [ -f "$file" ]; then
71+
mv "$file" "dist/remfull_${file#rem_}"
72+
fi
73+
done
74+
upx dist/remfull* || true
75+
76+
- name: Zip files
77+
run: |
78+
zip -r -j dist/rem_archive.zip dist/rem* dist/full* -x dist/lib/*
79+
zip -r dist/rem_lib.zip dist/lib/ -x *.h
80+
81+
- name: Upload binaries to release
82+
uses: svenstaro/upload-release-action@v2
83+
with:
84+
repo_token: ${{ secrets.GITHUB_TOKEN }}
85+
file: dist/rem*
86+
tag: nightly
87+
overwrite: true
88+
file_glob: true
89+
draft: true
90+
91+
- name: Delete Old Nightly Releases
92+
uses: dev-drprasad/delete-older-releases@v0.3.2
93+
with:
94+
keep_latest: 7
95+
delete_tags: true
96+
delete_tag_pattern: nightly
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
100+
- name: Create Release
101+
uses: softprops/action-gh-release@v1
102+
with:
103+
name: Nightly Build ${{ env.NIGHTLY_VERSION }}
104+
tag_name: nightly
105+
prerelease: true
106+
files: |
107+
dist/**/*
108+
body: |
109+
🌙 Nightly build
110+
111+
📝 Commit: ${{ env.COMMIT }}
112+
113+
⚠️ This is an automated nightly build and may be unstable.
114+
115+
📦 This release includes the latest changes from the main branch.
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+

.github/workflows/release.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
goreleaser:
11+
runs-on: ubuntu-22.04
12+
environment: release
13+
env:
14+
EDITION: ${{ vars.EDITION || 'community' }}
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
submodules: recursive
22+
23+
- name: Install dependencies
24+
run: |
25+
sudo dpkg --add-architecture i386
26+
sudo apt-get update
27+
sudo apt-get install -y \
28+
gcc-multilib \
29+
g++-multilib \
30+
libc6-dev-i386 \
31+
upx \
32+
zip \
33+
mingw-w64 \
34+
gcc-mingw-w64-i686 \
35+
gcc-mingw-w64-x86-64
36+
37+
- name: Set up GCC
38+
uses: egor-tensin/setup-gcc@v1
39+
with:
40+
version: latest
41+
platform: x64
42+
43+
- name: Set up Go
44+
uses: actions/setup-go@v3
45+
with:
46+
go-version: "1.22"
47+
48+
- name: Run GoReleaser
49+
uses: goreleaser/goreleaser-action@v4
50+
with:
51+
distribution: goreleaser
52+
version: latest
53+
args: release
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
GOPATH: "/home/runner/go"
57+
58+
- name: Build Libraries
59+
run: |
60+
mkdir -p dist/lib
61+
62+
# Windows DLL (64-bit)
63+
echo "Building Windows x64 DLL..."
64+
CGO_ENABLED=1 \
65+
GOOS=windows \
66+
GOARCH=amd64 \
67+
CC=x86_64-w64-mingw32-gcc \
68+
go build -buildmode=c-shared \
69+
-o dist/lib/rem_${EDITION}_windows_amd64.dll \
70+
-ldflags "-s -w -X 'github.com/chainreactors/rem/cmd/cmd.ver=${{ github.ref_name }}'" \
71+
-buildvcs=false ./cmd/export/
72+
73+
# Windows DLL (32-bit)
74+
echo "Building Windows x86 DLL..."
75+
CGO_ENABLED=1 \
76+
GOOS=windows \
77+
GOARCH=386 \
78+
CC=i686-w64-mingw32-gcc \
79+
go build -buildmode=c-shared \
80+
-o dist/lib/rem_${EDITION}_windows_386.dll \
81+
-ldflags "-s -w -X 'github.com/chainreactors/rem/cmd/cmd.ver=${{ github.ref_name }}'" \
82+
-buildvcs=false ./cmd/export/
83+
84+
# Linux .so (64-bit)
85+
echo "Building Linux x64 SO..."
86+
CGO_ENABLED=1 \
87+
GOOS=linux \
88+
GOARCH=amd64 \
89+
go build -buildmode=c-shared \
90+
-o dist/lib/rem_${EDITION}_linux_amd64.so \
91+
-ldflags "-s -w -X 'github.com/chainreactors/rem/cmd/cmd.ver=${{ github.ref_name }}'" \
92+
-buildvcs=false ./cmd/export/
93+
94+
# Linux .so (32-bit)
95+
echo "Building Linux x86 SO..."
96+
CGO_ENABLED=1 \
97+
GOOS=linux \
98+
GOARCH=386 \
99+
PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig \
100+
go build -buildmode=c-shared \
101+
-o dist/lib/rem_${EDITION}_linux_386.so \
102+
-ldflags "-s -w -X 'github.com/chainreactors/rem/cmd/cmd.ver=${{ github.ref_name }}'" \
103+
-buildvcs=false ./cmd/export/
104+
105+
# Static Libraries (.a)
106+
echo "Building Linux x64 Static Library..."
107+
CGO_ENABLED=1 \
108+
GOOS=linux \
109+
GOARCH=amd64 \
110+
go build -buildmode=c-archive \
111+
-o dist/lib/librem_${EDITION}_linux_amd64.a \
112+
-ldflags "-s -w -X 'github.com/chainreactors/rem/cmd/cmd.ver=${{ github.ref_name }}'" \
113+
-buildvcs=false ./cmd/export/
114+
115+
echo "Building Windows x64 Static Library..."
116+
CGO_ENABLED=1 \
117+
GOOS=windows \
118+
GOARCH=amd64 \
119+
CC=x86_64-w64-mingw32-gcc \
120+
go build -buildmode=c-archive \
121+
-o dist/lib/librem_${EDITION}_windows_amd64.a \
122+
-ldflags "-s -w -X 'github.com/chainreactors/rem/cmd/cmd.ver=${{ github.ref_name }}'" \
123+
-buildvcs=false ./cmd/export/
124+
125+
- name: Zip files
126+
run: |
127+
zip -r -j dist/rem_archive.zip dist/rem*
128+
zip -r dist/rem_lib.zip dist/lib/ -x "*.h"
129+
130+
- name: Upload binaries to release
131+
uses: svenstaro/upload-release-action@v2
132+
with:
133+
repo_token: ${{ secrets.GITHUB_TOKEN }}
134+
file: dist/rem*
135+
tag: ${{ github.ref }}
136+
overwrite: true
137+
file_glob: true
138+
draft: true

0 commit comments

Comments
 (0)