chore: improve propagation logs

This commit is contained in:
Fernandez Ludovic 2026-02-08 12:40:53 +01:00
commit 43805bfb5d
2 changed files with 12 additions and 2 deletions

View file

@ -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

View file

@ -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 {