Skip to content

Commit 31f7eed

Browse files
authored
docs: fix s3 docs for force-path-style (#1596)
1 parent 0c18c6b commit 31f7eed

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

docs/authentication_and_upload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,5 @@ rattler-build upload s3 \
169169
--channel s3://my-bucket/my-channel \
170170
--region auto \
171171
--endpoint-url https://xyz.r2.cloudflarestorage.com \
172-
--force-path-style true
172+
--force-path-style
173173
```

docs/reference/cli.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ This document contains the help content for the `rattler-build` command-line pro
5050
- Possible values: `true`, `false`
5151

5252

53+
- `--config-file <CONFIG_FILE>`
54+
55+
The rattler-build configuration file to use
56+
57+
5358
- `--color <COLOR>`
5459

5560
Enable or disable colored output from rattler-build. Also honors the `CLICOLOR` and `CLICOLOR_FORCE` environment variable

src/upload/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use opendal::{Configurator, Operator, services::S3Config};
88
use reqwest_retry::{RetryDecision, RetryPolicy, policies::ExponentialBackoff};
99
use std::{
1010
fmt::Write,
11+
net::Ipv4Addr,
1112
path::{Path, PathBuf},
1213
time::{Duration, SystemTime},
1314
};
@@ -283,6 +284,15 @@ pub async fn upload_package_to_s3(
283284
.host_str()
284285
.ok_or_else(|| miette::miette!("Failed to get host from channel URL"))?;
285286

287+
if let Some(host_endpoint) = endpoint_url.host_str() {
288+
if host_endpoint.parse::<Ipv4Addr>().is_ok() && !force_path_style {
289+
return Err(miette::miette!(
290+
"Endpoint URL {} (IPv4 address) cannot be used without path style, please use --force-path-style",
291+
endpoint_url
292+
));
293+
}
294+
}
295+
286296
let mut s3_config = S3Config::default();
287297
s3_config.root = Some(channel.path().to_string());
288298
s3_config.bucket = bucket.to_string();

0 commit comments

Comments
 (0)