aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-08-06 20:53:03 -0700
committerchrislu <chris.lu@gmail.com>2025-08-06 20:53:05 -0700
commitdd4880d55a193709a2eb05b39d7326ef7834457a (patch)
treebfc563ec6bb44f9d8f4fa6995d912dcb514bb9db
parent4af182f88001033440f5d397f26b1c6f5e7635e1 (diff)
downloadseaweedfs-dd4880d55a193709a2eb05b39d7326ef7834457a.tar.xz
seaweedfs-dd4880d55a193709a2eb05b39d7326ef7834457a.zip
fix for baidu cloud storage
-rw-r--r--weed/remote_storage/s3/baidu.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/remote_storage/s3/baidu.go b/weed/remote_storage/s3/baidu.go
index 32976c4a0..5c175e74b 100644
--- a/weed/remote_storage/s3/baidu.go
+++ b/weed/remote_storage/s3/baidu.go
@@ -2,14 +2,16 @@ package s3
import (
"fmt"
+ "os"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
+ v4 "github.com/aws/aws-sdk-go/aws/signer/v4"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
- "os"
)
func init() {
@@ -33,7 +35,7 @@ func (s BaiduRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storag
config := &aws.Config{
Endpoint: aws.String(conf.BaiduEndpoint),
Region: aws.String(conf.BaiduRegion),
- S3ForcePathStyle: aws.Bool(true),
+ S3ForcePathStyle: aws.Bool(false),
S3DisableContentMD5Validation: aws.Bool(true),
}
if accessKey != "" && secretKey != "" {
@@ -44,6 +46,7 @@ func (s BaiduRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storag
if err != nil {
return nil, fmt.Errorf("create baidu session: %w", err)
}
+ sess.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
sess.Handlers.Build.PushFront(skipSha256PayloadSigning)
client.conn = s3.New(sess)
return client, nil