diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bbc45ef --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: Unit Test + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Run unit tests + run: | + cargo test --verbose diff --git a/.github/workflows/shift_left.yml b/.github/workflows/shift_left.yml new file mode 100644 index 0000000..ac66d0a --- /dev/null +++ b/.github/workflows/shift_left.yml @@ -0,0 +1,17 @@ +name: ShiftLeft Scan + +on: push + +jobs: + Scan-Build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Perform ShiftLeft Scan + uses: ShiftLeftSecurity/scan-action@master + env: + WORKSPACE: "" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + output: reports diff --git a/Cargo.toml b/Cargo.toml index a216559..c213679 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ http3 = ["quinn", "h3", "h3-quinn"] [dependencies] env_logger = "0.9.0" anyhow = "1.0.58" -clap = { version = "3.2.13", features = ["std", "cargo", "wrap_help"] } +clap = { version = "3.2.15", features = ["std", "cargo", "wrap_help"] } futures = { version = "0.3.21", features = ["alloc", "async-await"] } hyper = { version = "0.14.20", default-features = false, features = [ "server", @@ -27,7 +27,7 @@ hyper = { version = "0.14.20", default-features = false, features = [ "stream", ] } log = "0.4.17" -tokio = { version = "1.20.0", default-features = false, features = [ +tokio = { version = "1.20.1", default-features = false, features = [ "net", "rt-multi-thread", "parking_lot", diff --git a/README.md b/README.md index 6cff2fa..5314d80 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # rpxy: A simple and ultrafast reverse-proxy for multiple host names with TLS termination, written in pure Rust +![Unit Test](https://github.com/junkurihara/rust-rpxy/actions/workflows/ci.yml/badge.svg) +![Build and Publish Docker](https://github.com/junkurihara/rust-rpxy/actions/workflows/docker_build_push.yml/badge.svg) +![ShiftLeft Scan](https://github.com/junkurihara/rust-rpxy/actions/workflows/shift_left.yml/badge.svg) + + **WIP Project** ## Introduction diff --git a/src/handler/handler_main.rs b/src/handler/handler_main.rs index aa18449..b69a489 100644 --- a/src/handler/handler_main.rs +++ b/src/handler/handler_main.rs @@ -218,7 +218,7 @@ where } #[allow(clippy::too_many_arguments)] - fn generate_request_forwarded( + fn generate_request_forwarded( &self, client_addr: &SocketAddr, listen_addr: &SocketAddr, diff --git a/src/proxy/proxy_main.rs b/src/proxy/proxy_main.rs index e482ff0..0af1f3e 100644 --- a/src/proxy/proxy_main.rs +++ b/src/proxy/proxy_main.rs @@ -9,7 +9,7 @@ use tokio::{ time::{timeout, Duration}, }; -#[derive(Clone, Debug)] +#[derive(Clone)] pub struct LocalExecutor { runtime_handle: Handle, }