From 641292fe5db2c66cc34f4a08cc850ee5b308e3b1 Mon Sep 17 00:00:00 2001 From: Jun Kurihara Date: Tue, 5 Nov 2024 19:40:04 +0900 Subject: [PATCH 1/3] deps --- rpxy-acme/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpxy-acme/Cargo.toml b/rpxy-acme/Cargo.toml index be4a73a..d33c794 100644 --- a/rpxy-acme/Cargo.toml +++ b/rpxy-acme/Cargo.toml @@ -28,7 +28,7 @@ rustls = { version = "0.23.16", default-features = false, features = [ "std", "aws_lc_rs", ] } -rustls-platform-verifier = { version = "0.3.4" } +rustls-platform-verifier = { version = "0.4.0" } rustls-acme = { path = "../submodules/rustls-acme/", default-features = false, features = [ "aws-lc-rs", ] } From 1a199396c0fe8309165cce750a83f7fc1867abf7 Mon Sep 17 00:00:00 2001 From: Jun Kurihara Date: Tue, 5 Nov 2024 19:49:21 +0900 Subject: [PATCH 2/3] fix: update the default logging level of external crates to warn --- rpxy-bin/src/log.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpxy-bin/src/log.rs b/rpxy-bin/src/log.rs index 4076943..dd98b77 100644 --- a/rpxy-bin/src/log.rs +++ b/rpxy-bin/src/log.rs @@ -21,7 +21,7 @@ pub fn init_logger() { .target() .starts_with(env!("CARGO_PKG_NAME").replace('-', "_").as_str()) && metadata.level() <= &level) - || metadata.level() <= &tracing::Level::ERROR.min(level) + || metadata.level() <= &tracing::Level::WARN.min(level) })); tracing_subscriber::registry().with(stdio_layer).init(); } else { From 7cad7fd3650a53044abebfd55a38b5b2a23dbbf7 Mon Sep 17 00:00:00 2001 From: Jun Kurihara Date: Tue, 5 Nov 2024 23:07:14 +0900 Subject: [PATCH 3/3] update hot_reload --- rpxy-bin/Cargo.toml | 2 +- rpxy-bin/src/config/service.rs | 9 ++++----- rpxy-bin/src/main.rs | 13 ++++++++----- rpxy-certs/Cargo.toml | 2 +- rpxy-lib/Cargo.toml | 2 +- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/rpxy-bin/Cargo.toml b/rpxy-bin/Cargo.toml index 6c76d9a..990f60a 100644 --- a/rpxy-bin/Cargo.toml +++ b/rpxy-bin/Cargo.toml @@ -49,7 +49,7 @@ futures-util = { version = "0.3.31", default-features = false } # config clap = { version = "4.5.20", features = ["std", "cargo", "wrap_help"] } toml = { version = "0.8.19", default-features = false, features = ["parse"] } -hot_reload = "0.1.6" +hot_reload = "0.1.8" serde_ignored = "0.1.10" # logging diff --git a/rpxy-bin/src/config/service.rs b/rpxy-bin/src/config/service.rs index 8769b96..76702c8 100644 --- a/rpxy-bin/src/config/service.rs +++ b/rpxy-bin/src/config/service.rs @@ -8,17 +8,16 @@ pub struct ConfigTomlReloader { } #[async_trait] -impl Reload for ConfigTomlReloader { +impl Reload for ConfigTomlReloader { type Source = String; - async fn new(source: &Self::Source) -> Result> { + async fn new(source: &Self::Source) -> Result> { Ok(Self { config_path: source.clone(), }) } - async fn reload(&self) -> Result, ReloaderError> { - let conf = ConfigToml::new(&self.config_path) - .map_err(|_e| ReloaderError::::Reload("Failed to reload config toml"))?; + async fn reload(&self) -> Result, ReloaderError> { + let conf = ConfigToml::new(&self.config_path).map_err(|e| ReloaderError::::Reload(e.to_string()))?; Ok(Some(conf)) } } diff --git a/rpxy-bin/src/main.rs b/rpxy-bin/src/main.rs index ce96253..d1156d8 100644 --- a/rpxy-bin/src/main.rs +++ b/rpxy-bin/src/main.rs @@ -40,10 +40,13 @@ fn main() { std::process::exit(1); } } else { - let (config_service, config_rx) = - ReloaderService::::new(&parsed_opts.config_file_path, CONFIG_WATCH_DELAY_SECS, false) - .await - .unwrap(); + let (config_service, config_rx) = ReloaderService::::new( + &parsed_opts.config_file_path, + CONFIG_WATCH_DELAY_SECS, + false, + ) + .await + .unwrap(); tokio::select! { config_res = config_service.start() => { @@ -246,7 +249,7 @@ async fn rpxy_service_without_watcher( } async fn rpxy_service_with_watcher( - mut config_rx: ReloaderReceiver, + mut config_rx: ReloaderReceiver, runtime_handle: tokio::runtime::Handle, ) -> Result<(), anyhow::Error> { info!("Start rpxy service with dynamic config reloader"); diff --git a/rpxy-certs/Cargo.toml b/rpxy-certs/Cargo.toml index 70b633a..7da21b4 100644 --- a/rpxy-certs/Cargo.toml +++ b/rpxy-certs/Cargo.toml @@ -20,7 +20,7 @@ rustc-hash = { version = "2.0.0" } tracing = { version = "0.1.40" } derive_builder = { version = "0.20.2" } thiserror = { version = "1.0.68" } -hot_reload = { version = "0.1.6" } +hot_reload = { version = "0.1.8" } async-trait = { version = "0.1.83" } rustls = { version = "0.23.16", default-features = false, features = [ "std", diff --git a/rpxy-lib/Cargo.toml b/rpxy-lib/Cargo.toml index 214c855..5020e8e 100644 --- a/rpxy-lib/Cargo.toml +++ b/rpxy-lib/Cargo.toml @@ -79,7 +79,7 @@ hyper-rustls = { version = "0.27.3", default-features = false, features = [ # tls and cert management for server rpxy-certs = { path = "../rpxy-certs/", default-features = false } -hot_reload = "0.1.6" +hot_reload = "0.1.8" rustls = { version = "0.23.16", default-features = false } rustls-post-quantum = { version = "0.1.0", optional = true } tokio-rustls = { version = "0.26.0", features = ["early-data"] }