diff options
author | Hendrik Jäger <gitcommit@henk.geekmail.org> | 2024-02-01 21:16:53 +0100 |
---|---|---|
committer | Hendrik Jäger <gitcommit@henk.geekmail.org> | 2024-02-01 21:16:53 +0100 |
commit | af51d1605fdb933518e5e0e61082fe93548c0916 (patch) | |
tree | af9a90f3646c194a19844d7900f8a1c8f6d78fc8 | |
parent | 14b4edf199e865cc50f03544be3c11925d50460d (diff) |
only do auth if not still valid
-rw-r--r-- | macir.rb | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -110,7 +110,7 @@ def wait_for_challenge_propagation( domain, challenge ) begin p 'Querying ACME challenge record' result = res.query_no_validation_or_recursion( "_acme-challenge." + domain, "TXT" ) - p result + # p result propagated = result.answer.any? do |answer| answer.rdata[0] == challenge.record_content end @@ -187,6 +187,8 @@ config['certs'].each_pair do |cert_name, cert_opts| p "Creating order object for cert #{cert_name}" order = client.new_order(identifiers: cert_opts['domain_names'] ) + p 'order status' + p order.status if order.status != 'ready' p 'Order is not ready, we need to authorize first' @@ -194,6 +196,11 @@ config['certs'].each_pair do |cert_name, cert_opts| order.authorizations.each do |auth| p "Processing authorization for #{auth.domain}" p "Finding challenge type for #{auth.domain}" + if auth.status == 'valid' + p "Authorization for #{auth.domain} is still valid, skipping" + next + end + challenge = auth.dns01 deploy_dns01_challenge_token( auth.domain, challenge, config['domains'][auth.domain]['primary_ns'], config ) wait_for_challenge_propagation( auth.domain, challenge ) |