Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Realm and Upgrade to Realm2 #52

Merged
merged 169 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
cf0737a
sync cargo lock
zephyrchien Feb 20, 2022
42b8f42
refactor
zephyrchien Jul 7, 2021
0cc4d58
refactor file tree
zephyrchien Jul 7, 2021
f26daf4
refactor file tree & support config file
zephyrchien Jul 8, 2021
6afffae
fmt & doc
zephyrchien Jul 8, 2021
fe72ffe
revert last? merge
zephyrchien Jul 8, 2021
23fe88d
fmt
zephyrchien Jul 10, 2021
6e49291
indent
zephyrchien Jul 10, 2021
e88c222
rename dns mode; fix resolver not applied
zephyrchien Jul 14, 2021
5d5d1fc
fix resource leak
zephyrchien Sep 5, 2021
c04e5d9
correctly parse ipv6 addr
zephyrchien Sep 5, 2021
4b83365
update workflow
zephyrchien Sep 5, 2021
92f9ede
rename module
zephyrchien Sep 5, 2021
ea70d74
use type converter
zephyrchien Sep 5, 2021
636c3af
support starting from command line
zephyrchien Sep 5, 2021
5c2f85e
docs
zephyrchien Sep 5, 2021
2344564
update deps & build cfgs
zephyrchien Sep 5, 2021
34ecba0
bump version
zephyrchien Sep 5, 2021
72e0db5
use try_io; rename src file
zephyrchien Oct 29, 2021
816e262
tfo support
zephyrchien Oct 30, 2021
3047faa
add tfo to features
zephyrchien Oct 30, 2021
f817c73
add tokio-tfo submodule
zephyrchien Oct 30, 2021
193fd16
compatible with zero-copy(kernel>=4.11)
zephyrchien Oct 30, 2021
8332211
clean up
zephyrchien Oct 30, 2021
1be9565
sync submodules
zephyrchien Oct 30, 2021
1bbfaa3
make [udp, tfo, zero-copy] optional
zephyrchien Oct 30, 2021
ddcb4f8
v1.4.0-rc2
zephyrchien Oct 30, 2021
b34b551
docs
zephyrchien Oct 30, 2021
53417a2
enable all features by default
zephyrchien Oct 30, 2021
828157b
disable tfo by default
zephyrchien Nov 5, 2021
59aa607
indent
zephyrchien Nov 5, 2021
8ea95ff
update deps
zephyrchien Nov 6, 2021
8b30321
support bind ip before connect
zephyrchien Nov 6, 2021
b5191be
docs
zephyrchien Nov 6, 2021
6049e46
bump version
zephyrchien Nov 6, 2021
6b76377
compatibility fix
zephyrchien Nov 6, 2021
eecd826
polish up
zephyrchien Nov 6, 2021
b5fa5e8
allow ip format like [::1]
zephyrchien Nov 6, 2021
8b78875
clippy
zephyrchien Nov 6, 2021
0c4e4b7
extend dns options
zephyrchien Nov 7, 2021
fd1746e
compile with all features, add options for zero-copy and tfo
zephyrchien Nov 8, 2021
f0d94da
rollback zero-copy implementation
zephyrchien Nov 8, 2021
3e2fab3
handle tfo opt, no matter whether tfo feature is enabled or not
zephyrchien Nov 8, 2021
d96950f
docs
zephyrchien Nov 8, 2021
526af17
Update readme.md
zephyrchien Nov 8, 2021
19e98cc
Revert "rollback zero-copy implementation"
zephyrchien Nov 9, 2021
5a51dd7
no need to use generics
zephyrchien Nov 9, 2021
ce7f9c5
ensure all data is written to socket buffer, where connection is slow…
zephyrchien Nov 9, 2021
2a55257
daemonize
zephyrchien Nov 9, 2021
9866f48
docs & bump version
zephyrchien Nov 9, 2021
1d0bd30
add timeout option
zephyrchien Nov 12, 2021
b7460f0
read errno via safe method
zephyrchien Nov 12, 2021
6f4496d
docs
zephyrchien Nov 12, 2021
73728c5
solve conflicts on other os
zephyrchien Nov 12, 2021
adc45c0
reset default timeout;tcp=300s, udp=30s
zephyrchien Nov 13, 2021
7f5d9b6
update docs
zephyrchien Nov 13, 2021
e202c2d
docs, custom dns server requires addr instead of ip
zephyrchien Nov 22, 2021
1e45e4d
avoid realloc
zephyrchien Nov 23, 2021
516c183
remove duplicated clone
zephyrchien Nov 23, 2021
8ae8544
better error handle
zephyrchien Nov 23, 2021
fcc0415
add logger
zephyrchien Nov 24, 2021
729c579
improve startup steps
zephyrchien Nov 24, 2021
8d76f8e
docs
zephyrchien Nov 24, 2021
11dc356
use snake_case
zephyrchien Nov 24, 2021
cf212cb
more log details
zephyrchien Nov 24, 2021
9567f01
fix compile error if disable trust-dns
zephyrchien Nov 24, 2021
f3f09b3
remove ref binding
zephyrchien Nov 24, 2021
1ac77de
clippy
zephyrchien Nov 24, 2021
55777a1
remove subcommands
zephyrchien Nov 24, 2021
369f0c4
switch to clapv3.0
zephyrchien Nov 24, 2021
2cd0344
set release profile, panic=abort
zephyrchien Nov 24, 2021
e5d2cfe
adjust buffer size
zephyrchien Nov 25, 2021
d28c1eb
use mimalloc
zephyrchien Nov 25, 2021
78f821c
show compiled features
zephyrchien Nov 25, 2021
3c84cac
pass ci && update workflow
zephyrchien Nov 25, 2021
858e612
use libc's malloc by default
zephyrchien Nov 25, 2021
4020428
add -h and -v; #1
zephyrchien Nov 25, 2021
a0b1a18
default value for each field of dns conf
zephyrchien Nov 27, 2021
0b7143c
support cmd arguments override
zephyrchien Nov 28, 2021
7f6c9b5
move dns conf when necessary
zephyrchien Nov 28, 2021
ca4a99d
display log and dns message when start up
zephyrchien Nov 28, 2021
9f3239e
docs
zephyrchien Nov 28, 2021
cf414b1
support toml
zephyrchien Nov 28, 2021
04a3e5f
typo
zephyrchien Nov 29, 2021
4b26247
indent
zephyrchien Nov 29, 2021
04432fc
remove env logger
zephyrchien Dec 3, 2021
50e451f
rename dns field
zephyrchien Dec 3, 2021
59cb6ec
parse endpoint in conf module
zephyrchien Dec 3, 2021
156812d
make multi-thread optional
zephyrchien Dec 3, 2021
5e5b652
read config from env var
zephyrchien Dec 3, 2021
70681e0
fix default log level conflict
zephyrchien Dec 8, 2021
e42634d
remove compatible dns config
zephyrchien Dec 8, 2021
918ef13
improve config parser
zephyrchien Dec 8, 2021
5320dfe
add network global config
zephyrchien Dec 8, 2021
63342cb
refactor config parser
zephyrchien Dec 9, 2021
82b09ac
rename some fields
zephyrchien Dec 9, 2021
b05090f
disable timeout when value = 0
zephyrchien Dec 9, 2021
f19c6cc
rename env var
zephyrchien Dec 9, 2021
b28cb66
update doc
zephyrchien Dec 9, 2021
c67625c
apply new timeout rule to udp
zephyrchien Dec 9, 2021
00a33ec
fix log configuration display
zephyrchien Jan 11, 2022
6a8b86b
update deps
zephyrchien Feb 2, 2022
dea2cba
add cross-compile for arm64: #7
zephyrchien Feb 2, 2022
f78390e
update doc
zephyrchien Feb 2, 2022
44b54cd
avoid extra allocation when displaying log config
zephyrchien Feb 2, 2022
bd68bae
sync tokio-tfo
zephyrchien Feb 2, 2022
50b528c
detailed log info
zephyrchien Feb 2, 2022
139f62f
do not drop connection if socket option not supported: zhboner/realm#51
zephyrchien Feb 2, 2022
ad809f3
adapt to tfo
zephyrchien Feb 2, 2022
61c4bf4
refactor relay
zephyrchien Feb 4, 2022
564c3a3
rc10
zephyrchien Feb 4, 2022
3c0cee7
new option: set nofile limit
zephyrchien Feb 14, 2022
a55abe2
show nofile limit when starting
zephyrchien Feb 14, 2022
aea46e8
new option: dns-min-ttl, dns-max-ttl, dns-cache-size; related: zephyr…
zephyrchien Feb 14, 2022
5002453
docs
zephyrchien Feb 14, 2022
c7b680e
rc11
zephyrchien Feb 14, 2022
2b23854
add examples
zephyrchien Feb 14, 2022
f4ed405
fix dependency issue when features disabled
zephyrchien Feb 16, 2022
b77f7cb
add proxy-protocol support
zephyrchien Feb 18, 2022
1662b0a
docs
zephyrchien Feb 18, 2022
0d51be1
fix link
zephyrchien Feb 18, 2022
8547195
remove tcp timeout
zephyrchien Feb 18, 2022
e100d5b
add proxy-protocol timeout option
zephyrchien Feb 18, 2022
5c279f8
refine timeout
zephyrchien Feb 18, 2022
986f9ac
add accept-proxy-timeout cmd opt
zephyrchien Feb 18, 2022
066e9ce
clippy
zephyrchien Feb 18, 2022
329f1b5
fix build
zephyrchien Feb 18, 2022
d02bd60
update examples
zephyrchien Feb 18, 2022
205ed90
rc12
zephyrchien Feb 18, 2022
1f1ec64
extract lib
zephyrchien Feb 18, 2022
9a194ed
use raw ptr(do something evil)
zephyrchien Feb 18, 2022
2062877
support bind to iface, both tcp and udp socket
zephyrchien Feb 18, 2022
7b5649e
rename some functions
zephyrchien Feb 19, 2022
4117685
better option display
zephyrchien Feb 19, 2022
aa34a0d
keep compatible with old versions
zephyrchien Feb 19, 2022
86ac778
beautify code
zephyrchien Feb 19, 2022
c9f69fa
print warnings when using a legacy config file
zephyrchien Feb 19, 2022
6e272e8
update to clap 3.1.0, replace deprecated code
zephyrchien Feb 20, 2022
1741e9d
skip empty field when serializing
zephyrchien Feb 20, 2022
bec662f
add config converter
zephyrchien Feb 20, 2022
85c45b2
fix typo
zephyrchien Feb 20, 2022
91e7cad
docs
zephyrchien Feb 20, 2022
3118d3a
rename raw ptr wrapper; export tcp, udp entrance
zephyrchien Feb 20, 2022
71f22f4
add tcp test
zephyrchien Feb 20, 2022
bb86cef
add zero_copy test
zephyrchien Feb 20, 2022
0c0fc90
add proxy_protocol test
zephyrchien Feb 20, 2022
6d2eda7
add udp test
zephyrchien Feb 20, 2022
1b6f260
rename tests
zephyrchien Feb 20, 2022
b6df4b1
beautify code
zephyrchien Feb 20, 2022
468e9db
update workflow
zephyrchien Feb 20, 2022
a8d285c
rebase
zephyrchien Feb 20, 2022
7f86db4
update badge link
zephyrchien Feb 20, 2022
1489b40
Update ci.yml
zephyrchien Feb 20, 2022
26d802a
move some log from info to debug level
zephyrchien Feb 22, 2022
0a84af4
optimize udp
zephyrchien Feb 22, 2022
8c32ac3
avoid potential dangling ptr
zephyrchien Feb 23, 2022
bb851db
replace macros with generics
zephyrchien Feb 23, 2022
5f2b093
add pipe cap option
zephyrchien Mar 30, 2022
50a92f5
conditional compile
zephyrchien Mar 30, 2022
456d826
update workflows
zephyrchien Apr 2, 2022
03bd7e5
update readme
zephyrchien Apr 2, 2022
1f66789
use libkaminari
zephyrchien Apr 12, 2022
7b7529a
add basic transport support
zephyrchien Apr 13, 2022
effcdc4
add kaminari entry point from cmd/env/file
zephyrchien Apr 13, 2022
f17bf6f
conditional compilation
zephyrchien Apr 13, 2022
215934c
docs about transport
zephyrchien Apr 13, 2022
3c5ec32
add config examples
zephyrchien Apr 13, 2022
0bc0fe9
bump to v2.1.0
zephyrchien Apr 13, 2022
62799e6
update workflow; use the latest compiler
zephyrchien Apr 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ci
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
default: true
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
run_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
override: true
- run: cargo test -v --no-fail-fast
101 changes: 101 additions & 0 deletions .github/workflows/cross_compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: compile
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
build-corss:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
output: realm
- target: x86_64-unknown-linux-musl
output: realm
- target: x86_64-linux-android
output: realm
- target: x86_64-pc-windows-gnu
output: realm.exe
- target: aarch64-unknown-linux-gnu
output: realm
- target: aarch64-unknown-linux-musl
output: realm
- target: aarch64-linux-android
output: realm
steps:
- uses: actions/checkout@v2
- name: install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: ${{ matrix.target }}
override: true
- name: compile
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.target }}
- name: upload
uses: actions/upload-artifact@v2
with:
name: realm-${{ matrix.target }}
path: target/${{ matrix.target }}/release/${{ matrix.output }}
build-windows:
runs-on: windows-latest
strategy:
matrix:
target:
- x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v2
- name: install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: ${{ matrix.target }}
override: true
- name: compile
uses: actions-rs/cargo@v1
with:
use-cross: false
command: build
args: --release --target=${{ matrix.target }}
- name: upload
uses: actions/upload-artifact@v2
with:
name: realm-${{ matrix.target }}
path: target/${{ matrix.target }}/release/realm.exe
build-apple:
runs-on: macos-latest
strategy:
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
- aarch64-apple-ios
steps:
- uses: actions/checkout@v2
- name: install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: ${{ matrix.target }}
override: true
- name: compile
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.target }}
- name: upload
uses: actions/upload-artifact@v2
with:
name: realm-${{ matrix.target }}
path: target/${{ matrix.target }}/release/realm
34 changes: 0 additions & 34 deletions .github/workflows/relay.yml

