Add a new flag to support S3 path style URLs without disabling SSL
The use case for this came up in Discord - someone is running a custom self hosted instance where they're using MinIO as their "production S3", but it is not local (so they don't want the clients to connect without SSL). So we need a way to get MinIO to work, which needs path style URLs, without also disabling the SSL.
This commit is contained in:
parent
87d39ae2dd
commit
92ae1be40a
2 changed files with 16 additions and 4 deletions
|
@ -113,10 +113,7 @@ s3:
|
|||
#
|
||||
# 1. Disable SSL.
|
||||
#
|
||||
# 2. Use "path" style S3 URLs where the bucket is part of the URL path, e.g.
|
||||
# http://localhost:3200/b2-eu-cen. By default the bucket name is part of
|
||||
# the (sub)domain, e.g. http://b2-eu-cen.localhost:3200/ and cannot be
|
||||
# resolved when running locally.
|
||||
# 2. Use "path" style S3 URLs (see `use_path_style_urls` below).
|
||||
#
|
||||
# 3. Directly download the file during replication instead of going via the
|
||||
# Cloudflare worker.
|
||||
|
@ -125,6 +122,17 @@ s3:
|
|||
# not support them, specifically it doesn't support GLACIER).
|
||||
#
|
||||
#are_local_buckets: true
|
||||
# Uncomment this to use "path" style S3 URLs.
|
||||
#
|
||||
# By default the bucket name is part of the (sub)domain, e.g.
|
||||
# http://b2-eu-cen.localhost:3200/. If this is true, then we use "path"
|
||||
# style S3 URLs where the bucket is part of the URL path, e.g.
|
||||
# http://localhost:3200/b2-eu-cen.
|
||||
#
|
||||
# This is useful in scenarios when sub-domain based addressing cannot be
|
||||
# resolved, e.g. when running a local instance, or when using MinIO as a
|
||||
# production store.
|
||||
#use_path_style_urls: true
|
||||
|
||||
# Key used for encrypting customer emails before storing them in DB
|
||||
#
|
||||
|
|
|
@ -104,6 +104,7 @@ func (config *S3Config) initialize() {
|
|||
config.s3Configs = make(map[string]*aws.Config)
|
||||
config.s3Clients = make(map[string]s3.S3)
|
||||
|
||||
usePathStyleURLs := viper.GetBool("s3.use_path_style_urls")
|
||||
areLocalBuckets := viper.GetBool("s3.are_local_buckets")
|
||||
config.areLocalBuckets = areLocalBuckets
|
||||
|
||||
|
@ -116,6 +117,9 @@ func (config *S3Config) initialize() {
|
|||
Endpoint: aws.String(viper.GetString("s3." + dc + ".endpoint")),
|
||||
Region: aws.String(viper.GetString("s3." + dc + ".region")),
|
||||
}
|
||||
if usePathStyleURLs {
|
||||
s3Config.S3ForcePathStyle = aws.Bool(true)
|
||||
}
|
||||
if areLocalBuckets {
|
||||
s3Config.DisableSSL = aws.Bool(true)
|
||||
s3Config.S3ForcePathStyle = aws.Bool(true)
|
||||
|
|
Loading…
Add table
Reference in a new issue