Merge remote-tracking branch 'origin/errcode' into errcode

This commit is contained in:
withchao 2023-04-12 18:16:14 +08:00
commit 9910f98d1a
3 changed files with 30 additions and 24 deletions

View File

@ -171,9 +171,9 @@ services:
- prometheus - prometheus
network_mode: "host" network_mode: "host"
node-exporter: # node-exporter:
image: quay.io/prometheus/node-exporter # image: quay.io/prometheus/node-exporter
container_name: node-exporter # container_name: node-exporter
restart: always # restart: always
ports: # ports:
- "9100:9100" # - "9100:9100"

View File

@ -3,8 +3,6 @@
echo "Welcome to the Open-IM-Server installation script." echo "Welcome to the Open-IM-Server installation script."
echo "Please select an deploy option:" echo "Please select an deploy option:"
echo "1. docker-compose install" echo "1. docker-compose install"
# echo "2. source code install"
# echo "3. source code install with docker-compose dependence"
echo "2. exit" echo "2. exit"
clear_openimlog() { clear_openimlog() {
@ -19,7 +17,7 @@ is_path() {
fi fi
} }
is_empyt() { is_empty() {
if [ -z "$1" ]; then if [ -z "$1" ]; then
return 1 return 1
else else
@ -51,6 +49,7 @@ edit_config() {
} }
edit_enterprise_config() { edit_enterprise_config() {
echo "Is edit enterprise config.yaml?" echo "Is edit enterprise config.yaml?"
echo "1. vi edit enterprise config" echo "1. vi edit enterprise config"
echo "2. do not edit enterprise config" echo "2. do not edit enterprise config"
@ -68,7 +67,7 @@ edit_enterprise_config() {
install_docker_compose() { install_docker_compose() {
echo "Please input the installation path, default is $(pwd)/Open-IM-Server, press enter to use default" echo "Please input the installation path, default is $(pwd)/Open-IM-Server, press enter to use default"
read install_path read install_path
is_empyt $install_path is_empty $install_path
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
install_path="." install_path="."
fi fi
@ -78,7 +77,7 @@ install_docker_compose() {
cd $install_path cd $install_path
is_directory_exists "${install_path}/Open-IM-Server" is_directory_exists "${install_path}/Open-IM-Server"
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
echo "Error: Directory $install_path/Open-IM-Server exist, please ensure your path" echo "WARNING: Directory $install_path/Open-IM-Server exist, please ensure your path"
echo "1. delete the directory and install" echo "1. delete the directory and install"
echo "2. exit" echo "2. exit"
read choice read choice
@ -92,50 +91,57 @@ install_docker_compose() {
esac esac
fi fi
rm -rf ./Open-IM-Server rm -rf ./Open-IM-Server
set -e
git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive; git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive;
set +e
cd ./Open-IM-Server cd ./Open-IM-Server
git checkout errcode git checkout errcode
echo "======== git clone success ========" echo "======== git clone success ========"
source .env source .env
echo "Please input the components data directory, deault is ${DATA_DIR} press enter to use default" if [ $DATA_DIR = "./" ]; then
DATA_DIR=$(pwd)/components
fi
echo "Please input the components data directory, deault is ${DATA_DIR}, press enter to use default"
read NEW_DATA_DIR read NEW_DATA_DIR
is_empyt $NEW_DATA_DIR is_empty $NEW_DATA_DIR
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
DATA_DIR=$NEW_DATA_DIR DATA_DIR=$NEW_DATA_DIR
fi fi
echo "Please input the user, deault is root, press enter to use default" echo "Please input the user, deault is root, press enter to use default"
read NEW_USER read NEW_USER
is_empyt $NEW_USER is_empty $NEW_USER
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
USER=$NEW_USER USER=$NEW_USER
fi fi
echo "Please input the password, default is openIM123, press enter to use default" echo "Please input the password, default is openIM123, press enter to use default"
read NEW_PASSWORD read NEW_PASSWORD
is_empyt $NEW_PASSWORD is_empty $NEW_PASSWORD
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
PASSWORD=$NEW_PASSWORD PASSWORD=$NEW_PASSWORD
fi fi
echo "Please input the minio_endpoint, default will detect auto, press enter to use default:" echo "Please input the minio_endpoint, default will detect auto, press enter to use default"
read NEW_MINIO_ENDPOINT read NEW_MINIO_ENDPOINT
is_empyt $NEW_MINIO_ENDPOINT is_empty $NEW_MINIO_ENDPOINT
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
internet_ip=`curl ifconfig.me -s` internet_ip=`curl ifconfig.me -s`
MINIO_ENDPOINT="http://${internet_ip}:10005" MINIO_ENDPOINT="http://${internet_ip}:10005"
else else
MINIO_ENDPOINT=$NEW_MINIO_ENDPOINT MINIO_ENDPOINT=$NEW_MINIO_ENDPOINT
fi fi
set -e
export MINIO_ENDPOINT export MINIO_ENDPOINT
export USER export USER
export PASSWORD export PASSWORD
export DATA_DIR export DATA_DIR
sed -i "s/^MINIO_ENDPOINT=.*/MINIO_ENDPOINT=$MINIO_ENDPOINT/" .env
sed -i "s/^USER=.*/USER=$USER/" .env
sed -i "s/^PASSWORD=.*/PASSWORD=$PASSWORD/" .env
sed -i "s/^DATA_DIR=.*/DATA_DIR=$DATA_DIR/" .env
cat <<EOF > .env
USER=${USER}
PASSWORD=${PASSWORD}
MINIO_ENDPOINT=${MINIO_ENDPOINT}
DATA_DIR=${DATA_DIR}
EOF
edit_config edit_config
edit_enterprise_config edit_enterprise_config

View File

@ -3,7 +3,7 @@ echo "docker-compose ps..........................."
docker-compose ps docker-compose ps
echo "check OpenIM, waiting 30s...................." echo "check OpenIM, waiting 30s...................."
sleep 30 sleep 60
echo "check OpenIM................................" echo "check OpenIM................................"
./check_all.sh ./check_all.sh