This file was deleted.

118 changes: 118 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: release
on:
push:
tags:
- 'v*.*.*'

jobs:
release-corss:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
output: realm
- target: x86_64-unknown-linux-musl
output: realm
- target: x86_64-linux-android
output: realm
- target: x86_64-pc-windows-gnu
output: realm.exe
- target: aarch64-unknown-linux-gnu
output: realm
- target: aarch64-unknown-linux-musl
output: realm
- target: aarch64-linux-android
output: realm
steps:
- uses: actions/checkout@v2
- name: install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: ${{ matrix.target }}
override: true
- name: compile
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.target }}
- name: pack
run: |
mkdir -p release-${{ matrix.target }}
cd release-${{ matrix.target }}
tar -C ../target/${{ matrix.target }}/release -zcf realm-${{ matrix.target }}.tar.gz ${{ matrix.output }}
sha256sum realm-${{ matrix.target }}.tar.gz > realm-${{ matrix.target }}.sha256
- name: release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: release-${{ matrix.target }}/*
release-windows:
runs-on: windows-latest
strategy:
matrix:
target:
- x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v2
- name: install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: ${{ matrix.target }}
override: true
- name: compile
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.target }}
- name: pack
run: |
mkdir -p release-${{ matrix.target }}
cd release-${{ matrix.target }}
tar -C ../target/${{ matrix.target }}/release/ -zcf realm-${{ matrix.target }}.tar.gz realm
openssl dgst -sha256 -r realm-${{ matrix.target }}.tar.gz > realm-${{ matrix.target }}.sha256
- name: release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: release-${{ matrix.target }}/*
release-apple:
runs-on: macos-latest
strategy:
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
- aarch64-apple-ios
steps:
- uses: actions/checkout@v2
- name: install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: ${{ matrix.target }}
override: true
- name: compile
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.target }}
- name: pack
run: |
mkdir -p release-${{ matrix.target }}
cd release-${{ matrix.target }}
tar -C ../target/${{ matrix.target }}/release/ -zcf realm-${{ matrix.target }}.tar.gz realm
shasum -a 256 realm-${{ matrix.target }}.tar.gz > realm-${{ matrix.target }}.sha256
- name: release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: release-${{ matrix.target }}/*
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "tokio-tfo"]
path = tokio-tfo
url = [email protected]:zephyrchien/tokio-tfo.git
branch = main
Loading