Merge remote-tracking branch 'upstream/main'

pull/2040/head
skiffer-git 8 months ago
commit ae78ea479e

@ -0,0 +1,20 @@
# Version logging for OpenIM
<!-- BEGIN MUNGE: GENERATED_TOC -->
<!-- END MUNGE: GENERATED_TOC -->
<a name="unreleased"></a>
## [Unreleased]
<a name="v3.6.0"></a>
## v3.6.0 - 2024-03-07
### Reverts
- update etcd to v3.5.2 ([#206](https://github.com/openimsdk/open-im-server/issues/206))
### Pull Requests
- Merge branch 'tuoyun'
[Unreleased]: https://github.com/openimsdk/open-im-server/compare/v3.6.0...HEAD

@ -101,7 +101,16 @@ function openim::tools::start_service() {
cmd="${cmd} --prometheus_port ${prometheus_port}"
fi
openim::log::status "Starting binary ${binary_name}..."
${cmd} | tee -a "${LOG_FILE}"
${cmd}
local status=$?
if [ $status -eq 0 ]; then
openim::log::info "Service ${binary_name} started successfully."
return 0
else
openim::log::error "Failed to start service ${binary_name}."
return 1
fi
}
function openim::tools::start() {
@ -118,8 +127,12 @@ function openim::tools::pre-start() {
openim::log::info "Preparing to start OpenIM Tools..."
for tool in "${OPENIM_TOOLS_PRE_START_NAME_LISTARIES[@]}"; do
openim::log::info "Starting tool ${tool}..."
openim::tools::start_service ${tool} ${OPNEIM_CONFIG}
if ! openim::tools::start_service ${tool} ${OPNEIM_CONFIG}; then
openim::log::error "Failed to start ${tool}, aborting..."
return 1
fi
done
openim::log::info "All tools started successfully."
}
function openim::tools::post-start() {

@ -83,10 +83,18 @@ fi
# TODO Prelaunch tools, simple for now, can abstract functions later
TOOLS_START_SCRIPTS_PATH=${START_SCRIPTS_PATH}/openim-tools.sh
openim::log::status "\n## Pre Starting OpenIM services"
${TOOLS_START_SCRIPTS_PATH} openim::tools::pre-start
openim::log::print_blue "\n## Pre Starting OpenIM services"
if ! ${TOOLS_START_SCRIPTS_PATH} openim::tools::pre-start; then
openim::log::error "Pre Starting OpenIM services failed, aborting..."
exit 1
fi
openim::log::print_blue "Pre Starting OpenIM services processed successfully"
result=$("${OPENIM_ROOT}"/scripts/stop-all.sh)
if [[ $? -ne 0 ]]; then
openim::log::error "View the error logs from this startup. ${LOG_FILE} \n"

@ -102,7 +102,14 @@ func main() {
if !check.flag {
err = check.function(check.config)
if err != nil {
allSuccess = false
if errors.Is(err, errMinioNotEnabled) {
fmt.Println(err.Error())
checks[index].flag = true
}
if errors.Is(err, errSignEndPoint) {
fmt.Fprintf(os.Stderr, err.Error())
checks[index].flag = true
}
component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error()))
if !strings.Contains(errs.Unwrap(err).Error(), "connection refused") &&
!strings.Contains(errs.Unwrap(err).Error(), "timeout waiting") {
@ -125,6 +132,11 @@ func main() {
os.Exit(-1)
}
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
func checkMongo(config *config.GlobalConfig) error {
mongoStu := &component.Mongo{
@ -153,10 +165,16 @@ func checkRedis(config *config.GlobalConfig) error {
// checkMinio checks the MinIO connection
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, "config.Object.ApiURL: "+config.Object.ApiURL)
}
if config.Object.Enable != "minio" {
return errs.Wrap(errors.New("minio.Enable is empty"))
return errs.Wrap(errMinioNotEnabled, "config.Object.Enable: "+config.Object.Enable)
}
if strings.Contains(config.Object.Minio.Endpoint, "127.0.0.1") {
return errs.Wrap(errSignEndPoint, "config.Object.Minio.Endpoint: "+config.Object.Minio.Endpoint)
}
minio := &component.Minio{
ApiURL: config.Object.ApiURL,
Endpoint: config.Object.Minio.Endpoint,

Loading…
Cancel
Save