From 8c77cb465b4da4890c76a907d4ce68432550aab2 Mon Sep 17 00:00:00 2001 From: Jun Kurihara Date: Fri, 26 Jul 2024 13:53:43 +0900 Subject: [PATCH] chore: deps, update readme --- README.md | 19 +++++-------------- docker/README.md | 27 ++++++++++++++++++++++++--- rpxy-acme/Cargo.toml | 2 +- rpxy-bin/Cargo.toml | 6 +++--- rpxy-certs/Cargo.toml | 2 +- rpxy-lib/Cargo.toml | 2 +- 6 files changed, 35 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 0b29149..221d6be 100644 --- a/README.md +++ b/README.md @@ -238,20 +238,7 @@ Since it is currently a work-in-progress project, we are frequently adding new o ## Using Docker Image -You can also use `docker` image hosted on [Docker Hub](https://hub.docker.com/r/jqtype/rpxy) and [GitHub Container Registry](https://github.com/junkurihara/rust-rpxy/pkgs/container/rust-rpxy) instead of directly executing the binary. See [`./docker/README.md`](./docker/README.md) for the differences on image tags. - -There are only several docker-specific environment variables. - -- `HOST_USER` (default: `user`): User name executing `rpxy` inside the container. -- `HOST_UID` (default: `900`): `UID` of `HOST_USER`. -- `HOST_GID` (default: `900`): `GID` of `HOST_USER` -- `LOG_LEVEL=debug|info|warn|error`: Log level -- `LOG_TO_FILE=true|false`: Enable logging to the log file `/rpxy/log/rpxy.log` using `logrotate`. You should mount `/rpxy/log` via docker volume option if enabled. The log dir and file will be owned by the `HOST_USER` with `HOST_UID:HOST_GID` on the host machine. Hence, `HOST_USER`, `HOST_UID` and `HOST_GID` should be the same as ones of the user who executes the `rpxy` docker container on the host. -- `WATCH=true|false` (default: `false`): Activate continuous watching of the config file if true. - -Then, all you need is to mount your `config.toml` as `/etc/rpxy.toml` and certificates/private keys as you like through the docker volume option. **If `WATCH=true`, You need to mount a directory, e.g., `./rpxy-config/`, including `rpxy.toml` on `/rpxy/config` instead of a file to correctly track file changes**. This is a docker limitation. Even if `WATCH=false`, you can mount the dir onto `/rpxy/config` rather than `/etc/rpxy.toml`. A file mounted on `/etc/rpxy` is prioritized over a dir mounted on `/rpxy/config`. - -See [`docker/docker-compose.yml`](./docker/docker-compose.yml) for the detailed configuration. Note that the file path of keys and certificates must be ones in your docker container. +You can also use `docker` image hosted on [Docker Hub](https://hub.docker.com/r/jqtype/rpxy) and [GitHub Container Registry](https://github.com/junkurihara/rust-rpxy/pkgs/container/rust-rpxy) instead of directly executing the binary. See [`./docker`](./docker/README.md) directory for more details. ## Example @@ -407,6 +394,10 @@ However, we found that if you want to use the brand-new UDP-based protocol, HTTP Your docker container can receive only TCP-based connection, i.e., HTTP/2 or before, unless you manually manage the port. We see that this is weird and expect that it is a kind of bug (of docker? ubuntu? or something else?). But at least for Ubuntu 22.04LTS, you need to handle it as above. +### Managing `rpxy` via web interface + +Check a third party project [`Gamerboy59/rpxy-webui`](https://github.com/Gamerboy59/rpxy-webui) to manage `rpxy` via web interface. + ### Other TIPS todo! diff --git a/docker/README.md b/docker/README.md index 74344a7..56411d0 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,14 +1,33 @@ # Docker Images of `rpxy` -The `rpxy` docker images are hosted both on [Docker Hub](https://hub.docker.com/r/jqtype/rpxy) and [GitHub Container Registry](https://github.com/junkurihara/rust-rpxy/pkgs/container/rust-rpxy). Differences among tags are summarized as follows. +The `rpxy` docker images are hosted both on [Docker Hub](https://hub.docker.com/r/jqtype/rpxy) and [GitHub Container Registry](https://github.com/junkurihara/rust-rpxy/pkgs/container/rust-rpxy). -## Latest Builds +## Usage + +There are several docker-specific environment variables. + +- `HOST_USER` (default: `user`): User name executing `rpxy` inside the container. +- `HOST_UID` (default: `900`): `UID` of `HOST_USER`. +- `HOST_GID` (default: `900`): `GID` of `HOST_USER` +- `LOG_LEVEL=debug|info|warn|error`: Log level +- `LOG_TO_FILE=true|false`: Enable logging to the log file `/rpxy/log/rpxy.log` using `logrotate`. You should mount `/rpxy/log` via docker volume option if enabled. The log dir and file will be owned by the `HOST_USER` with `HOST_UID:HOST_GID` on the host machine. Hence, `HOST_USER`, `HOST_UID` and `HOST_GID` should be the same as ones of the user who executes the `rpxy` docker container on the host. +- `WATCH=true|false` (default: `false`): Activate continuous watching of the config file if true. + +Then, all you need is to mount your `config.toml` as `/etc/rpxy.toml` and certificates/private keys as you like through the docker volume option. **If `WATCH=true`, You need to mount a directory, e.g., `./rpxy-config/`, including `rpxy.toml` on `/rpxy/config` instead of a file to correctly track file changes**. This is a docker limitation. Even if `WATCH=false`, you can mount the dir onto `/rpxy/config` rather than `/etc/rpxy.toml`. A file mounted on `/etc/rpxy` is prioritized over a dir mounted on `/rpxy/config`. + +See [`docker-compose.yml`](./docker-compose.yml) for the detailed configuration. Note that the file path of keys and certificates must be ones in your docker container. + +## Differences among image tags of Docker Hub and GitHub Container Registry + +Differences among tags are summarized as follows. + +### Latest Builds - `latest`: Built from the `main` branch with default features, running on Ubuntu. - `latest-slim`, `slim`: Built by `musl` from the `main` branch with default features, running on Alpine. - `latest-s2n`, `s2n`: Built from the `main` branch with the `http3-s2n` feature, running on Ubuntu. -## Nightly Builds +### Nightly Builds - `nightly`: Built from the `develop` branch with default features, running on Ubuntu. - `nightly-slim`: Built by `musl` from the `develop` branch with default features, running on Alpine. @@ -17,3 +36,5 @@ The `rpxy` docker images are hosted both on [Docker Hub](https://hub.docker.com/ ## Caveats Due to some compile errors of `s2n-quic` subpackages with `musl`, `nightly-s2n-slim` or `latest-s2n-slim` are not yet provided. + +See [`./docker/README.md`](./docker/README.md) for the differences on image tags. diff --git a/rpxy-acme/Cargo.toml b/rpxy-acme/Cargo.toml index 55a93c2..d1d318c 100644 --- a/rpxy-acme/Cargo.toml +++ b/rpxy-acme/Cargo.toml @@ -29,5 +29,5 @@ rustls-platform-verifier = { version = "0.3.2" } rustls-acme = { path = "../submodules/rustls-acme/", default-features = false, features = [ "aws-lc-rs", ] } -tokio = { version = "1.38.1", default-features = false } +tokio = { version = "1.39.1", default-features = false } tokio-stream = { version = "0.1.15", default-features = false } diff --git a/rpxy-bin/Cargo.toml b/rpxy-bin/Cargo.toml index 3e16fb9..73911d8 100644 --- a/rpxy-bin/Cargo.toml +++ b/rpxy-bin/Cargo.toml @@ -32,7 +32,7 @@ mimalloc = { version = "*", default-features = false } anyhow = "1.0.86" rustc-hash = "2.0.0" serde = { version = "1.0.204", default-features = false, features = ["derive"] } -tokio = { version = "1.38.1", default-features = false, features = [ +tokio = { version = "1.39.1", default-features = false, features = [ "net", "rt-multi-thread", "time", @@ -43,8 +43,8 @@ async-trait = "0.1.81" futures-util = { version = "0.3.30", default-features = false } # config -clap = { version = "4.5.10", features = ["std", "cargo", "wrap_help"] } -toml = { version = "0.8.15", default-features = false, features = ["parse"] } +clap = { version = "4.5.11", features = ["std", "cargo", "wrap_help"] } +toml = { version = "0.8.16", default-features = false, features = ["parse"] } hot_reload = "0.1.6" # logging diff --git a/rpxy-certs/Cargo.toml b/rpxy-certs/Cargo.toml index c17a94c..d80eb3c 100644 --- a/rpxy-certs/Cargo.toml +++ b/rpxy-certs/Cargo.toml @@ -33,7 +33,7 @@ rustls-webpki = { version = "0.102.6", default-features = false, features = [ x509-parser = { version = "0.16.0" } [dev-dependencies] -tokio = { version = "1.38.1", default-features = false, features = [ +tokio = { version = "1.39.1", default-features = false, features = [ "rt-multi-thread", "macros", ] } diff --git a/rpxy-lib/Cargo.toml b/rpxy-lib/Cargo.toml index da03ef1..ed29683 100644 --- a/rpxy-lib/Cargo.toml +++ b/rpxy-lib/Cargo.toml @@ -37,7 +37,7 @@ rustc-hash = "2.0.0" bytes = "1.6.1" derive_builder = "0.20.0" futures = { version = "0.3.30", features = ["alloc", "async-await"] } -tokio = { version = "1.38.1", default-features = false, features = [ +tokio = { version = "1.39.1", default-features = false, features = [ "net", "rt-multi-thread", "time",