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

Release/0.0.1 #5

Merged
merged 73 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
c75e6b9
Restructure code before merge
hironichu Sep 15, 2023
1f66147
Working code
hironichu Sep 15, 2023
a4e926f
Working demo recv,send
hironichu Sep 15, 2023
12ec1fa
Starting bench and fixes
hironichu Sep 16, 2023
916f07e
Fixes and speed
hironichu Sep 16, 2023
18bbd32
Cleaning architecture for client integration
hironichu Sep 16, 2023
3de8d06
fmt
hironichu Sep 16, 2023
2146c88
fix: arm support
hironichu Sep 16, 2023
04f25e7
fix: try on hard CPU hits...
hironichu Sep 16, 2023
db3e72b
feat: CI
hironichu Sep 17, 2023
1ac4338
fix: remove deno.lock file
hironichu Sep 17, 2023
def6c0a
feat: more config and stuff
hironichu Sep 17, 2023
852327f
Fixed configuration for CI (not tested)
hironichu Sep 17, 2023
d7d7b32
fix clean, ci
hironichu Sep 17, 2023
9212765
fix fmt cmd
hironichu Sep 17, 2023
c28c831
fix ci syntax
hironichu Sep 17, 2023
6ae1101
fix ci syntax
hironichu Sep 17, 2023
f676908
fix ci
hironichu Sep 17, 2023
87f087b
fix ci
hironichu Sep 17, 2023
0cd3cd9
fix ci
hironichu Sep 17, 2023
51726f8
fix ci
hironichu Sep 17, 2023
442dee0
fix ci windows/linux builds
hironichu Sep 17, 2023
2a6b3cb
fix ci windows/linux builds
hironichu Sep 17, 2023
b358a96
fix ci syntax
hironichu Sep 17, 2023
f8e5bfd
Testing/ci : Added CI (#2)
hironichu Sep 17, 2023
e909cfa
added dev/ to CI
hironichu Sep 17, 2023
6aab994
lot of work, restructure client/server code, types and other stuff
hironichu Sep 17, 2023
7c6b392
Removed trash
hironichu Sep 17, 2023
2557fb3
fmt
hironichu Sep 17, 2023
57182e4
Working code!
hironichu Sep 17, 2023
6f7fe2e
Added working client (first try btw)
hironichu Sep 17, 2023
456608a
lint
hironichu Sep 17, 2023
e2839b8
Added more detail to readme
hironichu Sep 17, 2023
9bbae39
added classes to global scope
hironichu Sep 17, 2023
95fca83
Trying test
hironichu Sep 17, 2023
1a58800
Fixes CI env variable
hironichu Sep 17, 2023
f68340c
Fixes CI cache
hironichu Sep 17, 2023
707fc1e
Fixes CI cache
hironichu Sep 17, 2023
b27e136
Fixes CI...
hironichu Sep 17, 2023
e61c837
Fixes CI...
hironichu Sep 17, 2023
d52a1ec
ci: trying new CI config (#3)
hironichu Sep 19, 2023
9a7418a
Added safety and fixes
hironichu Sep 19, 2023
c23ef68
Re-Writen Connection (rust side) and fixed Lib loading without Plug.
hironichu Sep 20, 2023
2827620
Rm useless file
hironichu Sep 20, 2023
2a51b7f
fix ci : Lib loading in CI
hironichu Sep 20, 2023
2c7aa8f
Removed env from CI
hironichu Sep 20, 2023
9782b34
Trying to fix custom lib loading in CI
hironichu Sep 20, 2023
80b3d6b
fix
hironichu Sep 20, 2023
4ae2e7d
fix aarch64
hironichu Sep 20, 2023
2016ec6
fix aarch64 2
hironichu Sep 20, 2023
8a37adb
Removed _
hironichu Sep 20, 2023
4940693
Re-added Macos and windows CI, if it works it works..
hironichu Sep 20, 2023
47f724a
Getting WebTransport closer to 'standards'
hironichu Sep 21, 2023
0d69324
feat: Bidi and Uni stream (Client and server)
hironichu Sep 23, 2023
3656dc1
Cleaned up code
hironichu Sep 23, 2023
ebdbb26
Changing Callback calls
hironichu Sep 24, 2023
7a9b9a0
Reversed back CB to normal use
hironichu Sep 24, 2023
f2faa80
Changed CB workflow..
hironichu Sep 24, 2023
f3e8cab
Some fixes
hironichu Sep 24, 2023
bd7fe53
More stable fixes
hironichu Sep 24, 2023
c3414fb
Example fixes
hironichu Sep 24, 2023
5cc2031
fix tests
hironichu Sep 24, 2023
1c5c076
lint
hironichu Sep 24, 2023
5692678
remove certificate generation in tests
hironichu Sep 24, 2023
16bea16
fix
hironichu Sep 24, 2023
b72c82d
fmt
hironichu Sep 24, 2023
f8906e5
Fix Server panic when already listening (Return null instead)
hironichu Sep 24, 2023
67025fc
Add more linux safety when listening
hironichu Sep 24, 2023
d858f56
fix tests
hironichu Sep 24, 2023
54c220c
Fixed gracefull server close
hironichu Sep 24, 2023
c6981a7
fmt
hironichu Sep 24, 2023
d898a64
Fixed crash on close
hironichu Sep 25, 2023
7f2dc71
Need more fixes
hironichu Sep 25, 2023
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
15 changes: 15 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security Policy

## Supported Versions

The following version of the project are currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 0.1.x | :white_check_mark: |


## Reporting a Vulnerability

To report a vulnerability, please open an issue with the label "security".

206 changes: 206 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
on:
pull_request:
types: [review_requested, opened]
branches:
- 'releases/**'
push:
branches:
- 'main'
- 'releases/**'
- 'testing/**'
- 'feat/**'
- 'fix/**'
- 'dev/**'
concurrency:
group: ${{ github.workflow }}-${{ !contains(github.event.pull_request.labels.*.name, 'test-flaky-ci') && github.head_ref || github.run_id }}
cancel-in-progress: true

name: Webtransport CI
jobs:
build:
if: |
github.event_name == 'push' || !startsWith(github.event.pull_request.head.label, 'hironichu:')
strategy:
matrix:
os: [ 'ubuntu-latest', 'self-hosted', "macos-latest", "windows-latest"]
job: [build]
profile: [debug, release]
include:
- os: 'ubuntu-latest'
job: lint
profile: debug

name: ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Create source tarballs (release, linux)
if: |
startsWith(matrix.os, 'ubuntu') &&
matrix.profile == 'release' &&
matrix.job == 'build' &&
github.repository == 'hironichu/webtransport' &&
startsWith(github.ref, 'refs/tags/')
run: |
mkdir -p target/release
tar --exclude=".git*" --exclude=target --exclude=third_party/prebuilt \
-czvf target/release/webtransport.tar.gz -C .. webtransport

- name: Setting Up Rust
uses: dtolnay/rust-toolchain@master
if: |
matrix.job != 'lint'
with:
toolchain: stable
- name: Install Deno from .land
if: matrix.os != 'self-hosted'
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Install Deno from source
if: matrix.os == 'self-hosted'
run: |
echo "Check if Deno is already installed"
if ! type deno > /dev/null; then
echo "Deno is not installed, installing..."
curl -s https://gist.githubusercontent.com/LukeChannings/09d53f5c364391042186518c8598b85e/raw/ac8cd8c675b985edd4b3e16df63ffef14d1f0e24/deno_install.sh | sh
else
echo "Deno is already installed"
fi
- name: Error on warning
run: echo "RUSTFLAGS=-D warnings" >> $GITHUB_ENV

- name: Deno Format
if: matrix.job == 'lint'
run: deno task util:fmt

- name: Deno lint
if: matrix.job == 'lint'
run: deno task util:lint

- name: Build Debug
if: |
(matrix.job == 'build' && matrix.profile == 'debug')
run: deno task build:${{matrix.profile}}

- name: Build release
if: |
(matrix.job == 'build' && matrix.profile == 'release') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: deno task build:${{matrix.profile}}

- name: Move arm file (release)
if: startsWith(matrix.os, 'self-hosted') && matrix.job == 'build' && matrix.profile == 'release' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: |
mv target/${{matrix.profile}}/libwebtransport.so target/${{matrix.profile}}/libwebtransport_aarch64.so

- name: Move arm file (debug)
if: startsWith(matrix.os, 'self-hosted') && matrix.job == 'build' && matrix.profile == 'debug'
run: |
mv target/${{matrix.profile}}/libwebtransport.so target/${{matrix.profile}}/libwebtransport_aarch64.so
- name: Upload artifact (release)
uses: actions/upload-artifact@master
if: |
(matrix.job == 'build' && matrix.profile == 'release') &&
((github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')))
with:
name: release
path: |
target/${{matrix.profile}}/webtransport.dll
target/${{matrix.profile}}/libwebtransport.so
target/${{matrix.profile}}/libwebtransport_aarch64.so
target/${{matrix.profile}}/libwebtransport.dylib
- name: Upload artifact (debug)
uses: actions/upload-artifact@master
if: |
matrix.job == 'build' && matrix.profile == 'debug' && !startsWith(github.ref, 'refs/tags/')
with:
name: debug
path: |
target/${{matrix.profile}}/webtransport.dll
target/${{matrix.profile}}/libwebtransport.so
target/${{matrix.profile}}/libwebtransport_aarch64.so
target/${{matrix.profile}}/libwebtransport.dylib
- name: Upload release to GitHub
uses: softprops/action-gh-release@59c3b4891632ff9a897f99a91d7bc557467a3a22
if: |
(matrix.job == 'build' && matrix.profile == 'release') &&
github.repository == 'hironichu/webtransport' &&
github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
target/${{matrix.profile}}/webtransport.dll
target/${{matrix.profile}}/libwebtransport.so
target/${{matrix.profile}}/libwebtransport_aarch64.so
target/${{matrix.profile}}/libwebtransport.dylib
draft: true
test:
needs: build
if: |
github.event_name == 'push' || !startsWith(github.event.pull_request.head.label, 'hironichu:')
strategy:
matrix:
os: ['ubuntu-latest', 'self-hosted', "macos-latest", "windows-latest"]
job: [test]
profile: [debug, release]
name: ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 5

steps:
- uses: actions/checkout@master
- name: Creating target structure
run: |
mkdir -p target

- name: Download artifact
uses: actions/download-artifact@master
with:
path: target

- name: Display structure of downloaded files
run: ls -R
- name: Install Deno from .land
if: matrix.os != 'self-hosted'
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Install Deno from source
if: matrix.os == 'self-hosted'
run: |
echo "Check if Deno is already installed"
if ! type deno > /dev/null; then
echo "Deno is not installed, installing..."
curl -s https://gist.githubusercontent.com/LukeChannings/09d53f5c364391042186518c8598b85e/raw/ac8cd8c675b985edd4b3e16df63ffef14d1f0e24/deno_install.sh | sh
else
echo "Deno is already installed"
fi
- name: Run deno test (debug)
if: |
matrix.job == 'test' && matrix.profile == 'debug' && !startsWith(github.ref, 'refs/tags/')
env:
BUILD_TARGET: debug
CI_BUILD: true
run: |
deno task test

- name: Run deno test (release)
if: |
(matrix.job == 'test' && matrix.profile == 'release') &&
((github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')))
env:
BUILD_TARGET: release
CI_BUILD: true
run: |
deno task test
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# will have compiled files and executables
debug/
target/

certs/
dist/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

*.lock
# These are backup files generated by rustfmt
**/*.rs.bk

Expand All @@ -18,3 +19,9 @@ Cargo.lock

/target
/Cargo.lock


.env
*.env

.VSCodeCounter/
38 changes: 38 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"name": "server-uni-recv",
"type": "node",
"program": "${workspaceFolder}/examples/deno/wt_server_uni_recv.ts",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "C:\\Users\\zenze\\.deno\\bin\\deno.EXE",
"runtimeArgs": [
"run",
"--unstable",
"--inspect-wait",
"--allow-all"
],
"attachSimplePort": 9229
},
{
"request": "launch",
"name": "client-uni-send",
"type": "node",
"program": "${workspaceFolder}/examples/deno/wt_client_uni_send.ts",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "C:\\Users\\zenze\\.deno\\bin\\deno.EXE",
"runtimeArgs": [
"run",
"--unstable",
"--inspect-wait",
"--allow-all"
],
"attachSimplePort": 9229
}
]
}
12 changes: 8 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true
}
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
"editor.formatOnSave": true,
"rust-analyzer.linkedProjects": [
".\\Cargo.toml"
]
}
55 changes: 45 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,54 @@
[package]
name = "FTL-2"
name = "Webtransport"
description = "Deno WebTransport FFI library for Deno"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "ftlt"
name = "webtransport"
crate-type = ["cdylib"]
test = false
bench = false

[profile.release]
strip = true
opt-level = 3
debug = false
debug-assertions = false
overflow-checks = true
lto = "fat"
panic = "unwind"
incremental = false
codegen-units = 16
rpath = false

[profile.dev]
opt-level = 0
lto = false
debug = true
debug-assertions = true
overflow-checks = true
panic = "abort"
incremental = true
codegen-units = 1

[dependencies]
flume = "0.11.0"
futures-util = "0.3.28"
num_cpus = "1.16.0"
once_cell = "1.18.0"
smol = "1.3.0"
tokio = { version = "1.28.1", features = ["rt", "rt-multi-thread", "macros"] }
wtransport = "0.1.4"
serde = { version = "1", features = ["derive"] }
once_cell = "=1.18.0"
tokio = { version = "=1.32.0", default-features = false, features = [
"rt",
"rt-multi-thread",
"macros",
] }
# wtransport = "0.1.4" # TODO: Replace this once the fix for arm is merged.
wtransport = { git = "https://github.com/hironichu/wtransport", branch = "master", features = [
"dangerous-configuration",
"quinn",
] }
wtransport-proto = { git = "https://github.com/hironichu/wtransport", branch = "master" }
rcgen = "=0.11.2"
ring = "=0.16.20"
time = "=0.3.29"
anyhow = "=1.0.75"
serde = { version = "=1.0", features = ["derive"] }
serde_json = "1.0.107"
Loading