at startup, request missing acme tls certificates more quickly/silently

This commit is contained in:
Mechiel Lukkien
2023-12-22 13:41:00 +01:00
parent dbd6773f6b
commit 4701857d7f
2 changed files with 42 additions and 0 deletions

View File

@ -801,6 +801,14 @@ func Serve() {
i := 0
for m, hosts := range ensureManagerHosts {
for host := range hosts {
// Check if certificate is already available. If so, we don't print as much after a
// restart, and finish more quickly if only a few certificates are missing/old.
if avail, err := m.CertAvailable(mox.Shutdown, pkglog, host); err != nil {
pkglog.Errorx("checking acme certificate availability", err, slog.Any("host", host))
} else if avail {
continue
}
if i >= 10 {
// Just in case someone adds quite some domains to their config. We don't want to
// hit any ACME rate limits.