mirror of
https://github.com/go-acme/lego.git
synced 2024-11-25 00:56:20 +02:00
otc: sequential challenge (#2023)
This commit is contained in:
parent
b523518108
commit
c2fd4498e5
@ -2030,6 +2030,7 @@ func displayDNSHelp(w io.Writer, name string) error {
|
||||
ew.writeln(` - "OTC_HTTP_TIMEOUT": API request timeout`)
|
||||
ew.writeln(` - "OTC_POLLING_INTERVAL": Time between DNS propagation check`)
|
||||
ew.writeln(` - "OTC_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation`)
|
||||
ew.writeln(` - "OTC_SEQUENCE_INTERVAL": Time between sequential requests`)
|
||||
ew.writeln(` - "OTC_TTL": The TTL of the TXT record used for the DNS challenge`)
|
||||
|
||||
ew.writeln()
|
||||
|
@ -51,6 +51,7 @@ More information [here]({{< ref "dns#configuration-and-credentials" >}}).
|
||||
| `OTC_HTTP_TIMEOUT` | API request timeout |
|
||||
| `OTC_POLLING_INTERVAL` | Time between DNS propagation check |
|
||||
| `OTC_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation |
|
||||
| `OTC_SEQUENCE_INTERVAL` | Time between sequential requests |
|
||||
| `OTC_TTL` | The TTL of the TXT record used for the DNS challenge |
|
||||
|
||||
The environment variable names can be suffixed by `_FILE` to reference a file instead of a value.
|
||||
|
@ -33,6 +33,7 @@ const (
|
||||
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
|
||||
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
|
||||
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
|
||||
EnvSequenceInterval = envNamespace + "SEQUENCE_INTERVAL"
|
||||
)
|
||||
|
||||
// Config is used to configure the creation of the DNSProvider.
|
||||
@ -44,6 +45,7 @@ type Config struct {
|
||||
Password string
|
||||
PropagationTimeout time.Duration
|
||||
PollingInterval time.Duration
|
||||
SequenceInterval time.Duration
|
||||
TTL int
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
@ -55,6 +57,7 @@ func NewDefaultConfig() *Config {
|
||||
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout),
|
||||
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
|
||||
IdentityEndpoint: env.GetOrDefaultString(EnvIdentityEndpoint, defaultIdentityEndpoint),
|
||||
SequenceInterval: env.GetOrDefaultSecond(EnvSequenceInterval, dns01.DefaultPropagationTimeout),
|
||||
HTTPClient: &http.Client{
|
||||
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 10*time.Second),
|
||||
Transport: &http.Transport{
|
||||
@ -202,3 +205,9 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
||||
func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
|
||||
return d.config.PropagationTimeout, d.config.PollingInterval
|
||||
}
|
||||
|
||||
// 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.SequenceInterval
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ Example = ''''''
|
||||
[Configuration.Additional]
|
||||
OTC_POLLING_INTERVAL = "Time between DNS propagation check"
|
||||
OTC_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"
|
||||
OTC_SEQUENCE_INTERVAL = "Time between sequential requests"
|
||||
OTC_TTL = "The TTL of the TXT record used for the DNS challenge"
|
||||
OTC_HTTP_TIMEOUT = "API request timeout"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user