Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add PropagationWait function #2288

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions challenge/dns01/precheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}

Expand Down
4 changes: 3 additions & 1 deletion cmd/setup_challenges.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down