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

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

@ -17,7 +17,14 @@ var (
func MinioInit() { func MinioInit() {
operationID := utils.OperationIDGenerator() operationID := utils.OperationIDGenerator()
log.NewInfo(operationID, utils.GetSelfFuncName(), "minio config: ", config.Config.Credential.Minio) 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 { if err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), "parse failed, please check config/config.yaml", err.Error()) log.NewError(operationID, utils.GetSelfFuncName(), "parse failed, please check config/config.yaml", err.Error())
return return

@ -56,11 +56,13 @@ type config struct {
OssRoleArn string `yaml:"OssRoleArn"` OssRoleArn string `yaml:"OssRoleArn"`
} }
Minio struct { Minio struct {
Bucket string `yaml:"bucket"` Bucket string `yaml:"bucket"`
Location string `yaml:"location"` Location string `yaml:"location"`
Endpoint string `yaml:"endpoint"` Endpoint string `yaml:"endpoint"`
AccessKeyID string `yaml:"accessKeyID"` AccessKeyID string `yaml:"accessKeyID"`
SecretAccessKey string `yaml:"secretAccessKey"` SecretAccessKey string `yaml:"secretAccessKey"`
EndpointInner string `yaml:"endpointInner"`
EndpointInnerEnable bool `yaml:"endpointInnerEnable"`
} `yaml:"minio"` } `yaml:"minio"`
} }

Loading…
Cancel
Save