1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-12-01 01:16:08 +02:00

[#156] added forcePathStyle to the s3 config

This commit is contained in:
Gani Georgiev
2022-07-19 10:45:38 +03:00
parent 571c4dcc8d
commit 73fb12c2bc
13 changed files with 116 additions and 96 deletions

View File

@@ -35,15 +35,17 @@ func NewS3(
endpoint string,
accessKey string,
secretKey string,
s3ForcePathStyle bool,
) (*System, error) {
ctx := context.Background() // default context
cred := credentials.NewStaticCredentials(accessKey, secretKey, "")
sess, err := session.NewSession(&aws.Config{
Region: aws.String(region),
Endpoint: aws.String(endpoint),
Credentials: cred,
Region: aws.String(region),
Endpoint: aws.String(endpoint),
Credentials: cred,
S3ForcePathStyle: aws.Bool(s3ForcePathStyle),
})
if err != nil {
return nil, err