feat: add support for path style buckets
This commit is contained in:
@@ -132,6 +132,7 @@ emojis = [128, 128]
|
|||||||
#
|
#
|
||||||
# Backblaze B2:
|
# Backblaze B2:
|
||||||
# - endpoint is listed on the "Buckets" page
|
# - endpoint is listed on the "Buckets" page
|
||||||
|
# - path_style_buckets is set to true
|
||||||
# - region is `eu-central-003` string from endpoint URL
|
# - region is `eu-central-003` string from endpoint URL
|
||||||
# - access_key_id is keyID generated on the "Application Keys" page
|
# - access_key_id is keyID generated on the "Application Keys" page
|
||||||
# - secret_access_key is token generated on the "Application Keys" page
|
# - secret_access_key is token generated on the "Application Keys" page
|
||||||
@@ -139,6 +140,9 @@ emojis = [128, 128]
|
|||||||
|
|
||||||
# S3 protocol endpoint
|
# S3 protocol endpoint
|
||||||
endpoint = "http://minio:9000"
|
endpoint = "http://minio:9000"
|
||||||
|
# Whether to use path-style buckets
|
||||||
|
# Generally true, except for MinIO
|
||||||
|
path_style_buckets = false
|
||||||
# S3 region name
|
# S3 region name
|
||||||
region = "minio"
|
region = "minio"
|
||||||
# S3 protocol key ID
|
# S3 protocol key ID
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ pub struct FilesLimit {
|
|||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub struct FilesS3 {
|
pub struct FilesS3 {
|
||||||
pub endpoint: String,
|
pub endpoint: String,
|
||||||
|
pub path_style_buckets: bool,
|
||||||
pub region: String,
|
pub region: String,
|
||||||
pub access_key_id: String,
|
pub access_key_id: String,
|
||||||
pub secret_access_key: String,
|
pub secret_access_key: String,
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ pub fn create_client(s3_config: FilesS3) -> Client {
|
|||||||
let config = Config::builder()
|
let config = Config::builder()
|
||||||
.region(Region::new(s3_config.region))
|
.region(Region::new(s3_config.region))
|
||||||
.endpoint_url(s3_config.endpoint)
|
.endpoint_url(s3_config.endpoint)
|
||||||
|
.force_path_style(s3_config.path_style_buckets)
|
||||||
.credentials_provider(creds)
|
.credentials_provider(creds)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user