feat: add PropagationWait function (#2288)

This commit is contained in:
Ludovic Fernandez 2024-10-02 19:31:52 +02:00 committed by GitHub
parent 56986eaa99
commit d81507c126
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -44,10 +44,15 @@ func RecursiveNSsPropagationRequirement() ChallengeOption {
}
}
func PropagationWaitOnly(wait time.Duration) ChallengeOption {
func PropagationWait(wait time.Duration, skipCheck bool) ChallengeOption {
return WrapPreCheck(func(domain, fqdn, value string, check PreCheckFunc) (bool, error) {
time.Sleep(wait)
return true, nil
if skipCheck {
return true, nil
}
return check(fqdn, value)
})
}

View file

@ -143,7 +143,9 @@ func setupDNS(ctx *cli.Context, client *lego.Client) error {
dns01.DisableAuthoritativeNssPropagationRequirement()),
dns01.CondOption(ctx.Duration(flgDNSPropagationWait) > 0,
dns01.PropagationWaitOnly(wait)),
// TODO(ldez): inside the next major version we will use flgDNSDisableCP here.
// This will change the meaning of this flag to really disable all propagation checks.
dns01.PropagationWait(wait, true)),
dns01.CondOption(ctx.Bool(flgDNSPropagationRNS),
dns01.RecursiveNSsPropagationRequirement()),