pull/218/head
wangchuxiao 3 years ago
parent 13473eeb4d
commit 4a8d37bde1

@ -93,6 +93,8 @@ credential: #腾讯cos发送图片、视频、文件时需要请自行申
bucket: openim
location: us-east-1
endpoint: http://127.0.0.1:9000
endpointInner: http://127.0.0.1:9000 #minio内网地址
endpointInnerEnable: true #是否启用minio内网地址 启用可以让桶初始化IM server连接minio走内网地址访问
accessKeyID: user12345
secretAccessKey: key12345
ali: # ali oss

@ -17,7 +17,14 @@ var (
func MinioInit() {
operationID := utils.OperationIDGenerator()
log.NewInfo(operationID, utils.GetSelfFuncName(), "minio config: ", config.Config.Credential.Minio)
minioUrl, err := url2.Parse(config.Config.Credential.Minio.Endpoint)
var initUrl string
if config.Config.Credential.Minio.EndpointInnerEnable {
initUrl = config.Config.Credential.Minio.EndpointInner
} else {
initUrl = config.Config.Credential.Minio.Endpoint
}
log.NewInfo(operationID, utils.GetSelfFuncName(), "use initUrl: ", initUrl)
minioUrl, err := url2.Parse(initUrl)
if err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), "parse failed, please check config/config.yaml", err.Error())
return

@ -61,6 +61,8 @@ type config struct {
Endpoint string `yaml:"endpoint"`
AccessKeyID string `yaml:"accessKeyID"`
SecretAccessKey string `yaml:"secretAccessKey"`
EndpointInner string `yaml:"endpointInner"`
EndpointInnerEnable bool `yaml:"endpointInnerEnable"`
} `yaml:"minio"`
}

Loading…
Cancel
Save