From 7f90eb55a94ddf1e39bb3d83a5955a39735672e8 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Wed, 30 Aug 2023 18:33:55 +0800 Subject: [PATCH] feat: update openim-web Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- .env | 1 - build/images/openim-api/Dockerfile | 2 +- build/images/openim-cmdutils/Dockerfile | 2 +- build/images/openim-crontask/Dockerfile | 2 +- build/images/openim-msggateway/Dockerfile | 2 +- build/images/openim-msgtransfer/Dockerfile | 2 +- build/images/openim-push/Dockerfile | 2 +- build/images/openim-rpc-auth/Dockerfile | 2 +- build/images/openim-rpc-conversation/Dockerfile | 2 +- build/images/openim-rpc-friend/Dockerfile | 2 +- build/images/openim-rpc-group/Dockerfile | 2 +- build/images/openim-rpc-msg/Dockerfile | 2 +- build/images/openim-rpc-third/Dockerfile | 2 +- build/images/openim-rpc-user/Dockerfile | 2 +- build/images/openim-tools/openim-web/Dockerfile | 2 +- deployments/templates/env_template.yaml | 8 +++++++- install.sh | 1 - scripts/install/environment.sh | 5 +++++ 18 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.env b/.env index 6a83dfd97..c5c5ba375 100644 --- a/.env +++ b/.env @@ -11,7 +11,6 @@ API_URL=http://127.0.0.1:10002 # Directory path for storing data files or related information DATA_DIR=./ - # ============ Component Extension Configuration ========== # Address or hostname for the ZooKeeper service (often used in distributed systems for maintaining configuration information) ZOOKEEPER_ADDRESS=127.0.0.1 diff --git a/build/images/openim-api/Dockerfile b/build/images/openim-api/Dockerfile index 0686f48fc..878689e47 100644 --- a/build/images/openim-api/Dockerfile +++ b/build/images/openim-api/Dockerfile @@ -47,6 +47,6 @@ ENV CONFIG=/openim/openim-server/config EXPOSE $PORT -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-api /usr/bin/openim-api +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-api /usr/bin/openim-api CMD ["bash", "-c", "openim-api -c $CONFIG --port $PORT"] diff --git a/build/images/openim-cmdutils/Dockerfile b/build/images/openim-cmdutils/Dockerfile index 8b0b6c587..56923fe8a 100644 --- a/build/images/openim-cmdutils/Dockerfile +++ b/build/images/openim-cmdutils/Dockerfile @@ -42,7 +42,7 @@ WORKDIR /openim/openim-server COPY --from=builder $OPENIM_SERVER_BINDIR/platforms /openim/openim-server/_output/bin/platforms COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-cmdutils /usr/bin/openim-cmdutils +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-cmdutils /usr/bin/openim-cmdutils ENTRYPOINT ["openim-cmdutils"] diff --git a/build/images/openim-crontask/Dockerfile b/build/images/openim-crontask/Dockerfile index d5453a67a..1472af624 100644 --- a/build/images/openim-crontask/Dockerfile +++ b/build/images/openim-crontask/Dockerfile @@ -43,6 +43,6 @@ COPY --from=builder /openim/openim-server/config /openim/openim-server/config ENV CONFIG=/openim/openim-server/config -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-crontask /usr/bin/openim-crontask +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-crontask /usr/bin/openim-crontask CMD ["bash", "-c", "openim-crontask -c $CONFIG"] diff --git a/build/images/openim-msggateway/Dockerfile b/build/images/openim-msggateway/Dockerfile index b7be4474d..c823643cb 100644 --- a/build/images/openim-msggateway/Dockerfile +++ b/build/images/openim-msggateway/Dockerfile @@ -48,6 +48,6 @@ ENV CONFIG=/openim/openim-server/config EXPOSE $PORT EXPOSE $WS_PORT -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-msggateway /usr/bin/openim-msggateway +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-msggateway /usr/bin/openim-msggateway CMD ["bash", "-c", "openim-msggateway -c $CONFIG --port $PORT --ws_port $WS_PORT"] \ No newline at end of file diff --git a/build/images/openim-msgtransfer/Dockerfile b/build/images/openim-msgtransfer/Dockerfile index 4522659c7..247529ce4 100644 --- a/build/images/openim-msgtransfer/Dockerfile +++ b/build/images/openim-msgtransfer/Dockerfile @@ -41,6 +41,6 @@ WORKDIR /openim/openim-server COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms COPY --from=builder /openim/openim-server/config /openim/openim-server/config -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-msgtransfer /usr/bin/openim-msgtransfer +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-msgtransfer /usr/bin/openim-msgtransfer ENTRYPOINT ["bash", "-c", "if [[ -n $PROMETHEUS_PORT ]]; then openim-msgtransfer -c $CONFIG --prometheus_port $PROMETHEUS_PORT; else openim-msgtransfer -c $CONFIG; fi"] \ No newline at end of file diff --git a/build/images/openim-push/Dockerfile b/build/images/openim-push/Dockerfile index 2955edc4a..de7f3a2b7 100644 --- a/build/images/openim-push/Dockerfile +++ b/build/images/openim-push/Dockerfile @@ -48,6 +48,6 @@ ENV PORT 10170 \ EXPOSE $PORT -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-push /usr/bin/openim-push +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-push /usr/bin/openim-push ENTRYPOINT ["bash", "-c", "if [[ -n $PROMETHEUS_PORT ]]; then openim-push -c $CONFIG --port $PORT --prometheus_port $PROMETHEUS_PORT; else openim-push -c $CONFIG --port $PORT; fi"] \ No newline at end of file diff --git a/build/images/openim-rpc-auth/Dockerfile b/build/images/openim-rpc-auth/Dockerfile index 615594c3d..880ff7737 100644 --- a/build/images/openim-rpc-auth/Dockerfile +++ b/build/images/openim-rpc-auth/Dockerfile @@ -47,6 +47,6 @@ ENV CONFIG=/openim/openim-server/config EXPOSE $PORT -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-auth /usr/bin/openim-rpc-auth +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-auth /usr/bin/openim-rpc-auth ENTRYPOINT ["bash", "-c", "if [[ -n $PROMETHEUS_PORT ]]; then "openim-rpc-auth --port $PORT -c $CONFIG" --prometheus_port $PROMETHEUS_PORT; else "openim-rpc-auth --port $PORT -c $CONFIG"; fi"] \ No newline at end of file diff --git a/build/images/openim-rpc-conversation/Dockerfile b/build/images/openim-rpc-conversation/Dockerfile index c566b5f5f..337722715 100644 --- a/build/images/openim-rpc-conversation/Dockerfile +++ b/build/images/openim-rpc-conversation/Dockerfile @@ -49,6 +49,6 @@ ENV PORT 10230 \ EXPOSE $PORT EXPOSE $PROMETHEUS_PORT -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-conversation /usr/bin/openim-rpc-conversation +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-conversation /usr/bin/openim-rpc-conversation ENTRYPOINT ["bash", "-c", "if [[ -n $PROMETHEUS_PORT ]]; then "openim-rpc-conversation --port $PORT -c $CONFIG" --prometheus_port $PROMETHEUS_PORT; else "openim-rpc-conversation --port $PORT -c $CONFIG"; fi"] \ No newline at end of file diff --git a/build/images/openim-rpc-friend/Dockerfile b/build/images/openim-rpc-friend/Dockerfile index 8c5f1c55e..ae3c2c716 100644 --- a/build/images/openim-rpc-friend/Dockerfile +++ b/build/images/openim-rpc-friend/Dockerfile @@ -49,6 +49,6 @@ ENV PORT 10120 \ EXPOSE $PORT EXPOSE $PROMETHEUS_PORT -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-friend /usr/bin/openim-rpc-friend +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-friend /usr/bin/openim-rpc-friend ENTRYPOINT ["bash", "-c", "if [[ -n $PROMETHEUS_PORT ]]; then "openim-rpc-friend --port $PORT -c $CONFIG" --prometheus_port $PROMETHEUS_PORT; else "openim-rpc-friend --port $PORT -c $CONFIG"; fi"] diff --git a/build/images/openim-rpc-group/Dockerfile b/build/images/openim-rpc-group/Dockerfile index 83cf3a969..6fc3c9597 100644 --- a/build/images/openim-rpc-group/Dockerfile +++ b/build/images/openim-rpc-group/Dockerfile @@ -49,6 +49,6 @@ ENV PORT 10150 \ EXPOSE $PORT EXPOSE $PROMETHEUS_PORT -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-group /usr/bin/openim-rpc-group +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-group /usr/bin/openim-rpc-group ENTRYPOINT ["bash", "-c", "if [[ -n $PROMETHEUS_PORT ]]; then "openim-rpc-group --port $PORT -c $CONFIG" --prometheus_port $PROMETHEUS_PORT; else "openim-rpc-group --port $PORT -c $CONFIG"; fi"] \ No newline at end of file diff --git a/build/images/openim-rpc-msg/Dockerfile b/build/images/openim-rpc-msg/Dockerfile index ed71a5657..3ad24ba8b 100644 --- a/build/images/openim-rpc-msg/Dockerfile +++ b/build/images/openim-rpc-msg/Dockerfile @@ -49,6 +49,6 @@ ENV PORT 10130 \ EXPOSE $PORT EXPOSE $PROMETHEUS_PORT -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-msg /usr/bin/openim-rpc-msg +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-msg /usr/bin/openim-rpc-msg ENTRYPOINT ["bash", "-c", "if [[ -n $PROMETHEUS_PORT ]]; then "openim-rpc-msg --port $PORT -c $CONFIG" --prometheus_port $PROMETHEUS_PORT; else "openim-rpc-msg --port $PORT -c $CONFIG"; fi"] \ No newline at end of file diff --git a/build/images/openim-rpc-third/Dockerfile b/build/images/openim-rpc-third/Dockerfile index bb9456a76..d413ed81e 100644 --- a/build/images/openim-rpc-third/Dockerfile +++ b/build/images/openim-rpc-third/Dockerfile @@ -48,6 +48,6 @@ ENV PORT 10200 \ EXPOSE $PORT -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-third /usr/bin/openim-rpc-third +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-third /usr/bin/openim-rpc-third ENTRYPOINT ["bash", "-c", "if [[ -n $PROMETHEUS_PORT ]]; then "openim-rpc-third --port $PORT -c $CONFIG" --prometheus_port $PROMETHEUS_PORT; else "openim-rpc-third --port $PORT -c $CONFIG"; fi"] diff --git a/build/images/openim-rpc-user/Dockerfile b/build/images/openim-rpc-user/Dockerfile index 6bfe06a26..1ccb577ef 100644 --- a/build/images/openim-rpc-user/Dockerfile +++ b/build/images/openim-rpc-user/Dockerfile @@ -47,6 +47,6 @@ ENV PORT 10110 \ EXPOSE $PORT -RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-user /usr/bin/openim-rpc-user +RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-rpc-user /usr/bin/openim-rpc-user ENTRYPOINT ["bash", "-c", "if [[ -n $PROMETHEUS_PORT ]]; then "openim-rpc-user --port $PORT -c $CONFIG" --prometheus_port $PROMETHEUS_PORT; else "openim-rpc-user --port $PORT -c $CONFIG"; fi"] diff --git a/build/images/openim-tools/openim-web/Dockerfile b/build/images/openim-tools/openim-web/Dockerfile index 7fd0b6140..fc5c7bc76 100644 --- a/build/images/openim-tools/openim-web/Dockerfile +++ b/build/images/openim-tools/openim-web/Dockerfile @@ -52,6 +52,6 @@ ENV DISTPATH /openim/openim-server/dist EXPOSE $PORT -RUN ln ${OPENIM_SERVER_BINDIR}/tools/$(get_os)/$(get_arch)/openim-web /usr/bin/openim-web +RUN mv ${OPENIM_SERVER_BINDIR}/tools/$(get_os)/$(get_arch)/openim-web /usr/bin/openim-web ENTRYPOINT ["bash", "-c", "openim-web -port $PORT -distPath $DISTPATH"] \ No newline at end of file diff --git a/deployments/templates/env_template.yaml b/deployments/templates/env_template.yaml index 9441f24d6..14a88b28b 100644 --- a/deployments/templates/env_template.yaml +++ b/deployments/templates/env_template.yaml @@ -32,6 +32,7 @@ DATA_DIR=${DATA_DIR} # ============ Component Extension Configuration ========== # Address or hostname for the ZooKeeper service (often used in distributed systems for maintaining configuration information) ZOOKEEPER_ADDRESS=${ZOOKEEPER_ADDRESS} +ZOOKEEPER_PORT=${ZOOKEEPER_PORT} # Port on which MySQL database service is running MYSQL_PORT=${MYSQL_PORT} @@ -83,4 +84,9 @@ MINIO_SECRET_KEY=${MINIO_SECRET_KEY} # ================== OpenIM Web =========================== OPENIM_WEB_DIST_PATH=${OPENIM_WEB_DIST_PATH} -OPENIM_WEB_PPRT=${OPENIM_WEB_PPRT} \ No newline at end of file +OPENIM_WEB_PPRT=${OPENIM_WEB_PPRT} + + +# =================== BRANCH NAME ========================= +CHAT_BRANCH=${CHAT_BRANCH} +SERVER_BRANCH=${SERVER_BRANCH} \ No newline at end of file diff --git a/install.sh b/install.sh index c159a7f12..7dba0a39e 100755 --- a/install.sh +++ b/install.sh @@ -20,7 +20,6 @@ set -e set -o pipefail - ############################## OpenIM Github ############################## # ... rest of the script ... diff --git a/scripts/install/environment.sh b/scripts/install/environment.sh index 90d6d89d6..3294b6801 100755 --- a/scripts/install/environment.sh +++ b/scripts/install/environment.sh @@ -61,6 +61,11 @@ mkdir -p ${INSTALL_DIR} def "ENV_FILE" ""${OPENIM_ROOT}"/scripts/install/environment.sh" +###################### Docker compose ################### +# OPENIM AND CHAT +def "CHAT_BRANCH" "main" +def "SERVER_BRANCH" "main" + ###################### openim 配置 ###################### # read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployment/init/README.md def "OPENIM_DATA_DIR" "/data/openim"