mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-29 05:38:45 +08:00
fix bug
This commit is contained in:
parent
ef9c291d9a
commit
9136838b63
@ -47,8 +47,10 @@ func MinioInit() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
opt := minio.MakeBucketOptions{
|
opt := minio.MakeBucketOptions{
|
||||||
Region: config.Config.Credential.Minio.Location,
|
Region: config.Config.Credential.Minio.Location,
|
||||||
ObjectLocking: false,
|
}
|
||||||
|
if config.Config.Credential.Minio.IsDistributedMod == true {
|
||||||
|
opt.ObjectLocking = true
|
||||||
}
|
}
|
||||||
err = MinioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.Bucket, opt)
|
err = MinioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.Bucket, opt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -161,6 +161,7 @@ func MinioStorageCredential(c *gin.Context) {
|
|||||||
resp.BucketName = config.Config.Credential.Minio.Bucket
|
resp.BucketName = config.Config.Credential.Minio.Bucket
|
||||||
resp.StsEndpointURL = config.Config.Credential.Minio.Endpoint
|
resp.StsEndpointURL = config.Config.Credential.Minio.Endpoint
|
||||||
resp.StorageTime = config.Config.Credential.Minio.StorageTime
|
resp.StorageTime = config.Config.Credential.Minio.StorageTime
|
||||||
|
resp.IsDistributedMod = config.Config.Credential.Minio.IsDistributedMod
|
||||||
c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp})
|
c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,12 +7,13 @@ type MinioStorageCredentialReq struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MiniostorageCredentialResp struct {
|
type MiniostorageCredentialResp struct {
|
||||||
SecretAccessKey string `json:"secretAccessKey"`
|
SecretAccessKey string `json:"secretAccessKey"`
|
||||||
AccessKeyID string `json:"accessKeyID"`
|
AccessKeyID string `json:"accessKeyID"`
|
||||||
SessionToken string `json:"sessionToken"`
|
SessionToken string `json:"sessionToken"`
|
||||||
BucketName string `json:"bucketName"`
|
BucketName string `json:"bucketName"`
|
||||||
StsEndpointURL string `json:"stsEndpointURL"`
|
StsEndpointURL string `json:"stsEndpointURL"`
|
||||||
StorageTime int `json:"storageTime"`
|
StorageTime int `json:"storageTime"`
|
||||||
|
IsDistributedMod bool `json:"isDistributedMod"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MinioUploadFileReq struct {
|
type MinioUploadFileReq struct {
|
||||||
|
@ -72,6 +72,7 @@ type config struct {
|
|||||||
EndpointInner string `yaml:"endpointInner"`
|
EndpointInner string `yaml:"endpointInner"`
|
||||||
EndpointInnerEnable bool `yaml:"endpointInnerEnable"`
|
EndpointInnerEnable bool `yaml:"endpointInnerEnable"`
|
||||||
StorageTime int `yaml:"storageTime"`
|
StorageTime int `yaml:"storageTime"`
|
||||||
|
IsDistributedMod bool `yaml:"isDistributedMod"`
|
||||||
} `yaml:"minio"`
|
} `yaml:"minio"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user