Merge remote-tracking branch 'origin/main'

pull/1080/head
withchao 2 years ago
commit cce2734798

@ -140,7 +140,10 @@ func (m *Minio) initMinio(ctx context.Context) error {
} }
} }
if conf.PublicRead { if conf.PublicRead {
policy := fmt.Sprintf(`{"Version": "2012-10-17","Statement": [{"Action": ["s3:GetObject","s3:PutObject"],"Effect": "Allow","Principal": {"AWS": ["*"]},"Resource": ["arn:aws:s3:::%s/*"],"Sid": ""}]}`, conf.Bucket) policy := fmt.Sprintf(
`{"Version": "2012-10-17","Statement": [{"Action": ["s3:GetObject","s3:PutObject"],"Effect": "Allow","Principal": {"AWS": ["*"]},"Resource": ["arn:aws:s3:::%s/*"],"Sid": ""}]}`,
conf.Bucket,
)
if err := m.core.Client.SetBucketPolicy(ctx, conf.Bucket, policy); err != nil { if err := m.core.Client.SetBucketPolicy(ctx, conf.Bucket, policy); err != nil {
return err return err
} }

@ -18,7 +18,6 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
"net/http" "net/http"
"net/url" "net/url"
"reflect" "reflect"
@ -26,6 +25,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
"github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/config"
"github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3"
) )

Loading…
Cancel
Save