Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

fix for baidu cloud storage

chrisludd4880d55a19
diff --git a/weed/remote_storage/s3/baidu.go b/weed/remote_storage/s3/baidu.go
index 32976c4a07..5c175e74be 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