exec: add detected variable to handle sequence interval (#1510)

This commit is contained in:
raunsbaekdk 2021-10-21 23:33:38 +02:00 committed by GitHub
parent df54dd233a
commit 18bcc0fa0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -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

View file

@ -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
}

View file

@ -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