From 822d5d7afe96f261857b0882d80435da7d042dab Mon Sep 17 00:00:00 2001 From: Gordon <46924906+FGadvancer@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:10:22 +0800 Subject: [PATCH] fix: add test port. --- docker-compose-a.yml | 194 +++++++++++ env-a.sh | 52 +++ scripts/install/environment-a.sh | 549 +++++++++++++++++++++++++++++++ 3 files changed, 795 insertions(+) create mode 100644 docker-compose-a.yml create mode 100644 env-a.sh create mode 100644 scripts/install/environment-a.sh diff --git a/docker-compose-a.yml b/docker-compose-a.yml new file mode 100644 index 0000000000..a15a00dc97 --- /dev/null +++ b/docker-compose-a.yml @@ -0,0 +1,194 @@ +#fixme Clone openIM Server project before using docker-compose,project address:https://github.com/OpenIMSDK/Open-IM-Server.git +version: '3' + +networks: + server: + driver: bridge + ipam: + driver: default + config: + - subnet: '${DOCKER_BRIDGE_SUBNET}' + gateway: '${DOCKER_BRIDGE_GATEWAY}' + +services: + mysql: + image: mysql:5.7 + ports: + - "${MYSQL_PORT}:3306" + container_name: mysql-a + volumes: + - "${DATA_DIR}/components/mysql/data:/var/lib/mysql" + - "/etc/localtime:/etc/localtime" + environment: + MYSQL_ROOT_PASSWORD: "${MYSQL_PASSWORD}" + restart: always + networks: + server: + ipv4_address: ${MYSQL_NETWORK_ADDRESS} + + mongodb: + image: mongo:6.0.2 + ports: + - "${MONGO_PORT}:27017" + container_name: mongo-a + command: --wiredTigerCacheSizeGB 1 --auth + volumes: + - "${DATA_DIR}/components/mongodb/data/db:/data/db" + - "${DATA_DIR}/components/mongodb/data/logs:/data/logs" + - "${DATA_DIR}/components/mongodb/data/conf:/etc/mongo" + - ./scripts/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro" + environment: + - TZ=Asia/Shanghai + - wiredTigerCacheSizeGB=1 + - MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME} + - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD} + - MONGO_INITDB_DATABASE=${MONGO_DATABASE} + restart: always + networks: + server: + ipv4_address: ${MONGO_NETWORK_ADDRESS} + + redis: + image: redis:7.0.0 + container_name: redis-a + ports: + - "${REDIS_PORT}:6379" + volumes: + - "${DATA_DIR}/components/redis/data:/data" + - "${DATA_DIR}/components/redis/config/redis.conf:/usr/local/redis/config/redis.conf" + environment: + TZ: Asia/Shanghai + restart: always + sysctls: + net.core.somaxconn: 1024 + command: redis-server --requirepass ${REDIS_PASSWORD} --appendonly yes + networks: + server: + ipv4_address: ${REDIS_NETWORK_ADDRESS} + + zookeeper: + image: bitnami/zookeeper:3.8 + container_name: zookeeper-a + ports: + - "${ZOOKEEPER_PORT}:2181" + volumes: + - "/etc/localtime:/etc/localtime" + environment: + - ALLOW_ANONYMOUS_LOGIN=yes + - TZ="Asia/Shanghai" + restart: always + networks: + server: + ipv4_address: ${ZOOKEEPER_NETWORK_ADDRESS} + + kafka: + image: 'bitnami/kafka:3.5.1' + container_name: kafka-a + user: root + restart: always + ports: + - "${KAFKA_PORT}:9094" + volumes: + - ./scripts/create-topic.sh:/opt/bitnami/kafka/create-topic.sh + - ${DATA_DIR}/components/kafka:/bitnami/kafka + command: > + bash -c " + /opt/bitnami/scripts/kafka/run.sh & sleep 5; /opt/bitnami/kafka/create-topic.sh; wait + " + environment: + - TZ=Asia/Shanghai + - KAFKA_CFG_NODE_ID=0 + - KAFKA_CFG_PROCESS_ROLES=controller,broker + - KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@:9093 + - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094 + - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://${DOCKER_BRIDGE_GATEWAY}:${KAFKA_PORT} + - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT + - KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER + networks: + server: + ipv4_address: ${KAFKA_NETWORK_ADDRESS} + + minio: + image: minio/minio + ports: + - "${MINIO_PORT}:9000" + - "9090:9090" + container_name: minio-a + volumes: + - "${DATA_DIR}/components/mnt/data:/data" + - "${DATA_DIR}/components/mnt/config:/root/.minio" + environment: + MINIO_ROOT_USER: "${MINIO_ACCESS_KEY}" + MINIO_ROOT_PASSWORD: "${MINIO_SECRET_KEY}" + restart: always + command: minio server /data --console-address ':9090' + networks: + server: + ipv4_address: ${MINIO_NETWORK_ADDRESS} + + openim-web: + # image: ghcr.io/openimsdk/openim-web:latest + # image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-web:latest + # image: openim/openim-web:latest + image: ${IMAGE_REGISTRY}/openim-web:latest + container_name: openim-web-a + environment: + - OPENIM_WEB_DIST_PATH=${OPENIM_WEB_DIST_PATH} + - OPENIM_WEB_PORT=${OPENIM_WEB_PORT} + restart: always + ports: + - "${OPENIM_WEB_PORT}:11001" + networks: + server: + ipv4_address: ${OPENIM_WEB_NETWORK_ADDRESS} + + openim-admin: + image: ${IMAGE_REGISTRY}/openim-admin-front:v3.4.0 + # image: ghcr.io/openimsdk/openim-admin-front:v3.4.0 + # image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-admin-front:v3.4.0 + # image: openim/openim-admin-front:v3.4.0 + container_name: openim-admin-a + restart: always + ports: + - "${OPENIM_ADMIN_FRONT_PORT}:80" + networks: + server: + ipv4_address: ${OPENIM_ADMIN_FRONT_NETWORK_ADDRESS} + + prometheus: + image: prom/prometheus + container_name: prometheus-a + hostname: prometheus + restart: always + volumes: + - ./config/prometheus.yml:/etc/prometheus/prometheus.yml + ports: + - "${PROMETHEUS_PORT}:9090" + networks: + server: + ipv4_address: ${PROMETHEUS_NETWORK_ADDRESS} + + grafana: + image: grafana/grafana + container_name: grafana-a + hostname: grafana + user: root + restart: always + ports: + - "${GRAFANA_PORT}:3000" + volumes: + - ${DATA_DIR}/components/grafana:/var/lib/grafana + networks: + server: + ipv4_address: ${GRAFANA_NETWORK_ADDRESS} + + node-exporter: + image: quay.io/prometheus/node-exporter + container_name: node-exporter-a + hostname: node-exporter + restart: always + ports: + - "${NODE_EXPORTER_PORT}:9100" + networks: + server: + ipv4_address: ${NODE_EXPORTER_NETWORK_ADDRESS} \ No newline at end of file diff --git a/env-a.sh b/env-a.sh new file mode 100644 index 0000000000..c67390fee9 --- /dev/null +++ b/env-a.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + + +#export MINIO_ENDPOINT=http://172.30.0.1:10005 +export DOCKER_BRIDGE_SUBNET=172.30.0.0/16 +export ZOOKEEPER_PORT=22181 +export MYSQL_PORT=23306 +export MONGO_PORT=27017 +export REDIS_PORT=26379 +export KAFKA_PORT=29094 +export MINIO_PORT=20005 +export GRAFANA_PORT=2000 +export OPENIM_WEB_PORT=21001 +export OPENIM_WS_PORT=20001 +export API_OPENIM_PORT=20002 +export OPENIM_CHAT_API_PORT=20008 +export OPENIM_ADMIN_API_PORT=20009 +export NODE_EXPORTER_PORT=29100 +export PROMETHEUS_PORT=29090 +export OPENIM_ADMIN_FRONT_PORT=21002 + +export OPENIM_USER_PORT=30110 +export OPENIM_FRIEND_PORT=30120 +export OPENIM_MESSAGE_PORT=30130 +export OPENIM_MESSAGE_GATEWAY_PORT=30140 +export OPENIM_GROUP_PORT=30150 +export OPENIM_AUTH_PORT=30160 +export OPENIM_PUSH_PORT=30170 +export OPENIM_CONVERSATION_PORT=30180 +export OPENIM_THIRD_PORT=30190 +export API_PROM_PORT=30100 +export USER_PROM_PORT=30110 +export FRIEND_PROM_PORT=30120 +export MESSAGE_PROM_PORT=30130 +export MSG_GATEWAY_PROM_PORT=30140 +export GROUP_PROM_PORT=30150 +export AUTH_PROM_PORT=30160 +export PUSH_PROM_PORT=30170 +export CONVERSATION_PROM_PORT=30230 +export RTC_PROM_PORT=31300 +export THIRD_PROM_PORT=31301 +export MSG_TRANSFER_PROM_PORT='31400 31401 31402 31403' + + + + + + + + + + diff --git a/scripts/install/environment-a.sh b/scripts/install/environment-a.sh new file mode 100644 index 0000000000..f441327304 --- /dev/null +++ b/scripts/install/environment-a.sh @@ -0,0 +1,549 @@ +#!/usr/bin/env bash +# Copyright © 2023 OpenIM. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This is a file that initializes variables for the automation script that initializes the config file +# You need to supplement the script according to the specification. +# Read: https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/init-config.md +# 格式化 bash 注释:https://tool.lu/shell/ +# 配置中心文档:https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md + +OPENIM_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" + +# 生成文件存放目录 +LOCAL_OUTPUT_ROOT=""${OPENIM_ROOT}"/${OUT_DIR:-_output}" +source "${OPENIM_ROOT}/scripts/lib/init.sh" + +#TODO: Access to the OPENIM_IP networks outside, or you want to use the OPENIM_IP network +# OPENIM_IP=127.0.0.1 +if [ -z "${OPENIM_IP}" ]; then + OPENIM_IP=$(openim::util::get_server_ip) +fi + +# config.gateway custom bridge modes +# if [ -z "{IP_GATEWAY}" ] then +# IP_GATEWAY=$(openim::util::get_local_ip) +# fi + +function def() { + local var_name="$1" + local default_value="${2:-}" + eval "readonly $var_name=\"\${$var_name:-$(printf '%q' "$default_value")}\"" +} + +# OpenIM Docker Compose 数据存储的默认路径 +def "DATA_DIR" "${OPENIM_ROOT}" + +# 设置统一的用户名,方便记忆 +def "OPENIM_USER" "root" + +# 设置统一的密码,方便记忆 +readonly PASSWORD=${PASSWORD:-'openIM123'} + +# 设置统一的数据库名称,方便管理 +def "DATABASE_NAME" "openIM_v3" + +# Linux系统 openim 用户 +def "LINUX_USERNAME" "openim" +readonly LINUX_PASSWORD=${LINUX_PASSWORD:-"${PASSWORD}"} + +# 设置安装目录 +def "INSTALL_DIR" "${LOCAL_OUTPUT_ROOT}/installs" +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" + +# Choose the appropriate image address, the default is GITHUB image, +# you can choose docker hub, for Chinese users can choose Ali Cloud +# export IMAGE_REGISTRY="ghcr.io/openimsdk" +# export IMAGE_REGISTRY="openim" +# export IMAGE_REGISTRY="registry.cn-hangzhou.aliyuncs.com/openimsdk" +def "IMAGE_REGISTRY" "ghcr.io/openimsdk" +# def "IMAGE_REGISTRY" "openim" +# def "IMAGE_REGISTRY" "registry.cn-hangzhou.aliyuncs.com/openimsdk" + +# Choose the appropriate image tag, the default is the latest version +def "SERVER_IMAGE_TAG" "latest" + +###################### OpenIM Docker Network ###################### +# 设置 Docker 网络的网段 +readonly DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET:-'172.30.0.0/16'} +IP_PREFIX=$(echo $DOCKER_BRIDGE_SUBNET | cut -d '/' -f 1) +SUBNET=$(echo $DOCKER_BRIDGE_SUBNET | cut -d '/' -f 2) +LAST_OCTET=$(echo $IP_PREFIX | cut -d '.' -f 4) + +generate_ip() { + local NEW_IP="$(echo $IP_PREFIX | cut -d '.' -f 1-3).$((LAST_OCTET++))" + echo $NEW_IP +} +LAST_OCTET=$((LAST_OCTET + 1)) +DOCKER_BRIDGE_GATEWAY=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +MYSQL_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +MONGO_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +REDIS_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +KAFKA_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +ZOOKEEPER_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +MINIO_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +OPENIM_WEB_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +OPENIM_SERVER_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +OPENIM_CHAT_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +PROMETHEUS_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +GRAFANA_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +NODE_EXPORTER_NETWORK_ADDRESS=$(generate_ip) +LAST_OCTET=$((LAST_OCTET + 1)) +OPENIM_ADMIN_FRONT_NETWORK_ADDRESS=$(generate_ip) +###################### openim 配置 ###################### +# read: https://github.com/openimsdk/open-im-server/blob/main/deployment/README.md +def "OPENIM_DATA_DIR" "/data/openim" +def "OPENIM_INSTALL_DIR" "/opt/openim" +def "OPENIM_CONFIG_DIR" "/etc/openim/config" +def "OPENIM_LOG_DIR" "/var/log/openim" +def "CA_FILE" "${OPENIM_CONFIG_DIR}/cert/ca.pem" + +def "OPNEIM_CONFIG" ""${OPENIM_ROOT}"/config" +def "OPENIM_SERVER_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # OpenIM服务地址 + +# OpenIM Websocket端口 +readonly OPENIM_WS_PORT=${OPENIM_WS_PORT:-'20001'} + +# OpenIM API端口 +readonly API_OPENIM_PORT=${API_OPENIM_PORT:-'20002'} +def "API_LISTEN_IP" "0.0.0.0" # API的监听IP + +###################### openim-chat 配置信息 ###################### +def "OPENIM_CHAT_DATA_DIR" "./openim-chat/${CHAT_BRANCH}" +def "OPENIM_CHAT_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # OpenIM服务地址 +def "OPENIM_CHAT_API_PORT" "20008" # OpenIM API端口 +def "CHAT_API_LISTEN_IP" "" # OpenIM API的监听IP + +def "OPENIM_ADMIN_API_PORT" "20009" # OpenIM Admin API端口 +def "ADMIN_API_LISTEN_IP" "" # OpenIM Admin API的监听IP + +def "OPENIM_ADMIN_PORT" "30200" # OpenIM chat Admin端口 +def "OPENIM_CHAT_PORT" "30300" # OpenIM chat Admin的监听IP + +def "OPENIM_ADMIN_NAME" "admin" # openim-chat Admin用户名 +def "OPENIM_CHAT_NAME" "chat" # openim-chat chat用户名 + +# TODO 注意: 一般的配置都可以使用 def 函数来定义,如果是包含特殊字符,比如说: +# TODO readonly MSG_DESTRUCT_TIME=${MSG_DESTRUCT_TIME:-'0 2 * * *'} +# TODO 使用 readonly 来定义合适,负责无法正常解析, 并且 yaml 模板需要加 "" 来包裹 +###################### Env 配置信息 ###################### +def "ENVS_DISCOVERY" "zookeeper" + +###################### Zookeeper 配置信息 ###################### +def "ZOOKEEPER_SCHEMA" "openim" # Zookeeper的模式 +def "ZOOKEEPER_PORT" "22181" # Zookeeper的端口 +def "ZOOKEEPER_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # Zookeeper的地址 +def "ZOOKEEPER_USERNAME" "" # Zookeeper的用户名 +def "ZOOKEEPER_PASSWORD" "" # Zookeeper的密码 + +###################### MySQL 配置信息 ###################### +def "MYSQL_PORT" "23306" # MySQL的端口 +def "MYSQL_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # MySQL的地址 +def "MYSQL_USERNAME" "${OPENIM_USER}" # MySQL的用户名 +# MySQL的密码 +readonly MYSQL_PASSWORD=${MYSQL_PASSWORD:-"${PASSWORD}"} +def "MYSQL_DATABASE" "${DATABASE_NAME}" # MySQL的数据库名 +def "MYSQL_MAX_OPEN_CONN" "1000" # 最大打开的连接数 +def "MYSQL_MAX_IDLE_CONN" "100" # 最大空闲连接数 +def "MYSQL_MAX_LIFETIME" "60" # 连接可以重用的最大生命周期(秒) +def "MYSQL_LOG_LEVEL" "4" # 日志级别 +def "MYSQL_SLOW_THRESHOLD" "500" # 慢查询阈值(毫秒) + +###################### MongoDB 配置信息 ###################### +def "MONGO_URI" # MongoDB的URI +def "MONGO_PORT" "27017" # MongoDB的端口 +def "MONGO_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # MongoDB的地址 +def "MONGO_DATABASE" "${DATABASE_NAME}" # MongoDB的数据库名 +def "MONGO_USERNAME" "${OPENIM_USER}" # MongoDB的用户名 +# MongoDB的密码 +readonly MONGO_PASSWORD=${MONGO_PASSWORD:-"${PASSWORD}"} +def "MONGO_MAX_POOL_SIZE" "100" # 最大连接池大小 + +###################### Object 配置信息 ###################### +# app要能访问到此ip和端口或域名 +readonly API_URL=${API_URL:-"http://${OPENIM_IP}:${API_OPENIM_PORT}"} + +def "OBJECT_ENABLE" "minio" # 对象是否启用 +# 对象的API地址 +readonly OBJECT_APIURL=${OBJECT_APIURL:-"${API_URL}"} +def "MINIO_BUCKET" "openim" # MinIO的存储桶名称 +def "MINIO_PORT" "20005" # MinIO的端口 +# MinIO的端点URL +def MINIO_ADDRESS "${DOCKER_BRIDGE_GATEWAY}" +readonly MINIO_ENDPOINT=${MINIO_ENDPOINT:-"http://${MINIO_ADDRESS}:${MINIO_PORT}"} +def "MINIO_ACCESS_KEY" "${OPENIM_USER}" # MinIO的访问密钥ID +readonly MINIO_SECRET_KEY=${MINIO_SECRET_KEY:-"${PASSWORD}"} +def "MINIO_SESSION_TOKEN" # MinIO的会话令牌 +readonly MINIO_SIGN_ENDPOINT=${MINIO_SIGN_ENDPOINT:-"http://${OPENIM_IP}:${MINIO_PORT}"} # signEndpoint为minio公网地址 +def "MINIO_PUBLIC_READ" "false" # 公有读 + +# 腾讯云COS的存储桶URL +def "COS_BUCKET_URL" "https://temp-1252357374.cos.ap-chengdu.myqcloud.com" +def "COS_SECRET_ID" # 腾讯云COS的密钥ID +def "COS_SECRET_KEY" # 腾讯云COS的密钥 +def "COS_SESSION_TOKEN" # 腾讯云COS的会话令牌 +def "COS_PUBLIC_READ" "false" # 公有读 +def "OSS_ENDPOINT" "https://oss-cn-chengdu.aliyuncs.com" # 阿里云OSS的端点URL +def "OSS_BUCKET" "demo-9999999" # 阿里云OSS的存储桶名称 +def "OSS_BUCKET_URL" "https://demo-9999999.oss-cn-chengdu.aliyuncs.com" # 阿里云OSS的存储桶URL +def "OSS_ACCESS_KEY_ID" # 阿里云OSS的访问密钥ID +def "OSS_ACCESS_KEY_SECRET" # 阿里云OSS的密钥 +def "OSS_SESSION_TOKEN" # 阿里云OSS的会话令牌 +def "OSS_PUBLIC_READ" "false" # 公有读 + +###################### Redis 配置信息 ###################### +def "REDIS_PORT" "26379" # Redis的端口 +def "REDIS_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # Redis的地址 +def "REDIS_USERNAME" # Redis的用户名 +readonly REDIS_PASSWORD=${REDIS_PASSWORD:-"${PASSWORD}"} + +###################### Kafka 配置信息 ###################### +def "KAFKA_USERNAME" # `Kafka` 的用户名 +def "KAFKA_PASSWORD" # `Kafka` 的密码 +def "KAFKA_PORT" "29094" # `Kafka` 的端口 +def "KAFKA_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # `Kafka` 的地址 +def "KAFKA_LATESTMSG_REDIS_TOPIC" "latestMsgToRedis" # `Kafka` 的最新消息到Redis的主题 +def "KAFKA_OFFLINEMSG_MONGO_TOPIC" "offlineMsgToMongoMysql" # `Kafka` 的离线消息到Mongo的主题 +def "KAFKA_MSG_PUSH_TOPIC" "msgToPush" # `Kafka` 的消息到推送的主题 +def "KAFKA_CONSUMERGROUPID_REDIS" "redis" # `Kafka` 的消费组ID到Redis +def "KAFKA_CONSUMERGROUPID_MONGO" "mongo" # `Kafka` 的消费组ID到Mongo +def "KAFKA_CONSUMERGROUPID_MYSQL" "mysql" # `Kafka` 的消费组ID到MySql +def "KAFKA_CONSUMERGROUPID_PUSH" "push" # `Kafka` 的消费组ID到推送 + +###################### openim-web 配置信息 ###################### +def "OPENIM_WEB_PORT" "21001" # openim-web的端口 +def "OPENIM_WEB_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # openim-web的地址 +def "OPENIM_WEB_DIST_PATH" "/app/dist" # openim-web的dist路径 + +###################### openim-admin-front 配置信息 ###################### +def "OPENIM_ADMIN_FRONT_PORT" "21002" # openim-admin-front的端口 + +###################### RPC 配置信息 ###################### +def "RPC_REGISTER_IP" # RPC的注册IP +def "RPC_LISTEN_IP" "0.0.0.0" # RPC的监听IP + +###################### prometheus 配置 ###################### +def "PROMETHEUS_PORT" "29090" # Prometheus的端口 +def "PROMETHEUS_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # Prometheus的地址 + +###################### node-exporter 配置 ###################### +def "NODE_EXPORTER_PORT" "29100" # node-exporter的端口 +def "NODE_EXPORTER_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # node-exporter的地址 +###################### Grafana 配置信息 ###################### +def "GRAFANA_PORT" "2000" # Grafana的端口 +def "GRAFANA_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # Grafana的地址 + +###################### RPC Port Configuration Variables ###################### +# For launching multiple programs, just fill in multiple ports separated by commas +# For example: +# readonly OPENIM_USER_PORT=${OPENIM_USER_PORT:-'10110, 10111, 10112'} #Try not to have Spaces + +# OpenIM用户服务端口 +readonly OPENIM_USER_PORT=${OPENIM_USER_PORT:-'30110'} +# OpenIM朋友服务端口 +readonly OPENIM_FRIEND_PORT=${OPENIM_FRIEND_PORT:-'30120'} +# OpenIM消息服务端口 +readonly OPENIM_MESSAGE_PORT=${OPENIM_MESSAGE_PORT:-'30130'} +# OpenIM消息网关服务端口 +readonly OPENIM_MESSAGE_GATEWAY_PORT=${OPENIM_MESSAGE_GATEWAY_PORT:-'30140'} +# OpenIM组服务端口 +readonly OPENIM_GROUP_PORT=${OPENIM_GROUP_PORT:-'30150'} +# OpenIM授权服务端口 +readonly OPENIM_AUTH_PORT=${OPENIM_AUTH_PORT:-'30160'} +# OpenIM推送服务端口 +readonly OPENIM_PUSH_PORT=${OPENIM_PUSH_PORT:-'30170'} +# OpenIM对话服务端口 +readonly OPENIM_CONVERSATION_PORT=${OPENIM_CONVERSATION_PORT:-'30180'} +# OpenIM第三方服务端口 +readonly OPENIM_THIRD_PORT=${OPENIM_THIRD_PORT:-'30190'} + +###################### RPC Register Name Variables ###################### +def "OPENIM_USER_NAME" "User" # OpenIM用户服务名称 +def "OPENIM_FRIEND_NAME" "Friend" # OpenIM朋友服务名称 +def "OPENIM_MSG_NAME" "Msg" # OpenIM消息服务名称 +def "OPENIM_PUSH_NAME" "Push" # OpenIM推送服务名称 +def "OPENIM_MESSAGE_GATEWAY_NAME" "MessageGateway" # OpenIM消息网关服务名称 +def "OPENIM_GROUP_NAME" "Group" # OpenIM组服务名称 +def "OPENIM_AUTH_NAME" "Auth" # OpenIM授权服务名称 +def "OPENIM_CONVERSATION_NAME" "Conversation" # OpenIM对话服务名称 +def "OPENIM_THIRD_NAME" "Third" # OpenIM第三方服务名称 + +###################### Log Configuration Variables ###################### +def "LOG_STORAGE_LOCATION" ""${OPENIM_ROOT}"/logs/" # 日志存储位置 +def "LOG_ROTATION_TIME" "24" # 日志轮替时间 +def "LOG_REMAIN_ROTATION_COUNT" "2" # 保留的日志轮替数量 +def "LOG_REMAIN_LOG_LEVEL" "6" # 保留的日志级别 +def "LOG_IS_STDOUT" "false" # 是否将日志输出到标准输出 +def "LOG_IS_JSON" "false" # 日志是否为JSON格式 +def "LOG_WITH_STACK" "false" # 日志是否带有堆栈信息 + +###################### Variables definition ###################### +def "WEBSOCKET_MAX_CONN_NUM" "100000" # Websocket最大连接数 +def "WEBSOCKET_MAX_MSG_LEN" "4096" # Websocket最大消息长度 +def "WEBSOCKET_TIMEOUT" "10" # Websocket超时 +def "PUSH_ENABLE" "getui" # 推送是否启用 +# GeTui推送URL +readonly GETUI_PUSH_URL=${GETUI_PUSH_URL:-'https://restapi.getui.com/v2/$appId'} +def "GETUI_MASTER_SECRET" "" # GeTui主密钥 +def "GETUI_APP_KEY" "" # GeTui应用密钥 +def "GETUI_INTENT" "" # GeTui推送意图 +def "GETUI_CHANNEL_ID" "" # GeTui渠道ID +def "GETUI_CHANNEL_NAME" "" # GeTui渠道名称 +def "FCM_SERVICE_ACCOUNT" "x.json" # FCM服务账户 +def "JPNS_APP_KEY" "" # JPNS应用密钥 +def "JPNS_MASTER_SECRET" "" # JPNS主密钥 +def "JPNS_PUSH_URL" "" # JPNS推送URL +def "JPNS_PUSH_INTENT" "" # JPNS推送意图 +def "MANAGER_USERID_1" "openIM123456" # 管理员ID 1 +def "MANAGER_USERID_2" "openIM654321" # 管理员ID 2 +def "MANAGER_USERID_3" "openIMAdmin" # 管理员ID 3 +def "NICKNAME_1" "system1" # 昵称1 +def "NICKNAME_2" "system2" # 昵称2 +def "NICKNAME_3" "system3" # 昵称3 +def "MULTILOGIN_POLICY" "1" # 多登录策略 +def "CHAT_PERSISTENCE_MYSQL" "true" # 聊天持久化MySQL +def "MSG_CACHE_TIMEOUT" "86400" # 消息缓存超时 +def "GROUP_MSG_READ_RECEIPT" "true" # 群消息已读回执启用 +def "SINGLE_MSG_READ_RECEIPT" "true" # 单一消息已读回执启用 +def "RETAIN_CHAT_RECORDS" "365" # 保留聊天记录 +# 聊天记录清理时间 +readonly CHAT_RECORDS_CLEAR_TIME=${CHAT_RECORDS_CLEAR_TIME:-'0 2 * * 3'} +# 消息销毁时间 +readonly MSG_DESTRUCT_TIME=${MSG_DESTRUCT_TIME:-'0 2 * * *'} +# 密钥 +readonly SECRET=${SECRET:-"${PASSWORD}"} +def "TOKEN_EXPIRE" "90" # Token到期时间 +def "FRIEND_VERIFY" "false" # 朋友验证 +def "IOS_PUSH_SOUND" "xxx" # IOS推送声音 +def "IOS_BADGE_COUNT" "true" # IOS徽章计数 +def "IOS_PRODUCTION" "false" # IOS生产 + +###################### Prometheus 配置信息 ###################### +# 是否启用 Prometheus +readonly PROMETHEUS_ENABLE=${PROMETHEUS_ENABLE:-'false'} +def "PROMETHEUS_URL" "${GRAFANA_ADDRESS}:${GRAFANA_PORT}" +# Api 服务的 Prometheus 端口 +readonly API_PROM_PORT=${API_PROM_PORT:-'30100'} +# User 服务的 Prometheus 端口 +readonly USER_PROM_PORT=${USER_PROM_PORT:-'30110'} +# Friend 服务的 Prometheus 端口 +readonly FRIEND_PROM_PORT=${FRIEND_PROM_PORT:-'30120'} +# Message 服务的 Prometheus 端口 +readonly MESSAGE_PROM_PORT=${MESSAGE_PROM_PORT:-'30130'} +# Message Gateway 服务的 Prometheus 端口 +readonly MSG_GATEWAY_PROM_PORT=${MSG_GATEWAY_PROM_PORT:-'30140'} +# Group 服务的 Prometheus 端口 +readonly GROUP_PROM_PORT=${GROUP_PROM_PORT:-'30150'} +# Auth 服务的 Prometheus 端口 +readonly AUTH_PROM_PORT=${AUTH_PROM_PORT:-'30160'} +# Push 服务的 Prometheus 端口 +readonly PUSH_PROM_PORT=${PUSH_PROM_PORT:-'30170'} +# Conversation 服务的 Prometheus 端口 +readonly CONVERSATION_PROM_PORT=${CONVERSATION_PROM_PORT:-'30230'} +# RTC 服务的 Prometheus 端口 +readonly RTC_PROM_PORT=${RTC_PROM_PORT:-'31300'} +# Third 服务的 Prometheus 端口 +readonly THIRD_PROM_PORT=${THIRD_PROM_PORT:-'31301'} + +# Message Transfer 服务的 Prometheus 端口列表 +readonly MSG_TRANSFER_PROM_PORT=${MSG_TRANSFER_PROM_PORT:-'31400, 31401, 31402, 31403'} +readonly MSG_TRANSFER_PROM_ADDRESS_PORT=${MSG_TRANSFER_PROM_ADDRESS_PORT:-"${DOCKER_BRIDGE_GATEWAY}:31400, ${DOCKER_BRIDGE_GATEWAY}:31401, ${DOCKER_BRIDGE_GATEWAY}:31402, ${DOCKER_BRIDGE_GATEWAY}:31403"} + +###################### OpenIM openim-api ###################### +def "OPENIM_API_HOST" "127.0.0.1" +def "OPENIM_API_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-api" # OpenIM openim-api 二进制文件路径 +def "OPENIM_API_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-api 配置文件路径 +def "OPENIM_API_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-api" # OpenIM openim-api 日志存储路径 +def "OPENIM_API_LOG_LEVEL" "info" # OpenIM openim-api 日志级别 +def "OPENIM_API_LOG_MAX_SIZE" "100" # OpenIM openim-api 日志最大大小(MB) +def "OPENIM_API_LOG_MAX_BACKUPS" "7" # OpenIM openim-api 日志最大备份数 +def "OPENIM_API_LOG_MAX_AGE" "7" # OpenIM openim-api 日志最大保存时间(天) +def "OPENIM_API_LOG_COMPRESS" "false" # OpenIM openim-api 日志是否压缩 +def "OPENIM_API_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-api 日志是否带有堆栈信息 + +###################### OpenIM openim-cmdutils ###################### +def "OPENIM_CMDUTILS_HOST" "127.0.0.1" +def "OPENIM_CMDUTILS_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-cmdutils" # OpenIM openim-cmdutils 二进制文件路径 +def "OPENIM_CMDUTILS_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-cmdutils 配置文件路径 +def "OPENIM_CMDUTILS_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-cmdutils" # OpenIM openim-cmdutils 日志存储路径 +def "OPENIM_CMDUTILS_LOG_LEVEL" "info" # OpenIM openim-cmdutils 日志级别 +def "OPENIM_CMDUTILS_LOG_MAX_SIZE" "100" # OpenIM openim-cmdutils 日志最大大小(MB) +def "OPENIM_CMDUTILS_LOG_MAX_BACKUPS" "7" # OpenIM openim-cmdutils 日志最大备份数 +def "OPENIM_CMDUTILS_LOG_MAX_AGE" "7" # OpenIM openim-cmdutils 日志最大保存时间(天) +def "OPENIM_CMDUTILS_LOG_COMPRESS" "false" # OpenIM openim-cmdutils 日志是否压缩 +def "OPENIM_CMDUTILS_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-cmdutils 日志是否带有堆栈信息 + +###################### OpenIM openim-crontask ###################### +def "OPENIM_CRONTASK_HOST" "127.0.0.1" +def "OPENIM_CRONTASK_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-crontask" # OpenIM openim-crontask 二进制文件路径 +def "OPENIM_CRONTASK_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-crontask 配置文件路径 +def "OPENIM_CRONTASK_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-crontask" # OpenIM openim-crontask 日志存储路径 +def "OPENIM_CRONTASK_LOG_LEVEL" "info" # OpenIM openim-crontask 日志级别 +def "OPENIM_CRONTASK_LOG_MAX_SIZE" "100" # OpenIM openim-crontask 日志最大大小(MB) +def "OPENIM_CRONTASK_LOG_MAX_BACKUPS" "7" # OpenIM openim-crontask 日志最大备份数 +def "OPENIM_CRONTASK_LOG_MAX_AGE" "7" # OpenIM openim-crontask 日志最大保存时间(天) +def "OPENIM_CRONTASK_LOG_COMPRESS" "false" # OpenIM openim-crontask 日志是否压缩 +def "OPENIM_CRONTASK_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-crontask 日志是否带有堆栈信息 + +###################### OpenIM openim-msggateway ###################### +def "OPENIM_MSGGATEWAY_HOST" "127.0.0.1" +def "OPENIM_MSGGATEWAY_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-msggateway" +def "OPENIM_MSGGATEWAY_CONFIG" ""${OPENIM_ROOT}"/config/" +def "OPENIM_MSGGATEWAY_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-msggateway" +def "OPENIM_MSGGATEWAY_LOG_LEVEL" "info" +def "OPENIM_MSGGATEWAY_LOG_MAX_SIZE" "100" +def "OPENIM_MSGGATEWAY_LOG_MAX_BACKUPS" "7" +def "OPENIM_MSGGATEWAY_LOG_MAX_AGE" "7" +def "OPENIM_MSGGATEWAY_LOG_COMPRESS" "false" +def "OPENIM_MSGGATEWAY_LOG_WITH_STACK" "${LOG_WITH_STACK}" + +# 定义 openim-msggateway 的数量, 默认为 4 +readonly OPENIM_MSGGATEWAY_NUM=${OPENIM_MSGGATEWAY_NUM:-'4'} + +###################### OpenIM openim-msgtransfer ###################### +def "OPENIM_MSGTRANSFER_HOST" "127.0.0.1" +def "OPENIM_MSGTRANSFER_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-msgtransfer" # OpenIM openim-msgtransfer 二进制文件路径 +def "OPENIM_MSGTRANSFER_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-msgtransfer 配置文件路径 +def "OPENIM_MSGTRANSFER_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-msgtransfer" # OpenIM openim-msgtransfer 日志存储路径 +def "OPENIM_MSGTRANSFER_LOG_LEVEL" "info" # OpenIM openim-msgtransfer 日志级别 +def "OPENIM_MSGTRANSFER_LOG_MAX_SIZE" "100" # OpenIM openim-msgtransfer 日志最大大小(MB) +def "OPENIM_MSGTRANSFER_LOG_MAX_BACKUPS" "7" # OpenIM openim-msgtransfer 日志最大备份数 +def "OPENIM_MSGTRANSFER_LOG_MAX_AGE" "7" # OpenIM openim-msgtransfer 日志最大保存时间(天) +def "OPENIM_MSGTRANSFER_LOG_COMPRESS" "false" # OpenIM openim-msgtransfer 日志是否压缩 +def "OPENIM_MSGTRANSFER_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-msgtransfer 日志是否带有堆栈信息 + +###################### OpenIM openim-push ###################### +def "OPENIM_PUSH_HOST" "127.0.0.1" +def "OPENIM_PUSH_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-push" # OpenIM openim-push 二进制文件路径 +def "OPENIM_PUSH_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-push 配置文件路径 +def "OPENIM_PUSH_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-push" # OpenIM openim-push 日志存储路径 +def "OPENIM_PUSH_LOG_LEVEL" "info" # OpenIM openim-push 日志级别 +def "OPENIM_PUSH_LOG_MAX_SIZE" "100" # OpenIM openim-push 日志最大大小(MB) +def "OPENIM_PUSH_LOG_MAX_BACKUPS" "7" # OpenIM openim-push 日志最大备份数 +def "OPENIM_PUSH_LOG_MAX_AGE" "7" # OpenIM openim-push 日志最大保存时间(天) +def "OPENIM_PUSH_LOG_COMPRESS" "false" # OpenIM openim-push 日志是否压缩 +def "OPENIM_PUSH_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-push 日志是否带有堆栈信息 + +###################### OpenIM openim-rpc-auth ###################### +def "OPENIM_RPC_AUTH_HOST" "127.0.0.1" +def "OPENIM_RPC_AUTH_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-rpc-auth" # OpenIM openim-rpc-auth 二进制文件路径 +def "OPENIM_RPC_AUTH_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-rpc-auth 配置文件路径 +def "OPENIM_RPC_AUTH_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-rpc-auth" # OpenIM openim-rpc-auth 日志存储路径 +def "OPENIM_RPC_AUTH_LOG_LEVEL" "info" # OpenIM openim-rpc-auth 日志级别 +def "OPENIM_RPC_AUTH_LOG_MAX_SIZE" "100" # OpenIM openim-rpc-auth 日志最大大小(MB) +def "OPENIM_RPC_AUTH_LOG_MAX_BACKUPS" "7" # OpenIM openim-rpc-auth 日志最大备份数 +def "OPENIM_RPC_AUTH_LOG_MAX_AGE" "7" # OpenIM openim-rpc-auth 日志最大保存时间(天) +def "OPENIM_RPC_AUTH_LOG_COMPRESS" "false" # OpenIM openim-rpc-auth 日志是否压缩 +def "OPENIM_RPC_AUTH_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-rpc-auth 日志是否带有堆栈信息 + +###################### OpenIM openim-rpc-conversation ###################### +def "OPENIM_RPC_CONVERSATION_HOST" "127.0.0.1" +def "OPENIM_RPC_CONVERSATION_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-rpc-conversation" # OpenIM openim-rpc-conversation 二进制文件路径 +def "OPENIM_RPC_CONVERSATION_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-rpc-conversation 配置文件路径 +def "OPENIM_RPC_CONVERSATION_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-rpc-conversation" # OpenIM openim-rpc-conversation 日志存储路径 +def "OPENIM_RPC_CONVERSATION_LOG_LEVEL" "info" # OpenIM openim-rpc-conversation 日志级别 +def "OPENIM_RPC_CONVERSATION_LOG_MAX_SIZE" "100" # OpenIM openim-rpc-conversation 日志最大大小(MB) +def "OPENIM_RPC_CONVERSATION_LOG_MAX_BACKUPS" "7" # OpenIM openim-rpc-conversation 日志最大备份数 +def "OPENIM_RPC_CONVERSATION_LOG_MAX_AGE" "7" # OpenIM openim-rpc-conversation 日志最大保存时间(天) +def "OPENIM_RPC_CONVERSATION_LOG_COMPRESS" "false" # OpenIM openim-rpc-conversation 日志是否压缩 +def "OPENIM_RPC_CONVERSATION_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-rpc-conversation 日志是否带有堆栈信息 + +###################### OpenIM openim-rpc-friend ###################### +def "OPENIM_RPC_FRIEND_HOST" "127.0.0.1" +def "OPENIM_RPC_FRIEND_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-rpc-friend" # OpenIM openim-rpc-friend 二进制文件路径 +def "OPENIM_RPC_FRIEND_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-rpc-friend 配置文件路径 +def "OPENIM_RPC_FRIEND_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-rpc-friend" # OpenIM openim-rpc-friend 日志存储路径 +def "OPENIM_RPC_FRIEND_LOG_LEVEL" "info" # OpenIM openim-rpc-friend 日志级别 +def "OPENIM_RPC_FRIEND_LOG_MAX_SIZE" "100" # OpenIM openim-rpc-friend 日志最大大小(MB) +def "OPENIM_RPC_FRIEND_LOG_MAX_BACKUPS" "7" # OpenIM openim-rpc-friend 日志最大备份数 +def "OPENIM_RPC_FRIEND_LOG_MAX_AGE" "7" # OpenIM openim-rpc-friend 日志最大保存时间(天) +def "OPENIM_RPC_FRIEND_LOG_COMPRESS" "false" # OpenIM openim-rpc-friend 日志是否压缩 +def "OPENIM_RPC_FRIEND_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-rpc-friend 日志是否带有堆栈信息 + +###################### OpenIM openim-rpc-group ###################### +def "OPENIM_RPC_GROUP_HOST" "127.0.0.1" +def "OPENIM_RPC_GROUP_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-rpc-group" # OpenIM openim-rpc-group 二进制文件路径 +def "OPENIM_RPC_GROUP_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-rpc-group 配置文件路径 +def "OPENIM_RPC_GROUP_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-rpc-group" # OpenIM openim-rpc-group 日志存储路径 +def "OPENIM_RPC_GROUP_LOG_LEVEL" "info" # OpenIM openim-rpc-group 日志级别 +def "OPENIM_RPC_GROUP_LOG_MAX_SIZE" "100" # OpenIM openim-rpc-group 日志最大大小(MB) +def "OPENIM_RPC_GROUP_LOG_MAX_BACKUPS" "7" # OpenIM openim-rpc-group 日志最大备份数 +def "OPENIM_RPC_GROUP_LOG_MAX_AGE" "7" # OpenIM openim-rpc-group 日志最大保存时间(天) +def "OPENIM_RPC_GROUP_LOG_COMPRESS" "false" # OpenIM openim-rpc-group 日志是否压缩 +def "OPENIM_RPC_GROUP_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-rpc-group 日志是否带有堆栈信息 + +###################### OpenIM openim-rpc-msg ###################### +def "OPENIM_RPC_MSG_HOST" "127.0.0.1" +def "OPENIM_RPC_MSG_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-rpc-msg" # OpenIM openim-rpc-msg 二进制文件路径 +def "OPENIM_RPC_MSG_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-rpc-msg 配置文件路径 +def "OPENIM_RPC_MSG_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-rpc-msg" # OpenIM openim-rpc-msg 日志存储路径 +def "OPENIM_RPC_MSG_LOG_LEVEL" "info" # OpenIM openim-rpc-msg 日志级别 +def "OPENIM_RPC_MSG_LOG_MAX_SIZE" "100" # OpenIM openim-rpc-msg 日志最大大小(MB) +def "OPENIM_RPC_MSG_LOG_MAX_BACKUPS" "7" # OpenIM openim-rpc-msg 日志最大备份数 +def "OPENIM_RPC_MSG_LOG_MAX_AGE" "7" # OpenIM openim-rpc-msg 日志最大保存时间(天) +def "OPENIM_RPC_MSG_LOG_COMPRESS" "false" # OpenIM openim-rpc-msg 日志是否压缩 +def "OPENIM_RPC_MSG_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-rpc-msg 日志是否带有堆栈信息 + +###################### OpenIM openim-rpc-third ###################### +def "OPENIM_RPC_THIRD_HOST" "127.0.0.1" +def "OPENIM_RPC_THIRD_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-rpc-third" # OpenIM openim-rpc-third 二进制文件路径 +def "OPENIM_RPC_THIRD_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-rpc-third 配置文件路径 +def "OPENIM_RPC_THIRD_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-rpc-third" # OpenIM openim-rpc-third 日志存储路径 +def "OPENIM_RPC_THIRD_LOG_LEVEL" "info" # OpenIM openim-rpc-third 日志级别 +def "OPENIM_RPC_THIRD_LOG_MAX_SIZE" "100" # OpenIM openim-rpc-third 日志最大大小(MB) +def "OPENIM_RPC_THIRD_LOG_MAX_BACKUPS" "7" # OpenIM openim-rpc-third 日志最大备份数 +def "OPENIM_RPC_THIRD_LOG_MAX_AGE" "7" # OpenIM openim-rpc-third 日志最大保存时间(天) +def "OPENIM_RPC_THIRD_LOG_COMPRESS" "false" # OpenIM openim-rpc-third 日志是否压缩 +def "OPENIM_RPC_THIRD_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-rpc-third 日志是否带有堆栈信息 + +###################### OpenIM openim-rpc-user ###################### +def "OPENIM_RPC_USER_HOST" "127.0.0.1" +def "OPENIM_RPC_USER_BINARY" "${OPENIM_OUTPUT_HOSTBIN}/openim-rpc-user" # OpenIM openim-rpc-user 二进制文件路径 +def "OPENIM_RPC_USER_CONFIG" ""${OPENIM_ROOT}"/config/" # OpenIM openim-rpc-user 配置文件路径 +def "OPENIM_RPC_USER_LOG_DIR" "${LOG_STORAGE_LOCATION}/openim-rpc-user" # OpenIM openim-rpc-user 日志存储路径 +def "OPENIM_RPC_USER_LOG_LEVEL" "info" # OpenIM openim-rpc-user 日志级别 +def "OPENIM_RPC_USER_LOG_MAX_SIZE" "100" # OpenIM openim-rpc-user 日志最大大小(MB) +def "OPENIM_RPC_USER_LOG_MAX_BACKUPS" "7" # OpenIM openim-rpc-user 日志最大备份数 +def "OPENIM_RPC_USER_LOG_MAX_AGE" "7" # OpenIM openim-rpc-user 日志最大保存时间(天) +def "OPENIM_RPC_USER_LOG_COMPRESS" "false" # OpenIM openim-rpc-user 日志是否压缩 +def "OPENIM_RPC_USER_LOG_WITH_STACK" "${LOG_WITH_STACK}" # OpenIM openim-rpc-user 日志是否带有堆栈信息 + +###################### 设计中...暂时不需要###################### + +# openimctl 配置 +def "CONFIG_USER_USERNAME" "admin" +def "CONFIG_USER_PASSWORD" "Admin@2021" +def "CONFIG_USER_CLIENT_CERTIFICATE" "${HOME}/.openim/cert/admin.pem" +def "CONFIG_USER_CLIENT_KEY" "${HOME}/.openim/cert/admin-key.pem" +def "CONFIG_SERVER_ADDRESS" "${OPENIM_APISERVER_HOST}:${OPENIM_APISERVER_SECURE_BIND_PORT}" +def "CONFIG_SERVER_CERTIFICATE_AUTHORITY" "${CA_FILE}"