mirror of
https://github.com/go-acme/lego
synced 2026-03-14 14:35:48 +01:00
chore: improve propagation logs
This commit is contained in:
parent
6e1b1a17d8
commit
43805bfb5d
2 changed files with 12 additions and 2 deletions
|
|
@ -112,7 +112,7 @@ func (c *Challenge) Solve(ctx context.Context, authz acme.Authorization) error {
|
|||
timeout, interval = DefaultPropagationTimeout, DefaultPollingInterval
|
||||
}
|
||||
|
||||
log.Info("acme: Checking DNS record propagation.",
|
||||
log.Info("acme: waiting for DNS record propagation.",
|
||||
log.DomainAttr(domain),
|
||||
slog.String("nameservers", strings.Join(DefaultClient().recursiveNameservers, ",")),
|
||||
)
|
||||
|
|
@ -122,7 +122,7 @@ func (c *Challenge) Solve(ctx context.Context, authz acme.Authorization) error {
|
|||
err = wait.For("propagation", timeout, interval, func() (bool, error) {
|
||||
stop, errP := c.preCheck.call(ctx, domain, info.EffectiveFQDN, info.Value)
|
||||
if !stop || errP != nil {
|
||||
log.Info("acme: Waiting for DNS record propagation.", log.DomainAttr(domain))
|
||||
log.Info("acme: waiting for DNS record propagation.", log.DomainAttr(domain))
|
||||
}
|
||||
|
||||
return stop, errP
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@ package dns01
|
|||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
"time"
|
||||
|
||||
"github.com/go-acme/lego/v5/log"
|
||||
)
|
||||
|
||||
type ChallengeOption func(*Challenge) error
|
||||
|
|
@ -35,6 +38,13 @@ func DisableRecursiveNSsPropagationRequirement() ChallengeOption {
|
|||
|
||||
func PropagationWait(wait time.Duration, skipCheck bool) ChallengeOption {
|
||||
return WrapPreCheck(func(ctx context.Context, domain, fqdn, value string, check PreCheckFunc) (bool, error) {
|
||||
if skipCheck {
|
||||
log.Info("acme: the active propagation check is disabled, waiting for the propagation instead.",
|
||||
slog.Duration("wait", wait),
|
||||
log.DomainAttr(domain),
|
||||
)
|
||||
}
|
||||
|
||||
time.Sleep(wait)
|
||||
|
||||
if skipCheck {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue