Skip to content

Commit

Permalink
Merge pull request #21 from kpcyrd/update
Browse files Browse the repository at this point in the history
Reduce timeouts for check http requests
  • Loading branch information
kpcyrd authored May 6, 2021
2 parents 2bb7cab + 2838e7e commit 8b14294
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 45 deletions.
83 changes: 42 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ pub struct RenewArgs {
/// Don't clean up old certs that are not live anymore
#[structopt(long)]
pub skip_cleanup: bool,
/// Only execute hooks without actually renewing certs
#[structopt(long)]
pub hooks_only: bool,
/// Only renew specific certs
pub certs: Vec<String>,
}
Expand Down
6 changes: 3 additions & 3 deletions src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use std::collections::HashSet;
pub fn check(name: &str, token: &str) -> Result<()> {
let url = format!("http://{}/.well-known/acme-challenge/{}", name, token);
let r = ureq::get(&url)
.timeout_connect(30_000)
.timeout_read(30_000)
.timeout_write(30_000)
.timeout_connect(3_000)
.timeout_read(3_000)
.timeout_write(3_000)
.call();

let status = r.status();
Expand Down
2 changes: 1 addition & 1 deletion src/renew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn renew_cert(
return Ok(());
}

if args.dry_run {
if args.dry_run || args.hooks_only {
info!("renewing {:?} (dry run)", cert.name);
} else {
info!("renewing {:?}", cert.name);
Expand Down

0 comments on commit 8b14294

Please sign in to comment.