mirror of
https://github.com/sadoyan/aralez.git
synced 2026-10-23 06:01:35 +08:00
Fix scheme detection on HC disable upstreams
This commit is contained in:
Generated
+1
-1
@@ -130,7 +130,7 @@ checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aralez"
|
name = "aralez"
|
||||||
version = "0.94.3"
|
version = "0.94.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
"ahash",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ pub async fn order(domain: &str, credsfile: &str, certs_dir: String, provider: O
|
|||||||
let newlist: Vec<String> = DOMAINS.iter().map(|item| item.key().to_string()).collect();
|
let newlist: Vec<String> = DOMAINS.iter().map(|item| item.key().to_string()).collect();
|
||||||
if let Ok(json_content) = serde_json::to_string_pretty(&newlist) {
|
if let Ok(json_content) = serde_json::to_string_pretty(&newlist) {
|
||||||
let autocfg_file = credsfile.replace("/acme_credentials.json", "/domains.json");
|
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);
|
error!("Error Updating domains for certificates: {} : {}", domain, err);
|
||||||
return Err(Box::from(err));
|
return Err(Box::from(err));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,13 +47,13 @@ async fn build_upstreams(fullist: &UpstreamsDashMap, method: &str) -> UpstreamsD
|
|||||||
let tls = if upstream.healthcheck {
|
let tls = if upstream.healthcheck {
|
||||||
detect_tls(upstream.address.as_ref(), &upstream.port, host).await
|
detect_tls(upstream.address.as_ref(), &upstream.port, host).await
|
||||||
} else {
|
} else {
|
||||||
false
|
upstream.is_ssl
|
||||||
};
|
};
|
||||||
let mut scheme = InnerMap {
|
let mut scheme = InnerMap {
|
||||||
address: upstream.address.clone(),
|
address: upstream.address.clone(),
|
||||||
port: upstream.port,
|
port: upstream.port,
|
||||||
is_ssl: tls,
|
is_ssl: tls,
|
||||||
is_http2: false,
|
is_http2: upstream.is_http2,
|
||||||
to_https: upstream.to_https,
|
to_https: upstream.to_https,
|
||||||
rate_limit: upstream.rate_limit,
|
rate_limit: upstream.rate_limit,
|
||||||
x4xx_limit: upstream.x4xx_limit,
|
x4xx_limit: upstream.x4xx_limit,
|
||||||
|
|||||||
@@ -223,8 +223,8 @@ async fn populate_file_upstreams(config: &mut Configuration, parsed: &Config) {
|
|||||||
server_list.push(Arc::from(InnerMap {
|
server_list.push(Arc::from(InnerMap {
|
||||||
address: Arc::from(ip),
|
address: Arc::from(ip),
|
||||||
port,
|
port,
|
||||||
is_ssl: false,
|
is_ssl: path_config.is_ssl.unwrap_or(false),
|
||||||
is_http2: false,
|
is_http2: path_config.is_http2.unwrap_or(false),
|
||||||
to_https: path_config.to_https.unwrap_or(false),
|
to_https: path_config.to_https.unwrap_or(false),
|
||||||
rate_limit: path_config.rate_limit.unwrap_or(0),
|
rate_limit: path_config.rate_limit.unwrap_or(0),
|
||||||
x4xx_limit: path_config.x4xx_limit.unwrap_or(0),
|
x4xx_limit: path_config.x4xx_limit.unwrap_or(0),
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ pub struct PathConfig {
|
|||||||
pub healthcheck: Option<bool>,
|
pub healthcheck: Option<bool>,
|
||||||
pub redirect_to: Option<String>,
|
pub redirect_to: Option<String>,
|
||||||
pub authorization: Option<Auth>,
|
pub authorization: Option<Auth>,
|
||||||
|
pub is_ssl: Option<bool>,
|
||||||
|
pub is_http2: Option<bool>,
|
||||||
}
|
}
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct Configuration {
|
pub struct Configuration {
|
||||||
|
|||||||
Reference in New Issue
Block a user