Skip to content

Commit

Permalink
fix: use sequential approach
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Oct 24, 2024
1 parent 9875f8e commit af502bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions providers/dns/corenetworks/corenetworks.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
EnvTTL = envNamespace + "TTL"
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
EnvSequenceInterval = envNamespace + "SEQUENCE_INTERVAL"
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)

Expand All @@ -31,6 +32,7 @@ type Config struct {
Password string
PropagationTimeout time.Duration
PollingInterval time.Duration
SequenceInterval time.Duration
TTL int
HTTPClient *http.Client
}
Expand All @@ -41,6 +43,7 @@ func NewDefaultConfig() *Config {
TTL: env.GetOrDefaultInt(EnvTTL, 3600),
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout),
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
SequenceInterval: env.GetOrDefaultSecond(EnvSequenceInterval, dns01.DefaultPropagationTimeout),
HTTPClient: &http.Client{
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
},
Expand Down Expand Up @@ -93,6 +96,12 @@ 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
}

// Present creates a TXT record using the specified parameters.
func (d *DNSProvider) Present(domain, token, keyAuth string) error {
info := dns01.GetChallengeInfo(domain, keyAuth)
Expand Down
1 change: 1 addition & 0 deletions providers/dns/corenetworks/corenetworks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ lego --email [email protected] --dns corenetworks --domains my.example.org run
CORENETWORKS_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"
CORENETWORKS_TTL = "The TTL of the TXT record used for the DNS challenge"
CORENETWORKS_HTTP_TIMEOUT = "API request timeout"
CORENETWORKS_SEQUENCE_INTERVAL = "Time between sequential requests"

[Links]
API = "https://beta.api.core-networks.de/doc/"

0 comments on commit af502bc

Please sign in to comment.