mirror of
https://github.com/ZizzyDizzyMC/linx-server.git
synced 2026-01-23 02:14:33 +00:00
Add -s3-force-path-style flag and config option (#157)
This option forces path-style addressing instead of using a subdomain. This appears to be needed by Minio.
This commit is contained in:
parent
35c4415f8d
commit
207c19e3df
3 changed files with 9 additions and 3 deletions
|
|
@ -177,7 +177,7 @@ func (b S3Backend) List() ([]string, error) {
|
|||
return output, nil
|
||||
}
|
||||
|
||||
func NewS3Backend(bucket string, region string, endpoint string) S3Backend {
|
||||
func NewS3Backend(bucket string, region string, endpoint string, forcePathStyle bool) S3Backend {
|
||||
awsConfig := &aws.Config{}
|
||||
if region != "" {
|
||||
awsConfig.Region = aws.String(region)
|
||||
|
|
@ -185,6 +185,9 @@ func NewS3Backend(bucket string, region string, endpoint string) S3Backend {
|
|||
if endpoint != "" {
|
||||
awsConfig.Endpoint = aws.String(endpoint)
|
||||
}
|
||||
if forcePathStyle == true {
|
||||
awsConfig.S3ForcePathStyle = aws.Bool(true)
|
||||
}
|
||||
|
||||
sess := session.Must(session.NewSession(awsConfig))
|
||||
svc := s3.New(sess)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue