Skip to content

Commit 21a33f0

Browse files
Construct backblaze aws session for uploads
1 parent 8abb527 commit 21a33f0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pushd_plugin.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/aws/aws-sdk-go/aws/session"
1919
"github.com/aws/aws-sdk-go/service/s3"
2020
"github.com/google/uuid"
21+
"github.com/imgproxy/imgproxy/v3/config"
2122
)
2223

2324
var pushdPath = "/pushd"
@@ -116,7 +117,11 @@ func createMD5Hash(data []byte) string {
116117
func uploadToS3(data []byte, s3Key string, uploaded chan bool) {
117118
md5Hash := createMD5Hash(data)
118119
log.Infof("Uploading rendered image to: %s with md5 hash: %s", s3Key, md5Hash)
119-
awsSession, err := session.NewSession()
120+
awsSession, err := session.NewSession(&aws.Config{
121+
Endpoint: aws.String(config.S3Endpoint),
122+
Region: aws.String(config.S3Region),
123+
S3ForcePathStyle: aws.Bool(true),
124+
})
120125
if err != nil {
121126
log.Error(err.Error())
122127
return

0 commit comments

Comments
 (0)