mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 10:52:33 +08:00
minio.Enable is not configured to use MinIO, therefore the image server is not checked
This commit is contained in:
parent
bdfe3ff6e9
commit
722639ae50
@ -102,12 +102,10 @@ func main() {
|
|||||||
if !check.flag {
|
if !check.flag {
|
||||||
err = check.function(check.config)
|
err = check.function(check.config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if check.name == "Minio" {
|
|
||||||
if errors.Is(err, errMinioNotEnabled) {
|
if errors.Is(err, errMinioNotEnabled) {
|
||||||
fmt.Println("minio.Enable is not configured to use MinIO, therefore the image server is not checked")
|
fmt.Println("minio.Enable is not configured to use MinIO, therefore the image server is not checked")
|
||||||
checks[index].flag = true
|
checks[index].flag = true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
allSuccess = false
|
allSuccess = false
|
||||||
component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error()))
|
component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error()))
|
||||||
if !strings.Contains(errs.Unwrap(err).Error(), "connection refused") &&
|
if !strings.Contains(errs.Unwrap(err).Error(), "connection refused") &&
|
||||||
@ -133,6 +131,9 @@ func main() {
|
|||||||
|
|
||||||
var errMinioNotEnabled = errors.New("minio.Enable is not configured to use MinIO")
|
var errMinioNotEnabled = errors.New("minio.Enable is not configured to use MinIO")
|
||||||
|
|
||||||
|
var errSignEndPoint = errors.New("minio.signEndPoint contains 127.0.0.1, causing issues with image sending")
|
||||||
|
var errApiURL = errors.New("object.apiURL contains 127.0.0.1, causing issues with image sending")
|
||||||
|
|
||||||
// checkMongo checks the MongoDB connection without retries
|
// checkMongo checks the MongoDB connection without retries
|
||||||
func checkMongo(config *config.GlobalConfig) error {
|
func checkMongo(config *config.GlobalConfig) error {
|
||||||
mongoStu := &component.Mongo{
|
mongoStu := &component.Mongo{
|
||||||
@ -161,10 +162,16 @@ func checkRedis(config *config.GlobalConfig) error {
|
|||||||
|
|
||||||
// checkMinio checks the MinIO connection
|
// checkMinio checks the MinIO connection
|
||||||
func checkMinio(config *config.GlobalConfig) error {
|
func checkMinio(config *config.GlobalConfig) error {
|
||||||
// Check if MinIO is enabled
|
if strings.Contains(config.Object.ApiURL, "127.0.0.1") {
|
||||||
|
return errs.Wrap(errApiURL)
|
||||||
|
}
|
||||||
if config.Object.Enable != "minio" {
|
if config.Object.Enable != "minio" {
|
||||||
return errs.Wrap(errMinioNotEnabled)
|
return errs.Wrap(errMinioNotEnabled)
|
||||||
}
|
}
|
||||||
|
if strings.Contains(config.Object.Minio.Endpoint, "127.0.0.1") {
|
||||||
|
return errs.Wrap(errSignEndPoint)
|
||||||
|
}
|
||||||
|
|
||||||
minio := &component.Minio{
|
minio := &component.Minio{
|
||||||
ApiURL: config.Object.ApiURL,
|
ApiURL: config.Object.ApiURL,
|
||||||
Endpoint: config.Object.Minio.Endpoint,
|
Endpoint: config.Object.Minio.Endpoint,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user