v1.0.3
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -4,7 +4,7 @@ version = 3
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "acme-client"
|
name = "acme-client"
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"acme-lib",
|
"acme-lib",
|
||||||
"async-std",
|
"async-std",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "acme-client"
|
name = "acme-client"
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Acme auto challenge client, acme-client can issue certificates from Let's encrypt"
|
description = "Acme auto challenge client, acme-client can issue certificates from Let's encrypt"
|
||||||
|
|||||||
16
src/main.rs
16
src/main.rs
@@ -285,11 +285,13 @@ async fn main() -> tide::Result<()> {
|
|||||||
key_file: Some(format!("{}/{}", item.path, KEY_NAME)),
|
key_file: Some(format!("{}/{}", item.path, KEY_NAME)),
|
||||||
outputs_file: None,
|
outputs_file: None,
|
||||||
};
|
};
|
||||||
|
let mut domains = vec![common_name.clone()];
|
||||||
|
dns_names.iter().for_each(|dns_name| domains.push(dns_name.clone()));
|
||||||
if let Err(e) = request_acme_certificate(acme_request) {
|
if let Err(e) = request_acme_certificate(acme_request) {
|
||||||
failure!("Request certificate: {}, by acme failed: {}", item.path, e);
|
failure!("Request certificate: {}, by acme failed: {}", item.path, e);
|
||||||
acme_statics.add_item(dns_names.clone(), AcmeStatus::Fail(format!("{}", e)));
|
acme_statics.add_item(domains, AcmeStatus::Fail(format!("{}", e)));
|
||||||
} else {
|
} else {
|
||||||
acme_statics.add_item(dns_names.clone(), AcmeStatus::Success);
|
acme_statics.add_item(domains, AcmeStatus::Success);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -332,12 +334,12 @@ async fn main() -> tide::Result<()> {
|
|||||||
|
|
||||||
let mut success_domains = vec![];
|
let mut success_domains = vec![];
|
||||||
let mut failed_domains = vec![];
|
let mut failed_domains = vec![];
|
||||||
for acme_static in &acme_statics.items {
|
for acme_item in &acme_statics.items {
|
||||||
if let AcmeStatus::Success = acme_static.status {
|
if let AcmeStatus::Success = acme_item.status {
|
||||||
success_domains.push(format!("* {}", acme_static.domains.join(", ")));
|
success_domains.push(format!("* {}", acme_item.domains.join(", ")));
|
||||||
}
|
}
|
||||||
if let AcmeStatus::Fail(_) = acme_static.status {
|
if let AcmeStatus::Fail(_) = acme_item.status {
|
||||||
failed_domains.push(format!("* {}", &acme_static.domains.join(", ")));
|
failed_domains.push(format!("* {}", acme_item.domains.join(", ")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user