You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/config/config.yaml

326 lines
11 KiB

4 years ago
# The class cannot be named by Pascal or camel case.
# If it is not used, the corresponding structure will not be set,
# and it will not be read naturally.
2 years ago
serverversion: 2.3.7
4 years ago
#---------------Infrastructure configuration---------------------#
2 years ago
zookeeper:
schema: openim #默认即可
zkAddr: [ 127.0.0.1:2181 ] #单机部署时,默认即可
2 years ago
userName:
password:
3 years ago
4 years ago
mysql:
3 years ago
dbMysqlAddress: [ 127.0.0.1:13306 ] #mysql地址 目前仅支持单机,默认即可
2 years ago
dbMysqlUserName: root #mysql用户名建议修改
dbMysqlPassword: openIM123 # mysql密码建议修改
dbMysqlDatabaseName: openIM_v2 #默认即可
dbTableName: eMsg #默认即可
4 years ago
dbMsgTableNum: 1
2 years ago
dbMaxOpenConns: 100
dbMaxIdleConns: 10
dbMaxLifeTime: 5
2 years ago
logLevel: 4 #1=slient 2=error 3=warn 4=info
2 years ago
slowThreshold: 500
4 years ago
mongo:
dbUri: ""#当dbUri值不为空则直接使用该值
dbAddress: [ 127.0.0.1:37017 ] #单机时为mongo地址使用分片集群时为mongos地址 默认即可
4 years ago
dbDirect: false
3 years ago
dbTimeout: 60
dbDatabase: openIM #mongo db 默认即可
4 years ago
dbSource: admin
2 years ago
dbUserName: root #mongo用户名建议先不设置
dbPassword: openIM123 #mongo密码建议先不设置
3 years ago
dbMaxPoolSize: 100
dbRetainChatRecords: 3650 #mongo保存离线消息时间根据需求修改
2 years ago
chatRecordsClearTime: "0 2 * * 3" # 每周三凌晨2点清除消息该配置和linux定时任务一样 清理操作建议设置在用户活跃少的时候 # 0 3 * * *
4 years ago
redis:
2 years ago
dbAddress: [ 127.0.0.1:16379 ] #redis地址 单机时填写一个地址即可使用redis集群时候填写集群中多个节点地址主从地址都可以填写增加容灾能力默认即可
4 years ago
dbMaxIdle: 128
dbMaxActive: 0
dbIdleTimeout: 120
2 years ago
dbUserName: #only redis version 6.0+ need username
2 years ago
dbPassWord: openIM123 #redis密码 建议修改
2 years ago
enableCluster: false #如果外部redis以集群方式启动需要打开此开关
4 years ago
kafka:
2 years ago
SASLUserName:
SASLPassword:
4 years ago
ws2mschat:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "ws2ms_chat" #用于mongo和mysql保存消息
2 years ago
msgtomongo:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "msg_to_mongo"
4 years ago
ms2pschat:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "ms2ps_chat" #消息push
2 years ago
msgtomodify:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "msg_to_modify"
4 years ago
consumergroupid:
msgToTransfer: mongo
msgToMongo: mongo_ex
4 years ago
msgToMySql: mysql
msgToPush: push
2 years ago
msgToModify: modify
4 years ago
#---------------Internal service configuration---------------------#
# The service ip default is empty,
# automatically obtain the machine's valid network card ip as the service ip,
# otherwise the configuration ip is preferred
#如果是单机模式用0.0.0.0或者不填,默认即可
4 years ago
2 years ago
#作为rpc时注册到etcd的地址单机默认即可如果是集群部署需要修改具体使用内网地址还是外网地址要依情况而定目的是api/gateway能访问到
rpcRegisterIP:
2 years ago
#默认即可
3 years ago
listenIP: 0.0.0.0
3 years ago
api:
3 years ago
openImApiPort: [ 10002 ] #api服务端口默认即可需要开放此端口或做nginx转发
listenIP: 0.0.0.0
2 years ago
sdk:
3 years ago
openImSdkWsPort: [ 10003 ] #jssdk服务端口默认即可项目中使用jssdk才需开放此端口或做nginx转发
dataDir: [ ../db/sdk/ ]
2 years ago
openImWsAddress: ws://127.0.0.1:10001
openImApiAddress: http://127.0.0.1:10002
#对象存储服务以下配置二选一目前支持两种腾讯云和minio二者配置好其中一种即可如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器
credential: #腾讯cos发送图片、视频、文件时需要请自行申请后替换必须修改
2 years ago
object:
enable: minio
2 years ago
apiURL: http://127.0.0.1:10002/third/object
2 years ago
minio: #MinIO 发送图片、视频、文件时需要,请自行申请后替换,必须修改。 客户端初始化InitSDK中 object_storage参数为minio
tempBucket: "openim"
dataBucket: "openim"
location: us-east-1
endpoint: http://127.0.0.1:10005 #minio外网ip 这个ip是给客户端访问的
accessKeyID: root
secretAccessKey: openIM123
isDistributedMod: false # 是否分布式多硬盘部署 默认docker-compose中为false如果是多硬盘部署需要修改为true
4 years ago
tencent:
2 years ago
appID:
region:
bucket:
secretID:
secretKey:
ali: # ali oss
2 years ago
regionID:
accessKeyID:
accessKeySecret:
stsEndpoint:
ossEndpoint:
bucket:
finalHost:
stsDurationSeconds:
OssRoleArn:
aws:
accessKeyID: #AssumeRole用户关联的accessKeyID
accessKeySecret: #AssumeRole用户关联的accessKeySecrect
region: #分区
bucket: #桶
finalHost: #对外Host
roleArn: #RoleArn
externalId: #角色扩展Id
roleSessionName: #角色SESSION名称
rpcport: #rpc服务端口 默认即可
3 years ago
openImUserPort: [ 10110 ]
openImFriendPort: [ 10120 ]
openImMessagePort: [ 10130 ]
openImMessageGatewayPort: [ 10140 ]
openImGroupPort: [ 10150 ]
openImAuthPort: [ 10160 ]
openImPushPort: [ 10170 ]
2 years ago
openImConversationPort: [ 10180 ]
openImRtcPort: [ 10190 ]
openImThirdPort : [ 10200 ]
4 years ago
rpcregistername: #rpc注册服务名默认即可
3 years ago
openImUserName: User
4 years ago
openImFriendName: Friend
2 years ago
openImMsgName: Msg
4 years ago
openImPushName: Push
2 years ago
openImMessageGatewayName: MessageGateway
4 years ago
openImGroupName: Group
openImAuthName: Auth
openImConversationName: Conversation
2 years ago
openImRtcName: Rtc
2 years ago
openImThirdName: Third
2 years ago
4 years ago
log:
storageLocation: ../logs/
rotationTime: 24
2 years ago
remainRotationCount: 2 #日志数量
3 years ago
#日志级别 6表示全都打印测试阶段建议设置为6
2 years ago
remainLogLevel: 6
2 years ago
isStdout: false
isJson: false
2 years ago
withStack: false
4 years ago
elasticSearchSwitch: false
3 years ago
elasticSearchAddr: [ 127.0.0.1:9201 ]
4 years ago
elasticSearchUser: ""
elasticSearchPassword: ""
modulename: #日志文件按模块命名,默认即可
4 years ago
longConnSvrName: msg_gateway
msgTransferName: msg_transfer
pushName: push
longconnsvr:
3 years ago
openImWsPort: [ 10001 ] # ws服务端口默认即可要开放此端口或做nginx转发
4 years ago
websocketMaxConnNum: 10000
websocketMaxMsgLen: 4096
websocketTimeOut: 10
3 years ago
## 推送只能开启一个 enable代表开启
4 years ago
push:
tpns: #腾讯推送,暂未测试 暂不要使用
4 years ago
ios:
accessID: 1600018281
secretKey: 3cd68a77a95b89e5089a1aca523f318f
android:
accessID: 111
secretKey: 111
2 years ago
enable: false # true or false (bool)
jpns: #极光推送 在极光后台申请后,修改以下四项,必须修改
appKey:
masterSecret:
pushUrl:
pushIntent:
2 years ago
enable: false # true or false (bool)
2 years ago
getui: #个推推送
2 years ago
pushUrl: "https://restapi.getui.com/v2/$appId"
3 years ago
masterSecret: ""
3 years ago
appKey: ""
intent: ""
2 years ago
enable: false # true or false (bool)
2 years ago
channelID: ""
channelName: ""
fcm: #firebase cloud message 消息推送
2 years ago
serviceAccount: "openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json" #帐号文件,此处需要改修配置,并且这个文件放在 config目录下
enable: false
3 years ago
manager:
#app管理员userID和对应的secret 建议修改。 用于管理后台登录也可以用户管理后台对应的api
3 years ago
appManagerUid: [ "openIM123456","openIM654321", "openIM333", "openIMAdmin"]
2 years ago
nickname: [ "系统通知","openIM654321", "openIM333", "openIMAdmin" ]
4 years ago
2 years ago
secret: tuoyun
# 多端互踢策略
# 1多平台登录Android、iOS、Windows、Mac 每种平台只能一个在线web端可以多个同时在线
multiloginpolicy: 1
4 years ago
2 years ago
#msg log insert to db
chatpersistencemysql: true
3 years ago
#消息缓存时间
msgCacheTimeout: 86400
2 years ago
#群聊已读开启
groupMessageHasReadReceiptEnable: true
2 years ago
#单聊已读开启
singleMessageHasReadReceiptEnable: true
2 years ago
4 years ago
#token config
tokenpolicy:
2 years ago
accessSecret: "OpenIM_server" #token生成相关默认即可
# Token effective time day as a unit
2 years ago
accessExpire: 90 #token过期时间 默认即可
3 years ago
messageverify:
2 years ago
friendVerify: false
#ios系统推送声音以及标记计数
3 years ago
iospush:
pushSound: "xxx"
3 years ago
badgeCount: true
production: false
3 years ago
callback:
3 years ago
# callback url 需要自行更换callback url
callbackUrl : "http://127.0.0.1:8080/callback"
3 years ago
# 开启关闭操作前后回调的配置
3 years ago
callbackBeforeSendSingleMsg:
3 years ago
enable: false # 回调是否启用
3 years ago
callbackTimeOut: 2 # 回调超时时间
3 years ago
callbackFailedContinue: true # 回调超时是否继续执行代码
3 years ago
callbackAfterSendSingleMsg:
3 years ago
enable: false
3 years ago
callbackTimeOut: 2
3 years ago
callbackBeforeSendGroupMsg:
3 years ago
enable: false
3 years ago
callbackTimeOut: 2
3 years ago
callbackFailedContinue: true
3 years ago
callbackAfterSendGroupMsg:
3 years ago
enable: false
3 years ago
callbackTimeOut: 2
2 years ago
callbackMsgModify:
3 years ago
enable: false
3 years ago
callbackTimeOut: 2
3 years ago
callbackFailedContinue: true
3 years ago
callbackUserOnline:
3 years ago
enable: false
3 years ago
callbackTimeOut: 2
callbackUserOffline:
3 years ago
enable: false
3 years ago
callbackTimeOut: 2
2 years ago
callbackUserKickOff:
enable: false
callbackTimeOut: 2
3 years ago
callbackOfflinePush:
3 years ago
enable: false
3 years ago
callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续离线推送
callbackOnlinePush:
enable: false
callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续离线推送
callbackSuperGroupOnlinePush:
enable: false
callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续离线推送
callbackBeforeAddFriend:
enable: false
callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续
2 years ago
callbackBeforeCreateGroup:
enable: false
callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续
callbackBeforeMemberJoinGroup:
enable: false
callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续
callbackBeforeSetGroupMemberInfo:
2 years ago
enable: false
callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续
2 years ago
callbackSetMessageReactionExtensions:
2 years ago
enable: false
callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续
3 years ago
rtc:
signalTimeout: 35
2 years ago
2 years ago
# prometheus每个服务监听的端口数量需要和rpc port保持一致
2 years ago
prometheus:
enable: false
userPrometheusPort: [ 20110 ]
friendPrometheusPort: [ 20120 ]
messagePrometheusPort: [ 20130 ]
messageGatewayPrometheusPort: [ 20140 ]
groupPrometheusPort: [ 20150 ]
authPrometheusPort: [ 20160 ]
pushPrometheusPort: [ 20170 ]
conversationPrometheusPort: [ 20230 ]
2 years ago
rtcPrometheusPort: [ 21300 ]
messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] # 端口数量和 script/path_info.cfg msg_transfer_service_num保持一致
2 years ago