Files
open-im-server/config/config.yaml
T

388 lines
10 KiB
YAML
Raw Normal View History

2023-07-04 11:15:20 +08:00
# Copyright © 2023 OpenIM. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the License);
2023-07-04 11:15:20 +08:00
# 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.
2023-07-27 14:38:46 +08:00
# -----------------------------------------------------------------
# TODO: This config file is the template file
# --| source: deployments/templates/openim.yaml
# --| env: scripts/install/environment
# --| target: config/config.yaml
2023-07-27 14:38:46 +08:00
# -----------------------------------------------------------------
###################### Zookeeper ######################
# Zookeeper configuration
# It's not recommended to modify the schema
#
# Zookeeper address
# Zookeeper username
# Zookeeper password
2023-06-30 09:45:02 +08:00
zookeeper:
2023-08-08 16:40:07 +08:00
schema: openim
address: [ 172.28.0.1:12181 ]
username: ''
password: ''
2023-07-27 14:38:46 +08:00
###################### 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
2023-06-29 22:35:31 +08:00
mysql:
address: [ 172.28.0.1:13306 ]
2023-07-27 12:31:06 +08:00
username: root
password: openIM123
2023-08-08 16:40:07 +08:00
database: openIM_v3
maxOpenConn: 1000
maxIdleConn: 100
maxLifeTime: 60
logLevel: 4
slowThreshold: 500
2023-07-27 14:38:46 +08:00
###################### 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
2023-06-29 22:35:31 +08:00
mongo:
uri: ''
address: [ 172.28.0.1:37017 ]
2023-07-27 14:38:46 +08:00
database: openIM_v3
2023-07-27 12:31:06 +08:00
username: root
password: openIM123
2023-08-08 16:40:07 +08:00
maxPoolSize: 100
2023-06-29 22:35:31 +08:00
###################### Redis configuration information ######################
2023-07-27 14:38:46 +08:00
# Redis configuration
#
# Username is required only for Redis version 6.0+
2023-06-29 22:35:31 +08:00
redis:
address: [ 172.28.0.1:16379 ]
username: ''
2023-07-27 12:31:06 +08:00
password: openIM123
2023-06-29 22:35:31 +08:00
###################### Kafka configuration information ######################
2023-07-27 14:38:46 +08:00
# Kafka configuration
#
# Kafka username
# Kafka password
# It's not recommended to modify this topic name
# Consumer group ID, it's not recommended to modify
2023-06-29 22:35:31 +08:00
kafka:
username: ''
password: ''
addr: [ 172.28.0.1:19094 ]
2023-06-30 09:45:02 +08:00
latestMsgToRedis:
2023-08-08 16:40:07 +08:00
topic: "latestMsgToRedis"
2023-06-30 09:45:02 +08:00
offlineMsgToMongo:
2023-08-08 16:40:07 +08:00
topic: "offlineMsgToMongoMysql"
2023-06-30 09:45:02 +08:00
msgToPush:
2023-07-27 14:38:46 +08:00
topic: "msgToPush"
consumerGroupID:
msgToRedis: redis
msgToMongo: mongo
msgToMySql: mysql
msgToPush: push
###################### RPC configuration information ######################
2023-07-27 14:38:46 +08:00
# 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
2023-06-30 09:45:02 +08:00
rpc:
registerIP: ''
2023-07-27 14:38:46 +08:00
listenIP: 0.0.0.0
2023-06-29 22:35:31 +08:00
###################### API configuration information ######################
2023-07-27 14:38:46 +08:00
# API configuration
#
# API service port
# Default listen IP is 0.0.0.0
2023-06-29 22:35:31 +08:00
api:
2023-08-08 16:40:07 +08:00
openImApiPort: [ 10002 ]
listenIP: 0.0.0.0
2023-06-30 09:45:02 +08:00
###################### Object configuration information ######################
2023-07-27 14:38:46 +08:00
# 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
2023-08-08 16:40:07 +08:00
# 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
2023-06-30 09:45:02 +08:00
object:
2023-08-08 16:40:07 +08:00
enable: "minio"
apiURL: "http://14.153.6.114:10002"
2023-06-30 09:45:02 +08:00
minio:
2023-08-08 16:40:07 +08:00
bucket: "openim"
endpoint: "http://172.28.0.1:10005"
2023-08-08 16:40:07 +08:00
accessKeyID: "root"
secretAccessKey: "openIM123"
sessionToken: ''
signEndpoint: "http://14.153.6.114:10005"
2023-08-08 16:40:07 +08:00
cos:
bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com
secretID: ''
secretKey: ''
sessionToken: ''
2023-08-08 16:40:07 +08:00
oss:
2023-07-13 16:51:52 +08:00
endpoint: "https://oss-cn-chengdu.aliyuncs.com"
bucket: "demo-9999999"
bucketURL: "https://demo-9999999.oss-cn-chengdu.aliyuncs.com"
accessKeyID: ''
accessKeySecret: ''
sessionToken: ''
2023-06-30 09:45:02 +08:00
###################### RPC Port Configuration ######################
2023-07-27 14:38:46 +08:00
# 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:
2022-04-25 16:21:48 +08:00
openImUserPort: [ 10110 ]
openImFriendPort: [ 10120 ]
openImMessagePort: [ 10130 ]
openImMessageGatewayPort: [ 10140 ]
openImGroupPort: [ 10150 ]
openImAuthPort: [ 10160 ]
openImPushPort: [ 10170 ]
2023-06-30 09:45:02 +08:00
openImConversationPort: [ 10180 ]
openImThirdPort: [ 10190 ]
###################### RPC Register Name Configuration ######################
2023-07-27 14:38:46 +08:00
# RPC service names for registration, it's not recommended to modify these
rpcRegisterName:
2023-06-29 22:35:31 +08:00
openImUserName: User
openImFriendName: Friend
2022-07-20 21:40:11 +08:00
openImMsgName: Msg
2023-06-29 22:35:31 +08:00
openImPushName: Push
2023-06-30 09:45:02 +08:00
openImMessageGatewayName: MessageGateway
2023-06-29 22:35:31 +08:00
openImGroupName: Group
openImAuthName: Auth
2022-04-24 11:23:54 +08:00
openImConversationName: Conversation
2023-06-30 09:45:02 +08:00
openImThirdName: Third
2023-06-29 22:35:31 +08:00
###################### Log Configuration ######################
2023-07-27 14:38:46 +08:00
# 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
2023-06-29 22:35:31 +08:00
log:
storageLocation: ../logs
2023-08-08 16:40:07 +08:00
rotationTime: 24
remainRotationCount: 2
remainLogLevel: 6
isStdout: false
2023-08-08 16:40:07 +08:00
isJson: false
2023-06-30 09:45:02 +08:00
withStack: false
###################### Variables definition ######################
2023-07-27 14:38:46 +08:00
# Long connection server configuration
#
# Websocket port for msg_gateway
# Maximum number of websocket connections
# Maximum length of websocket request package
# Websocket connection handshake timeout
2023-06-30 09:45:02 +08:00
longConnSvr:
2023-08-08 16:40:07 +08:00
openImWsPort: [ 10001 ]
websocketMaxConnNum: 100000
websocketMaxMsgLen: 4096
websocketTimeout: 10
2023-06-30 09:45:02 +08:00
2023-07-27 14:38:46 +08:00
# 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
2023-06-29 22:35:31 +08:00
push:
2023-06-30 23:04:28 +08:00
enable: getui
2023-07-27 14:38:46 +08:00
geTui:
2023-06-29 22:35:31 +08:00
pushUrl: "https://restapi.getui.com/v2/$appId"
masterSecret: ""
appKey: ""
intent: ""
2023-06-30 09:45:02 +08:00
channelID: ""
channelName: ""
2023-07-27 14:38:46 +08:00
fcm:
serviceAccount: "x.json"
jpns:
2023-06-30 09:45:02 +08:00
appKey:
masterSecret:
pushUrl:
pushIntent:
2023-06-30 23:04:28 +08:00
2023-07-27 14:38:46 +08:00
# App manager configuration
#
# Built-in app manager user IDs
# Built-in app manager nicknames
2023-06-30 09:45:02 +08:00
manager:
userID: [ "openIM123456", "openIM654321", "openIMAdmin" ]
nickname: [ "system1", "system2", "system3" ]
2023-06-29 22:35:31 +08:00
2023-07-27 14:38:46 +08:00
# Multi-platform login policy
# For each platform(Android, iOS, Windows, Mac, web), only one can be online at a time
multiLoginPolicy: 1
2023-06-29 22:35:31 +08:00
2023-07-27 14:38:46 +08:00
# Whether to store messages in MySQL, messages in MySQL are only used for management background
chatPersistenceMysql: true
2023-06-29 22:35:31 +08:00
2023-07-27 14:38:46 +08:00
# Message cache timeout in seconds, it's not recommended to modify
msgCacheTimeout: 86400
2023-06-30 09:45:02 +08:00
2023-07-27 14:38:46 +08:00
# Whether to enable read receipts for group chat
groupMessageHasReadReceiptEnable: true
2023-06-30 09:45:02 +08:00
2023-07-27 14:38:46 +08:00
# Whether to enable read receipts for single chat
singleMessageHasReadReceiptEnable: true
2023-06-30 09:45:02 +08:00
2023-07-27 14:38:46 +08:00
# MongoDB offline message retention period in days
retainChatRecords: 365
2023-06-30 09:45:02 +08:00
2023-07-27 14:38:46 +08:00
# 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"
2023-06-30 09:45:02 +08:00
2023-07-27 14:38:46 +08:00
# 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
2023-07-27 12:31:06 +08:00
secret: openIM123
2023-06-30 09:45:02 +08:00
2023-07-27 14:38:46 +08:00
# Token policy
#
# Token expiration period in days
2023-06-30 09:45:02 +08:00
tokenPolicy:
2023-07-27 14:38:46 +08:00
expire: 90
2023-06-30 09:45:02 +08:00
2023-07-27 14:38:46 +08:00
# Message verification policy
#
# Whether to verify friendship when sending messages
2023-06-30 09:45:02 +08:00
messageVerify:
2023-07-27 14:38:46 +08:00
friendVerify: false
2023-06-30 09:45:02 +08:00
2023-07-27 14:38:46 +08:00
# iOS push notification configuration
#
# iOS push notification sound
# Whether to count badge
# Whether it's production environment
2023-06-30 09:45:02 +08:00
iosPush:
2023-06-29 22:35:31 +08:00
pushSound: "xxx"
badgeCount: true
2022-06-21 11:28:02 +08:00
production: false
2023-06-29 22:35:31 +08:00
###################### Third-party service configuration ######################
2023-07-27 14:38:46 +08:00
# Callback configuration
#
# Callback URL
# Whether to enable this callback event
# Timeout in seconds
# Whether to continue execution if callback fails
2023-06-29 22:35:31 +08:00
callback:
2023-06-30 09:45:02 +08:00
url:
beforeSendSingleMsg:
2023-07-27 14:38:46 +08:00
enable: false
timeout: 5
failedContinue: true
2023-06-30 09:45:02 +08:00
afterSendSingleMsg:
enable: false
timeout: 5
beforeSendGroupMsg:
enable: false
timeout: 5
failedContinue: true
afterSendGroupMsg:
enable: false
timeout: 5
msgModify:
2023-06-29 22:35:31 +08:00
enable: false
2023-06-30 09:45:02 +08:00
timeout: 5
failedContinue: true
userOnline:
2023-06-29 22:35:31 +08:00
enable: false
2023-06-30 09:45:02 +08:00
timeout: 5
userOffline:
2023-06-29 22:35:31 +08:00
enable: false
2023-06-30 09:45:02 +08:00
timeout: 5
userKickOff:
2023-06-29 22:35:31 +08:00
enable: false
2023-06-30 09:45:02 +08:00
timeout: 5
offlinePush:
2022-05-27 13:16:05 +08:00
enable: false
2023-06-30 09:45:02 +08:00
timeout: 5
failedContinue: true
onlinePush:
2022-05-27 13:16:05 +08:00
enable: false
2023-06-30 09:45:02 +08:00
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
2023-07-27 14:38:46 +08:00
###################### Prometheus ######################
# Prometheus configuration for various services
2023-07-27 14:38:46 +08:00
# 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:
2023-06-30 09:45:02 +08:00
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