[pve-devel] [PATCH manager 2/3] api: apt: use new dc proxy option
    Maximiliano Sandoval 
    m.sandoval at proxmox.com
       
    Tue Oct 21 12:03:29 CEST 2025
    
    
  
Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 PVE/API2/APT.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm
index 1ccbaf97..521cee9d 100644
--- a/PVE/API2/APT.pm
+++ b/PVE/API2/APT.pm
@@ -336,8 +336,11 @@ __PACKAGE__->register_method({
             # setup proxy for apt
 
             my $aptconf = "// no proxy configured\n";
-            if ($dcconf->{http_proxy}) {
-                $aptconf = "Acquire::http::Proxy \"$dcconf->{http_proxy}\";\n";
+            if (my $http_proxy = PVE::Cluster::get_proxy($dcconf, 'http', 'apt')) {
+                $aptconf = "Acquire::http::Proxy \"$http_proxy\";\n";
+            }
+            if (my $https_proxy = PVE::Cluster::get_proxy($dcconf, 'https', 'apt')) {
+                $aptconf .= "Acquire::https::Proxy \"$https_proxy\";\n";
             }
             my $aptcfn = "/etc/apt/apt.conf.d/76pveproxy";
             PVE::Tools::file_set_contents($aptcfn, $aptconf);
-- 
2.47.3
    
    
More information about the pve-devel
mailing list