feat: add PropagationWait function (#2288)
This commit is contained in:
parent
56986eaa99
commit
d81507c126
2 changed files with 10 additions and 3 deletions
|
@ -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) {
|
return WrapPreCheck(func(domain, fqdn, value string, check PreCheckFunc) (bool, error) {
|
||||||
time.Sleep(wait)
|
time.Sleep(wait)
|
||||||
return true, nil
|
|
||||||
|
if skipCheck {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return check(fqdn, value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,9 @@ func setupDNS(ctx *cli.Context, client *lego.Client) error {
|
||||||
dns01.DisableAuthoritativeNssPropagationRequirement()),
|
dns01.DisableAuthoritativeNssPropagationRequirement()),
|
||||||
|
|
||||||
dns01.CondOption(ctx.Duration(flgDNSPropagationWait) > 0,
|
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.CondOption(ctx.Bool(flgDNSPropagationRNS),
|
||||||
dns01.RecursiveNSsPropagationRequirement()),
|
dns01.RecursiveNSsPropagationRequirement()),
|
||||||
|
|
Loading…
Reference in a new issue