all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: David Riley <d.riley@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: David Riley <d.riley@proxmox.com>
Subject: [PATCH pve-manager v3 4/4] fix #8006: pveupdate: use lifetime-based renewal lead time
Date: Wed, 21 Oct 2026 11:52:29 +0200	[thread overview]
Message-ID: <20261021095229.50842-5-d.riley@proxmox.com> (raw)
In-Reply-To: <20261021095229.50842-1-d.riley@proxmox.com>

Use a dynamically calculated renewal lead time based on the
certificate's lifetime instead of the previously hardcoded 30-day
lead time.

The previous hardcoded limit caused excessive daily renewals for
short-lived certificates (e.g., 31 days). This change ensures they
renew at sensible intervals, avoiding upstream rate limits.

Signed-off-by: David Riley <d.riley@proxmox.com>
Reviewed-by: Michael Köppl <m.koeppl@proxmox.com>
Tested-by: Michael Köppl <m.koeppl@proxmox.com>
---
 bin/pveupdate | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/pveupdate b/bin/pveupdate
index b1960c35..a014d1d3 100755
--- a/bin/pveupdate
+++ b/bin/pveupdate
@@ -83,7 +83,9 @@ eval {
     if ($acme_node_config && $acme_node_config->{domains}) {
         my $cert = PVE::CertHelpers::cert_path_prefix($nodename) . ".pem";
         if (-e $cert) {
-            if (PVE::Certificate::check_expiry($cert, time() + 30 * 24 * 60 * 60)) {
+            my $lead_time = PVE::Certificate::get_cert_renew_lead_time($cert);
+
+            if (PVE::Certificate::check_expiry($cert, time() + $lead_time)) {
                 PVE::API2::ACME->renew_certificate({ node => $nodename });
             } else {
                 syslog(
-- 
2.47.3





      parent reply	other threads:[~2026-10-21  9:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21  9:52 [PATCH common/manager v3 0/4] fix #8006: acme: lifetime-based certificate renewal threshold David Riley
2026-10-21  9:52 ` [PATCH pve-common v3 1/4] certificate: add helper to extract validity period David Riley
2026-10-21  9:52 ` [PATCH pve-common v3 2/4] certificate: add helper for lifetime-based ACME renewal lead time David Riley
2026-10-21  9:52 ` [PATCH pve-manager v3 3/4] fix #8006: api: acme: use lifetime-based certificate " David Riley
2026-10-21  9:52 ` David Riley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261021095229.50842-5-d.riley@proxmox.com \
    --to=d.riley@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal