[pbs-devel] [PATCH proxmox-backup 2/2] acme: plugin: add sleep for dns propagation

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jun 28 19:01:43 CEST 2021


"fix #3496: ..." 

On 28.06.21 18:27, Stoiko Ivanov wrote:
> the dns plugin config allow for a specified amount of time to wait for
> the TXT record to be set and propagated through DNS.
> 
> This patch adds a sleep for this amount of time.
> The log message was taken from the perl implementation in proxmox-acme
> for consistency.
> 
> Tested with the powerdns plugin in my test setup.
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
>  src/acme/plugin.rs | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/acme/plugin.rs b/src/acme/plugin.rs
> index 5e0e547a..96f64b7d 100644
> --- a/src/acme/plugin.rs
> +++ b/src/acme/plugin.rs
> @@ -2,6 +2,7 @@ use std::future::Future;
>  use std::pin::Pin;
>  use std::process::Stdio;
>  use std::sync::Arc;
> +use std::time::Duration;
>  
>  use anyhow::{bail, format_err, Error};
>  use hyper::{Body, Request, Response};
> @@ -168,6 +169,13 @@ impl DnsPlugin {
>              );
>          }
>  
> +        let validation_delay = self.core.validation_delay.unwrap_or(30) as u64;

misses the `if validation_delay > 0 {` for consistency with PVE and PMG.

> +        task.log(format!(
> +            "Sleeping {} seconds to wait for TXT record propagation",
> +            validation_delay
> +        ));
> +        tokio::time::sleep(Duration::from_secs(validation_delay)).await;
> +

This now adds the delay on every action, not only on "setup" like in PVE/PMG - makes
no sense to do so for teardown...

>          Ok(&challenge.url)
>      }
>  }
> 






More information about the pbs-devel mailing list