[pbs-devel] [PATCH proxmox-backup 4/4] fix #3296: use proxy client to retrieve changelog

Dylan Whyte d.whyte at proxmox.com
Fri May 7 12:53:03 CEST 2021


Signed-off-by: Dylan Whyte <d.whyte at proxmox.com>
---
 src/api2/node/apt.rs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/api2/node/apt.rs b/src/api2/node/apt.rs
index 44b13edd..96a0f530 100644
--- a/src/api2/node/apt.rs
+++ b/src/api2/node/apt.rs
@@ -6,6 +6,7 @@ use proxmox::list_subdirs_api_method;
 use proxmox::api::{api, RpcEnvironment, RpcEnvironmentType, Permission};
 use proxmox::api::router::{Router, SubdirMap};
 
+use crate::config::node;
 use crate::server::WorkerTask;
 use crate::tools::{apt, http::SimpleHttp, subscription};
 
@@ -194,7 +195,13 @@ fn apt_get_changelog(
         bail!("Package '{}' not found", name);
     }
 
-    let mut client = SimpleHttp::new(None); // TODO: pass proxy_config
+    let proxy_config = if let Ok((node_config, _digest)) = node::config() {
+        node_config.http_proxy()
+    } else {
+        None
+    };
+
+    let mut client = SimpleHttp::new(proxy_config);
 
     let changelog_url = &pkg_info[0].change_log_url;
     // FIXME: use 'apt-get changelog' for proxmox packages as well, once repo supports it
-- 
2.20.1






More information about the pbs-devel mailing list