From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 097CF1FF0AE for ; Tue, 15 Sep 2026 10:03:15 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 73AB3215C7; Tue, 15 Sep 2026 10:03:10 +0200 (CEST) From: Maximiliano Sandoval To: Jonas Theisen Subject: Re: [PATCH pve-manager v2 2/2] fix #8031: write APT proxy config on http_proxy change In-Reply-To: <20260914152423.410631-3-j.theisen@proxmox.com> (Jonas Theisen's message of "Mon, 14 Sep 2026 17:24:12 +0200") References: <20260914152423.410631-1-j.theisen@proxmox.com> <20260914152423.410631-3-j.theisen@proxmox.com> User-Agent: mu4e 1.12.9; emacs 30.1 Date: Tue, 15 Sep 2026 10:03:03 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1789459369408 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.832 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: AMUUROWREA3XGV27JORYRFE75UPH3DZP X-Message-ID-Hash: AMUUROWREA3XGV27JORYRFE75UPH3DZP X-MailFrom: m.sandoval@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: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Jonas Theisen writes: > Writes the necessary file for APT if the http_proxy variable > on the datacenter level is changed. > > This reuses the same function from the APT API for a regular > database update. > > Signed-off-by: Jonas Theisen > --- > PVE/API2/Cluster.pm | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm > index 4e5efbfd..8529c026 100644 > --- a/PVE/API2/Cluster.pm > +++ b/PVE/API2/Cluster.pm > @@ -36,6 +36,7 @@ use PVE::API2::ClusterConfig; > use PVE::API2::Firewall::Cluster; > use PVE::API2::HAConfig; > use PVE::API2::ReplicationConfig; > +use PVE::API2::APT; > > my $have_sdn; > eval { > @@ -842,7 +843,11 @@ __PACKAGE__->register_method({ > code => sub { > my ($param) = @_; > > + my $http_proxy_change = 0; > + > my $delete = extract_param($param, 'delete'); > + $http_proxy_change = 1 > + if ((defined($param->{http_proxy})) || (defined($delete) && $delete =~ m/\bhttp_proxy\b/ )); Cosmetic stuff: Please run a 'make tidy' to format this file. the whitespace before the '))' at the end will probably trigger the formatter. I don't think you need to use two levels of parenthesis either on the defined($param->{http_proxy} part, but the formatter won't fix that automatically. Regarding the '\b', they look correct to me but I am not sure if this is necessary. This is not a blocked in any case. > > cfs_lock_file( > 'datacenter.cfg', > @@ -859,6 +864,10 @@ __PACKAGE__->register_method({ > ); > die $@ if $@; > > + if ($http_proxy_change) { > + PVE::API2::APT::update_apt_proxy_config(); > + } > + > return undef; > }, > }); Other than that, the patch looks good to me. Reviewed-by: Maximiliano Sandoval -- Maximiliano