From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 19C281FF0C0 for ; Wed, 21 Oct 2026 11:53:24 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 69FF72170D; Wed, 21 Oct 2026 11:53:04 +0200 (CEST) From: David Riley To: pve-devel@lists.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 Message-ID: <20261021095229.50842-5-d.riley@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261021095229.50842-1-d.riley@proxmox.com> References: <20261021095229.50842-1-d.riley@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792576371107 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.652 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: F5QZQRE7RQANPY43QHYIVZW2XRM2HQJV X-Message-ID-Hash: F5QZQRE7RQANPY43QHYIVZW2XRM2HQJV X-MailFrom: d.riley@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Riley X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Michael Köppl Tested-by: Michael Köppl --- 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