From: Jonas Theisen <j.theisen@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-mamager v3 3/3] fix #8031: api: cluster options: update APT proxy config on change
Date: Mon, 12 Oct 2026 16:45:36 +0200 [thread overview]
Message-ID: <20261012144603.288276-4-j.theisen@proxmox.com> (raw)
In-Reply-To: <20261012144603.288276-1-j.theisen@proxmox.com>
Changing the http_proxy datacenter option did not update the APT
proxy config until the next package database update. Write it right
away, so APT on all nodes uses the new proxy immediately.
Do so while still holding the datacenter.cfg lock, so concurrent
changes cannot write the APT config in a different order than the
datacenter config.
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=8031
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
PVE/API2/Cluster.pm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm
index 4e5efbfd..29820c59 100644
--- a/PVE/API2/Cluster.pm
+++ b/PVE/API2/Cluster.pm
@@ -23,6 +23,7 @@ use PVE::Tools qw(extract_param);
use PVE::API2::ACMEAccount;
use PVE::API2::ACMEPlugin;
+use PVE::API2::APT;
use PVE::API2::Backup;
use PVE::API2::Cluster::BackupInfo;
use PVE::API2::Cluster::BulkAction;
@@ -842,8 +843,17 @@ __PACKAGE__->register_method({
code => sub {
my ($param) = @_;
+ my $http_proxy_change = 0;
+
my $delete = extract_param($param, 'delete');
+ if (
+ defined($param->{http_proxy})
+ || (defined($delete) && $delete =~ m/\bhttp_proxy\b/)
+ ) {
+ $http_proxy_change = 1;
+ }
+
cfs_lock_file(
'datacenter.cfg',
undef,
@@ -855,6 +865,8 @@ __PACKAGE__->register_method({
delete $conf->{$_} for PVE::Tools::split_list($delete);
cfs_write_file('datacenter.cfg', $conf);
+
+ PVE::API2::APT::update_apt_proxy_config($conf) if $http_proxy_change;
},
);
die $@ if $@;
--
2.47.3
next prev parent reply other threads:[~2026-10-12 14:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 14:45 [PATCH pve-mamager v3 0/3] fix #8031: Write APT proxy config on http_proxy change Jonas Theisen
2026-10-12 14:45 ` [PATCH pve-mamager v3 1/3] api: apt: factor out writing the APT proxy config Jonas Theisen
2026-10-12 14:45 ` [PATCH pve-mamager v3 2/3] api: apt: move proxy config to pmxcfs and symlink to it Jonas Theisen
2026-10-12 14:45 ` Jonas Theisen [this message]
2026-10-12 14:58 ` [PATCH pve-mamager v3 0/3] fix #8031: Write APT proxy config on http_proxy change Jonas Theisen
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=20261012144603.288276-4-j.theisen@proxmox.com \
--to=j.theisen@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox