From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup 2/3] api: config: allow editing the use-node-config flag for s3 endpoints
Date: Mon, 11 May 2026 17:19:23 +0200 [thread overview]
Message-ID: <20260511151924.901315-3-c.ebner@proxmox.com> (raw)
In-Reply-To: <20260511151924.901315-1-c.ebner@proxmox.com>
Since commit fbf8d1b25 ("fix #6716: pass node http proxy config to s3
backend") the node config is used unconditionally also for S3 API
connections.
This is however not always wanted, therefore add an s3 endpoint
config flag to explicitley opt-in to this behaviour.
Fixes: https://forum.proxmox.com/threads/183436/
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-datastore/src/datastore.rs | 14 ++++++++++++--
src/api2/admin/s3.rs | 8 +++++++-
src/api2/config/s3.rs | 16 +++++++++++++++-
3 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index 34efcd398..38d0d421c 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -494,6 +494,11 @@ impl DataStore {
user: pbs_config::backup_user()?,
base_path: S3_CLIENT_REQUEST_COUNTER_BASE_PATH.into(),
};
+ let http_proxy = if config.config.use_node_proxy.unwrap_or(false) {
+ pbs_config::node::node_http_proxy_config()?
+ } else {
+ None
+ };
let mut options = S3ClientOptions::from_config(
config.config,
@@ -501,7 +506,7 @@ impl DataStore {
Some(bucket),
self.name().to_owned(),
Some(rate_limiter_options),
- pbs_config::node::node_http_proxy_config()?,
+ http_proxy,
Some(request_counter_config),
);
if let Some(notify) = self.inner.thresholds_exceeded_callback {
@@ -3349,6 +3354,11 @@ impl DataStore {
user: pbs_config::backup_user()?,
base_path: S3_CLIENT_REQUEST_COUNTER_BASE_PATH.into(),
};
+ let http_proxy = if client_config.config.use_node_proxy.unwrap_or(false) {
+ pbs_config::node::node_http_proxy_config()?
+ } else {
+ None
+ };
let options = S3ClientOptions::from_config(
client_config.config,
@@ -3356,7 +3366,7 @@ impl DataStore {
Some(bucket),
datastore_config.name.to_owned(),
Some(rate_limiter_options),
- pbs_config::node::node_http_proxy_config()?,
+ http_proxy,
Some(request_counter_config),
);
let s3_client = S3Client::new(options)
diff --git a/src/api2/admin/s3.rs b/src/api2/admin/s3.rs
index 0cc163eb6..d6cc9fb30 100644
--- a/src/api2/admin/s3.rs
+++ b/src/api2/admin/s3.rs
@@ -63,6 +63,12 @@ pub async fn check(
base_path: S3_CLIENT_REQUEST_COUNTER_BASE_PATH.into(),
};
+ let http_proxy = if config.config.use_node_proxy.unwrap_or(false) {
+ pbs_config::node::node_http_proxy_config()?
+ } else {
+ None
+ };
+
let store_prefix = store_prefix.unwrap_or_default();
let options = S3ClientOptions::from_config(
config.config,
@@ -70,7 +76,7 @@ pub async fn check(
Some(bucket),
store_prefix,
None,
- pbs_config::node::node_http_proxy_config()?,
+ http_proxy,
Some(request_counter_config),
);
diff --git a/src/api2/config/s3.rs b/src/api2/config/s3.rs
index 6f5a4cea1..1355b2dff 100644
--- a/src/api2/config/s3.rs
+++ b/src/api2/config/s3.rs
@@ -149,6 +149,8 @@ pub enum DeletableProperty {
BurstOut,
/// Delete the provider quirks property.
ProviderQuirks,
+ /// Delete the use-node-proxy property.
+ UseNodeProxy,
}
#[api(
@@ -233,6 +235,9 @@ pub fn update_s3_client_config(
DeletableProperty::ProviderQuirks => {
data.config.provider_quirks = None;
}
+ DeletableProperty::UseNodeProxy => {
+ data.config.use_node_proxy = None;
+ }
}
}
}
@@ -270,6 +275,9 @@ pub fn update_s3_client_config(
if let Some(provider_quirks) = update.provider_quirks {
data.config.provider_quirks = Some(provider_quirks);
}
+ if let Some(use_node_proxy) = update.use_node_proxy {
+ data.config.use_node_proxy = Some(use_node_proxy);
+ }
if let Some(secret_key) = secret_key {
data.secret_key = secret_key;
@@ -349,13 +357,19 @@ pub async fn list_buckets(
user: pbs_config::backup_user()?,
base_path: S3_CLIENT_REQUEST_COUNTER_BASE_PATH.into(),
};
+ let http_proxy = if config.config.use_node_proxy.unwrap_or(false) {
+ pbs_config::node::node_http_proxy_config()?
+ } else {
+ None
+ };
+
let options = S3ClientOptions::from_config(
config.config,
config.secret_key,
None,
empty_prefix,
None,
- pbs_config::node::node_http_proxy_config()?,
+ http_proxy,
Some(request_counter_config),
);
let client = S3Client::new(options).context("client creation failed")?;
--
2.47.3
next prev parent reply other threads:[~2026-05-11 15:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 15:19 [PATCH proxmox{,-backup} 0/3] add flag to opt-in using node proxy config for s3 connections Christian Ebner
2026-05-11 15:19 ` [PATCH proxmox 1/3] s3-client: add flag to opt-in for using node proxy for connections Christian Ebner
2026-05-11 15:19 ` Christian Ebner [this message]
2026-05-11 15:19 ` [PATCH proxmox-backup 3/3] ui: add opt-in flag for using the node proxy config for s3 connections Christian Ebner
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=20260511151924.901315-3-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-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