mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 21:22:16 +08:00
feat: add scripts set
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
31611f5657
commit
ab91f24fd1
24
.env
24
.env
@ -1,5 +1,19 @@
|
|||||||
USER="root"
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
PASSWORD="openIM123"
|
#
|
||||||
MINIO_ENDPOINT="http://127.0.0.1:10005"
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
API_URL="http://127.0.0.1:10002/object/"
|
# you may not use this file except in compliance with the License.
|
||||||
DATA_DIR="/root/workspaces/openim/Open-IM-Server"
|
# 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.
|
||||||
|
|
||||||
|
USER=root
|
||||||
|
PASSWORD=openIM123
|
||||||
|
MINIO_ENDPOINT=http://http://127.0.0.1:10005
|
||||||
|
API_URL=http://http://127.0.0.1:10002/object/
|
||||||
|
DATA_DIR=/root/workspaces/openim/openim-server
|
||||||
|
|||||||
@ -114,7 +114,7 @@ api:
|
|||||||
openImApiPort: [ 10002 ]
|
openImApiPort: [ 10002 ]
|
||||||
listenIP: 0.0.0.0
|
listenIP: 0.0.0.0
|
||||||
|
|
||||||
###################### Object ######################
|
###################### Gateway ######################
|
||||||
# Object storage configuration
|
# Object storage configuration
|
||||||
#
|
#
|
||||||
# Use minio for object storage
|
# Use minio for object storage
|
||||||
@ -165,6 +165,7 @@ rpcPort:
|
|||||||
openImConversationPort: [ 10180 ]
|
openImConversationPort: [ 10180 ]
|
||||||
openImThirdPort: [ 10190 ]
|
openImThirdPort: [ 10190 ]
|
||||||
|
|
||||||
|
# RPC service names for registration, it's not recommended to modify these
|
||||||
rpcRegisterName:
|
rpcRegisterName:
|
||||||
openImUserName: User
|
openImUserName: User
|
||||||
openImFriendName: Friend
|
openImFriendName: Friend
|
||||||
@ -176,6 +177,15 @@ rpcRegisterName:
|
|||||||
openImConversationName: Conversation
|
openImConversationName: Conversation
|
||||||
openImThirdName: Third
|
openImThirdName: Third
|
||||||
|
|
||||||
|
# Log configuration
|
||||||
|
#
|
||||||
|
# Storage directory
|
||||||
|
# Log rotation time
|
||||||
|
# Maximum number of logs to retain
|
||||||
|
# Log level, 6 means all levels
|
||||||
|
# Whether to output to stdout
|
||||||
|
# Whether to output in json format
|
||||||
|
# Whether to include stack trace in logs
|
||||||
log:
|
log:
|
||||||
storageLocation: ../../../../../logs/
|
storageLocation: ../../../../../logs/
|
||||||
rotationTime: 24
|
rotationTime: 24
|
||||||
@ -185,12 +195,25 @@ log:
|
|||||||
isJson: false
|
isJson: false
|
||||||
withStack: false
|
withStack: false
|
||||||
|
|
||||||
|
# Long connection server configuration
|
||||||
|
#
|
||||||
|
# Websocket port for msg_gateway
|
||||||
|
# Maximum number of websocket connections
|
||||||
|
# Maximum length of websocket request package
|
||||||
|
# Websocket connection handshake timeout
|
||||||
longConnSvr:
|
longConnSvr:
|
||||||
openImWsPort: [ 10001 ]
|
openImWsPort: [ 10001 ]
|
||||||
websocketMaxConnNum: 100000
|
websocketMaxConnNum: 100000
|
||||||
websocketMaxMsgLen: 4096
|
websocketMaxMsgLen: 4096
|
||||||
websocketTimeout: 10
|
websocketTimeout: 10
|
||||||
|
|
||||||
|
# Push notification service configuration
|
||||||
|
#
|
||||||
|
# Use GeTui for push notifications
|
||||||
|
# GeTui offline push configuration
|
||||||
|
# FCM offline push configuration
|
||||||
|
# Account file, place it in the config directory
|
||||||
|
# JPush configuration, modify these after applying in JPush backend
|
||||||
push:
|
push:
|
||||||
enable: getui
|
enable: getui
|
||||||
geTui:
|
geTui:
|
||||||
@ -208,41 +231,66 @@ push:
|
|||||||
pushUrl:
|
pushUrl:
|
||||||
pushIntent:
|
pushIntent:
|
||||||
|
|
||||||
|
# App manager configuration
|
||||||
|
#
|
||||||
|
# Built-in app manager user IDs
|
||||||
|
# Built-in app manager nicknames
|
||||||
manager:
|
manager:
|
||||||
userID: [ "openIM123456","openIM654321","openIMAdmin" ]
|
userID: [ "openIM123456","openIM654321","openIMAdmin" ]
|
||||||
nickname: [ "system1","system2", "system3" ]
|
nickname: [ "system1","system2", "system3" ]
|
||||||
|
|
||||||
|
# Multi-platform login policy
|
||||||
|
# For each platform(Android, iOS, Windows, Mac, web), only one can be online at a time
|
||||||
multiLoginPolicy: 1
|
multiLoginPolicy: 1
|
||||||
|
|
||||||
|
# Whether to store messages in MySQL, messages in MySQL are only used for management background
|
||||||
chatPersistenceMysql: true
|
chatPersistenceMysql: true
|
||||||
|
|
||||||
|
# Message cache timeout in seconds, it's not recommended to modify
|
||||||
msgCacheTimeout: 86400
|
msgCacheTimeout: 86400
|
||||||
|
|
||||||
|
# Whether to enable read receipts for group chat
|
||||||
groupMessageHasReadReceiptEnable: true
|
groupMessageHasReadReceiptEnable: true
|
||||||
|
|
||||||
|
# Whether to enable read receipts for single chat
|
||||||
singleMessageHasReadReceiptEnable: true
|
singleMessageHasReadReceiptEnable: true
|
||||||
|
|
||||||
|
# MongoDB offline message retention period in days
|
||||||
retainChatRecords: 365
|
retainChatRecords: 365
|
||||||
|
|
||||||
|
# Schedule to clear expired messages(older than retainChatRecords days) in MongoDB every Wednesday at 2am
|
||||||
|
# This deletion is just for cleaning up disk usage according to previous configuration retainChatRecords, no notification will be sent
|
||||||
chatRecordsClearTime: "0 2 * * 3"
|
chatRecordsClearTime: "0 2 * * 3"
|
||||||
|
|
||||||
|
# Schedule to auto delete messages every day at 2am
|
||||||
|
# This deletion is for messages that have been retained for more than msg_destruct_time (seconds) in the conversation field
|
||||||
msgDestructTime: "0 2 * * *"
|
msgDestructTime: "0 2 * * *"
|
||||||
|
|
||||||
|
# Secret key
|
||||||
secret: openIM123
|
secret: openIM123
|
||||||
|
|
||||||
|
# Token policy
|
||||||
|
#
|
||||||
|
# Token expiration period in days
|
||||||
tokenPolicy:
|
tokenPolicy:
|
||||||
expire: 90
|
expire: 90
|
||||||
|
|
||||||
|
# Message verification policy
|
||||||
|
#
|
||||||
|
# Whether to verify friendship when sending messages
|
||||||
messageVerify:
|
messageVerify:
|
||||||
friendVerify: false
|
friendVerify: false
|
||||||
|
|
||||||
|
# iOS push notification configuration
|
||||||
|
#
|
||||||
|
# iOS push notification sound
|
||||||
|
# Whether to count badge
|
||||||
# Whether it's production environment
|
# Whether it's production environment
|
||||||
iosPush:
|
iosPush:
|
||||||
pushSound: "xxx"
|
pushSound: "xxx"
|
||||||
badgeCount: true
|
badgeCount: true
|
||||||
production: false
|
production: false
|
||||||
|
|
||||||
###################### Third-party service configuration ######################
|
|
||||||
# Callback configuration
|
# Callback configuration
|
||||||
#
|
#
|
||||||
# Callback URL
|
# Callback URL
|
||||||
@ -327,4 +375,4 @@ prometheus:
|
|||||||
conversationPrometheusPort: [ 20230 ]
|
conversationPrometheusPort: [ 20230 ]
|
||||||
rtcPrometheusPort: [ 21300 ]
|
rtcPrometheusPort: [ 21300 ]
|
||||||
thirdPrometheusPort: [ 21301 ]
|
thirdPrometheusPort: [ 21301 ]
|
||||||
messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ]
|
messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ]
|
||||||
387
config/openim_config.yaml
Normal file
387
config/openim_config.yaml
Normal file
@ -0,0 +1,387 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
# TODO: This config file is the template file
|
||||||
|
# --| source: scripts/template/config-tmpl/openim_config.yaml
|
||||||
|
# --| env: scripts/install/environment.sh
|
||||||
|
# --| target: config/config.yaml
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
|
||||||
|
###################### Zookeeper ######################
|
||||||
|
# Zookeeper configuration
|
||||||
|
# It's not recommended to modify the schema
|
||||||
|
#
|
||||||
|
# Zookeeper address
|
||||||
|
# Zookeeper username
|
||||||
|
# Zookeeper password
|
||||||
|
zookeeper:
|
||||||
|
schema: openim
|
||||||
|
address: [ 127.0.0.1:2181 ]
|
||||||
|
username: ''
|
||||||
|
password: ''
|
||||||
|
|
||||||
|
###################### Mysql ######################
|
||||||
|
# MySQL configuration
|
||||||
|
# Currently, only single machine setup is supported
|
||||||
|
#
|
||||||
|
# Maximum number of open connections
|
||||||
|
# Maximum number of idle connections
|
||||||
|
# Maximum lifetime in seconds a connection can be reused
|
||||||
|
# Log level: 1=slient, 2=error, 3=warn, 4=info
|
||||||
|
# Slow query threshold in milliseconds
|
||||||
|
mysql:
|
||||||
|
address: [ 127.0.0.1:13306 ]
|
||||||
|
username: root
|
||||||
|
password: openIM123
|
||||||
|
database: openIM_v3
|
||||||
|
maxOpenConn: 1000
|
||||||
|
maxIdleConn: 100
|
||||||
|
maxLifeTime: 60
|
||||||
|
logLevel: 4
|
||||||
|
slowThreshold: 500
|
||||||
|
|
||||||
|
###################### Mongo ######################
|
||||||
|
# MongoDB configuration
|
||||||
|
# If uri is not empty, it will be used directly
|
||||||
|
#
|
||||||
|
# MongoDB address for standalone setup, Mongos address for sharded cluster setup
|
||||||
|
# Default MongoDB database name
|
||||||
|
# Maximum connection pool size
|
||||||
|
mongo:
|
||||||
|
uri: ''
|
||||||
|
address: [ 127.0.0.1:37017 ]
|
||||||
|
database: openIM_v3
|
||||||
|
username: root
|
||||||
|
password: openIM123
|
||||||
|
maxPoolSize: 100
|
||||||
|
|
||||||
|
###################### Redis configuration information ######################
|
||||||
|
# Redis configuration
|
||||||
|
#
|
||||||
|
# Username is required only for Redis version 6.0+
|
||||||
|
redis:
|
||||||
|
address: [ 127.0.0.1:16379 ]
|
||||||
|
username: ''
|
||||||
|
password: openIM123
|
||||||
|
|
||||||
|
###################### Kafka configuration information ######################
|
||||||
|
# Kafka configuration
|
||||||
|
#
|
||||||
|
# Kafka username
|
||||||
|
# Kafka password
|
||||||
|
# It's not recommended to modify this topic name
|
||||||
|
# Consumer group ID, it's not recommended to modify
|
||||||
|
kafka:
|
||||||
|
username: ''
|
||||||
|
password: ''
|
||||||
|
addr: [ 127.0.0.1:9092 ]
|
||||||
|
latestMsgToRedis:
|
||||||
|
topic: "latestMsgToRedis"
|
||||||
|
offlineMsgToMongo:
|
||||||
|
topic: "offlineMsgToMongoMysql"
|
||||||
|
msgToPush:
|
||||||
|
topic: "msgToPush"
|
||||||
|
consumerGroupID:
|
||||||
|
msgToRedis: redis
|
||||||
|
msgToMongo: mongo
|
||||||
|
msgToMySql: mysql
|
||||||
|
msgToPush: push
|
||||||
|
|
||||||
|
###################### RPC configuration information ######################
|
||||||
|
# RPC configuration
|
||||||
|
#
|
||||||
|
# IP address to register with zookeeper when starting RPC, the IP and corresponding rpcPort should be accessible by api/gateway
|
||||||
|
# Default listen IP is 0.0.0.0
|
||||||
|
rpc:
|
||||||
|
registerIP: ''
|
||||||
|
listenIP: 0.0.0.0
|
||||||
|
|
||||||
|
###################### API configuration information ######################
|
||||||
|
# API configuration
|
||||||
|
#
|
||||||
|
# API service port
|
||||||
|
# Default listen IP is 0.0.0.0
|
||||||
|
api:
|
||||||
|
openImApiPort: [ 10002 ]
|
||||||
|
listenIP: 0.0.0.0
|
||||||
|
|
||||||
|
###################### Object configuration information ######################
|
||||||
|
# Object storage configuration
|
||||||
|
#
|
||||||
|
# Use minio for object storage
|
||||||
|
# API URL should be accessible by the app
|
||||||
|
# It's not recommended to modify the bucket name
|
||||||
|
# Endpoint should be accessible by the app
|
||||||
|
# Session token
|
||||||
|
# Configuration for Tencent COS
|
||||||
|
# Configuration for Aliyun OSS
|
||||||
|
# apiURL is the address of the api, the access address of the app, use s3 must be configured
|
||||||
|
# minio.endpoint can be configured as an intranet address,
|
||||||
|
# minio.signEndpoint is minio public network address
|
||||||
|
object:
|
||||||
|
enable: "minio"
|
||||||
|
apiURL: "http://127.0.0.1:10002/object/"
|
||||||
|
minio:
|
||||||
|
bucket: "openim"
|
||||||
|
endpoint: "http://http://127.0.0.1:10005"
|
||||||
|
accessKeyID: "root"
|
||||||
|
secretAccessKey: "openIM123"
|
||||||
|
sessionToken: ''
|
||||||
|
signEndpoint: "http://http://127.0.0.1:10005"
|
||||||
|
cos:
|
||||||
|
bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com
|
||||||
|
secretID: ''
|
||||||
|
secretKey: ''
|
||||||
|
sessionToken: ''
|
||||||
|
oss:
|
||||||
|
endpoint: "https://oss-cn-chengdu.aliyuncs.com"
|
||||||
|
bucket: "demo-9999999"
|
||||||
|
bucketURL: "https://demo-9999999.oss-cn-chengdu.aliyuncs.com"
|
||||||
|
accessKeyID: root
|
||||||
|
accessKeySecret: ''
|
||||||
|
sessionToken: ''
|
||||||
|
|
||||||
|
|
||||||
|
###################### RPC Port Configuration ######################
|
||||||
|
# RPC service ports
|
||||||
|
# These ports are passed into the program by the script and are not recommended to modify
|
||||||
|
# For launching multiple programs, just fill in multiple ports separated by commas
|
||||||
|
# For example, [10110, 10111]
|
||||||
|
rpcPort:
|
||||||
|
openImUserPort: [ 10110 ]
|
||||||
|
openImFriendPort: [ 10120 ]
|
||||||
|
openImMessagePort: [ 10130 ]
|
||||||
|
openImMessageGatewayPort: [ 10140 ]
|
||||||
|
openImGroupPort: [ 10150 ]
|
||||||
|
openImAuthPort: [ 10160 ]
|
||||||
|
openImPushPort: [ 10170 ]
|
||||||
|
openImConversationPort: [ 10180 ]
|
||||||
|
openImThirdPort: [ 10190 ]
|
||||||
|
|
||||||
|
###################### RPC Register Name Configuration ######################
|
||||||
|
# RPC service names for registration, it's not recommended to modify these
|
||||||
|
rpcRegisterName:
|
||||||
|
openImUserName: User
|
||||||
|
openImFriendName: Friend
|
||||||
|
openImMsgName: Msg
|
||||||
|
openImPushName: Push
|
||||||
|
openImMessageGatewayName: MessageGateway
|
||||||
|
openImGroupName: Group
|
||||||
|
openImAuthName: Auth
|
||||||
|
openImConversationName: Conversation
|
||||||
|
openImThirdName: Third
|
||||||
|
|
||||||
|
###################### Log Configuration ######################
|
||||||
|
# Log configuration
|
||||||
|
#
|
||||||
|
# Storage directory
|
||||||
|
# Log rotation time
|
||||||
|
# Maximum number of logs to retain
|
||||||
|
# Log level, 6 means all levels
|
||||||
|
# Whether to output to stdout
|
||||||
|
# Whether to output in json format
|
||||||
|
# Whether to include stack trace in logs
|
||||||
|
log:
|
||||||
|
storageLocation: /root/workspaces/openim/openim-server/logs/
|
||||||
|
rotationTime: 24
|
||||||
|
remainRotationCount: 2
|
||||||
|
remainLogLevel: 6
|
||||||
|
isStdout: false
|
||||||
|
isJson: false
|
||||||
|
withStack: false
|
||||||
|
|
||||||
|
###################### Variables definition ######################
|
||||||
|
# Long connection server configuration
|
||||||
|
#
|
||||||
|
# Websocket port for msg_gateway
|
||||||
|
# Maximum number of websocket connections
|
||||||
|
# Maximum length of websocket request package
|
||||||
|
# Websocket connection handshake timeout
|
||||||
|
longConnSvr:
|
||||||
|
openImWsPort: [ 10001 ]
|
||||||
|
websocketMaxConnNum: 100000
|
||||||
|
websocketMaxMsgLen: 4096
|
||||||
|
websocketTimeout: 10
|
||||||
|
|
||||||
|
# Push notification service configuration
|
||||||
|
#
|
||||||
|
# Use GeTui for push notifications
|
||||||
|
# GeTui offline push configuration
|
||||||
|
# FCM offline push configuration
|
||||||
|
# Account file, place it in the config directory
|
||||||
|
# JPush configuration, modify these after applying in JPush backend
|
||||||
|
push:
|
||||||
|
enable: getui
|
||||||
|
geTui:
|
||||||
|
pushUrl: "https://restapi.getui.com/v2/$appId"
|
||||||
|
masterSecret: ""
|
||||||
|
appKey: ""
|
||||||
|
intent: ""
|
||||||
|
channelID: ""
|
||||||
|
channelName: ""
|
||||||
|
fcm:
|
||||||
|
serviceAccount: x.json
|
||||||
|
jpns:
|
||||||
|
appKey:
|
||||||
|
masterSecret:
|
||||||
|
pushUrl:
|
||||||
|
pushIntent:
|
||||||
|
|
||||||
|
# App manager configuration
|
||||||
|
#
|
||||||
|
# Built-in app manager user IDs
|
||||||
|
# Built-in app manager nicknames
|
||||||
|
manager:
|
||||||
|
userID: [ "openIM123456", "openIM654321", "openIMAdmin" ]
|
||||||
|
nickname: [ "system1", "system2", "system3" ]
|
||||||
|
|
||||||
|
# Multi-platform login policy
|
||||||
|
# For each platform(Android, iOS, Windows, Mac, web), only one can be online at a time
|
||||||
|
multiLoginPolicy: 1
|
||||||
|
|
||||||
|
# Whether to store messages in MySQL, messages in MySQL are only used for management background
|
||||||
|
chatPersistenceMysql: true
|
||||||
|
|
||||||
|
# Message cache timeout in seconds, it's not recommended to modify
|
||||||
|
msgCacheTimeout: 86400
|
||||||
|
|
||||||
|
# Whether to enable read receipts for group chat
|
||||||
|
groupMessageHasReadReceiptEnable: true
|
||||||
|
|
||||||
|
# Whether to enable read receipts for single chat
|
||||||
|
singleMessageHasReadReceiptEnable: true
|
||||||
|
|
||||||
|
# MongoDB offline message retention period in days
|
||||||
|
retainChatRecords: 365
|
||||||
|
|
||||||
|
# Schedule to clear expired messages(older than retainChatRecords days) in MongoDB every Wednesday at 2am
|
||||||
|
# This deletion is just for cleaning up disk usage according to previous configuration retainChatRecords, no notification will be sent
|
||||||
|
chatRecordsClearTime: "0 2 * * 3"
|
||||||
|
|
||||||
|
# Schedule to auto delete messages every day at 2am
|
||||||
|
# This deletion is for messages that have been retained for more than msg_destruct_time (seconds) in the conversation field
|
||||||
|
msgDestructTime: "0 2 * * *"
|
||||||
|
|
||||||
|
# Secret key
|
||||||
|
secret: openIM123
|
||||||
|
|
||||||
|
# Token policy
|
||||||
|
#
|
||||||
|
# Token expiration period in days
|
||||||
|
tokenPolicy:
|
||||||
|
expire: 90
|
||||||
|
|
||||||
|
# Message verification policy
|
||||||
|
#
|
||||||
|
# Whether to verify friendship when sending messages
|
||||||
|
messageVerify:
|
||||||
|
friendVerify: false
|
||||||
|
|
||||||
|
# iOS push notification configuration
|
||||||
|
#
|
||||||
|
# iOS push notification sound
|
||||||
|
# Whether to count badge
|
||||||
|
# Whether it's production environment
|
||||||
|
iosPush:
|
||||||
|
pushSound: "xxx"
|
||||||
|
badgeCount: true
|
||||||
|
production: false
|
||||||
|
|
||||||
|
###################### Third-party service configuration ######################
|
||||||
|
# Callback configuration
|
||||||
|
#
|
||||||
|
# Callback URL
|
||||||
|
# Whether to enable this callback event
|
||||||
|
# Timeout in seconds
|
||||||
|
# Whether to continue execution if callback fails
|
||||||
|
callback:
|
||||||
|
url:
|
||||||
|
beforeSendSingleMsg:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterSendSingleMsg:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
beforeSendGroupMsg:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterSendGroupMsg:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
msgModify:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
userOnline:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
userOffline:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
userKickOff:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
onlinePush:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
superGroupOnlinePush:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeAddFriend:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeCreateGroup:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeMemberJoinGroup:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeSetGroupMemberInfo:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
setMessageReactionExtensions:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
|
||||||
|
###################### Prometheus ######################
|
||||||
|
# Prometheus configuration for various services
|
||||||
|
# The number of Prometheus ports per service needs to correspond to rpcPort
|
||||||
|
# The number of ports needs to be consistent with msg_transfer_service_num in script/path_info.sh
|
||||||
|
prometheus:
|
||||||
|
enable: false
|
||||||
|
userPrometheusPort: [ 20110 ]
|
||||||
|
friendPrometheusPort: [ 20120 ]
|
||||||
|
messagePrometheusPort: [ 20130 ]
|
||||||
|
messageGatewayPrometheusPort: [ 20140 ]
|
||||||
|
groupPrometheusPort: [ 20150 ]
|
||||||
|
authPrometheusPort: [ 20160 ]
|
||||||
|
pushPrometheusPort: [ 20170 ]
|
||||||
|
conversationPrometheusPort: [ 20230 ]
|
||||||
|
rtcPrometheusPort: [ 21300 ]
|
||||||
|
thirdPrometheusPort: [ 21301 ]
|
||||||
|
messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] # List of ports
|
||||||
@ -12,8 +12,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
USER="${USER}"
|
USER=${USER}
|
||||||
PASSWORD="${PASSWORD}"
|
PASSWORD=${PASSWORD}
|
||||||
MINIO_ENDPOINT="${MINIO_ENDPOINT}"
|
MINIO_ENDPOINT=${MINIO_ENDPOINT}
|
||||||
API_URL="${API_URL}"
|
API_URL=${API_URL}
|
||||||
DATA_DIR="${DATA_DIR}"
|
DATA_DIR=${DATA_DIR}
|
||||||
@ -88,11 +88,11 @@ kafka:
|
|||||||
password: ${KAFKA_PASSWORD}
|
password: ${KAFKA_PASSWORD}
|
||||||
addr: [ ${KAFKA_ADDR}:${KAFKA_PORT} ]
|
addr: [ ${KAFKA_ADDR}:${KAFKA_PORT} ]
|
||||||
latestMsgToRedis:
|
latestMsgToRedis:
|
||||||
topic: ${KAFKA_LATESTMSG_REDIS_TOPIC}
|
topic: "${KAFKA_LATESTMSG_REDIS_TOPIC}"
|
||||||
offlineMsgToMongo:
|
offlineMsgToMongo:
|
||||||
topic: ${KAFKA_OFFLINEMSG_MONGO_TOPIC}
|
topic: "${KAFKA_OFFLINEMSG_MONGO_TOPIC}"
|
||||||
msgToPush:
|
msgToPush:
|
||||||
topic: ${KAFKA_MSG_PUSH_TOPIC}
|
topic: "${KAFKA_MSG_PUSH_TOPIC}"
|
||||||
consumerGroupID:
|
consumerGroupID:
|
||||||
msgToRedis: ${KAFKA_CONSUMERGROUPID_REDIS}
|
msgToRedis: ${KAFKA_CONSUMERGROUPID_REDIS}
|
||||||
msgToMongo: ${KAFKA_CONSUMERGROUPID_MONGO}
|
msgToMongo: ${KAFKA_CONSUMERGROUPID_MONGO}
|
||||||
@ -127,25 +127,28 @@ api:
|
|||||||
# Session token
|
# Session token
|
||||||
# Configuration for Tencent COS
|
# Configuration for Tencent COS
|
||||||
# Configuration for Aliyun OSS
|
# Configuration for Aliyun OSS
|
||||||
# It can be set by an environment variable or by a script
|
# apiURL is the address of the api, the access address of the app, use s3 must be configured
|
||||||
|
# minio.endpoint can be configured as an intranet address,
|
||||||
|
# minio.signEndpoint is minio public network address
|
||||||
object:
|
object:
|
||||||
enable: ${OBJECT_ENABLE}
|
enable: "${OBJECT_ENABLE}"
|
||||||
apiURL: ${OBJECT_APIURL}
|
apiURL: "${OBJECT_APIURL}"
|
||||||
minio:
|
minio:
|
||||||
bucket: ${MINIO_BUCKET}
|
bucket: "${MINIO_BUCKET}"
|
||||||
endpoint: ${MINIO_ENDPOINT}
|
endpoint: "${MINIO_ENDPOINT}"
|
||||||
accessKeyID: ${MINIO_ACCESS_KEY}
|
accessKeyID: "${MINIO_ACCESS_KEY}"
|
||||||
secretAccessKey: ${MINIO_SECRET_KEY}
|
secretAccessKey: "${MINIO_SECRET_KEY}"
|
||||||
sessionToken: ${MINIO_SESSION_TOKEN}
|
sessionToken: ${MINIO_SESSION_TOKEN}
|
||||||
|
signEndpoint: "${MINIO_SIGN_ENDPOINT}"
|
||||||
cos:
|
cos:
|
||||||
bucketURL: ${COS_BUCKET_URL}
|
bucketURL: ${COS_BUCKET_URL}
|
||||||
secretID: ${COS_SECRET_ID}
|
secretID: ${COS_SECRET_ID}
|
||||||
secretKey: ${COS_SECRET_KEY}
|
secretKey: ${COS_SECRET_KEY}
|
||||||
sessionToken: ${COS_SESSION_TOKEN}
|
sessionToken: ${COS_SESSION_TOKEN}
|
||||||
oss:
|
oss:
|
||||||
endpoint: ${OSS_ENDPOINT}
|
endpoint: "${OSS_ENDPOINT}"
|
||||||
bucket: ${OSS_BUCKET}
|
bucket: "${OSS_BUCKET}"
|
||||||
bucketURL: ${OSS_BUCKET_URL}
|
bucketURL: "${OSS_BUCKET_URL}"
|
||||||
accessKeyID: ${OSS_ACCESS_KEY_ID}
|
accessKeyID: ${OSS_ACCESS_KEY_ID}
|
||||||
accessKeySecret: ${OSS_ACCESS_KEY_SECRET}
|
accessKeySecret: ${OSS_ACCESS_KEY_SECRET}
|
||||||
sessionToken: ${OSS_SESSION_TOKEN}
|
sessionToken: ${OSS_SESSION_TOKEN}
|
||||||
@ -191,7 +194,7 @@ rpcRegisterName:
|
|||||||
# Whether to output in json format
|
# Whether to output in json format
|
||||||
# Whether to include stack trace in logs
|
# Whether to include stack trace in logs
|
||||||
log:
|
log:
|
||||||
storageLocation: "${LOG_STORAGE_LOCATION}"
|
storageLocation: ${LOG_STORAGE_LOCATION}
|
||||||
rotationTime: ${LOG_ROTATION_TIME}
|
rotationTime: ${LOG_ROTATION_TIME}
|
||||||
remainRotationCount: ${LOG_REMAIN_ROTATION_COUNT}
|
remainRotationCount: ${LOG_REMAIN_ROTATION_COUNT}
|
||||||
remainLogLevel: ${LOG_REMAIN_LOG_LEVEL}
|
remainLogLevel: ${LOG_REMAIN_LOG_LEVEL}
|
||||||
@ -223,18 +226,18 @@ push:
|
|||||||
enable: ${PUSH_ENABLE}
|
enable: ${PUSH_ENABLE}
|
||||||
geTui:
|
geTui:
|
||||||
pushUrl: "${GETUI_PUSH_URL}"
|
pushUrl: "${GETUI_PUSH_URL}"
|
||||||
masterSecret:
|
masterSecret: ""
|
||||||
appKey:
|
appKey: ""
|
||||||
intent:
|
intent: ""
|
||||||
channelID:
|
channelID: ""
|
||||||
channelName:
|
channelName: ""
|
||||||
fcm:
|
fcm:
|
||||||
serviceAccount: ${FCM_SERVICE_ACCOUNT}
|
serviceAccount: ${FCM_SERVICE_ACCOUNT}
|
||||||
jpns:
|
jpns:
|
||||||
appKey: ${JPNS_APP_KEY}
|
appKey:
|
||||||
masterSecret: ${JPNS_MASTER_SECRET}
|
masterSecret:
|
||||||
pushUrl: ${JPNS_PUSH_URL}
|
pushUrl:
|
||||||
pushIntent: ${JPNS_PUSH_INTENT}
|
pushIntent:
|
||||||
|
|
||||||
# App manager configuration
|
# App manager configuration
|
||||||
#
|
#
|
||||||
@ -242,7 +245,7 @@ push:
|
|||||||
# Built-in app manager nicknames
|
# Built-in app manager nicknames
|
||||||
manager:
|
manager:
|
||||||
userID: [ "${MANAGER_USERID_1}", "${MANAGER_USERID_2}", "${MANAGER_USERID_3}" ]
|
userID: [ "${MANAGER_USERID_1}", "${MANAGER_USERID_2}", "${MANAGER_USERID_3}" ]
|
||||||
nickname: [ ${NICKNAME_1}, ${NICKNAME_2}, ${NICKNAME_3} ]
|
nickname: [ "${NICKNAME_1}", "${NICKNAME_2}", "${NICKNAME_3}" ]
|
||||||
|
|
||||||
# Multi-platform login policy
|
# Multi-platform login policy
|
||||||
# For each platform(Android, iOS, Windows, Mac, web), only one can be online at a time
|
# For each platform(Android, iOS, Windows, Mac, web), only one can be online at a time
|
||||||
|
|||||||
@ -98,82 +98,82 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
command: minio server /data --console-address ':9090'
|
command: minio server /data --console-address ':9090'
|
||||||
|
|
||||||
openim-server:
|
# openim-server:
|
||||||
# image: ghcr.io/openimsdk/openim-server:latest
|
# # image: ghcr.io/openimsdk/openim-server:latest
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:v3.2.1-beta.4
|
# image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:v3.2.1-beta.4
|
||||||
# image: openim/openim-server:latest
|
# # image: openim/openim-server:latest
|
||||||
# build: .
|
# # build: .
|
||||||
container_name: openim-server
|
# container_name: openim-server
|
||||||
volumes:
|
# volumes:
|
||||||
- ./logs:/openim/openim-server/logs
|
# - ./logs:/openim/openim-server/logs
|
||||||
- ./config:/openim/openim-server/config
|
# - ./config:/openim/openim-server/config
|
||||||
- ./scripts:/openim/openim-server/scripts
|
# - ./scripts:/openim/openim-server/scripts
|
||||||
restart: always
|
# restart: always
|
||||||
depends_on:
|
# depends_on:
|
||||||
- zookeeper
|
# - zookeeper
|
||||||
- kafka
|
# - kafka
|
||||||
- mysql
|
# - mysql
|
||||||
- mongodb
|
# - mongodb
|
||||||
- redis
|
# - redis
|
||||||
- minio
|
# - minio
|
||||||
network_mode: "host"
|
# network_mode: "host"
|
||||||
logging:
|
# logging:
|
||||||
driver: json-file
|
# driver: json-file
|
||||||
options:
|
# options:
|
||||||
max-size: "1g"
|
# max-size: "1g"
|
||||||
max-file: "2"
|
# max-file: "2"
|
||||||
|
|
||||||
openim-chat:
|
# openim-chat:
|
||||||
# image: ghcr.io/openimsdk/openim-chat:latest
|
# # image: ghcr.io/openimsdk/openim-chat:latest
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat:latest
|
# image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat:latest
|
||||||
# image: openim/openim-chat:latest
|
# # image: openim/openim-chat:latest
|
||||||
container_name: openim-chat
|
# container_name: openim-chat
|
||||||
healthcheck:
|
# healthcheck:
|
||||||
test: ["CMD-SHELL", "./scripts/check_all.sh"]
|
# test: ["CMD-SHELL", "./scripts/check_all.sh"]
|
||||||
interval: 30s
|
# interval: 30s
|
||||||
timeout: 10s
|
# timeout: 10s
|
||||||
retries: 5
|
# retries: 5
|
||||||
volumes:
|
# volumes:
|
||||||
- ${DATA_DIR}/_output/openim/openim-chat/logs:/openim/openim-chat/logs
|
# - ${DATA_DIR}/_output/openim/openim-chat/logs:/openim/openim-chat/logs
|
||||||
- ${DATA_DIR}/_output/openim/openim-chat/config:/openim/openim-chat/config
|
# - ${DATA_DIR}/_output/openim/openim-chat/config:/openim/openim-chat/config
|
||||||
- ${DATA_DIR}/_output/openim/openim-chat/scripts:/openim/openim-chat/scripts
|
# - ${DATA_DIR}/_output/openim/openim-chat/scripts:/openim/openim-chat/scripts
|
||||||
restart: always
|
# restart: always
|
||||||
user: root:root
|
# user: root:root
|
||||||
depends_on:
|
# depends_on:
|
||||||
- mysql
|
# - mysql
|
||||||
- mongodb
|
# - mongodb
|
||||||
- redis
|
# - redis
|
||||||
- minio
|
# - minio
|
||||||
- openim-server
|
# - openim-server
|
||||||
network_mode: "host"
|
# network_mode: "host"
|
||||||
logging:
|
# logging:
|
||||||
driver: json-file
|
# driver: json-file
|
||||||
options:
|
# options:
|
||||||
max-size: "1g"
|
# max-size: "1g"
|
||||||
max-file: "2"
|
# max-file: "2"
|
||||||
|
|
||||||
prometheus:
|
# prometheus:
|
||||||
image: prom/prometheus
|
# image: prom/prometheus
|
||||||
volumes:
|
# volumes:
|
||||||
- ./.docker-compose_cfg/prometheus-compose.yml:/etc/prometheus/prometheus.yml
|
# - ./.docker-compose_cfg/prometheus-compose.yml:/etc/prometheus/prometheus.yml
|
||||||
container_name: prometheus
|
# container_name: prometheus
|
||||||
# ports:
|
# # ports:
|
||||||
# - 9091:9091
|
# # - 9091:9091
|
||||||
depends_on:
|
# depends_on:
|
||||||
- openim-server
|
# - openim-server
|
||||||
command: --web.listen-address=:9091 --config.file="/etc/prometheus/prometheus.yml"
|
# command: --web.listen-address=:9091 --config.file="/etc/prometheus/prometheus.yml"
|
||||||
network_mode: "host"
|
# network_mode: "host"
|
||||||
|
|
||||||
grafana:
|
# grafana:
|
||||||
image: grafana/grafana
|
# image: grafana/grafana
|
||||||
volumes:
|
# volumes:
|
||||||
- ./.docker-compose_cfg/datasource-compose.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
|
# - ./.docker-compose_cfg/datasource-compose.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
|
||||||
- ./.docker-compose_cfg/grafana.ini:/etc/grafana/grafana.ini
|
# - ./.docker-compose_cfg/grafana.ini:/etc/grafana/grafana.ini
|
||||||
- ./.docker-compose_cfg/node-exporter-full_rev1.json:/var/lib/grafana/dashboards/node-exporter-full_rev1.json
|
# - ./.docker-compose_cfg/node-exporter-full_rev1.json:/var/lib/grafana/dashboards/node-exporter-full_rev1.json
|
||||||
container_name: grafana
|
# container_name: grafana
|
||||||
depends_on:
|
# depends_on:
|
||||||
- prometheus
|
# - prometheus
|
||||||
network_mode: "host"
|
# network_mode: "host"
|
||||||
|
|
||||||
# node-exporter:
|
# node-exporter:
|
||||||
# image: quay.io/prometheus/node-exporter
|
# image: quay.io/prometheus/node-exporter
|
||||||
|
|||||||
@ -30,7 +30,7 @@ readonly ENV_FILE=${ENV_FILE:-${OPENIM_ROOT}/scripts/install/environment.sh}
|
|||||||
# 定义关联数组,其中键是模板文件,值是对应的输出文件 (en: Defines an associative array where the keys are the template files and the values are the corresponding output files.)
|
# 定义关联数组,其中键是模板文件,值是对应的输出文件 (en: Defines an associative array where the keys are the template files and the values are the corresponding output files.)
|
||||||
declare -A TEMPLATES=(
|
declare -A TEMPLATES=(
|
||||||
["${OPENIM_ROOT}/deployments/templates/env_template.yaml"]="${OPENIM_ROOT}/.env"
|
["${OPENIM_ROOT}/deployments/templates/env_template.yaml"]="${OPENIM_ROOT}/.env"
|
||||||
["${OPENIM_ROOT}/deployments/templates/openim.yaml"]="${OPENIM_ROOT}/openim_config.yaml"
|
["${OPENIM_ROOT}/deployments/templates/openim.yaml"]="${OPENIM_ROOT}/config/openim_config.yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
for template in "${!TEMPLATES[@]}"; do
|
for template in "${!TEMPLATES[@]}"; do
|
||||||
|
|||||||
@ -87,7 +87,7 @@ openim::common::dependency_port() {
|
|||||||
${MYSQL_PORT} # MySQL port
|
${MYSQL_PORT} # MySQL port
|
||||||
${REDIS_PORT} # Redis port
|
${REDIS_PORT} # Redis port
|
||||||
${ZOOKEEPER_PORT} # Zookeeper port
|
${ZOOKEEPER_PORT} # Zookeeper port
|
||||||
${KAFKA_PORT} # Kafka port
|
# ${KAFKA_PORT} # Kafka port
|
||||||
${MongoDB_PORT} # MongoDB port
|
${MongoDB_PORT} # MongoDB port
|
||||||
${MINIO_PORT} # MinIO port
|
${MINIO_PORT} # MinIO port
|
||||||
)
|
)
|
||||||
|
|||||||
@ -26,6 +26,9 @@ source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
|||||||
|
|
||||||
IP=$(openim::util::get_server_ip)
|
IP=$(openim::util::get_server_ip)
|
||||||
|
|
||||||
|
#TODO
|
||||||
|
IP=http://127.0.0.1
|
||||||
|
|
||||||
function def() {
|
function def() {
|
||||||
local var_name="$1"
|
local var_name="$1"
|
||||||
local default_value="${2:-}"
|
local default_value="${2:-}"
|
||||||
@ -106,6 +109,7 @@ readonly MINIO_ENDPOINT=${MINIO_ENDPOINT:-"http://${IP}:${MINIO_PORT}"}
|
|||||||
def "MINIO_ACCESS_KEY" "${USER}" # MinIO的访问密钥ID
|
def "MINIO_ACCESS_KEY" "${USER}" # MinIO的访问密钥ID
|
||||||
def "MINIO_SECRET_KEY" "${PASSWORD}" # MinIO的密钥
|
def "MINIO_SECRET_KEY" "${PASSWORD}" # MinIO的密钥
|
||||||
def "MINIO_SESSION_TOKEN" # MinIO的会话令牌
|
def "MINIO_SESSION_TOKEN" # MinIO的会话令牌
|
||||||
|
readonly MINIO_SIGN_ENDPOINT=${MINIO_SIGN_ENDPOINT:-"http://${IP}:${MINIO_PORT}"} # signEndpoint为minio公网地址 # MinIO的会话令牌
|
||||||
def "COS_BUCKET_URL" "https://temp-1252357374.cos.ap-chengdu.myqcloud.com" # 腾讯云COS的存储桶URL
|
def "COS_BUCKET_URL" "https://temp-1252357374.cos.ap-chengdu.myqcloud.com" # 腾讯云COS的存储桶URL
|
||||||
def "COS_SECRET_ID" # 腾讯云COS的密钥ID
|
def "COS_SECRET_ID" # 腾讯云COS的密钥ID
|
||||||
def "COS_SECRET_KEY" # 腾讯云COS的密钥
|
def "COS_SECRET_KEY" # 腾讯云COS的密钥
|
||||||
@ -215,7 +219,7 @@ def "GROUP_MSG_READ_RECEIPT" "true" # 群消息已读回执启用
|
|||||||
def "SINGLE_MSG_READ_RECEIPT" "true" # 单一消息已读回执启用
|
def "SINGLE_MSG_READ_RECEIPT" "true" # 单一消息已读回执启用
|
||||||
def "RETAIN_CHAT_RECORDS" "365" # 保留聊天记录
|
def "RETAIN_CHAT_RECORDS" "365" # 保留聊天记录
|
||||||
# 聊天记录清理时间
|
# 聊天记录清理时间
|
||||||
readonly CHAT_RECORDS_CLEAR_TIME=${CHAT_RECORDS_CLEAR_TIME:-'0 2 * * *'}
|
readonly CHAT_RECORDS_CLEAR_TIME=${CHAT_RECORDS_CLEAR_TIME:-'0 2 * * 3'}
|
||||||
# 消息销毁时间
|
# 消息销毁时间
|
||||||
readonly MSG_DESTRUCT_TIME=${MSG_DESTRUCT_TIME:-'0 2 * * *'}
|
readonly MSG_DESTRUCT_TIME=${MSG_DESTRUCT_TIME:-'0 2 * * *'}
|
||||||
def "SECRET" "${PASSWORD}" # 密钥
|
def "SECRET" "${PASSWORD}" # 密钥
|
||||||
|
|||||||
@ -52,6 +52,7 @@ function execute_scripts() {
|
|||||||
else
|
else
|
||||||
openim::log::errexit "Script ${script_path##*/} is missing or not executable."
|
openim::log::errexit "Script ${script_path##*/} is missing or not executable."
|
||||||
fi
|
fi
|
||||||
|
sleep 1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user