From 18bcc0fa0c62b2c4678a49080d763fe86163bee2 Mon Sep 17 00:00:00 2001 From: raunsbaekdk Date: Thu, 21 Oct 2021 23:33:38 +0200 Subject: [PATCH] exec: add detected variable to handle sequence interval (#1510) --- docs/content/dns/zz_gen_exec.md | 1 + providers/dns/exec/exec.go | 5 ++++- providers/dns/exec/exec.toml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/content/dns/zz_gen_exec.md b/docs/content/dns/zz_gen_exec.md index d2eb05d2..c82e0fcf 100644 --- a/docs/content/dns/zz_gen_exec.md +++ b/docs/content/dns/zz_gen_exec.md @@ -42,6 +42,7 @@ lego --email myemail@example.com --dns exec --domains my.example.org run |----------------------------|-------------------------------------------| | `EXEC_POLLING_INTERVAL` | Time between DNS propagation check. | | `EXEC_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation. | +| `EXEC_SEQUENCE_INTERVAL` | Time between sequential requests. | ## Description diff --git a/providers/dns/exec/exec.go b/providers/dns/exec/exec.go index 71c5a06d..76de6d3e 100644 --- a/providers/dns/exec/exec.go +++ b/providers/dns/exec/exec.go @@ -22,6 +22,7 @@ const ( EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT" EnvPollingInterval = envNamespace + "POLLING_INTERVAL" + EnvSequenceInterval = envNamespace + "SEQUENCE_INTERVAL" ) // Config Provider configuration. @@ -30,6 +31,7 @@ type Config struct { Mode string PropagationTimeout time.Duration PollingInterval time.Duration + SequenceInterval time.Duration } // NewDefaultConfig returns a default configuration for the DNSProvider. @@ -37,6 +39,7 @@ func NewDefaultConfig() *Config { return &Config{ PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout), PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval), + SequenceInterval: env.GetOrDefaultSecond(EnvSequenceInterval, dns01.DefaultPropagationTimeout), } } @@ -119,5 +122,5 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) { // Sequential All DNS challenges for this provider will be resolved sequentially. // Returns the interval between each iteration. func (d *DNSProvider) Sequential() time.Duration { - return d.config.PropagationTimeout + return d.config.SequenceInterval } diff --git a/providers/dns/exec/exec.toml b/providers/dns/exec/exec.toml index e7a576f3..511ac8cd 100644 --- a/providers/dns/exec/exec.toml +++ b/providers/dns/exec/exec.toml @@ -25,6 +25,7 @@ Additional = ''' |----------------------------|-------------------------------------------| | `EXEC_POLLING_INTERVAL` | Time between DNS propagation check. | | `EXEC_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation. | +| `EXEC_SEQUENCE_INTERVAL` | Time between sequential requests. | ## Description