fix: scripts fix

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/926/head
Xinwei Xiong(cubxxw-openim) 2 years ago
parent 17bc9596da
commit 9c4517ac05
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE

@ -50,7 +50,7 @@ COPY --from=builder /openim/openim-server/dist /openim/openim-server/dist
ENV PORT 11001
ENV DISTPATH /openim/openim-server/dist
EXPOSE $PORT
EXPOSE 11001
RUN mv ${OPENIM_SERVER_BINDIR}/tools/$(get_os)/$(get_arch)/openim-web /usr/bin/openim-web

@ -144,7 +144,7 @@ source ./environment.sh
cat > openim-api.service.template <<EOF
[Unit]
Description=OpenIM Server API
Documentation=https://github.com/marmotedu/iam/blob/master/init/README.md
Documentation=https://github.com/oepnimsdk/open-im-server/blob/master/init/README.md
[Service]
WorkingDirectory=${OPENIM_DATA_DIR}/openim-api
@ -179,7 +179,7 @@ do
cat > $service.service.template <<EOF
[Unit]
Description=OpenIM Server - $service
Documentation=https://github.com/marmotedu/iam/blob/master/init/README.md
Documentation=https://github.com/oepnimsdk/open-im-server/blob/master/init/README.md
[Service]
WorkingDirectory=${OPENIM_DATA_DIR}/$service

@ -105,8 +105,8 @@ services:
# - "${OPENIM_WEB_PPRT}:11001"
openim-server:
image: ghcr.io/openimsdk/openim-server:main
# image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:main
# image: ghcr.io/openimsdk/openim-server:main
image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:main
# image: openim/openim-server:main
container_name: openim-server
healthcheck:

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Wait for Kafka to be ready
until /opt/bitnami/kafka/bin/kafka-topics.sh --list --bootstrap-server localhost:9092; do
echo "Waiting for Kafka to be ready..."
sleep 2
done
# Create topics
/opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 8 --topic latestMsgToRedis
/opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 8 --topic msgToPush
/opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 8 --topic offlineMsgToMongoMysql
echo "Topics created."

@ -38,7 +38,6 @@
# Note: Before executing this script, ensure that the necessary permissions are granted and relevant environmental variables are set.
#
set -o errexit
set +o nounset
set -o pipefail
@ -122,7 +121,8 @@ function openim::rpc::start() {
# start all rpc services
for ((i = 0; i < ${#OPENIM_RPC_SERVICE_LISTARIES[*]}; i++)); do
openim::util::stop_services_with_name ${OPENIM_RPC_SERVICE_LISTARIES[$i]}
# openim::util::stop_services_with_name ${OPENIM_RPC_SERVICE_LISTARIES
openim::util::stop_services_on_ports {OPENIM_RPC_PORT_LISTARIES[$i]}
openim::log::info "OpenIM ${OPENIM_RPC_SERVICE_LISTARIES[$i]} config path: ${OPENIM_RPC_CONFIG}"
# Get the service and Prometheus ports.

@ -280,8 +280,13 @@ openim::util::check_ports() {
local pid=$(echo $details | awk '{print $2}')
local fd=$(echo $details | awk '{print $3}')
# Get the start time of the process using the PID
if [[ -z $pid ]]; then
local start_time="N/A"
else
# Get the start time of the process using the PID
local start_time=$(ps -p $pid -o lstart=)
fi
started+=("Port $port - Command: $command, PID: $pid, FD: $fd, Started: $start_time")
fi

@ -6,8 +6,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/marmotedu/iam v1.7.0 h1:9aWg5Enx+npHU9kxQ0eYsdXvbiGeUsuuzxaV49BQa0I=
github.com/marmotedu/iam v1.7.0/go.mod h1:kjQ1Tzr+M6/B49DSC3Zky+2Ai9vAr6PbhuHV8mWUS48=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=

Loading…
Cancel
Save