all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 3/3] api: nodes: use new dc proxy option
Date: Tue, 21 Oct 2025 12:03:30 +0200	[thread overview]
Message-ID: <20251021100332.251697-7-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20251021100332.251697-1-m.sandoval@proxmox.com>

For the 'apl_download' and the 'query_url_metadata' API endpoints.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 PVE/API2/Nodes.pm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 4590b618..fde8229b 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -1750,7 +1750,8 @@ __PACKAGE__->register_method({
                     hash_required => 1,
                     sha512sum => $appliance->{sha512sum},
                     md5sum => $appliance->{md5sum},
-                    http_proxy => $dccfg->{http_proxy},
+                    http_proxy => PVE::Cluster::get_proxy($dccfg, 'http', 'download'),
+                    https_proxy => PVE::Cluster::get_proxy($dccfg, 'https', 'download'),
                 },
             );
         };
@@ -1818,8 +1819,12 @@ __PACKAGE__->register_method({
         $ua->agent("Proxmox VE");
 
         my $dccfg = PVE::Cluster::cfs_read_file('datacenter.cfg');
-        if ($dccfg->{http_proxy}) {
-            $ua->proxy(['http', 'https'], $dccfg->{http_proxy});
+        if (my $http_proxy = PVE::Cluster::get_proxy($dccfg, 'http', 'download')) {
+            $ua->proxy('http', $http_proxy);
+        }
+
+        if (my $https_proxy = PVE::Cluster::get_proxy($dccfg, 'https', 'download')) {
+            $ua->proxy('https', $https_proxy);
         }
 
         my $verify = $param->{'verify-certificates'} // 1;
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-10-21 10:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 10:03 [pve-devel] [RFC cluster/manager/storage 0/7] datacenter config: add setting for HTTP{, S} proxies Maximiliano Sandoval
2025-10-21 10:03 ` [pve-devel] [PATCH cluster 1/3] " Maximiliano Sandoval
2025-10-21 10:03 ` [pve-devel] [PATCH cluster 2/3] datacenter config: deprecate http_proxy Maximiliano Sandoval
2025-10-21 10:03 ` [pve-devel] [PATCH cluster 3/3] cluster: add helper to retrieve proxies Maximiliano Sandoval
2025-10-21 10:03 ` [pve-devel] [PATCH manager 1/3] api: subscription: use new proxy dc option Maximiliano Sandoval
2025-10-21 10:03 ` [pve-devel] [PATCH manager 2/3] api: apt: use new dc proxy option Maximiliano Sandoval
2025-10-21 10:03 ` Maximiliano Sandoval [this message]
2025-10-21 10:03 ` [pve-devel] [PATCH storage 1/1] api: storage: status: " Maximiliano Sandoval

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=20251021100332.251697-7-m.sandoval@proxmox.com \
    --to=m.sandoval@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