mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-31 00:12:18 +08:00
fix: scripts fix
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
ca72ce2d6f
commit
e4eb8ffd6e
261
.env
261
.env
@ -1,64 +1,265 @@
|
|||||||
# The following is automatically generated
|
# ======================================
|
||||||
# Use `make init` OR `./scripts/init-config.sh`
|
# ========= Basic Configuration ========
|
||||||
#
|
# ======================================
|
||||||
# ================= Basic Configuration ===================
|
|
||||||
# Endpoint for the MinIO object storage service
|
|
||||||
MINIO_ENDPOINT=http://127.0.0.1:10005
|
|
||||||
|
|
||||||
# Base URL for the application programming interface (API)
|
# The user for authentication or system operations.
|
||||||
API_URL=http://127.0.0.1:10002
|
# Default: USER=root
|
||||||
|
USER=root
|
||||||
|
|
||||||
# Directory path for storing data files or related information
|
# Password associated with the specified user for authentication.
|
||||||
DATA_DIR=./
|
# Default: PASSWORD=openIM123
|
||||||
|
PASSWORD=openIM123
|
||||||
|
|
||||||
|
# Endpoint for the MinIO object storage service.
|
||||||
|
# Default: MINIO_ENDPOINT=http://172.28.0.1:10005
|
||||||
|
MINIO_ENDPOINT=http://172.28.0.1:10005
|
||||||
|
|
||||||
|
# Base URL for the application programming interface (API).
|
||||||
|
# Default: API_URL=http://172.28.0.1:10002
|
||||||
|
API_URL=http://14.153.6.114:10002
|
||||||
|
|
||||||
|
# Directory path for storing data files or related information.
|
||||||
|
# Default: DATA_DIR=./
|
||||||
|
DATA_DIR=/root/workspaces/openim/openim-docker/openim-server/main
|
||||||
|
|
||||||
|
# ======================================
|
||||||
|
# ========= Network Configuration ======
|
||||||
|
# ======================================
|
||||||
|
|
||||||
|
# Subnet for the Docker network.
|
||||||
|
# Default: DOCKER_BRIDGE_SUBNET=172.28.0.0/16
|
||||||
|
DOCKER_BRIDGE_SUBNET=172.28.0.0/16
|
||||||
|
|
||||||
|
# Gateway for the Docker network.
|
||||||
|
# Default: DOCKER_BRIDGE_GATEWAY=172.28.0.1
|
||||||
|
DOCKER_BRIDGE_GATEWAY=172.28.0.1
|
||||||
|
|
||||||
|
# Address or hostname for the MySQL network.
|
||||||
|
# Default: MYSQL_NETWORK_ADDRESS=172.28.0.2
|
||||||
|
MYSQL_NETWORK_ADDRESS=172.28.0.2
|
||||||
|
|
||||||
|
# Address or hostname for the MongoDB network.
|
||||||
|
# Default: MONGO_NETWORK_ADDRESS=172.28.0.3
|
||||||
|
MONGO_NETWORK_ADDRESS=172.28.0.3
|
||||||
|
|
||||||
|
# Address or hostname for the Redis network.
|
||||||
|
# Default: REDIS_NETWORK_ADDRESS=172.28.0.4
|
||||||
|
REDIS_NETWORK_ADDRESS=172.28.0.4
|
||||||
|
|
||||||
|
# Address or hostname for the Kafka network.
|
||||||
|
# Default: KAFKA_NETWORK_ADDRESS=172.28.0.5
|
||||||
|
KAFKA_NETWORK_ADDRESS=172.28.0.5
|
||||||
|
|
||||||
|
# Address or hostname for the ZooKeeper network.
|
||||||
|
# Default: ZOOKEEPER_NETWORK_ADDRESS=172.28.0.6
|
||||||
|
ZOOKEEPER_NETWORK_ADDRESS=172.28.0.6
|
||||||
|
|
||||||
|
# Address or hostname for the MinIO network.
|
||||||
|
# Default: MINIO_NETWORK_ADDRESS=172.28.0.7
|
||||||
|
MINIO_NETWORK_ADDRESS=172.28.0.7
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM web network.
|
||||||
|
# Default: OPENIM_WEB_NETWORK_ADDRESS=172.28.0.8
|
||||||
|
OPENIM_WEB_NETWORK_ADDRESS=172.28.0.8
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM server network.
|
||||||
|
# Default: OPENIM_SERVER_NETWORK_ADDRESS=172.28.0.9
|
||||||
|
OPENIM_SERVER_NETWORK_ADDRESS=172.28.0.9
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM chat network.
|
||||||
|
# Default: OPENIM_CHAT_NETWORK_ADDRESS=172.28.0.10
|
||||||
|
OPENIM_CHAT_NETWORK_ADDRESS=172.28.0.10
|
||||||
|
|
||||||
|
# Address or hostname for the Prometheus network.
|
||||||
|
# Default: PROMETHEUS_NETWORK_ADDRESS=172.28.0.11
|
||||||
|
PROMETHEUS_NETWORK_ADDRESS=172.28.0.11
|
||||||
|
|
||||||
|
# Address or hostname for the Grafana network.
|
||||||
|
# Default: GRAFANA_NETWORK_ADDRESS=172.28.0.12
|
||||||
|
GRAFANA_NETWORK_ADDRESS=172.28.0.12
|
||||||
|
|
||||||
|
|
||||||
|
# ===============================================
|
||||||
|
# = Component Extension Configuration =
|
||||||
|
# ===============================================
|
||||||
|
|
||||||
# ============ Component Extension Configuration ==========
|
# ============ Component Extension Configuration ==========
|
||||||
# Address or hostname for the ZooKeeper service (often used in distributed systems for maintaining configuration information)
|
# ----- ZooKeeper Configuration -----
|
||||||
ZOOKEEPER_ADDRESS=127.0.0.1
|
# Address or hostname for the ZooKeeper service.
|
||||||
|
# Default: ZOOKEEPER_ADDRESS=172.28.0.1
|
||||||
|
ZOOKEEPER_ADDRESS=172.28.0.6
|
||||||
|
|
||||||
# Port on which MySQL database service is running
|
# Port for ZooKeeper service.
|
||||||
|
# Default: ZOOKEEPER_PORT=12181
|
||||||
|
ZOOKEEPER_PORT=12181
|
||||||
|
|
||||||
|
# ----- MySQL Configuration -----
|
||||||
|
|
||||||
|
# Address or hostname for the MySQL service.
|
||||||
|
# Default: MYSQL_ADDRESS=172.28.0.1
|
||||||
|
MYSQL_ADDRESS=172.28.0.2
|
||||||
|
|
||||||
|
# Port on which MySQL database service is running.
|
||||||
|
# Default: MYSQL_PORT=13306
|
||||||
MYSQL_PORT=13306
|
MYSQL_PORT=13306
|
||||||
|
|
||||||
# Password to authenticate with the MySQL database service
|
# Password to authenticate with the MySQL database service.
|
||||||
|
# Default: MYSQL_PASSWORD=openIM123
|
||||||
MYSQL_PASSWORD=openIM123
|
MYSQL_PASSWORD=openIM123
|
||||||
|
|
||||||
# Port on which MongoDB service is running
|
# ----- MongoDB Configuration -----
|
||||||
|
# Address or hostname for the MongoDB service.
|
||||||
|
# Default: MONGO_ADDRESS=172.28.0.1
|
||||||
|
MONGO_ADDRESS=172.28.0.3
|
||||||
|
|
||||||
|
# Port on which MongoDB service is running.
|
||||||
|
# Default: MONGO_PORT=37017
|
||||||
MONGO_PORT=37017
|
MONGO_PORT=37017
|
||||||
|
|
||||||
# Username to authenticate with the MongoDB service
|
# Username to authenticate with the MongoDB service.
|
||||||
|
# Default: MONGO_USERNAME=root
|
||||||
MONGO_USERNAME=root
|
MONGO_USERNAME=root
|
||||||
|
|
||||||
# Password to authenticate with the MongoDB service
|
# Password to authenticate with the MongoDB service.
|
||||||
|
# Default: MONGO_PASSWORD=openIM123
|
||||||
MONGO_PASSWORD=openIM123
|
MONGO_PASSWORD=openIM123
|
||||||
|
|
||||||
# Name of the database in MongoDB to be used
|
# Name of the database in MongoDB to be used.
|
||||||
|
# Default: MONGO_DATABASE=openIM_v3
|
||||||
MONGO_DATABASE=openIM_v3
|
MONGO_DATABASE=openIM_v3
|
||||||
|
|
||||||
# Port on which Redis in-memory data structure store is running
|
# ----- Redis Configuration -----
|
||||||
|
# Address or hostname for the Redis service.
|
||||||
|
# Default: REDIS_ADDRESS=172.28.0.1
|
||||||
|
REDIS_ADDRESS=172.28.0.4
|
||||||
|
|
||||||
|
# Port on which Redis in-memory data structure store is running.
|
||||||
|
# Default: REDIS_PORT=16379
|
||||||
REDIS_PORT=16379
|
REDIS_PORT=16379
|
||||||
|
|
||||||
# Password to authenticate with the Redis service
|
# Password to authenticate with the Redis service.
|
||||||
|
# Default: REDIS_PASSWORD=openIM123
|
||||||
REDIS_PASSWORD=openIM123
|
REDIS_PASSWORD=openIM123
|
||||||
|
|
||||||
# Port on which Kafka distributed streaming platform is running
|
# ----- Kafka Configuration -----
|
||||||
KAFKA_PORT=9092
|
# Address or hostname for the Kafka service.
|
||||||
|
# Default: KAFKA_ADDRESS=172.28.0.1
|
||||||
|
KAFKA_ADDRESS=172.28.0.5
|
||||||
|
|
||||||
# Address or hostname for the Kafka service
|
# Port on which Kafka distributed streaming platform is running.
|
||||||
KAFKA_ADDR=127.0.0.1
|
# Default: KAFKA_PORT=19092
|
||||||
|
KAFKA_PORT=19092
|
||||||
|
|
||||||
# Topic in Kafka for storing the latest messages in Redis
|
# Topic in Kafka for storing the latest messages in Redis.
|
||||||
|
# Default: KAFKA_LATESTMSG_REDIS_TOPIC=latestMsgToRedis
|
||||||
KAFKA_LATESTMSG_REDIS_TOPIC=latestMsgToRedis
|
KAFKA_LATESTMSG_REDIS_TOPIC=latestMsgToRedis
|
||||||
|
|
||||||
# Topic in Kafka for pushing messages (e.g. notifications or updates)
|
# Topic in Kafka for pushing messages (e.g. notifications or updates).
|
||||||
|
# Default: KAFKA_MSG_PUSH_TOPIC=msgToPush
|
||||||
KAFKA_MSG_PUSH_TOPIC=msgToPush
|
KAFKA_MSG_PUSH_TOPIC=msgToPush
|
||||||
|
|
||||||
# Topic in Kafka for storing offline messages in MongoDB
|
# Topic in Kafka for storing offline messages in MongoDB.
|
||||||
|
# Default: KAFKA_OFFLINEMSG_MONGO_TOPIC=offlineMsgToMongoMysql
|
||||||
KAFKA_OFFLINEMSG_MONGO_TOPIC=offlineMsgToMongoMysql
|
KAFKA_OFFLINEMSG_MONGO_TOPIC=offlineMsgToMongoMysql
|
||||||
|
|
||||||
# Port on which MinIO object storage service is running
|
# ----- MinIO Configuration ----
|
||||||
|
# Address or hostname for the MinIO object storage service.
|
||||||
|
# Default: MINIO_ADDRESS=172.28.0.1
|
||||||
|
MINIO_ADDRESS=172.28.0.7
|
||||||
|
|
||||||
|
# Port on which MinIO object storage service is running.
|
||||||
|
# Default: MINIO_PORT=10005
|
||||||
MINIO_PORT=10005
|
MINIO_PORT=10005
|
||||||
|
|
||||||
# Access key to authenticate with the MinIO service
|
# Access key to authenticate with the MinIO service.
|
||||||
|
# Default: MINIO_ACCESS_KEY=root
|
||||||
MINIO_ACCESS_KEY=root
|
MINIO_ACCESS_KEY=root
|
||||||
|
|
||||||
# Secret key corresponding to the access key for MinIO authentication
|
# Secret key corresponding to the access key for MinIO authentication.
|
||||||
|
# Default: MINIO_SECRET_KEY=openIM123
|
||||||
MINIO_SECRET_KEY=openIM123
|
MINIO_SECRET_KEY=openIM123
|
||||||
|
|
||||||
|
# ----- Prometheus Configuration -----
|
||||||
|
# Address or hostname for the Prometheus service.
|
||||||
|
# Default: PROMETHEUS_ADDRESS=172.28.0.1
|
||||||
|
PROMETHEUS_ADDRESS=172.28.0.11
|
||||||
|
|
||||||
|
# Port on which Prometheus service is running.
|
||||||
|
# Default: PROMETHEUS_PORT=19090
|
||||||
|
PROMETHEUS_PORT=19090
|
||||||
|
|
||||||
|
# ----- Grafana Configuration -----
|
||||||
|
# Address or hostname for the Grafana service.
|
||||||
|
# Default: GRAFANA_ADDRESS=172.28.0.1
|
||||||
|
GRAFANA_ADDRESS=172.28.0.12
|
||||||
|
|
||||||
|
# Port on which Grafana service is running.
|
||||||
|
# Default: GRAFANA_PORT=3000
|
||||||
|
GRAFANA_PORT=3000
|
||||||
|
|
||||||
|
# ======================================
|
||||||
|
# ============ OpenIM Web ===============
|
||||||
|
# ======================================
|
||||||
|
|
||||||
|
# Path to the OpenIM web distribution.
|
||||||
|
# Default: OPENIM_WEB_DIST_PATH=/app/dist
|
||||||
|
OPENIM_WEB_DIST_PATH=/app/dist
|
||||||
|
|
||||||
|
# Port on which OpenIM web service is running.
|
||||||
|
# Default: OPENIM_WEB_PORT=11001
|
||||||
|
OPENIM_WEB_PORT=11001
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM web service.
|
||||||
|
# Default: OPENIM_WEB_ADDRESS=172.28.0.1
|
||||||
|
OPENIM_WEB_ADDRESS=172.28.0.8
|
||||||
|
|
||||||
|
|
||||||
|
# ======================================
|
||||||
|
# ========= OpenIM Server ==============
|
||||||
|
# ======================================
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM server.
|
||||||
|
# Default: OPENIM_SERVER_ADDRESS=172.28.0.1
|
||||||
|
OPENIM_SERVER_ADDRESS=172.28.0.9
|
||||||
|
|
||||||
|
# Port for the OpenIM WebSockets.
|
||||||
|
# Default: OPENIM_WS_PORT=10001
|
||||||
|
OPENIM_WS_PORT=10001
|
||||||
|
|
||||||
|
# Port for the OpenIM API.
|
||||||
|
# Default: API_OPENIM_PORT=10002
|
||||||
|
API_OPENIM_PORT=10002
|
||||||
|
|
||||||
|
|
||||||
|
# ======================================
|
||||||
|
# ========== OpenIM Chat ===============
|
||||||
|
# ======================================
|
||||||
|
|
||||||
|
# Branch name for OpenIM chat.
|
||||||
|
# Default: CHAT_BRANCH=main
|
||||||
|
CHAT_BRANCH=main
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM chat service.
|
||||||
|
# Default: OPENIM_CHAT_ADDRESS=172.28.0.1
|
||||||
|
OPENIM_CHAT_ADDRESS=172.28.0.10
|
||||||
|
|
||||||
|
# Port for the OpenIM chat API.
|
||||||
|
# Default: OPENIM_CHAT_API_PORT=10008
|
||||||
|
OPENIM_CHAT_API_PORT=10008
|
||||||
|
|
||||||
|
# Directory path for storing data files or related information for OpenIM chat.
|
||||||
|
# Default: OPENIM_CHAT_DATA_DIR=./openim-chat/main
|
||||||
|
OPENIM_CHAT_DATA_DIR=./openim-chat/main
|
||||||
|
|
||||||
|
|
||||||
|
# ======================================
|
||||||
|
# ========== OpenIM Admin ==============
|
||||||
|
# ======================================
|
||||||
|
|
||||||
|
# Branch name for OpenIM server.
|
||||||
|
# Default: SERVER_BRANCH=main
|
||||||
|
SERVER_BRANCH=main
|
||||||
|
|
||||||
|
# Port for the OpenIM admin API.
|
||||||
|
# Default: OPENIM_ADMIN_API_PORT=10009
|
||||||
|
OPENIM_ADMIN_API_PORT=10009
|
||||||
|
|||||||
60
README.md
60
README.md
@ -128,9 +128,7 @@ $ make demo
|
|||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# choose what you need, We take branch 3.2 as an example
|
git clone -b feat/test https://github.com/openim-sigs/openim-docker openim/openim-docker && export openim=$(pwd)/openim && cd $openim/openim-docker && ./scripts/init-config.sh && docker-compose up -d
|
||||||
$ BRANCH=release-v3.2
|
|
||||||
$ git clone -b $BRANCH https://github.com/OpenIMSDK/Open-IM-Server openim/openim-server && export openim_dir=$(pwd)/openim && cd ${openim_dir}/openim-server
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
@ -144,42 +142,36 @@ If you tried to get started quickly with `make demo`, then you know that our con
|
|||||||
|
|
||||||
You can use `make init` to quickly initialize a configuration file
|
You can use `make init` to quickly initialize a configuration file
|
||||||
|
|
||||||
|
Modify the automation script:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cat scripts/install/environment.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
1. Recommended using environment variables:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export PASSWORD="openIM123" # Set password
|
||||||
|
export USER="root" # Set username
|
||||||
|
# Choose chat version and server version https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md, eg: main, release-v*.*
|
||||||
|
export CHAT_BRANCH="main"
|
||||||
|
export SERVER_BRANCH="main"
|
||||||
|
#... Other environment variables
|
||||||
|
# MONGO_USERNAME: This sets the MongoDB username
|
||||||
|
# MONGO_PASSWORD: Set the MongoDB password
|
||||||
|
# MONGO_DATABASE: Sets the MongoDB database name
|
||||||
|
# MINIO_ENDPOINT: set the MinIO service address
|
||||||
|
# API_URL: under network environment, set OpenIM Server API address
|
||||||
|
export API_URL="http://127.0.0.1:10002"
|
||||||
|
```
|
||||||
|
|
||||||
|
Next, update the configuration using make init:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ make init
|
$ make init
|
||||||
$ git diff
|
$ git diff
|
||||||
```
|
```
|
||||||
|
|
||||||
Then feel free to modify your current config file, you can also modify `/scripts/install/environment.sh` document template, `make init` is essentially rendering `environment.sh` template, and then through the `make init` to automatically generate a new configuration.
|
|
||||||
|
|
||||||
If you only need to change the config file for a short time, or if you don't want to make any major changes in the future, you can modify the `.env file directly
|
|
||||||
|
|
||||||
```bash
|
|
||||||
USER=root #no need to modify
|
|
||||||
PASSWORD=openIM123 #A combination of 8 or more numbers and letters, this password applies to redis, mysql, mongo, as well as accessSecret in config/config.yaml
|
|
||||||
ENDPOINT=http://127.0.0.1:10005 #minio's external service IP and port, or use the domain name storage.xx.xx, the app must be able to access this IP and port or domain,
|
|
||||||
API_URL=http://127.0.0.1:10002/object/ #the app must be able to access this IP and port or domain,
|
|
||||||
DATA_DIR=./ #designate large disk directory
|
|
||||||
```
|
|
||||||
|
|
||||||
**3. Deploy and start**
|
|
||||||
|
|
||||||
> **Note**
|
|
||||||
>
|
|
||||||
> You can deploy either directly with `make install` or with `docker compose up`, the logic is the same
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ make install
|
|
||||||
# OR
|
|
||||||
$ docker-compose up
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Check the service
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ make check
|
|
||||||
```
|
|
||||||
|
|
||||||
Looking at the command line at this point, there are two items in the output, checking for the start of the component port that OpenIM depends on, and the start of the OpenIM core component
|
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|||||||
111
deployments/templates/chat.yaml
Normal file
111
deployments/templates/chat.yaml
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
# Configuration for OpenIMServer
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
# TODO: This config file is the template file
|
||||||
|
# --| source: deployments/templates/chat.yaml
|
||||||
|
# --| env: scripts/install/environment
|
||||||
|
# --| target: config/config.yaml
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
|
||||||
|
###################### Zookeeper ######################
|
||||||
|
# Zookeeper configuration
|
||||||
|
# It's not recommended to modify the schema
|
||||||
|
zookeeper:
|
||||||
|
schema: ${ZOOKEEPER_SCHEMA}
|
||||||
|
zkAddr:
|
||||||
|
- ${ZOOKEEPER_ADDRESS}:${ZOOKEEPER_PORT}
|
||||||
|
username: ${ZOOKEEPER_USERNAME}
|
||||||
|
password: ${ZOOKEEPER_PASSWORD}
|
||||||
|
|
||||||
|
###################### Chat API ######################
|
||||||
|
chatApi:
|
||||||
|
openImChatApiPort: [ ${OPENIM_CHAT_API_PORT} ]
|
||||||
|
listenIP: ${CHAT_API_LISTEN_IP}
|
||||||
|
|
||||||
|
###################### Admin API ######################
|
||||||
|
adminApi:
|
||||||
|
openImAdminApiPort: [ ${OPENIM_ADMIN_API_PORT} ]
|
||||||
|
listenIP: ${ADMIN_API_LISTEN_IP}
|
||||||
|
|
||||||
|
###################### RPC ######################
|
||||||
|
rpc:
|
||||||
|
registerIP: #作为rpc启动时,注册到zookeeper的IP,api/gateway能访问到此ip和对应的rpcPort中的端口
|
||||||
|
listenIP: #默认为0.0.0.0
|
||||||
|
|
||||||
|
rpcPort:
|
||||||
|
openImAdminPort: [ ${OPENIM_ADMIN_PORT} ]
|
||||||
|
openImChatPort: [ ${OPENIM_CHAT_PORT} ]
|
||||||
|
rpcRegisterName:
|
||||||
|
openImAdminName: ${OPENIM_ADMIN_NAME}
|
||||||
|
openImChatName: ${OPENIM_CHAT_NAME}
|
||||||
|
|
||||||
|
###################### MySQL ######################
|
||||||
|
mysql:
|
||||||
|
# address: [ 127.0.0.1:13306 ] #目前仅支持单机
|
||||||
|
# username: root #用户名
|
||||||
|
# password: openIM123 #密码
|
||||||
|
# database: openIM_v2 #不建议修改
|
||||||
|
# maxOpenConn: 1000 #最大连接数
|
||||||
|
# maxIdleConn: 100 #最大空闲连接数
|
||||||
|
# maxLifeTime: 60 #连接可以重复使用的最长时间(秒)
|
||||||
|
# logLevel: 4 #日志级别 1=slient 2=error 3=warn 4=info
|
||||||
|
# slowThreshold: 500 #慢语句阈值 (毫秒)
|
||||||
|
database: openim_enterprise
|
||||||
|
|
||||||
|
###################### Log ######################
|
||||||
|
log:
|
||||||
|
storageLocation: ../logs/ #存放目录
|
||||||
|
# rotationTime: 24 #日志旋转时间
|
||||||
|
# remainRotationCount: 2 #日志数量
|
||||||
|
# remainLogLevel: 6 #日志级别 6表示全都打印,
|
||||||
|
# isStdout: false
|
||||||
|
# isJson: false
|
||||||
|
# withStack: false
|
||||||
|
|
||||||
|
###################### Secret & Token Policy ######################
|
||||||
|
# secret: openIM123
|
||||||
|
#tokenPolicy:
|
||||||
|
# expire: 86400
|
||||||
|
|
||||||
|
###################### Verify Code ######################
|
||||||
|
verifyCode:
|
||||||
|
validTime: 300 # 验证码有效时间
|
||||||
|
validCount: 5 # 验证码有效次数
|
||||||
|
uintTime: 86400 # 单位时间间隔
|
||||||
|
maxCount: 10 # 单位时间内最大获取次数
|
||||||
|
superCode: "666666" # 超级验证码(只有use为空时使用)
|
||||||
|
len: 6 # 验证码长度
|
||||||
|
use: "" # 使用的验证码服务(use: "ali")
|
||||||
|
ali:
|
||||||
|
endpoint: "dysmsapi.aliyuncs.com"
|
||||||
|
accessKeyId: ""
|
||||||
|
accessKeySecret: ""
|
||||||
|
signName: ""
|
||||||
|
verificationCodeTemplateCode: ""
|
||||||
|
|
||||||
|
|
||||||
|
###################### Proxy Header ######################
|
||||||
|
# 获取ip的header,没有配置直接获取远程地址
|
||||||
|
#proxyHeader: "X-Forwarded-For"
|
||||||
|
|
||||||
|
###################### Admin List ######################
|
||||||
|
adminList:
|
||||||
|
adminList:
|
||||||
|
- adminID: admin1
|
||||||
|
nickname: chat1
|
||||||
|
imAdmin: openIM123456
|
||||||
|
- adminID: admin2
|
||||||
|
nickname: chat2
|
||||||
|
imAdmin: openIM654321
|
||||||
|
- adminID: admin3
|
||||||
|
nickname: chat3
|
||||||
|
imAdmin: openIMAdmin
|
||||||
|
|
||||||
|
###################### OpenIM URL ######################
|
||||||
|
openIMUrl: ${OPENIM_SERVER_ADDRESS}:${API_OPENIM_PORT}
|
||||||
|
|
||||||
|
###################### Redis ######################
|
||||||
|
redis:
|
||||||
|
# address: [ 127.0.0.1:16379 ]
|
||||||
|
# username:
|
||||||
|
# password: openIM123
|
||||||
@ -1,98 +1,265 @@
|
|||||||
# Copyright © 2023 OpenIM. All rights reserved.
|
# ======================================
|
||||||
#
|
# ========= Basic Configuration ========
|
||||||
# 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.
|
|
||||||
|
|
||||||
# ================= Basic Configuration ===================
|
# The user for authentication or system operations.
|
||||||
USER=${USER} # User for authentication or system operations
|
# Default: USER=root
|
||||||
PASSWORD=${PASSWORD} # Password associated with the specified user for authentication
|
USER=${USER}
|
||||||
MINIO_ENDPOINT=${MINIO_ENDPOINT} # Endpoint for the MinIO object storage service
|
|
||||||
API_URL=${API_URL} # Base URL for the application programming interface (API)
|
|
||||||
DATA_DIR=${DATA_DIR} # Directory path for storing data files or related information
|
|
||||||
|
|
||||||
# ================= Network Configuration =================
|
# Password associated with the specified user for authentication.
|
||||||
DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET} # Subnet for the Docker network
|
# Default: PASSWORD=openIM123
|
||||||
DOCKER_BRIDGE_GATEWAY=${DOCKER_BRIDGE_GATEWAY} # Gateway for the Docker network
|
PASSWORD=${PASSWORD}
|
||||||
MYSQL_NETWORK_ADDRESS=${MYSQL_NETWORK_ADDRESS} # Address or hostname for the MySQL network
|
|
||||||
MONGO_NETWORK_ADDRESS=${MONGO_NETWORK_ADDRESS} # Address or hostname for the MongoDB network
|
# Endpoint for the MinIO object storage service.
|
||||||
REDIS_NETWORK_ADDRESS=${REDIS_NETWORK_ADDRESS} # Address or hostname for the Redis network
|
# Default: MINIO_ENDPOINT=http://172.28.0.1:10005
|
||||||
KAFKA_NETWORK_ADDRESS=${KAFKA_NETWORK_ADDRESS} # Address or hostname for the Kafka network
|
MINIO_ENDPOINT=${MINIO_ENDPOINT}
|
||||||
ZOOKEEPER_NETWORK_ADDRESS=${ZOOKEEPER_NETWORK_ADDRESS} # Address or hostname for the ZooKeeper network
|
|
||||||
MINIO_NETWORK_ADDRESS=${MINIO_NETWORK_ADDRESS} # Address or hostname for the MinIO network
|
# Base URL for the application programming interface (API).
|
||||||
OPENIM_WEB_NETWORK_ADDRESS=${OPENIM_WEB_NETWORK_ADDRESS} # Address or hostname for the OpenIM web network
|
# Default: API_URL=http://172.28.0.1:10002
|
||||||
OPENIM_SERVER_NETWORK_ADDRESS=${OPENIM_SERVER_NETWORK_ADDRESS} # Address or hostname for the OpenIM server network
|
API_URL=${API_URL}
|
||||||
OPENIM_CHAT_NETWORK_ADDRESS=${OPENIM_CHAT_NETWORK_ADDRESS} # Address or hostname for the OpenIM chat network
|
|
||||||
PROMETHEUS_NETWORK_ADDRESS=${PROMETHEUS_NETWORK_ADDRESS} # Address or hostname for the Prometheus network
|
# Directory path for storing data files or related information.
|
||||||
GRAFANA_NETWORK_ADDRESS=${GRAFANA_NETWORK_ADDRESS} # Address or hostname for the Grafana network
|
# Default: DATA_DIR=./
|
||||||
|
DATA_DIR=${DATA_DIR}
|
||||||
|
|
||||||
|
# ======================================
|
||||||
|
# ========= Network Configuration ======
|
||||||
|
# ======================================
|
||||||
|
|
||||||
|
# Subnet for the Docker network.
|
||||||
|
# Default: DOCKER_BRIDGE_SUBNET=172.28.0.0/16
|
||||||
|
DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET}
|
||||||
|
|
||||||
|
# Gateway for the Docker network.
|
||||||
|
# Default: DOCKER_BRIDGE_GATEWAY=172.28.0.1
|
||||||
|
DOCKER_BRIDGE_GATEWAY=${DOCKER_BRIDGE_GATEWAY}
|
||||||
|
|
||||||
|
# Address or hostname for the MySQL network.
|
||||||
|
# Default: MYSQL_NETWORK_ADDRESS=172.28.0.2
|
||||||
|
MYSQL_NETWORK_ADDRESS=${MYSQL_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Address or hostname for the MongoDB network.
|
||||||
|
# Default: MONGO_NETWORK_ADDRESS=172.28.0.3
|
||||||
|
MONGO_NETWORK_ADDRESS=${MONGO_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Address or hostname for the Redis network.
|
||||||
|
# Default: REDIS_NETWORK_ADDRESS=172.28.0.4
|
||||||
|
REDIS_NETWORK_ADDRESS=${REDIS_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Address or hostname for the Kafka network.
|
||||||
|
# Default: KAFKA_NETWORK_ADDRESS=172.28.0.5
|
||||||
|
KAFKA_NETWORK_ADDRESS=${KAFKA_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Address or hostname for the ZooKeeper network.
|
||||||
|
# Default: ZOOKEEPER_NETWORK_ADDRESS=172.28.0.6
|
||||||
|
ZOOKEEPER_NETWORK_ADDRESS=${ZOOKEEPER_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Address or hostname for the MinIO network.
|
||||||
|
# Default: MINIO_NETWORK_ADDRESS=172.28.0.7
|
||||||
|
MINIO_NETWORK_ADDRESS=${MINIO_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM web network.
|
||||||
|
# Default: OPENIM_WEB_NETWORK_ADDRESS=172.28.0.8
|
||||||
|
OPENIM_WEB_NETWORK_ADDRESS=${OPENIM_WEB_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM server network.
|
||||||
|
# Default: OPENIM_SERVER_NETWORK_ADDRESS=172.28.0.9
|
||||||
|
OPENIM_SERVER_NETWORK_ADDRESS=${OPENIM_SERVER_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM chat network.
|
||||||
|
# Default: OPENIM_CHAT_NETWORK_ADDRESS=172.28.0.10
|
||||||
|
OPENIM_CHAT_NETWORK_ADDRESS=${OPENIM_CHAT_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Address or hostname for the Prometheus network.
|
||||||
|
# Default: PROMETHEUS_NETWORK_ADDRESS=172.28.0.11
|
||||||
|
PROMETHEUS_NETWORK_ADDRESS=${PROMETHEUS_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Address or hostname for the Grafana network.
|
||||||
|
# Default: GRAFANA_NETWORK_ADDRESS=172.28.0.12
|
||||||
|
GRAFANA_NETWORK_ADDRESS=${GRAFANA_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
|
||||||
|
# ===============================================
|
||||||
|
# = Component Extension Configuration =
|
||||||
|
# ===============================================
|
||||||
|
|
||||||
# ============ Component Extension Configuration ==========
|
# ============ Component Extension Configuration ==========
|
||||||
# ----- ZooKeeper Configuration -----
|
# ----- ZooKeeper Configuration -----
|
||||||
ZOOKEEPER_ADDRESS=${ZOOKEEPER_ADDRESS} # Address or hostname for the ZooKeeper service
|
# Address or hostname for the ZooKeeper service.
|
||||||
ZOOKEEPER_PORT=${ZOOKEEPER_PORT} # Port for ZooKeeper service
|
# Default: ZOOKEEPER_ADDRESS=172.28.0.1
|
||||||
|
ZOOKEEPER_ADDRESS=${ZOOKEEPER_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Port for ZooKeeper service.
|
||||||
|
# Default: ZOOKEEPER_PORT=12181
|
||||||
|
ZOOKEEPER_PORT=${ZOOKEEPER_PORT}
|
||||||
|
|
||||||
# ----- MySQL Configuration -----
|
# ----- MySQL Configuration -----
|
||||||
MYSQL_ADDRESS=${MYSQL_ADDRESS} # Address or hostname for the MySQL service
|
|
||||||
MYSQL_PORT=${MYSQL_PORT} # Port on which MySQL database service is running
|
# Address or hostname for the MySQL service.
|
||||||
MYSQL_PASSWORD=${MYSQL_PASSWORD} # Password to authenticate with the MySQL database service
|
# Default: MYSQL_ADDRESS=172.28.0.1
|
||||||
|
MYSQL_ADDRESS=${MYSQL_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Port on which MySQL database service is running.
|
||||||
|
# Default: MYSQL_PORT=13306
|
||||||
|
MYSQL_PORT=${MYSQL_PORT}
|
||||||
|
|
||||||
|
# Password to authenticate with the MySQL database service.
|
||||||
|
# Default: MYSQL_PASSWORD=openIM123
|
||||||
|
MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
|
|
||||||
# ----- MongoDB Configuration -----
|
# ----- MongoDB Configuration -----
|
||||||
MONGO_ADDRESS=${MONGO_ADDRESS} # Address or hostname for the MongoDB service
|
# Address or hostname for the MongoDB service.
|
||||||
MONGO_PORT=${MONGO_PORT} # Port on which MongoDB service is running
|
# Default: MONGO_ADDRESS=172.28.0.1
|
||||||
MONGO_USERNAME=${MONGO_USERNAME} # Username to authenticate with the MongoDB service
|
MONGO_ADDRESS=${MONGO_NETWORK_ADDRESS}
|
||||||
MONGO_PASSWORD=${MONGO_PASSWORD} # Password to authenticate with the MongoDB service
|
|
||||||
MONGO_DATABASE=${MONGO_DATABASE} # Name of the database in MongoDB to be used
|
# Port on which MongoDB service is running.
|
||||||
|
# Default: MONGO_PORT=37017
|
||||||
|
MONGO_PORT=${MONGO_PORT}
|
||||||
|
|
||||||
|
# Username to authenticate with the MongoDB service.
|
||||||
|
# Default: MONGO_USERNAME=root
|
||||||
|
MONGO_USERNAME=${MONGO_USERNAME}
|
||||||
|
|
||||||
|
# Password to authenticate with the MongoDB service.
|
||||||
|
# Default: MONGO_PASSWORD=openIM123
|
||||||
|
MONGO_PASSWORD=${MONGO_PASSWORD}
|
||||||
|
|
||||||
|
# Name of the database in MongoDB to be used.
|
||||||
|
# Default: MONGO_DATABASE=openIM_v3
|
||||||
|
MONGO_DATABASE=${MONGO_DATABASE}
|
||||||
|
|
||||||
# ----- Redis Configuration -----
|
# ----- Redis Configuration -----
|
||||||
REDIS_ADDRESS=${REDIS_ADDRESS} # Address or hostname for the Redis service
|
# Address or hostname for the Redis service.
|
||||||
REDIS_PORT=${REDIS_PORT} # Port on which Redis in-memory data structure store is running
|
# Default: REDIS_ADDRESS=172.28.0.1
|
||||||
REDIS_PASSWORD=${REDIS_PASSWORD} # Password to authenticate with the Redis service
|
REDIS_ADDRESS=${REDIS_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Port on which Redis in-memory data structure store is running.
|
||||||
|
# Default: REDIS_PORT=16379
|
||||||
|
REDIS_PORT=${REDIS_PORT}
|
||||||
|
|
||||||
|
# Password to authenticate with the Redis service.
|
||||||
|
# Default: REDIS_PASSWORD=openIM123
|
||||||
|
REDIS_PASSWORD=${REDIS_PASSWORD}
|
||||||
|
|
||||||
# ----- Kafka Configuration -----
|
# ----- Kafka Configuration -----
|
||||||
KAFKA_ADDRESS=${KAFKA_ADDRESS} # Address or hostname for the Kafka service
|
# Address or hostname for the Kafka service.
|
||||||
KAFKA_PORT=${KAFKA_PORT} # Port on which Kafka distributed streaming platform is running
|
# Default: KAFKA_ADDRESS=172.28.0.1
|
||||||
KAFKA_LATESTMSG_REDIS_TOPIC=${KAFKA_LATESTMSG_REDIS_TOPIC} # Topic in Kafka for storing the latest messages in Redis
|
KAFKA_ADDRESS=${KAFKA_NETWORK_ADDRESS}
|
||||||
KAFKA_MSG_PUSH_TOPIC=${KAFKA_MSG_PUSH_TOPIC} # Topic in Kafka for pushing messages (e.g. notifications or updates)
|
|
||||||
KAFKA_OFFLINEMSG_MONGO_TOPIC=${KAFKA_OFFLINEMSG_MONGO_TOPIC} # Topic in Kafka for storing offline messages in MongoDB
|
|
||||||
|
|
||||||
# ----- MinIO Configuration -----
|
# Port on which Kafka distributed streaming platform is running.
|
||||||
MINIO_ADDRESS=${MINIO_ADDRESS} # Address or hostname for the MinIO object storage service
|
# Default: KAFKA_PORT=19092
|
||||||
MINIO_PORT=${MINIO_PORT} # Port on which MinIO object storage service is running
|
KAFKA_PORT=${KAFKA_PORT}
|
||||||
MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY} # Access key to authenticate with the MinIO service
|
|
||||||
MINIO_SECRET_KEY=${MINIO_SECRET_KEY} # Secret key corresponding to the access key for MinIO authentication
|
# Topic in Kafka for storing the latest messages in Redis.
|
||||||
|
# Default: KAFKA_LATESTMSG_REDIS_TOPIC=latestMsgToRedis
|
||||||
|
KAFKA_LATESTMSG_REDIS_TOPIC=${KAFKA_LATESTMSG_REDIS_TOPIC}
|
||||||
|
|
||||||
|
# Topic in Kafka for pushing messages (e.g. notifications or updates).
|
||||||
|
# Default: KAFKA_MSG_PUSH_TOPIC=msgToPush
|
||||||
|
KAFKA_MSG_PUSH_TOPIC=${KAFKA_MSG_PUSH_TOPIC}
|
||||||
|
|
||||||
|
# Topic in Kafka for storing offline messages in MongoDB.
|
||||||
|
# Default: KAFKA_OFFLINEMSG_MONGO_TOPIC=offlineMsgToMongoMysql
|
||||||
|
KAFKA_OFFLINEMSG_MONGO_TOPIC=${KAFKA_OFFLINEMSG_MONGO_TOPIC}
|
||||||
|
|
||||||
|
# ----- MinIO Configuration ----
|
||||||
|
# Address or hostname for the MinIO object storage service.
|
||||||
|
# Default: MINIO_ADDRESS=172.28.0.1
|
||||||
|
MINIO_ADDRESS=${MINIO_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Port on which MinIO object storage service is running.
|
||||||
|
# Default: MINIO_PORT=10005
|
||||||
|
MINIO_PORT=${MINIO_PORT}
|
||||||
|
|
||||||
|
# Access key to authenticate with the MinIO service.
|
||||||
|
# Default: MINIO_ACCESS_KEY=root
|
||||||
|
MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
|
||||||
|
|
||||||
|
# Secret key corresponding to the access key for MinIO authentication.
|
||||||
|
# Default: MINIO_SECRET_KEY=openIM123
|
||||||
|
MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
||||||
|
|
||||||
# ----- Prometheus Configuration -----
|
# ----- Prometheus Configuration -----
|
||||||
PROMETHEUS_ADDRESS=${PROMETHEUS_ADDRESS} # Address or hostname for the Prometheus service
|
# Address or hostname for the Prometheus service.
|
||||||
PROMETHEUS_PORT=${PROMETHEUS_PORT} # Port on which Prometheus service is running
|
# Default: PROMETHEUS_ADDRESS=172.28.0.1
|
||||||
|
PROMETHEUS_ADDRESS=${PROMETHEUS_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Port on which Prometheus service is running.
|
||||||
|
# Default: PROMETHEUS_PORT=19090
|
||||||
|
PROMETHEUS_PORT=${PROMETHEUS_PORT}
|
||||||
|
|
||||||
# ----- Grafana Configuration -----
|
# ----- Grafana Configuration -----
|
||||||
GRAFANA_ADDRESS=${GRAFANA_ADDRESS} # Address or hostname for the Grafana service
|
# Address or hostname for the Grafana service.
|
||||||
GRAFANA_PORT=${GRAFANA_PORT} # Port on which Grafana service is running
|
# Default: GRAFANA_ADDRESS=172.28.0.1
|
||||||
|
GRAFANA_ADDRESS=${GRAFANA_NETWORK_ADDRESS}
|
||||||
|
|
||||||
# ================== OpenIM Web ===========================
|
# Port on which Grafana service is running.
|
||||||
OPENIM_WEB_DIST_PATH=${OPENIM_WEB_DIST_PATH} # Path to the OpenIM web distribution
|
# Default: GRAFANA_PORT=3000
|
||||||
OPENIM_WEB_PORT=${OPENIM_WEB_PORT} # Port on which OpenIM web service is running
|
GRAFANA_PORT=${GRAFANA_PORT}
|
||||||
OPENIM_WEB_ADDRESS=${OPENIM_WEB_ADDRESS} # Address or hostname for the OpenIM web service
|
|
||||||
|
|
||||||
# =================== OpenIM Server =========================
|
# ======================================
|
||||||
OPENIM_SERVER_ADDRESS=${OPENIM_SERVER_ADDRESS} # Address or hostname for the OpenIM server
|
# ============ OpenIM Web ===============
|
||||||
OPENIM_WS_PORT=${OPENIM_WS_PORT} # Port for the OpenIM WebSockets
|
# ======================================
|
||||||
API_OPENIM_PORT=${API_OPENIM_PORT} # Port for the OpenIM API
|
|
||||||
|
|
||||||
# =================== OpenIM Chat ===========================
|
# Path to the OpenIM web distribution.
|
||||||
CHAT_BRANCH=${CHAT_BRANCH} # Branch name for OpenIM chat
|
# Default: OPENIM_WEB_DIST_PATH=/app/dist
|
||||||
OPENIM_CHAT_ADDRESS=${OPENIM_CHAT_ADDRESS} # Address or hostname for the OpenIM chat service
|
OPENIM_WEB_DIST_PATH=${OPENIM_WEB_DIST_PATH}
|
||||||
OPENIM_CHAT_API_PORT=${OPENIM_CHAT_API_PORT} # Port for the OpenIM chat API
|
|
||||||
OPENIM_CHAT_DATA_DIR=${OPENIM_CHAT_DATA_DIR} # Directory path for storing data files or related information
|
|
||||||
|
|
||||||
# =================== OpenIM Admin ==========================
|
# Port on which OpenIM web service is running.
|
||||||
SERVER_BRANCH=${SERVER_BRANCH} # Branch name for OpenIM server
|
# Default: OPENIM_WEB_PORT=11001
|
||||||
OPENIM_ADMIN_API_PORT=${OPENIM_ADMIN_API_PORT} # Port for the OpenIM admin API
|
OPENIM_WEB_PORT=${OPENIM_WEB_PORT}
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM web service.
|
||||||
|
# Default: OPENIM_WEB_ADDRESS=172.28.0.1
|
||||||
|
OPENIM_WEB_ADDRESS=${OPENIM_WEB_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
|
||||||
|
# ======================================
|
||||||
|
# ========= OpenIM Server ==============
|
||||||
|
# ======================================
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM server.
|
||||||
|
# Default: OPENIM_SERVER_ADDRESS=172.28.0.1
|
||||||
|
OPENIM_SERVER_ADDRESS=${OPENIM_SERVER_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Port for the OpenIM WebSockets.
|
||||||
|
# Default: OPENIM_WS_PORT=10001
|
||||||
|
OPENIM_WS_PORT=${OPENIM_WS_PORT}
|
||||||
|
|
||||||
|
# Port for the OpenIM API.
|
||||||
|
# Default: API_OPENIM_PORT=10002
|
||||||
|
API_OPENIM_PORT=${API_OPENIM_PORT}
|
||||||
|
|
||||||
|
|
||||||
|
# ======================================
|
||||||
|
# ========== OpenIM Chat ===============
|
||||||
|
# ======================================
|
||||||
|
|
||||||
|
# Branch name for OpenIM chat.
|
||||||
|
# Default: CHAT_BRANCH=main
|
||||||
|
CHAT_BRANCH=${CHAT_BRANCH}
|
||||||
|
|
||||||
|
# Address or hostname for the OpenIM chat service.
|
||||||
|
# Default: OPENIM_CHAT_ADDRESS=172.28.0.1
|
||||||
|
OPENIM_CHAT_ADDRESS=${OPENIM_CHAT_NETWORK_ADDRESS}
|
||||||
|
|
||||||
|
# Port for the OpenIM chat API.
|
||||||
|
# Default: OPENIM_CHAT_API_PORT=10008
|
||||||
|
OPENIM_CHAT_API_PORT=${OPENIM_CHAT_API_PORT}
|
||||||
|
|
||||||
|
# Directory path for storing data files or related information for OpenIM chat.
|
||||||
|
# Default: OPENIM_CHAT_DATA_DIR=./openim-chat/main
|
||||||
|
OPENIM_CHAT_DATA_DIR=${OPENIM_CHAT_DATA_DIR}
|
||||||
|
|
||||||
|
|
||||||
|
# ======================================
|
||||||
|
# ========== OpenIM Admin ==============
|
||||||
|
# ======================================
|
||||||
|
|
||||||
|
# Branch name for OpenIM server.
|
||||||
|
# Default: SERVER_BRANCH=main
|
||||||
|
SERVER_BRANCH=${SERVER_BRANCH}
|
||||||
|
|
||||||
|
# Port for the OpenIM admin API.
|
||||||
|
# Default: OPENIM_ADMIN_API_PORT=10009
|
||||||
|
OPENIM_ADMIN_API_PORT=${OPENIM_ADMIN_API_PORT}
|
||||||
|
|||||||
@ -61,7 +61,13 @@ openim::log::info "\n## Check all dependent service ports"
|
|||||||
echo "+++ The port being checked: ${OPENIM_DEPENDENCY_PORT_LISTARIES[@]}"
|
echo "+++ The port being checked: ${OPENIM_DEPENDENCY_PORT_LISTARIES[@]}"
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
openim::util::check_ports ${OPENIM_DEPENDENCY_PORT_LISTARIES[@]}
|
|
||||||
|
if grep -qE 'docker|kubepods' /proc/1/cgroup || [ -f /.dockerenv ]; then
|
||||||
|
openim::color::echo ${COLOR_BLUE} "Environment in the interior of the container"
|
||||||
|
else
|
||||||
|
openim::color::echo ${COLOR_BLUE} "The environment is outside the container"
|
||||||
|
openim::util::check_ports ${OPENIM_DEPENDENCY_PORT_LISTARIES[@]} || return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
openim::log::error_exit "The service does not start properly, please check the port, query variable definition!"
|
openim::log::error_exit "The service does not start properly, please check the port, query variable definition!"
|
||||||
@ -69,7 +75,6 @@ if [[ $? -ne 0 ]]; then
|
|||||||
else
|
else
|
||||||
echo "++++ Check all dependent service ports successfully !"
|
echo "++++ Check all dependent service ports successfully !"
|
||||||
fi
|
fi
|
||||||
set -e
|
|
||||||
|
|
||||||
openim::log::info "\n## Check OpenIM service name"
|
openim::log::info "\n## Check OpenIM service name"
|
||||||
. $(dirname ${BASH_SOURCE})/install/openim-msgtransfer.sh openim::msgtransfer::check
|
. $(dirname ${BASH_SOURCE})/install/openim-msgtransfer.sh openim::msgtransfer::check
|
||||||
@ -83,3 +88,5 @@ if [[ $? -ne 0 ]]; then
|
|||||||
else
|
else
|
||||||
echo "++++ Check all openim service ports successfully !"
|
echo "++++ Check all openim service ports successfully !"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
@ -42,7 +42,7 @@ function def() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# app要能访问到此ip和端口或域名
|
# app要能访问到此ip和端口或域名
|
||||||
def "API_URL" "http://${IP}:10002"
|
readonly API_URL=${API_URL:-"http://${IP}:10002"}
|
||||||
|
|
||||||
# OpenIM Docker Compose 数据存储的默认路径
|
# OpenIM Docker Compose 数据存储的默认路径
|
||||||
def "DATA_DIR" "${OPENIM_ROOT}"
|
def "DATA_DIR" "${OPENIM_ROOT}"
|
||||||
@ -74,7 +74,6 @@ def "SERVER_BRANCH" "main"
|
|||||||
###################### OpenIM Docker Network ######################
|
###################### OpenIM Docker Network ######################
|
||||||
# 设置 Docker 网络的网段
|
# 设置 Docker 网络的网段
|
||||||
readonly DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET:-'172.28.0.0/16'}
|
readonly DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET:-'172.28.0.0/16'}
|
||||||
|
|
||||||
IP_PREFIX=$(echo $DOCKER_BRIDGE_SUBNET | cut -d '/' -f 1)
|
IP_PREFIX=$(echo $DOCKER_BRIDGE_SUBNET | cut -d '/' -f 1)
|
||||||
SUBNET=$(echo $DOCKER_BRIDGE_SUBNET | cut -d '/' -f 2)
|
SUBNET=$(echo $DOCKER_BRIDGE_SUBNET | cut -d '/' -f 2)
|
||||||
LAST_OCTET=$(echo $IP_PREFIX | cut -d '.' -f 4)
|
LAST_OCTET=$(echo $IP_PREFIX | cut -d '.' -f 4)
|
||||||
@ -130,7 +129,16 @@ def "API_LISTEN_IP" "0.0.0.0" # API的监听IP
|
|||||||
def "OPENIM_CHAT_DATA_DIR" "./openim-chat/${CHAT_BRANCH}"
|
def "OPENIM_CHAT_DATA_DIR" "./openim-chat/${CHAT_BRANCH}"
|
||||||
def "OPENIM_CHAT_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # OpenIM服务地址
|
def "OPENIM_CHAT_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # OpenIM服务地址
|
||||||
def "OPENIM_CHAT_API_PORT" "10008" # OpenIM API端口
|
def "OPENIM_CHAT_API_PORT" "10008" # OpenIM API端口
|
||||||
|
def "CHAT_API_LISTEN_IP" "" # OpenIM API的监听IP
|
||||||
|
|
||||||
def "OPENIM_ADMIN_API_PORT" "10009" # OpenIM Admin API端口
|
def "OPENIM_ADMIN_API_PORT" "10009" # 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 注意: 一般的配置都可以使用 def 函数来定义,如果是包含特殊字符,比如说:
|
||||||
# TODO readonly MSG_DESTRUCT_TIME=${MSG_DESTRUCT_TIME:-'0 2 * * *'}
|
# TODO readonly MSG_DESTRUCT_TIME=${MSG_DESTRUCT_TIME:-'0 2 * * *'}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user