Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: update s3 config

Steven387bf48fc8ee
diff --git a/plugin/storage/s3/s3.go b/plugin/storage/s3/s3.go
index 3063f784e..221116c89 100644
--- a/plugin/storage/s3/s3.go
+++ b/plugin/storage/s3/s3.go
@@ -21,13 +21,7 @@ type Client struct {
}
func NewClient(ctx context.Context, s3Config *storepb.StorageS3Config) (*Client, error) {
- resolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...any) (aws.Endpoint, error) {
- return aws.Endpoint{
- URL: s3Config.Endpoint,
- }, nil
- })
cfg, err := config.LoadDefaultConfig(ctx,
- config.WithEndpointResolverWithOptions(resolver),
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(s3Config.AccessKeyId, s3Config.AccessKeySecret, "")),
config.WithRegion(s3Config.Region),
)
@@ -35,7 +29,9 @@ func NewClient(ctx context.Context, s3Config *storepb.StorageS3Config) (*Client,
return nil, errors.Wrap(err, "failed to load s3 config")
}
- client := s3.NewFromConfig(cfg)
+ client := s3.NewFromConfig(cfg, func(o *s3.Options) {
+ o.BaseEndpoint = aws.String(s3Config.Endpoint)
+ })
return &Client{
Client: client,
Bucket: aws.String(s3Config.Bucket),