diff --git a/Cargo.lock b/Cargo.lock index 76f29c3..ca98ba8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,7 +130,7 @@ checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "aralez" -version = "0.94.3" +version = "0.94.4" dependencies = [ "ahash", "anyhow", diff --git a/src/tls/acme/order.rs b/src/tls/acme/order.rs index 4a64df5..36718c8 100644 --- a/src/tls/acme/order.rs +++ b/src/tls/acme/order.rs @@ -31,7 +31,7 @@ pub async fn order(domain: &str, credsfile: &str, certs_dir: String, provider: O let newlist: Vec = DOMAINS.iter().map(|item| item.key().to_string()).collect(); if let Ok(json_content) = serde_json::to_string_pretty(&newlist) { let autocfg_file = credsfile.replace("/acme_credentials.json", "/domains.json"); - if let Err(err) = std::fs::write(&autocfg_file, json_content) { + if let Err(err) = fs::write(&autocfg_file, json_content) { error!("Error Updating domains for certificates: {} : {}", domain, err); return Err(Box::from(err)); } diff --git a/src/utils/healthcheck.rs b/src/utils/healthcheck.rs index a5d0bff..a94f5e8 100644 --- a/src/utils/healthcheck.rs +++ b/src/utils/healthcheck.rs @@ -47,13 +47,13 @@ async fn build_upstreams(fullist: &UpstreamsDashMap, method: &str) -> UpstreamsD let tls = if upstream.healthcheck { detect_tls(upstream.address.as_ref(), &upstream.port, host).await } else { - false + upstream.is_ssl }; let mut scheme = InnerMap { address: upstream.address.clone(), port: upstream.port, is_ssl: tls, - is_http2: false, + is_http2: upstream.is_http2, to_https: upstream.to_https, rate_limit: upstream.rate_limit, x4xx_limit: upstream.x4xx_limit, diff --git a/src/utils/parceyaml.rs b/src/utils/parceyaml.rs index 8fb1b89..ab7aa90 100644 --- a/src/utils/parceyaml.rs +++ b/src/utils/parceyaml.rs @@ -223,8 +223,8 @@ async fn populate_file_upstreams(config: &mut Configuration, parsed: &Config) { server_list.push(Arc::from(InnerMap { address: Arc::from(ip), port, - is_ssl: false, - is_http2: false, + is_ssl: path_config.is_ssl.unwrap_or(false), + is_http2: path_config.is_http2.unwrap_or(false), to_https: path_config.to_https.unwrap_or(false), rate_limit: path_config.rate_limit.unwrap_or(0), x4xx_limit: path_config.x4xx_limit.unwrap_or(0), diff --git a/src/utils/types.rs b/src/utils/types.rs index 901a72b..2f3ba58 100644 --- a/src/utils/types.rs +++ b/src/utils/types.rs @@ -92,6 +92,8 @@ pub struct PathConfig { pub healthcheck: Option, pub redirect_to: Option, pub authorization: Option, + pub is_ssl: Option, + pub is_http2: Option, } #[derive(Debug, Default)] pub struct Configuration {