mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-11 12:36:00 +08:00
Compare commits
156 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db081e6a4c | |||
| 6b0a2c9464 | |||
| 775aba52bd | |||
| e1770173ef | |||
| c73ce45e9e | |||
| 7aefb7fa2b | |||
| baece7eb3a | |||
| 1b31a07b40 | |||
| 83ba487c61 | |||
| 8dc0b639a2 | |||
| 9a636a15de | |||
| 7b12a8755a | |||
| b67c244bbd | |||
| 0bd2c00088 | |||
| cb1487109a | |||
| c9d8625274 | |||
| d0b659ccea | |||
| c182001fcf | |||
| c8038213c7 | |||
| 40a7bb9d48 | |||
| 7e48d1a00f | |||
| a64e5a776a | |||
| 9dc798bc53 | |||
| c6ea841064 | |||
| 0e03c5f89e | |||
| 70502685ce | |||
| a2fe6ffc7a | |||
| 1c724aa89b | |||
| 5d307c16b4 | |||
| 96c264981e | |||
| 60c507ff10 | |||
| 33ee58904b | |||
| 0938b11f83 | |||
| c0d633bc34 | |||
| 7a9506f616 | |||
| 36afd67a2c | |||
| 59d1090a6d | |||
| f384bb2aff | |||
| 4411ba3482 | |||
| 379118e481 | |||
| 661b1a5e6a | |||
| fd2d5252c5 | |||
| 284e89d410 | |||
| d7a649f699 | |||
| c758628701 | |||
| 28614e4c13 | |||
| beb9a37649 | |||
| 0e9810e9ff | |||
| 0c5cec8413 | |||
| 6135ce0919 | |||
| fdd765f982 | |||
| 529821475e | |||
| f2b21cbce6 | |||
| 061ee3abd2 | |||
| e2c53754b5 | |||
| f328ebc300 | |||
| 135c2c36aa | |||
| 16cf98213c | |||
| 094911bab2 | |||
| 6ee90b60c3 | |||
| c80b625977 | |||
| cc4ae8648e | |||
| 4f7eead38c | |||
| 386a99edbd | |||
| 982506c2fb | |||
| 5767a0fadc | |||
| a01fec538e | |||
| d451c36b2d | |||
| 0ae8433436 | |||
| 863c90e8bd | |||
| 396a87ab71 | |||
| a60b584dca | |||
| 3cb3b6ba2d | |||
| 16fbf7c63e | |||
| b980c9e751 | |||
| 127d45abc9 | |||
| e99f441e50 | |||
| 186cfa7226 | |||
| 7627ebed5c | |||
| 1be159b47c | |||
| 4e3ab62f6c | |||
| 85cb95602d | |||
| ff917466eb | |||
| 1235715c22 | |||
| 1393e40eb9 | |||
| 442c838bda | |||
| ea5039d2ae | |||
| 8f2e9f5261 | |||
| e1147aff9e | |||
| f9b39e91ee | |||
| 4bf73b0a47 | |||
| 05ee20613b | |||
| 286163ce18 | |||
| f0976c9ade | |||
| 1ab7660f0d | |||
| 84c7b8827e | |||
| 5e1aa43793 | |||
| a9b71e5a96 | |||
| 08ed131e19 | |||
| 85e3a81419 | |||
| 818ed107c6 | |||
| 4f322254b0 | |||
| decd6a98be | |||
| 5ae35bfee1 | |||
| a6ba349cb6 | |||
| 3e3818d4b5 | |||
| 6661c5baac | |||
| e813016402 | |||
| 924aa8ecb5 | |||
| 64edd9b7ea | |||
| 4400423fca | |||
| 0554778c83 | |||
| 2bc6d77d10 | |||
| 7ac790e4d0 | |||
| 0732fe6171 | |||
| d7b3ea0a6e | |||
| 0a2b6605d7 | |||
| f559795ba3 | |||
| 6b8b5f7896 | |||
| 1bf4fa0d87 | |||
| d53507b7b6 | |||
| 787bfccc2c | |||
| 955bfe3f40 | |||
| 78d7588af7 | |||
| bbde362570 | |||
| 972dd5f531 | |||
| 464320a3ec | |||
| 2aa49f080e | |||
| 9dac12cf2b | |||
| d1f3266383 | |||
| 1e2a60c802 | |||
| ee9c3cbde3 | |||
| 235be5da0c | |||
| 29adb5de07 | |||
| 4618bf990d | |||
| 0a57830925 | |||
| 71a2090363 | |||
| e420871e1f | |||
| 01b2de80ae | |||
| cdd86349d0 | |||
| 45293152bb | |||
| 7bf7686314 | |||
| 5888dc3b5d | |||
| 3d9355848b | |||
| 7033b603ca | |||
| 71ad683614 | |||
| 1fdc4d06d1 | |||
| cff9ee39be | |||
| 458f872fe3 | |||
| ac99da044a | |||
| a6bd8e5205 | |||
| f9fdd540f9 | |||
| 1706f5df07 | |||
| 40fc3e6c08 | |||
| 2608ae58df | |||
| 0e62deed0a |
+396
-13
@@ -1,20 +1,403 @@
|
|||||||
bin
|
# Copyright © 2023 OpenIMSDK.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
# For the entire design of.gitignore, ignore git commits and ignore files
|
||||||
|
#===============================================================================
|
||||||
|
#
|
||||||
|
|
||||||
|
### OpenIM developer supplement ###
|
||||||
logs
|
logs
|
||||||
.devcontainer
|
.devcontainer
|
||||||
components
|
components
|
||||||
out-test
|
out-test
|
||||||
.github
|
Dockerfile.cross
|
||||||
.idea
|
|
||||||
.exe
|
### Makefile ###
|
||||||
|
tmp/
|
||||||
|
bin/
|
||||||
|
output/
|
||||||
_output/
|
_output/
|
||||||
|
|
||||||
deploy/open_im_api
|
### OpenIM Config ###
|
||||||
deploy/open_im_msg_gateway
|
config/config.yaml
|
||||||
deploy/open_im_msg_transfer
|
./config/config.yaml
|
||||||
deploy/open_im_push
|
.env
|
||||||
deploy/open_im_rpc_user
|
./.env
|
||||||
deploy/open_im_rpc_friend
|
|
||||||
deploy/open_im_rpc_group
|
### OpenIM deploy ###
|
||||||
deploy/open_im_rpc_msg
|
deploy/openim_demo
|
||||||
deploy/open_im_rpc_auth
|
deploy/openim-api
|
||||||
|
deploy/openim-rpc-msg_gateway
|
||||||
|
deploy/openim-msgtransfer
|
||||||
|
deploy/openim-push
|
||||||
|
deploy/openim_timer_task
|
||||||
|
deploy/openim-rpc-user
|
||||||
|
deploy/openim-rpc-friend
|
||||||
|
deploy/openim-rpc-group
|
||||||
|
deploy/openim-rpc-msg
|
||||||
|
deploy/openim-rpc-auth
|
||||||
deploy/Open-IM-SDK-Core
|
deploy/Open-IM-SDK-Core
|
||||||
|
|
||||||
|
# files used by the developer
|
||||||
|
.idea.md
|
||||||
|
.todo.md
|
||||||
|
.note.md
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/go,git,vim,tags,test,emacs,backup,jetbrains
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=go,git,vim,tags,test,emacs,backup,jetbrains
|
||||||
|
|
||||||
|
### Backup ###
|
||||||
|
*.bak
|
||||||
|
*.gho
|
||||||
|
*.ori
|
||||||
|
*.orig
|
||||||
|
*.tmp
|
||||||
|
|
||||||
|
### Emacs ###
|
||||||
|
# -*- mode: gitignore; -*-
|
||||||
|
*~
|
||||||
|
\#*\#
|
||||||
|
/.emacs.desktop
|
||||||
|
/.emacs.desktop.lock
|
||||||
|
*.elc
|
||||||
|
auto-save-list
|
||||||
|
tramp
|
||||||
|
.\#*
|
||||||
|
|
||||||
|
# Org-mode
|
||||||
|
.org-id-locations
|
||||||
|
*_archive
|
||||||
|
|
||||||
|
# flymake-mode
|
||||||
|
*_flymake.*
|
||||||
|
|
||||||
|
# eshell files
|
||||||
|
/eshell/history
|
||||||
|
/eshell/lastdir
|
||||||
|
|
||||||
|
# elpa packages
|
||||||
|
/elpa/
|
||||||
|
|
||||||
|
# reftex files
|
||||||
|
*.rel
|
||||||
|
|
||||||
|
# AUCTeX auto folder
|
||||||
|
/auto/
|
||||||
|
|
||||||
|
# cask packages
|
||||||
|
.cask/
|
||||||
|
dist/
|
||||||
|
|
||||||
|
# Flycheck
|
||||||
|
flycheck_*.el
|
||||||
|
|
||||||
|
# server auth directory
|
||||||
|
/server/
|
||||||
|
|
||||||
|
# projectiles files
|
||||||
|
.projectile
|
||||||
|
|
||||||
|
# directory configuration
|
||||||
|
.dir-locals.el
|
||||||
|
|
||||||
|
# network security
|
||||||
|
/network-security.data
|
||||||
|
|
||||||
|
### vscode ###
|
||||||
|
.vscode
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
*.code-workspace
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/vim,jetbrains,vscode,git,go,tags,backup,test
|
||||||
|
|
||||||
|
### Git ###
|
||||||
|
# Created by git for backups. To disable backups in Git:
|
||||||
|
# $ git config --global mergetool.keepBackup false
|
||||||
|
|
||||||
|
# Created by git when using merge tools for conflicts
|
||||||
|
*.BACKUP.*
|
||||||
|
*.BASE.*
|
||||||
|
*.LOCAL.*
|
||||||
|
*.REMOTE.*
|
||||||
|
*_BACKUP_*.txt
|
||||||
|
*_BASE_*.txt
|
||||||
|
*_LOCAL_*.txt
|
||||||
|
*_REMOTE_*.txt
|
||||||
|
|
||||||
|
### Go ###
|
||||||
|
# If you prefer the allow list template instead of the deny list, see community template:
|
||||||
|
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||||
|
#
|
||||||
|
# Binaries for programs and plugins
|
||||||
|
*.exe
|
||||||
|
*.exe~
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Test binary, built with `go test -c`
|
||||||
|
*.test
|
||||||
|
|
||||||
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
|
*.out
|
||||||
|
|
||||||
|
# Dependency directories (remove the comment below to include it)
|
||||||
|
vendor/
|
||||||
|
|
||||||
|
# Go workspace file
|
||||||
|
# go.work
|
||||||
|
go.work.sum
|
||||||
|
|
||||||
|
### JetBrains ###
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||||
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
|
# User-specific stuff
|
||||||
|
.idea/
|
||||||
|
.idea/**/workspace.xml
|
||||||
|
.idea/**/tasks.xml
|
||||||
|
.idea/**/usage.statistics.xml
|
||||||
|
.idea/**/dictionaries
|
||||||
|
.idea/**/shelf
|
||||||
|
|
||||||
|
# AWS User-specific
|
||||||
|
.idea/**/aws.xml
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
.idea/**/contentModel.xml
|
||||||
|
|
||||||
|
# Sensitive or high-churn files
|
||||||
|
.idea/**/dataSources/
|
||||||
|
.idea/**/dataSources.ids
|
||||||
|
.idea/**/dataSources.local.xml
|
||||||
|
.idea/**/sqlDataSources.xml
|
||||||
|
.idea/**/dynamic.xml
|
||||||
|
.idea/**/uiDesigner.xml
|
||||||
|
.idea/**/dbnavigator.xml
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
.idea/**/gradle.xml
|
||||||
|
.idea/**/libraries
|
||||||
|
|
||||||
|
# Gradle and Maven with auto-import
|
||||||
|
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||||
|
# since they will be recreated, and may cause churn. Uncomment if using
|
||||||
|
# auto-import.
|
||||||
|
# .idea/artifacts
|
||||||
|
# .idea/compiler.xml
|
||||||
|
# .idea/jarRepositories.xml
|
||||||
|
# .idea/modules.xml
|
||||||
|
# .idea/*.iml
|
||||||
|
# .idea/modules
|
||||||
|
# *.iml
|
||||||
|
# *.ipr
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
cmake-build-*/
|
||||||
|
|
||||||
|
# Mongo Explorer plugin
|
||||||
|
.idea/**/mongoSettings.xml
|
||||||
|
|
||||||
|
# File-based project format
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
.idea/replstate.xml
|
||||||
|
|
||||||
|
# SonarLint plugin
|
||||||
|
.idea/sonarlint/
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
# Editor-based Rest Client
|
||||||
|
.idea/httpRequests
|
||||||
|
|
||||||
|
# Android studio 3.1+ serialized cache file
|
||||||
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
|
### JetBrains Patch ###
|
||||||
|
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||||
|
|
||||||
|
# *.iml
|
||||||
|
# modules.xml
|
||||||
|
# .idea/misc.xml
|
||||||
|
# *.ipr
|
||||||
|
|
||||||
|
# Sonarlint plugin
|
||||||
|
# https://plugins.jetbrains.com/plugin/7973-sonarlint
|
||||||
|
.idea/**/sonarlint/
|
||||||
|
|
||||||
|
# SonarQube Plugin
|
||||||
|
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
|
||||||
|
.idea/**/sonarIssues.xml
|
||||||
|
|
||||||
|
# Markdown Navigator plugin
|
||||||
|
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
|
||||||
|
.idea/**/markdown-navigator.xml
|
||||||
|
.idea/**/markdown-navigator-enh.xml
|
||||||
|
.idea/**/markdown-navigator/
|
||||||
|
|
||||||
|
# Cache file creation bug
|
||||||
|
# See https://youtrack.jetbrains.com/issue/JBR-2257
|
||||||
|
.idea/$CACHE_FILE$
|
||||||
|
|
||||||
|
# CodeStream plugin
|
||||||
|
# https://plugins.jetbrains.com/plugin/12206-codestream
|
||||||
|
.idea/codestream.xml
|
||||||
|
|
||||||
|
# Azure Toolkit for IntelliJ plugin
|
||||||
|
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
|
||||||
|
.idea/**/azureSettings.xml
|
||||||
|
|
||||||
|
### Tags ###
|
||||||
|
# Ignore tags created by etags, ctags, gtags (GNU global) and cscope
|
||||||
|
TAGS
|
||||||
|
.TAGS
|
||||||
|
!TAGS/
|
||||||
|
tags
|
||||||
|
.tags
|
||||||
|
!tags/
|
||||||
|
gtags.files
|
||||||
|
GTAGS
|
||||||
|
GRTAGS
|
||||||
|
GPATH
|
||||||
|
GSYMS
|
||||||
|
cscope.files
|
||||||
|
cscope.out
|
||||||
|
cscope.in.out
|
||||||
|
cscope.po.out
|
||||||
|
|
||||||
|
|
||||||
|
### Test ###
|
||||||
|
### Ignore all files that could be used to test your code and
|
||||||
|
### you wouldn't want to push
|
||||||
|
|
||||||
|
# Reference https://en.wikipedia.org/wiki/Metasyntactic_variable
|
||||||
|
|
||||||
|
# Most common
|
||||||
|
*foo
|
||||||
|
*bar
|
||||||
|
*fubar
|
||||||
|
*foobar
|
||||||
|
*baz
|
||||||
|
|
||||||
|
# Less common
|
||||||
|
*qux
|
||||||
|
*quux
|
||||||
|
*bongo
|
||||||
|
*bazola
|
||||||
|
*ztesch
|
||||||
|
|
||||||
|
# UK, Australia
|
||||||
|
*wibble
|
||||||
|
*wobble
|
||||||
|
*wubble
|
||||||
|
*flob
|
||||||
|
*blep
|
||||||
|
*blah
|
||||||
|
*boop
|
||||||
|
*beep
|
||||||
|
|
||||||
|
# Japanese
|
||||||
|
*hoge
|
||||||
|
*piyo
|
||||||
|
*fuga
|
||||||
|
*hogera
|
||||||
|
*hogehoge
|
||||||
|
|
||||||
|
# Portugal, Spain
|
||||||
|
*fulano
|
||||||
|
*sicrano
|
||||||
|
*beltrano
|
||||||
|
*mengano
|
||||||
|
*perengano
|
||||||
|
*zutano
|
||||||
|
|
||||||
|
# France, Italy, the Netherlands
|
||||||
|
*toto
|
||||||
|
*titi
|
||||||
|
*tata
|
||||||
|
*tutu
|
||||||
|
*pipppo
|
||||||
|
*pluto
|
||||||
|
*paperino
|
||||||
|
*aap
|
||||||
|
*noot
|
||||||
|
*mies
|
||||||
|
|
||||||
|
# Other names that would make sense
|
||||||
|
*tests
|
||||||
|
*testsdir
|
||||||
|
*testsfile
|
||||||
|
*testsfiles
|
||||||
|
*testdir
|
||||||
|
*testfile
|
||||||
|
*testfiles
|
||||||
|
*testing
|
||||||
|
*testingdir
|
||||||
|
*testingfile
|
||||||
|
*testingfiles
|
||||||
|
*temp
|
||||||
|
*tempdir
|
||||||
|
*tempfile
|
||||||
|
*tempfiles
|
||||||
|
*tmp
|
||||||
|
*tmpdir
|
||||||
|
*tmpfile
|
||||||
|
*tmpfiles
|
||||||
|
*lol
|
||||||
|
|
||||||
|
### Vim ###
|
||||||
|
# Swap
|
||||||
|
[._]*.s[a-v][a-z]
|
||||||
|
!*.svg # comment out if you don't need vector files
|
||||||
|
[._]*.sw[a-p]
|
||||||
|
[._]s[a-rt-v][a-z]
|
||||||
|
[._]ss[a-gi-z]
|
||||||
|
[._]sw[a-p]
|
||||||
|
|
||||||
|
# Session
|
||||||
|
Session.vim
|
||||||
|
Sessionx.vim
|
||||||
|
|
||||||
|
# Temporary
|
||||||
|
.netrwhist
|
||||||
|
# Auto-generated tag files
|
||||||
|
# Persistent undo
|
||||||
|
[._]*.un~
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/go,git,vim,tags,test,emacs,backup,jetbrains
|
||||||
|
.idea
|
||||||
|
dist/
|
||||||
|
.env
|
||||||
|
config/config.yaml
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ By deployment of the Open-IM-Server on the customer's server, developers can int
|
|||||||
- Supports multiple protocols
|
- Supports multiple protocols
|
||||||
|
|
||||||
## Community
|
## Community
|
||||||
|
|
||||||
- 中文官网访问这里:[Open-IM中文开发文档](https://doc.rentsoft.cn/)
|
- 中文官网访问这里:[Open-IM中文开发文档](https://doc.rentsoft.cn/)
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|||||||
+1
-1
Submodule cmd/Open-IM-SDK-Core updated: 373b6c00d4...e731cb86ec
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_api ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_api","--port", "10002"]
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"net"
|
|
||||||
"os"
|
|
||||||
"runtime"
|
|
||||||
"strconv"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"gopkg.in/yaml.v3"
|
|
||||||
|
|
||||||
"net/http"
|
|
||||||
_ "net/http/pprof"
|
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/api"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
|
|
||||||
openKeeper "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry/zookeeper"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
apiCmd := cmd.NewApiCmd()
|
|
||||||
apiCmd.AddPortFlag()
|
|
||||||
apiCmd.AddApi(run)
|
|
||||||
if err := apiCmd.Execute(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func startPprof() {
|
|
||||||
runtime.GOMAXPROCS(1)
|
|
||||||
runtime.SetMutexProfileFraction(1)
|
|
||||||
runtime.SetBlockProfileRate(1)
|
|
||||||
if err := http.ListenAndServe(":6060", nil); err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
os.Exit(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
func run(port int) error {
|
|
||||||
if port == 0 {
|
|
||||||
port = config.Config.Api.GinPort[0]
|
|
||||||
}
|
|
||||||
var err error
|
|
||||||
rdb, err := cache.NewRedis()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
fmt.Println("api start init discov client")
|
|
||||||
var client discoveryregistry.SvcDiscoveryRegistry
|
|
||||||
client, err = openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema,
|
|
||||||
openKeeper.WithFreq(time.Hour), openKeeper.WithUserNameAndPassword(config.Config.Zookeeper.UserName,
|
|
||||||
config.Config.Zookeeper.Password), openKeeper.WithRoundRobin(), openKeeper.WithTimeout(10), openKeeper.WithLogger(log.NewZkLogger()))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
fmt.Println("api init discov client success")
|
|
||||||
buf := bytes.NewBuffer(nil)
|
|
||||||
if err := yaml.NewEncoder(buf).Encode(config.Config); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
fmt.Println("api register public config to discov")
|
|
||||||
if err := client.RegisterConf2Registry(constant.OpenIMCommonConfigKey, buf.Bytes()); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
fmt.Println("api register public config to discov success")
|
|
||||||
router := api.NewGinRouter(client, rdb)
|
|
||||||
fmt.Println("api init router success")
|
|
||||||
var address string
|
|
||||||
if config.Config.Api.ListenIP != "" {
|
|
||||||
address = net.JoinHostPort(config.Config.Api.ListenIP, strconv.Itoa(port))
|
|
||||||
} else {
|
|
||||||
address = net.JoinHostPort("0.0.0.0", strconv.Itoa(port))
|
|
||||||
}
|
|
||||||
fmt.Println("start api server, address: ", address, ", OpenIM version: ", config.Version)
|
|
||||||
log.ZInfo(context.Background(), "start server success", "address", address, "version", config.Version)
|
|
||||||
go startPprof()
|
|
||||||
err = router.Run(address)
|
|
||||||
if err != nil {
|
|
||||||
log.ZError(context.Background(), "api run failed ", err, "address", address)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
msgUtilsCmd := cmd.NewMsgUtilsCmd("openIMCmdUtils", "openIM cmd utils", nil)
|
|
||||||
getCmd := cmd.NewGetCmd()
|
|
||||||
fixCmd := cmd.NewFixCmd()
|
|
||||||
clearCmd := cmd.NewClearCmd()
|
|
||||||
seqCmd := cmd.NewSeqCmd()
|
|
||||||
msgCmd := cmd.NewMsgCmd()
|
|
||||||
getCmd.AddCommand(seqCmd.GetSeqCmd(), msgCmd.GetMsgCmd())
|
|
||||||
getCmd.AddSuperGroupIDFlag()
|
|
||||||
getCmd.AddUserIDFlag()
|
|
||||||
getCmd.AddBeginSeqFlag()
|
|
||||||
getCmd.AddLimitFlag()
|
|
||||||
// openIM get seq --userID=xxx
|
|
||||||
// openIM get seq --superGroupID=xxx
|
|
||||||
// openIM get msg --userID=xxx --beginSeq=100 --limit=10
|
|
||||||
// openIM get msg --superGroupID=xxx --beginSeq=100 --limit=10
|
|
||||||
|
|
||||||
fixCmd.AddCommand(seqCmd.FixSeqCmd())
|
|
||||||
fixCmd.AddSuperGroupIDFlag()
|
|
||||||
fixCmd.AddUserIDFlag()
|
|
||||||
fixCmd.AddFixAllFlag()
|
|
||||||
// openIM fix seq --userID=xxx
|
|
||||||
// openIM fix seq --superGroupID=xxx
|
|
||||||
// openIM fix seq --fixAll
|
|
||||||
|
|
||||||
clearCmd.AddCommand(msgCmd.ClearMsgCmd())
|
|
||||||
clearCmd.AddSuperGroupIDFlag()
|
|
||||||
clearCmd.AddUserIDFlag()
|
|
||||||
clearCmd.AddClearAllFlag()
|
|
||||||
clearCmd.AddBeginSeqFlag()
|
|
||||||
clearCmd.AddLimitFlag()
|
|
||||||
// openIM clear msg --userID=xxx --beginSeq=100 --limit=10
|
|
||||||
// openIM clear msg --superGroupID=xxx --beginSeq=100 --limit=10
|
|
||||||
// openIM clear msg --clearAll
|
|
||||||
msgUtilsCmd.AddCommand(&getCmd.Command, &fixCmd.Command, &clearCmd.Command)
|
|
||||||
if err := msgUtilsCmd.Execute(); err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_cron_task ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_cron_task"]
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/tools"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
cronTaskCmd := cmd.NewCronTaskCmd()
|
|
||||||
if err := cronTaskCmd.Exec(tools.StartCronTask); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_msg_gateway ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_msg_gateway","--port", "10140" "--ws_port", "10001", "--prometheus_port", "20240"]
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
msgGatewayCmd := cmd.NewMsgGatewayCmd()
|
|
||||||
msgGatewayCmd.AddWsPortFlag()
|
|
||||||
msgGatewayCmd.AddPortFlag()
|
|
||||||
msgGatewayCmd.AddPrometheusPortFlag()
|
|
||||||
if err := msgGatewayCmd.Exec(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_msg_transfer ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_msg_transfer","--prometheus_port", "21400"]
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
msgTransferCmd := cmd.NewMsgTransferCmd()
|
|
||||||
msgTransferCmd.AddPrometheusPortFlag()
|
|
||||||
if err := msgTransferCmd.Exec(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -18,7 +18,7 @@ BINARY_NAME=${NAME}
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -32,3 +32,4 @@ install:build
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,250 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "Open_IM/cmd/open_im_api/docs"
|
||||||
|
apiAuth "Open_IM/internal/api/auth"
|
||||||
|
clientInit "Open_IM/internal/api/client_init"
|
||||||
|
"Open_IM/internal/api/conversation"
|
||||||
|
"Open_IM/internal/api/friend"
|
||||||
|
"Open_IM/internal/api/group"
|
||||||
|
"Open_IM/internal/api/manage"
|
||||||
|
apiChat "Open_IM/internal/api/msg"
|
||||||
|
"Open_IM/internal/api/office"
|
||||||
|
"Open_IM/internal/api/organization"
|
||||||
|
apiThird "Open_IM/internal/api/third"
|
||||||
|
"Open_IM/internal/api/user"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/log"
|
||||||
|
"Open_IM/pkg/grpc-etcdv3/getcdv3"
|
||||||
|
"Open_IM/pkg/utils"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
//_ "github.com/razeencheng/demo-go/swaggo-gin/docs"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
swaggerFiles "github.com/swaggo/files"
|
||||||
|
ginSwagger "github.com/swaggo/gin-swagger"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
//"syscall"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
)
|
||||||
|
|
||||||
|
// @title open-IM-Server API
|
||||||
|
// @version 1.0
|
||||||
|
// @description open-IM-Server 的API服务器文档, 文档中所有请求都有一个operationID字段用于链路追踪
|
||||||
|
|
||||||
|
// @license.name Apache 2.0
|
||||||
|
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
// @BasePath /
|
||||||
|
func main() {
|
||||||
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
|
gin.SetMode(gin.ReleaseMode)
|
||||||
|
f, _ := os.Create("../logs/api.log")
|
||||||
|
gin.DefaultWriter = io.MultiWriter(f)
|
||||||
|
// gin.SetMode(gin.DebugMode)
|
||||||
|
r := gin.New()
|
||||||
|
r.Use(gin.Recovery())
|
||||||
|
r.Use(utils.CorsHandler())
|
||||||
|
log.Info("load config: ", config.Config)
|
||||||
|
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
||||||
|
if config.Config.Prometheus.Enable {
|
||||||
|
promePkg.NewApiRequestCounter()
|
||||||
|
promePkg.NewApiRequestFailedCounter()
|
||||||
|
promePkg.NewApiRequestSuccessCounter()
|
||||||
|
r.Use(promePkg.PromeTheusMiddleware)
|
||||||
|
r.GET("/metrics", promePkg.PrometheusHandler())
|
||||||
|
}
|
||||||
|
// user routing group, which handles user registration and login services
|
||||||
|
userRouterGroup := r.Group("/user")
|
||||||
|
{
|
||||||
|
userRouterGroup.POST("/update_user_info", user.UpdateUserInfo) //1
|
||||||
|
userRouterGroup.POST("/set_global_msg_recv_opt", user.SetGlobalRecvMessageOpt)
|
||||||
|
userRouterGroup.POST("/get_users_info", user.GetUsersPublicInfo) //1
|
||||||
|
userRouterGroup.POST("/get_self_user_info", user.GetSelfUserInfo) //1
|
||||||
|
userRouterGroup.POST("/get_users_online_status", user.GetUsersOnlineStatus) //1
|
||||||
|
userRouterGroup.POST("/get_users_info_from_cache", user.GetUsersInfoFromCache)
|
||||||
|
userRouterGroup.POST("/get_user_friend_from_cache", user.GetFriendIDListFromCache)
|
||||||
|
userRouterGroup.POST("/get_black_list_from_cache", user.GetBlackIDListFromCache)
|
||||||
|
userRouterGroup.POST("/get_all_users_uid", manage.GetAllUsersUid) //1
|
||||||
|
userRouterGroup.POST("/account_check", manage.AccountCheck) //1
|
||||||
|
// userRouterGroup.POST("/get_users_online_status", manage.GetUsersOnlineStatus) //1
|
||||||
|
userRouterGroup.POST("/get_users", user.GetUsers)
|
||||||
|
}
|
||||||
|
//friend routing group
|
||||||
|
friendRouterGroup := r.Group("/friend")
|
||||||
|
{
|
||||||
|
// friendRouterGroup.POST("/get_friends_info", friend.GetFriendsInfo)
|
||||||
|
friendRouterGroup.POST("/add_friend", friend.AddFriend) //1
|
||||||
|
friendRouterGroup.POST("/delete_friend", friend.DeleteFriend) //1
|
||||||
|
friendRouterGroup.POST("/get_friend_apply_list", friend.GetFriendApplyList) //1
|
||||||
|
friendRouterGroup.POST("/get_self_friend_apply_list", friend.GetSelfFriendApplyList) //1
|
||||||
|
friendRouterGroup.POST("/get_friend_list", friend.GetFriendList) //1
|
||||||
|
friendRouterGroup.POST("/add_friend_response", friend.AddFriendResponse) //1
|
||||||
|
friendRouterGroup.POST("/set_friend_remark", friend.SetFriendRemark) //1
|
||||||
|
|
||||||
|
friendRouterGroup.POST("/add_black", friend.AddBlack) //1
|
||||||
|
friendRouterGroup.POST("/get_black_list", friend.GetBlacklist) //1
|
||||||
|
friendRouterGroup.POST("/remove_black", friend.RemoveBlack) //1
|
||||||
|
|
||||||
|
friendRouterGroup.POST("/import_friend", friend.ImportFriend) //1
|
||||||
|
friendRouterGroup.POST("/is_friend", friend.IsFriend) //1
|
||||||
|
}
|
||||||
|
//group related routing group
|
||||||
|
groupRouterGroup := r.Group("/group")
|
||||||
|
{
|
||||||
|
groupRouterGroup.POST("/create_group", group.CreateGroup) //1
|
||||||
|
groupRouterGroup.POST("/set_group_info", group.SetGroupInfo) //1
|
||||||
|
groupRouterGroup.POST("/join_group", group.JoinGroup) //1
|
||||||
|
groupRouterGroup.POST("/quit_group", group.QuitGroup) //1
|
||||||
|
groupRouterGroup.POST("/group_application_response", group.ApplicationGroupResponse) //1
|
||||||
|
groupRouterGroup.POST("/transfer_group", group.TransferGroupOwner) //1
|
||||||
|
groupRouterGroup.POST("/get_recv_group_applicationList", group.GetRecvGroupApplicationList) //1
|
||||||
|
groupRouterGroup.POST("/get_user_req_group_applicationList", group.GetUserReqGroupApplicationList)
|
||||||
|
groupRouterGroup.POST("/get_groups_info", group.GetGroupsInfo) //1
|
||||||
|
groupRouterGroup.POST("/kick_group", group.KickGroupMember) //1
|
||||||
|
// groupRouterGroup.POST("/get_group_member_list", group.GetGroupMemberList) //no use
|
||||||
|
groupRouterGroup.POST("/get_group_all_member_list", group.GetGroupAllMemberList) //1
|
||||||
|
groupRouterGroup.POST("/get_group_members_info", group.GetGroupMembersInfo) //1
|
||||||
|
groupRouterGroup.POST("/invite_user_to_group", group.InviteUserToGroup) //1
|
||||||
|
//only for supergroup
|
||||||
|
groupRouterGroup.POST("/invite_user_to_groups", group.InviteUserToGroups)
|
||||||
|
groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList)
|
||||||
|
groupRouterGroup.POST("/dismiss_group", group.DismissGroup) //
|
||||||
|
groupRouterGroup.POST("/mute_group_member", group.MuteGroupMember)
|
||||||
|
groupRouterGroup.POST("/cancel_mute_group_member", group.CancelMuteGroupMember) //MuteGroup
|
||||||
|
groupRouterGroup.POST("/mute_group", group.MuteGroup)
|
||||||
|
groupRouterGroup.POST("/cancel_mute_group", group.CancelMuteGroup)
|
||||||
|
groupRouterGroup.POST("/set_group_member_nickname", group.SetGroupMemberNickname)
|
||||||
|
groupRouterGroup.POST("/set_group_member_info", group.SetGroupMemberInfo)
|
||||||
|
groupRouterGroup.POST("/get_group_abstract_info", group.GetGroupAbstractInfo)
|
||||||
|
//groupRouterGroup.POST("/get_group_all_member_list_by_split", group.GetGroupAllMemberListBySplit)
|
||||||
|
}
|
||||||
|
superGroupRouterGroup := r.Group("/super_group")
|
||||||
|
{
|
||||||
|
superGroupRouterGroup.POST("/get_joined_group_list", group.GetJoinedSuperGroupList)
|
||||||
|
superGroupRouterGroup.POST("/get_groups_info", group.GetSuperGroupsInfo)
|
||||||
|
}
|
||||||
|
//certificate
|
||||||
|
authRouterGroup := r.Group("/auth")
|
||||||
|
{
|
||||||
|
authRouterGroup.POST("/user_register", apiAuth.UserRegister) //1
|
||||||
|
authRouterGroup.POST("/user_token", apiAuth.UserToken) //1
|
||||||
|
authRouterGroup.POST("/parse_token", apiAuth.ParseToken) //1
|
||||||
|
authRouterGroup.POST("/force_logout", apiAuth.ForceLogout) //1
|
||||||
|
}
|
||||||
|
//Third service
|
||||||
|
thirdGroup := r.Group("/third")
|
||||||
|
{
|
||||||
|
thirdGroup.POST("/tencent_cloud_storage_credential", apiThird.TencentCloudStorageCredential)
|
||||||
|
thirdGroup.POST("/ali_oss_credential", apiThird.AliOSSCredential)
|
||||||
|
thirdGroup.POST("/minio_storage_credential", apiThird.MinioStorageCredential)
|
||||||
|
thirdGroup.POST("/minio_upload", apiThird.MinioUploadFile)
|
||||||
|
thirdGroup.POST("/upload_update_app", apiThird.UploadUpdateApp)
|
||||||
|
thirdGroup.POST("/get_download_url", apiThird.GetDownloadURL)
|
||||||
|
thirdGroup.POST("/get_rtc_invitation_info", apiThird.GetRTCInvitationInfo)
|
||||||
|
thirdGroup.POST("/get_rtc_invitation_start_app", apiThird.GetRTCInvitationInfoStartApp)
|
||||||
|
thirdGroup.POST("/fcm_update_token", apiThird.FcmUpdateToken)
|
||||||
|
thirdGroup.POST("/aws_storage_credential", apiThird.AwsStorageCredential)
|
||||||
|
thirdGroup.POST("/set_app_badge", apiThird.SetAppBadge)
|
||||||
|
}
|
||||||
|
//Message
|
||||||
|
chatGroup := r.Group("/msg")
|
||||||
|
{
|
||||||
|
chatGroup.POST("/newest_seq", apiChat.GetSeq)
|
||||||
|
chatGroup.POST("/send_msg", apiChat.SendMsg)
|
||||||
|
chatGroup.POST("/pull_msg_by_seq", apiChat.PullMsgBySeqList)
|
||||||
|
chatGroup.POST("/del_msg", apiChat.DelMsg)
|
||||||
|
chatGroup.POST("/del_super_group_msg", apiChat.DelSuperGroupMsg)
|
||||||
|
chatGroup.POST("/clear_msg", apiChat.ClearMsg)
|
||||||
|
chatGroup.POST("/manage_send_msg", manage.ManagementSendMsg)
|
||||||
|
chatGroup.POST("/batch_send_msg", manage.ManagementBatchSendMsg)
|
||||||
|
chatGroup.POST("/check_msg_is_send_success", manage.CheckMsgIsSendSuccess)
|
||||||
|
chatGroup.POST("/set_msg_min_seq", apiChat.SetMsgMinSeq)
|
||||||
|
|
||||||
|
chatGroup.POST("/set_message_reaction_extensions", apiChat.SetMessageReactionExtensions)
|
||||||
|
chatGroup.POST("/get_message_list_reaction_extensions", apiChat.GetMessageListReactionExtensions)
|
||||||
|
chatGroup.POST("/add_message_reaction_extensions", apiChat.AddMessageReactionExtensions)
|
||||||
|
chatGroup.POST("/delete_message_reaction_extensions", apiChat.DeleteMessageReactionExtensions)
|
||||||
|
}
|
||||||
|
//Conversation
|
||||||
|
conversationGroup := r.Group("/conversation")
|
||||||
|
{ //1
|
||||||
|
conversationGroup.POST("/get_all_conversations", conversation.GetAllConversations)
|
||||||
|
conversationGroup.POST("/get_conversation", conversation.GetConversation)
|
||||||
|
conversationGroup.POST("/get_conversations", conversation.GetConversations)
|
||||||
|
//deprecated
|
||||||
|
conversationGroup.POST("/set_conversation", conversation.SetConversation)
|
||||||
|
conversationGroup.POST("/batch_set_conversation", conversation.BatchSetConversations)
|
||||||
|
//deprecated
|
||||||
|
conversationGroup.POST("/set_recv_msg_opt", conversation.SetRecvMsgOpt)
|
||||||
|
conversationGroup.POST("/modify_conversation_field", conversation.ModifyConversationField)
|
||||||
|
}
|
||||||
|
// office
|
||||||
|
officeGroup := r.Group("/office")
|
||||||
|
{
|
||||||
|
officeGroup.POST("/get_user_tags", office.GetUserTags)
|
||||||
|
officeGroup.POST("/get_user_tag_by_id", office.GetUserTagByID)
|
||||||
|
officeGroup.POST("/create_tag", office.CreateTag)
|
||||||
|
officeGroup.POST("/delete_tag", office.DeleteTag)
|
||||||
|
officeGroup.POST("/set_tag", office.SetTag)
|
||||||
|
officeGroup.POST("/send_msg_to_tag", office.SendMsg2Tag)
|
||||||
|
officeGroup.POST("/get_send_tag_log", office.GetTagSendLogs)
|
||||||
|
|
||||||
|
officeGroup.POST("/create_one_work_moment", office.CreateOneWorkMoment)
|
||||||
|
officeGroup.POST("/delete_one_work_moment", office.DeleteOneWorkMoment)
|
||||||
|
officeGroup.POST("/like_one_work_moment", office.LikeOneWorkMoment)
|
||||||
|
officeGroup.POST("/comment_one_work_moment", office.CommentOneWorkMoment)
|
||||||
|
officeGroup.POST("/get_work_moment_by_id", office.GetWorkMomentByID)
|
||||||
|
officeGroup.POST("/get_user_work_moments", office.GetUserWorkMoments)
|
||||||
|
officeGroup.POST("/get_user_friend_work_moments", office.GetUserFriendWorkMoments)
|
||||||
|
officeGroup.POST("/set_user_work_moments_level", office.SetUserWorkMomentsLevel)
|
||||||
|
officeGroup.POST("/delete_comment", office.DeleteComment)
|
||||||
|
}
|
||||||
|
|
||||||
|
organizationGroup := r.Group("/organization")
|
||||||
|
{
|
||||||
|
organizationGroup.POST("/create_department", organization.CreateDepartment)
|
||||||
|
organizationGroup.POST("/update_department", organization.UpdateDepartment)
|
||||||
|
organizationGroup.POST("/get_sub_department", organization.GetSubDepartment)
|
||||||
|
organizationGroup.POST("/delete_department", organization.DeleteDepartment)
|
||||||
|
organizationGroup.POST("/get_all_department", organization.GetAllDepartment)
|
||||||
|
|
||||||
|
organizationGroup.POST("/create_organization_user", organization.CreateOrganizationUser)
|
||||||
|
organizationGroup.POST("/update_organization_user", organization.UpdateOrganizationUser)
|
||||||
|
organizationGroup.POST("/delete_organization_user", organization.DeleteOrganizationUser)
|
||||||
|
|
||||||
|
organizationGroup.POST("/create_department_member", organization.CreateDepartmentMember)
|
||||||
|
organizationGroup.POST("/get_user_in_department", organization.GetUserInDepartment)
|
||||||
|
organizationGroup.POST("/update_user_in_department", organization.UpdateUserInDepartment)
|
||||||
|
|
||||||
|
organizationGroup.POST("/get_department_member", organization.GetDepartmentMember)
|
||||||
|
organizationGroup.POST("/delete_user_in_department", organization.DeleteUserInDepartment)
|
||||||
|
organizationGroup.POST("/get_user_in_organization", organization.GetUserInOrganization)
|
||||||
|
}
|
||||||
|
|
||||||
|
initGroup := r.Group("/init")
|
||||||
|
{
|
||||||
|
initGroup.POST("/set_client_config", clientInit.SetClientInitConfig)
|
||||||
|
initGroup.POST("/get_client_config", clientInit.GetClientInitConfig)
|
||||||
|
}
|
||||||
|
go getcdv3.RegisterConf()
|
||||||
|
go apiThird.MinioInit()
|
||||||
|
defaultPorts := config.Config.Api.GinPort
|
||||||
|
ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10002 as port")
|
||||||
|
flag.Parse()
|
||||||
|
address := "0.0.0.0:" + strconv.Itoa(*ginPort)
|
||||||
|
if config.Config.Api.ListenIP != "" {
|
||||||
|
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)
|
||||||
|
}
|
||||||
|
fmt.Println("start api server, address: ", address, ", OpenIM version: ", constant.CurrentVersion)
|
||||||
|
err := r.Run(address)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("", "api run failed ", address, err.Error())
|
||||||
|
panic("api start failed " + err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
.PHONY: all build run gotool install clean help
|
||||||
|
|
||||||
NAME=open_im_cmd_utils
|
NAME=open_im_cms_api
|
||||||
BIN_DIR=../../bin/
|
BIN_DIR=../../bin/
|
||||||
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
OS:= $(or $(os),linux)
|
||||||
ARCH:=$(or $(arch),amd64)
|
ARCH:=$(or $(arch),amd64)
|
||||||
all: gotool build
|
all: gotool build
|
||||||
@@ -18,7 +19,7 @@ BINARY_NAME=${NAME}
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -32,3 +33,4 @@ install:build
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/cms_api"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
"Open_IM/pkg/utils"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
gin.SetMode(gin.ReleaseMode)
|
||||||
|
router := cms_api.NewGinRouter()
|
||||||
|
router.Use(utils.CorsHandler())
|
||||||
|
defaultPorts := config.Config.CmsApi.GinPort
|
||||||
|
ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10006 as port")
|
||||||
|
flag.Parse()
|
||||||
|
address := "0.0.0.0:" + strconv.Itoa(*ginPort)
|
||||||
|
if config.Config.Api.ListenIP != "" {
|
||||||
|
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)
|
||||||
|
}
|
||||||
|
address = config.Config.CmsApi.ListenIP + ":" + strconv.Itoa(*ginPort)
|
||||||
|
fmt.Println("start cms api server, address: ", address, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
router.Run(address)
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ BINARY_NAME=${NAME}
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/cron_task"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var userID = flag.String("userID", "", "userID to clear msg and reset seq")
|
||||||
|
var workingGroupID = flag.String("workingGroupID", "", "workingGroupID to clear msg and reset seq")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println(time.Now(), "start cronTask", *userID, *workingGroupID)
|
||||||
|
cronTask.StartCronTask(*userID, *workingGroupID)
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
.PHONY: all build run gotool install clean help
|
||||||
|
|
||||||
|
NAME=open_im_demo
|
||||||
|
BIN_DIR=../../bin/
|
||||||
|
|
||||||
|
|
||||||
|
OS:= $(or $(os),linux)
|
||||||
|
ARCH:=$(or $(arch),amd64)
|
||||||
|
all: gotool build
|
||||||
|
|
||||||
|
ifeq ($(OS),windows)
|
||||||
|
|
||||||
|
BINARY_NAME=${NAME}.exe
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
BINARY_NAME=${NAME}
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
build:
|
||||||
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
|
run:
|
||||||
|
@go run ./
|
||||||
|
|
||||||
|
gotool:
|
||||||
|
go fmt ./
|
||||||
|
go vet ./
|
||||||
|
|
||||||
|
install:build
|
||||||
|
mv ${BINARY_NAME} ${BIN_DIR}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/demo/register"
|
||||||
|
"Open_IM/pkg/utils"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
"Open_IM/pkg/common/log"
|
||||||
|
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
|
gin.SetMode(gin.ReleaseMode)
|
||||||
|
f, _ := os.Create("../logs/api.log")
|
||||||
|
gin.DefaultWriter = io.MultiWriter(f)
|
||||||
|
r := gin.Default()
|
||||||
|
r.Use(utils.CorsHandler())
|
||||||
|
if config.Config.Prometheus.Enable {
|
||||||
|
r.GET("/metrics", promePkg.PrometheusHandler())
|
||||||
|
}
|
||||||
|
authRouterGroup := r.Group("/demo")
|
||||||
|
{
|
||||||
|
authRouterGroup.POST("/code", register.SendVerificationCode)
|
||||||
|
authRouterGroup.POST("/verify", register.Verify)
|
||||||
|
authRouterGroup.POST("/password", register.SetPassword)
|
||||||
|
authRouterGroup.POST("/login", register.Login)
|
||||||
|
authRouterGroup.POST("/reset_password", register.ResetPassword)
|
||||||
|
authRouterGroup.POST("/check_login", register.CheckLoginLimit)
|
||||||
|
}
|
||||||
|
demoRouterGroup := r.Group("/auth")
|
||||||
|
{
|
||||||
|
demoRouterGroup.POST("/code", register.SendVerificationCode)
|
||||||
|
demoRouterGroup.POST("/verify", register.Verify)
|
||||||
|
demoRouterGroup.POST("/password", register.SetPassword)
|
||||||
|
demoRouterGroup.POST("/login", register.Login)
|
||||||
|
demoRouterGroup.POST("/reset_password", register.ResetPassword)
|
||||||
|
demoRouterGroup.POST("/check_login", register.CheckLoginLimit)
|
||||||
|
}
|
||||||
|
|
||||||
|
//deprecated
|
||||||
|
cmsRouterGroup := r.Group("/cms_admin")
|
||||||
|
{
|
||||||
|
cmsRouterGroup.POST("/generate_invitation_code", register.GenerateInvitationCode)
|
||||||
|
cmsRouterGroup.POST("/query_invitation_code", register.QueryInvitationCode)
|
||||||
|
cmsRouterGroup.POST("/get_invitation_codes", register.GetInvitationCodes)
|
||||||
|
|
||||||
|
cmsRouterGroup.POST("/query_user_ip_limit_login", register.QueryUserIDLimitLogin)
|
||||||
|
cmsRouterGroup.POST("/add_user_ip_limit_login", register.AddUserIPLimitLogin)
|
||||||
|
cmsRouterGroup.POST("/remove_user_ip_limit_login", register.RemoveUserIPLimitLogin)
|
||||||
|
|
||||||
|
cmsRouterGroup.POST("/query_ip_register", register.QueryIPRegister)
|
||||||
|
cmsRouterGroup.POST("/add_ip_limit", register.AddIPLimit)
|
||||||
|
cmsRouterGroup.POST("/remove_ip_Limit", register.RemoveIPLimit)
|
||||||
|
}
|
||||||
|
defaultPorts := config.Config.Demo.Port
|
||||||
|
ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10004 as port")
|
||||||
|
flag.Parse()
|
||||||
|
address := "0.0.0.0:" + strconv.Itoa(*ginPort)
|
||||||
|
if config.Config.Api.ListenIP != "" {
|
||||||
|
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)
|
||||||
|
}
|
||||||
|
address = config.Config.CmsApi.ListenIP + ":" + strconv.Itoa(*ginPort)
|
||||||
|
fmt.Println("start demo api server address: ", address, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
go register.OnboardingProcessRoutine()
|
||||||
|
go register.ImportFriendRoutine()
|
||||||
|
err := r.Run(address)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("", "run failed ", *ginPort, err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ BINARY_NAME=${NAME}
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/msg_gateway/gate"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
"Open_IM/pkg/common/log"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
|
defaultRpcPorts := config.Config.RpcPort.OpenImMessageGatewayPort
|
||||||
|
defaultWsPorts := config.Config.LongConnSvr.WebsocketPort
|
||||||
|
defaultPromePorts := config.Config.Prometheus.MessageGatewayPrometheusPort
|
||||||
|
rpcPort := flag.Int("rpc_port", defaultRpcPorts[0], "rpc listening port")
|
||||||
|
wsPort := flag.Int("ws_port", defaultWsPorts[0], "ws listening port")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", defaultPromePorts[0], "PushrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
wg.Add(1)
|
||||||
|
fmt.Println("start rpc/msg_gateway server, port: ", *rpcPort, *wsPort, *prometheusPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
gate.Init(*rpcPort, *wsPort)
|
||||||
|
gate.Run(*prometheusPort)
|
||||||
|
wg.Wait()
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
NAME=open_im_msg_transfer
|
NAME=open_im_msg_transfer
|
||||||
BIN_DIR=../../bin/
|
BIN_DIR=../../bin/
|
||||||
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
OS:= $(or $(os),linux)
|
||||||
ARCH:=$(or $(arch),amd64)
|
ARCH:=$(or $(arch),amd64)
|
||||||
all: gotool build
|
all: gotool build
|
||||||
@@ -18,7 +19,7 @@ BINARY_NAME=${NAME}
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -32,3 +33,4 @@ install:build
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/msg_transfer/logic"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
"Open_IM/pkg/common/log"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
wg.Add(1)
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.MessageTransferPrometheusPort[0], "MessageTransferPrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
|
logic.Init()
|
||||||
|
fmt.Println("start msg_transfer server ", ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
logic.Run(*prometheusPort)
|
||||||
|
wg.Wait()
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ BINARY_NAME=${NAME}
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -32,3 +32,5 @@ install:build
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/push/logic"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
"Open_IM/pkg/common/log"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImPushPort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.MessageTransferPrometheusPort[0], "PushrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
wg.Add(1)
|
||||||
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
|
fmt.Println("start push rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
logic.Init(*rpcPort)
|
||||||
|
logic.Run(*prometheusPort)
|
||||||
|
wg.Wait()
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_push ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_push", "--port", "10170", "--prometheus_port", "20170"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/push"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
pushCmd := cmd.NewRpcCmd("push")
|
|
||||||
pushCmd.AddPortFlag()
|
|
||||||
pushCmd.AddPrometheusPortFlag()
|
|
||||||
if err := pushCmd.Exec(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
if err := pushCmd.StartSvr(config.Config.RpcRegisterName.OpenImPushName, push.Start); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_auth ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_auth", "--port", "10160"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/rpc/auth"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
authCmd := cmd.NewRpcCmd("auth")
|
|
||||||
authCmd.AddPortFlag()
|
|
||||||
authCmd.AddPrometheusPortFlag()
|
|
||||||
if err := authCmd.Exec(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
if err := authCmd.StartSvr(config.Config.RpcRegisterName.OpenImAuthName, auth.Start); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_conversation ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_conversation", "--port", "10230", "--prometheus_port","20230"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/rpc/conversation"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
rpcCmd := cmd.NewRpcCmd("conversation")
|
|
||||||
rpcCmd.AddPortFlag()
|
|
||||||
rpcCmd.AddPrometheusPortFlag()
|
|
||||||
if err := rpcCmd.Exec(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImConversationName, conversation.Start); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_friend ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_friend", "--port", "10120", "--prometheus_port","20120"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/rpc/friend"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
rpcCmd := cmd.NewRpcCmd("friend")
|
|
||||||
rpcCmd.AddPortFlag()
|
|
||||||
rpcCmd.AddPrometheusPortFlag()
|
|
||||||
if err := rpcCmd.Exec(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImFriendName, friend.Start); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_group ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_group", "--port", "10150", "--prometheus_port","20150"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/rpc/group"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
rpcCmd := cmd.NewRpcCmd("group")
|
|
||||||
rpcCmd.AddPortFlag()
|
|
||||||
rpcCmd.AddPrometheusPortFlag()
|
|
||||||
if err := rpcCmd.Exec(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImGroupName, group.Start); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_msg ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_msg", "--port", "10130", "--prometheus_port","20130"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/rpc/msg"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
rpcCmd := cmd.NewRpcCmd("msg")
|
|
||||||
rpcCmd.AddPortFlag()
|
|
||||||
rpcCmd.AddPrometheusPortFlag()
|
|
||||||
if err := rpcCmd.Exec(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImMsgName, msg.Start); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
.PHONY: all build run gotool install clean help
|
||||||
|
|
||||||
|
NAME=open_im_admin_cms
|
||||||
|
BIN_DIR=../../../bin/
|
||||||
|
|
||||||
|
OS:= $(or $(os),linux)
|
||||||
|
ARCH:=$(or $(arch),amd64)
|
||||||
|
all: gotool build
|
||||||
|
|
||||||
|
ifeq ($(OS),windows)
|
||||||
|
|
||||||
|
BINARY_NAME=${NAME}.exe
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
BINARY_NAME=${NAME}
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
build:
|
||||||
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
|
run:
|
||||||
|
@go run ./
|
||||||
|
|
||||||
|
gotool:
|
||||||
|
go fmt ./
|
||||||
|
go vet ./
|
||||||
|
|
||||||
|
install:build
|
||||||
|
mv ${BINARY_NAME} ${BIN_DIR}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
rpcMessageCMS "Open_IM/internal/rpc/admin_cms"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImAdminCmsPort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.AdminCmsPrometheusPort[0], "adminCMSPrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println("start cms rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
rpcServer := rpcMessageCMS.NewAdminCMSServer(*rpcPort)
|
||||||
|
go func() {
|
||||||
|
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
rpcServer.Run()
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ BINARY_NAME=${NAME}
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -32,3 +32,4 @@ install:build
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
rpcAuth "Open_IM/internal/rpc/auth"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImAuthPort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "RpcToken default listen port 10800")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.AuthPrometheusPort[0], "authPrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println("start auth rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
rpcServer := rpcAuth.NewRpcAuthServer(*rpcPort)
|
||||||
|
go func() {
|
||||||
|
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
rpcServer.Run()
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
.PHONY: all build run gotool install clean help
|
||||||
|
|
||||||
|
NAME=open_im_cache
|
||||||
|
BIN_DIR=../../../bin/
|
||||||
|
|
||||||
|
OS:= $(or $(os),linux)
|
||||||
|
ARCH:=$(or $(arch),amd64)
|
||||||
|
all: gotool build
|
||||||
|
|
||||||
|
ifeq ($(OS),windows)
|
||||||
|
|
||||||
|
BINARY_NAME=${NAME}.exe
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
BINARY_NAME=${NAME}
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
build:
|
||||||
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
|
run:
|
||||||
|
@go run ./
|
||||||
|
|
||||||
|
gotool:
|
||||||
|
go fmt ./
|
||||||
|
go vet ./
|
||||||
|
|
||||||
|
install:build
|
||||||
|
mv ${BINARY_NAME} ${BIN_DIR}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
rpcCache "Open_IM/internal/rpc/cache"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImCachePort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "RpcToken default listen port 10800")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.CachePrometheusPort[0], "cachePrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println("start cache rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
rpcServer := rpcCache.NewCacheServer(*rpcPort)
|
||||||
|
go func() {
|
||||||
|
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
rpcServer.Run()
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ BINARY_NAME=${NAME}
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -32,3 +32,4 @@ install:build
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
rpcConversation "Open_IM/internal/rpc/conversation"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImConversationPort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "RpcConversation default listen port 11300")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.ConversationPrometheusPort[0], "conversationPrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println("start conversation rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion)
|
||||||
|
rpcServer := rpcConversation.NewRpcConversationServer(*rpcPort)
|
||||||
|
go func() {
|
||||||
|
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
rpcServer.Run()
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,10 +15,11 @@ else
|
|||||||
|
|
||||||
BINARY_NAME=${NAME}
|
BINARY_NAME=${NAME}
|
||||||
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/rpc/friend"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImFriendPort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "get RpcFriendPort from cmd,default 12000 as port")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.FriendPrometheusPort[0], "friendPrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println("start friend rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
rpcServer := friend.NewFriendServer(*rpcPort)
|
||||||
|
go func() {
|
||||||
|
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
rpcServer.Run()
|
||||||
|
}
|
||||||
@@ -15,10 +15,11 @@ else
|
|||||||
|
|
||||||
BINARY_NAME=${NAME}
|
BINARY_NAME=${NAME}
|
||||||
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -34,6 +35,3 @@ clean:
|
|||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/rpc/group"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImGroupPort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "get RpcGroupPort from cmd,default 16000 as port")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.GroupPrometheusPort[0], "groupPrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println("start group rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
rpcServer := group.NewGroupServer(*rpcPort)
|
||||||
|
go func() {
|
||||||
|
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
rpcServer.Run()
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ BINARY_NAME=${NAME}
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -32,5 +32,3 @@ install:build
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/rpc/msg"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImMessagePort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.MessagePrometheusPort[0], "msgPrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println("start msg rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
rpcServer := msg.NewRpcChatServer(*rpcPort)
|
||||||
|
go func() {
|
||||||
|
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
rpcServer.Run()
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
.PHONY: all build run gotool install clean help
|
||||||
|
|
||||||
|
NAME=open_im_office
|
||||||
|
BIN_DIR=../../../bin/
|
||||||
|
|
||||||
|
OS:= $(or $(os),linux)
|
||||||
|
ARCH:=$(or $(arch),amd64)
|
||||||
|
all: gotool build
|
||||||
|
|
||||||
|
ifeq ($(OS),windows)
|
||||||
|
|
||||||
|
BINARY_NAME=${NAME}.exe
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
BINARY_NAME=${NAME}
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
build:
|
||||||
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
|
run:
|
||||||
|
@go run ./
|
||||||
|
|
||||||
|
gotool:
|
||||||
|
go fmt ./
|
||||||
|
go vet ./
|
||||||
|
|
||||||
|
install:build
|
||||||
|
mv ${BINARY_NAME} ${BIN_DIR}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
rpc "Open_IM/internal/rpc/office"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImOfficePort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.OfficePrometheusPort[0], "officePrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println("start office rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
rpcServer := rpc.NewOfficeServer(*rpcPort)
|
||||||
|
go func() {
|
||||||
|
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
rpcServer.Run()
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
.PHONY: all build run gotool install clean help
|
||||||
|
|
||||||
|
NAME=open_im_organization
|
||||||
|
BIN_DIR=../../../bin/
|
||||||
|
|
||||||
|
OS:= $(or $(os),linux)
|
||||||
|
ARCH:=$(or $(arch),amd64)
|
||||||
|
all: gotool build
|
||||||
|
|
||||||
|
ifeq ($(OS),windows)
|
||||||
|
|
||||||
|
BINARY_NAME=${NAME}.exe
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
BINARY_NAME=${NAME}
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
build:
|
||||||
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
|
run:
|
||||||
|
@go run ./
|
||||||
|
|
||||||
|
gotool:
|
||||||
|
go fmt ./
|
||||||
|
go vet ./
|
||||||
|
|
||||||
|
install:build
|
||||||
|
mv ${BINARY_NAME} ${BIN_DIR}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/rpc/organization"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImOrganizationPort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "get RpcOrganizationPort from cmd,default 11200 as port")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.OrganizationPrometheusPort[0], "organizationPrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println("start organization rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
rpcServer := organization.NewServer(*rpcPort)
|
||||||
|
go func() {
|
||||||
|
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
rpcServer.Run()
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ BINARY_NAME=${NAME}
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags="-w -s"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@go run ./
|
@go run ./
|
||||||
@@ -34,6 +34,3 @@ clean:
|
|||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/internal/rpc/user"
|
||||||
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
|
promePkg "Open_IM/pkg/common/prometheus"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defaultPorts := config.Config.RpcPort.OpenImUserPort
|
||||||
|
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
|
||||||
|
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.UserPrometheusPort[0], "userPrometheusPort default listen port")
|
||||||
|
flag.Parse()
|
||||||
|
fmt.Println("start user rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
|
||||||
|
rpcServer := user.NewUserServer(*rpcPort)
|
||||||
|
go func() {
|
||||||
|
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
rpcServer.Run()
|
||||||
|
}
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=open_im_third
|
|
||||||
BIN_DIR=../../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_third ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_third", "--port", "10200"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/rpc/third"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
rpcCmd := cmd.NewRpcCmd("third")
|
|
||||||
rpcCmd.AddPortFlag()
|
|
||||||
rpcCmd.AddPrometheusPortFlag()
|
|
||||||
if err := rpcCmd.Exec(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImThirdName, third.Start); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
RUN apt-get -qq update \
|
|
||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
|
||||||
COPY ./open_im_user ./
|
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
|
||||||
|
|
||||||
CMD ["./open_im_user", "--port", "10110"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/rpc/user"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
rpcCmd := cmd.NewRpcCmd("user")
|
|
||||||
rpcCmd.AddPortFlag()
|
|
||||||
rpcCmd.AddPrometheusPortFlag()
|
|
||||||
if err := rpcCmd.Exec(); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImUserName, user.Start); err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"Open_IM/pkg/utils"
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo/options"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type MongoMsg struct {
|
||||||
|
UID string
|
||||||
|
Msg []string
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
//"mongodb://%s:%s@%s/%s/?maxPoolSize=%d"
|
||||||
|
uri := "mongodb://user:pass@sample.host:27017/?maxPoolSize=20&w=majority"
|
||||||
|
DBAddress := "127.0.0.1:37017"
|
||||||
|
DBDatabase := "new-test-db"
|
||||||
|
Collection := "new-test-collection"
|
||||||
|
DBMaxPoolSize := 100
|
||||||
|
uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d",
|
||||||
|
DBAddress,DBDatabase,
|
||||||
|
DBMaxPoolSize)
|
||||||
|
|
||||||
|
mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
filter := bson.M{"uid":"my_uid"}
|
||||||
|
ctx, _ := context.WithTimeout(context.Background(), 30*time.Second)
|
||||||
|
for i:=0; i < 2; i++{
|
||||||
|
|
||||||
|
if err = mongoClient.Database(DBDatabase).Collection(Collection).FindOneAndUpdate(ctx, filter,
|
||||||
|
bson.M{"$push": bson.M{"msg": utils.Int32ToString(int32(i))}}).Err(); err != nil{
|
||||||
|
fmt.Println("FindOneAndUpdate failed ", i, )
|
||||||
|
var mmsg MongoMsg
|
||||||
|
mmsg.UID = "my_uid"
|
||||||
|
mmsg.Msg = append(mmsg.Msg, utils.Int32ToString(int32(i)))
|
||||||
|
_, err := mongoClient.Database(DBDatabase).Collection(Collection).InsertOne(ctx, &mmsg)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("insertone failed ", err.Error(), i)
|
||||||
|
} else{
|
||||||
|
fmt.Println("insertone ok ", i)
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
fmt.Println("FindOneAndUpdate ok ", i)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var mmsg MongoMsg
|
||||||
|
|
||||||
|
if err = mongoClient.Database(DBDatabase).Collection(Collection).FindOne(ctx, filter).Decode(&mmsg); err != nil {
|
||||||
|
fmt.Println("findone failed ", err.Error())
|
||||||
|
}else{
|
||||||
|
fmt.Println("findone ok ", mmsg.UID)
|
||||||
|
for i, v:=range mmsg.Msg{
|
||||||
|
fmt.Println("find value: ", i, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+577
-62
@@ -1,39 +1,42 @@
|
|||||||
# The class cannot be named by Pascal or camel case.
|
# The class cannot be named by Pascal or camel case.
|
||||||
|
# The class cannot be named by Pascal or camel case.
|
||||||
# If it is not used, the corresponding structure will not be set,
|
# If it is not used, the corresponding structure will not be set,
|
||||||
# and it will not be read naturally.
|
# and it will not be read naturally.
|
||||||
serverversion: 2.3.7
|
serverversion: 2.3.1
|
||||||
#---------------Infrastructure configuration---------------------#
|
#---------------Infrastructure configuration---------------------#
|
||||||
zookeeper:
|
etcd:
|
||||||
schema: openim #默认即可
|
etcdSchema: openim #默认即可
|
||||||
zkAddr: [ 127.0.0.1:2181 ] #单机部署时,默认即可
|
etcdAddr: [ 127.0.0.1:2379 ] #单机部署时,默认即可
|
||||||
userName:
|
userName:
|
||||||
password:
|
password:
|
||||||
|
secret:
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
dbMysqlAddress: [ 127.0.0.1:13306 ] #mysql地址 目前仅支持单机,默认即可
|
dbMysqlAddress: [ 127.0.0.1:13306 ] #mysql地址 目前仅支持单机,默认即可
|
||||||
dbMysqlUserName: root #mysql用户名,建议修改
|
dbMysqlUserName: #mysql用户名,建议修改
|
||||||
dbMysqlPassword: openIM123 # mysql密码,建议修改
|
dbMysqlPassword: # mysql密码,建议修改
|
||||||
dbMysqlDatabaseName: openIM_v2 #默认即可
|
dbMysqlDatabaseName: openIM_v2 #默认即可
|
||||||
dbTableName: eMsg #默认即可
|
dbTableName: eMsg #默认即可
|
||||||
dbMsgTableNum: 1
|
dbMsgTableNum: 1
|
||||||
dbMaxOpenConns: 100
|
dbMaxOpenConns: 100
|
||||||
dbMaxIdleConns: 10
|
dbMaxIdleConns: 10
|
||||||
dbMaxLifeTime: 5
|
dbMaxLifeTime: 5
|
||||||
logLevel: 4 #1=slient 2=error 3=warn 4=info
|
logLevel: 1 #1=slient 2=error 3=warn 4=info
|
||||||
slowThreshold: 500
|
slowThreshold: 500
|
||||||
|
|
||||||
mongo:
|
mongo:
|
||||||
dbUri: ""#当dbUri值不为空则直接使用该值
|
dbUri: ""#当dbUri值不为空则直接使用该值
|
||||||
|
#dbAddress: 127.0.0.1:37017 #单机时为mongo地址,使用分片集群时,为mongos地址 默认即可
|
||||||
dbAddress: [ 127.0.0.1:37017 ] #单机时为mongo地址,使用分片集群时,为mongos地址 默认即可
|
dbAddress: [ 127.0.0.1:37017 ] #单机时为mongo地址,使用分片集群时,为mongos地址 默认即可
|
||||||
dbDirect: false
|
dbDirect: false
|
||||||
dbTimeout: 60
|
dbTimeout: 60
|
||||||
dbDatabase: openIM #mongo db 默认即可
|
dbDatabase: openIM #mongo db 默认即可
|
||||||
dbSource: admin
|
dbSource: admin
|
||||||
dbUserName: root #mongo用户名,建议先不设置
|
dbUserName: #mongo用户名,建议先不设置
|
||||||
dbPassword: openIM123 #mongo密码,建议先不设置
|
dbPassword: #mongo密码,建议先不设置
|
||||||
dbMaxPoolSize: 100
|
dbMaxPoolSize: 100
|
||||||
dbRetainChatRecords: 3650 #mongo保存离线消息时间(天),根据需求修改
|
dbRetainChatRecords: 3650 #mongo保存离线消息时间(天),根据需求修改
|
||||||
chatRecordsClearTime: "0 2 * * 3" # 每周三凌晨2点清除消息,该配置和linux定时任务一样, 清理操作建议设置在用户活跃少的时候 # 0 3 * * *
|
chatRecordsClearTime: "0 3 * * *" # 每天凌晨3点清除消息,该配置和linux定时任务一样, 清理操作建议设置在用户活跃少的时候 # 0 3 * * *
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
dbAddress: [ 127.0.0.1:16379 ] #redis地址 单机时,填写一个地址即可,使用redis集群时候,填写集群中多个节点地址(主从地址都可以填写,增加容灾能力),默认即可
|
dbAddress: [ 127.0.0.1:16379 ] #redis地址 单机时,填写一个地址即可,使用redis集群时候,填写集群中多个节点地址(主从地址都可以填写,增加容灾能力),默认即可
|
||||||
@@ -41,7 +44,7 @@ redis:
|
|||||||
dbMaxActive: 0
|
dbMaxActive: 0
|
||||||
dbIdleTimeout: 120
|
dbIdleTimeout: 120
|
||||||
dbUserName: #only redis version 6.0+ need username
|
dbUserName: #only redis version 6.0+ need username
|
||||||
dbPassWord: openIM123 #redis密码 建议修改
|
dbPassWord: #redis密码 建议修改
|
||||||
enableCluster: false #如果外部redis以集群方式启动,需要打开此开关
|
enableCluster: false #如果外部redis以集群方式启动,需要打开此开关
|
||||||
|
|
||||||
kafka:
|
kafka:
|
||||||
@@ -50,6 +53,9 @@ kafka:
|
|||||||
ws2mschat:
|
ws2mschat:
|
||||||
addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可
|
addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可
|
||||||
topic: "ws2ms_chat" #用于mongo和mysql保存消息
|
topic: "ws2ms_chat" #用于mongo和mysql保存消息
|
||||||
|
# ws2mschatoffline:
|
||||||
|
# addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可
|
||||||
|
# topic: "ws2ms_chat_offline" #原为离线用户消息处理,目前暂时弃用
|
||||||
msgtomongo:
|
msgtomongo:
|
||||||
addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可
|
addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可
|
||||||
topic: "msg_to_mongo"
|
topic: "msg_to_mongo"
|
||||||
@@ -73,17 +79,33 @@ kafka:
|
|||||||
# automatically obtain the machine's valid network card ip as the service ip,
|
# automatically obtain the machine's valid network card ip as the service ip,
|
||||||
# otherwise the configuration ip is preferred
|
# otherwise the configuration ip is preferred
|
||||||
#如果是单机模式,用0.0.0.0或者不填,默认即可
|
#如果是单机模式,用0.0.0.0或者不填,默认即可
|
||||||
|
serverip: 0.0.0.0
|
||||||
|
|
||||||
#作为rpc时,注册到etcd的地址,单机默认即可,如果是集群部署,需要修改(具体使用内网地址还是外网地址,要依情况而定,目的是api/gateway能访问到)
|
#作为rpc时,注册到etcd的地址,单机默认即可,如果是集群部署,需要修改(具体使用内网地址还是外网地址,要依情况而定,目的是api/gateway能访问到)
|
||||||
rpcRegisterIP:
|
rpcRegisterIP:
|
||||||
#默认即可
|
#默认即可
|
||||||
listenIP: 0.0.0.0
|
listenIP: 0.0.0.0
|
||||||
|
|
||||||
|
# endpoints 内部组件间访问的端点host名称,访问时,可以内部直接访问 host:port 来访问
|
||||||
|
endpoints:
|
||||||
|
api: openim_api
|
||||||
|
cmsapi: openim_cms_api
|
||||||
|
push: openim_push
|
||||||
|
msg_gateway: openim_msg_gateway
|
||||||
|
rpc_auth: openim_rpc_auth
|
||||||
|
rpc_friend: openim_rpc_friend
|
||||||
|
rpc_group: openim_rpc_group
|
||||||
|
rpc_msg: openim_rpc_msg
|
||||||
|
rpc_user: openim_rpc_user
|
||||||
|
rpc_admin_cms: openim_rpc_admin_cms
|
||||||
|
rpc_office: openim_rpc_office
|
||||||
|
|
||||||
api:
|
api:
|
||||||
openImApiPort: [ 10002 ] #api服务端口,默认即可,需要开放此端口或做nginx转发
|
openImApiPort: [ 10002 ] #api服务端口,默认即可,需要开放此端口或做nginx转发
|
||||||
listenIP: 0.0.0.0
|
listenIP: 0.0.0.0
|
||||||
|
cmsapi:
|
||||||
|
openImCmsApiPort: [ 10006 ] #管理后台api服务端口,默认即可,需要开放此端口或做nginx转发
|
||||||
|
listenIP: 0.0.0.0
|
||||||
sdk:
|
sdk:
|
||||||
openImSdkWsPort: [ 10003 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发
|
openImSdkWsPort: [ 10003 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发
|
||||||
dataDir: [ ../db/sdk/ ]
|
dataDir: [ ../db/sdk/ ]
|
||||||
@@ -92,25 +114,23 @@ sdk:
|
|||||||
|
|
||||||
#对象存储服务,以下配置二选一,目前支持两种,腾讯云和minio,二者配置好其中一种即可(如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器)
|
#对象存储服务,以下配置二选一,目前支持两种,腾讯云和minio,二者配置好其中一种即可(如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器)
|
||||||
credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改
|
credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改
|
||||||
|
|
||||||
|
|
||||||
object:
|
|
||||||
enable: minio
|
|
||||||
apiURL: http://127.0.0.1:10002/third/object
|
|
||||||
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
|
|
||||||
tencent:
|
tencent:
|
||||||
appID:
|
appID:
|
||||||
region:
|
region:
|
||||||
bucket:
|
bucket:
|
||||||
secretID:
|
secretID:
|
||||||
secretKey:
|
secretKey:
|
||||||
|
minio: #MinIO 发送图片、视频、文件时需要,请自行申请后替换,必须修改。 客户端初始化InitSDK,中 object_storage参数为minio
|
||||||
|
bucket: openim # 存储内容桶
|
||||||
|
appBucket: app # 存储app的桶
|
||||||
|
location: us-east-1
|
||||||
|
endpoint: #minio外网ip 这个ip是给客户端访问的
|
||||||
|
endpointInner: http://127.0.0.1:10005 #minio内网地址 如果im server 可以通过内网访问到 minio就可以
|
||||||
|
endpointInnerEnable: true #是否启用minio内网地址 启用可以让桶初始化,IM server连接minio走内网地址访问
|
||||||
|
accessKeyID:
|
||||||
|
secretAccessKey:
|
||||||
|
storageTime: 50 #文件在minio中保存的时间
|
||||||
|
isDistributedMod: false # 是否分布式多硬盘部署 默认docker-compose中为false
|
||||||
ali: # ali oss
|
ali: # ali oss
|
||||||
regionID:
|
regionID:
|
||||||
accessKeyID:
|
accessKeyID:
|
||||||
@@ -122,14 +142,15 @@ object:
|
|||||||
stsDurationSeconds:
|
stsDurationSeconds:
|
||||||
OssRoleArn:
|
OssRoleArn:
|
||||||
aws:
|
aws:
|
||||||
accessKeyID: #AssumeRole用户关联的accessKeyID
|
accessKeyID: #AssumeRole用户关联的accessKeyID
|
||||||
accessKeySecret: #AssumeRole用户关联的accessKeySecrect
|
accessKeySecret: #AssumeRole用户关联的accessKeySecrect
|
||||||
region: #分区
|
region: #分区
|
||||||
bucket: #桶
|
bucket: #桶
|
||||||
finalHost: #对外Host
|
finalHost: #对外Host
|
||||||
roleArn: #RoleArn
|
roleArn: #RoleArn
|
||||||
externalId: #角色扩展Id
|
externalId: #角色扩展Id
|
||||||
roleSessionName: #角色SESSION名称
|
roleSessionName: #角色SESSION名称
|
||||||
|
|
||||||
|
|
||||||
rpcport: #rpc服务端口 默认即可
|
rpcport: #rpc服务端口 默认即可
|
||||||
openImUserPort: [ 10110 ]
|
openImUserPort: [ 10110 ]
|
||||||
@@ -139,31 +160,46 @@ rpcport: #rpc服务端口 默认即可
|
|||||||
openImGroupPort: [ 10150 ]
|
openImGroupPort: [ 10150 ]
|
||||||
openImAuthPort: [ 10160 ]
|
openImAuthPort: [ 10160 ]
|
||||||
openImPushPort: [ 10170 ]
|
openImPushPort: [ 10170 ]
|
||||||
openImConversationPort: [ 10180 ]
|
openImAdminCmsPort: [ 10200 ]
|
||||||
openImRtcPort: [ 10190 ]
|
openImOfficePort: [ 10210 ]
|
||||||
openImThirdPort: [ 10200 ]
|
openImOrganizationPort: [ 10220 ]
|
||||||
|
openImConversationPort: [ 10230 ]
|
||||||
|
openImCachePort: [ 10240 ]
|
||||||
|
openImRealTimeCommPort: [ 11300 ]
|
||||||
|
c2c:
|
||||||
|
callbackBeforeSendMsg:
|
||||||
|
switch: false
|
||||||
|
timeoutStrategy: 1 #1:send
|
||||||
|
callbackAfterSendMsg:
|
||||||
|
switch: false
|
||||||
|
state:
|
||||||
|
stateChange:
|
||||||
|
switch: false
|
||||||
|
|
||||||
rpcregistername: #rpc注册服务名,默认即可
|
rpcregistername: #rpc注册服务名,默认即可
|
||||||
openImUserName: User
|
openImUserName: User
|
||||||
openImFriendName: Friend
|
openImFriendName: Friend
|
||||||
openImMsgName: Msg
|
openImMsgName: Msg
|
||||||
openImPushName: Push
|
openImPushName: Push
|
||||||
openImMessageGatewayName: MessageGateway
|
openImRelayName: Relay
|
||||||
openImGroupName: Group
|
openImGroupName: Group
|
||||||
openImAuthName: Auth
|
openImAuthName: Auth
|
||||||
|
openImAdminCMSName: AdminCMS
|
||||||
|
openImOfficeName: Office
|
||||||
|
openImOrganizationName: Organization
|
||||||
openImConversationName: Conversation
|
openImConversationName: Conversation
|
||||||
openImRtcName: Rtc
|
openImCacheName: Cache
|
||||||
openImThirdName: Third
|
openImRealTimeCommName: RealTimeComm
|
||||||
|
|
||||||
log:
|
log:
|
||||||
storageLocation: ../logs/
|
storageLocation: ../logs/
|
||||||
rotationTime: 24
|
rotationTime: 24
|
||||||
remainRotationCount: 2 #日志数量
|
remainRotationCount: 2 #日志数量
|
||||||
#日志级别 6表示全都打印,测试阶段建议设置为6
|
#日志级别 6表示全都打印,测试阶段建议设置为6
|
||||||
remainLogLevel: 6
|
remainLogLevel: 6
|
||||||
isStdout: false
|
elasticSearchSwitch: false
|
||||||
isJson: false
|
elasticSearchAddr: [ 127.0.0.1:9201 ]
|
||||||
withStack: false
|
elasticSearchUser: ""
|
||||||
|
elasticSearchPassword: ""
|
||||||
|
|
||||||
modulename: #日志文件按模块命名,默认即可
|
modulename: #日志文件按模块命名,默认即可
|
||||||
longConnSvrName: msg_gateway
|
longConnSvrName: msg_gateway
|
||||||
@@ -180,11 +216,11 @@ longconnsvr:
|
|||||||
push:
|
push:
|
||||||
tpns: #腾讯推送,暂未测试 暂不要使用
|
tpns: #腾讯推送,暂未测试 暂不要使用
|
||||||
ios:
|
ios:
|
||||||
accessID: 1600018281
|
accessID:
|
||||||
secretKey: 3cd68a77a95b89e5089a1aca523f318f
|
secretKey:
|
||||||
android:
|
android:
|
||||||
accessID: 111
|
accessID:
|
||||||
secretKey: 111
|
secretKey:
|
||||||
enable: false # true or false (bool)
|
enable: false # true or false (bool)
|
||||||
jpns: #极光推送 在极光后台申请后,修改以下四项,必须修改
|
jpns: #极光推送 在极光后台申请后,修改以下四项,必须修改
|
||||||
appKey:
|
appKey:
|
||||||
@@ -192,31 +228,48 @@ push:
|
|||||||
pushUrl:
|
pushUrl:
|
||||||
pushIntent:
|
pushIntent:
|
||||||
enable: false # true or false (bool)
|
enable: false # true or false (bool)
|
||||||
getui: #个推推送
|
getui: #个推推送
|
||||||
pushUrl: "https://restapi.getui.com/v2/$appId"
|
pushUrl:
|
||||||
masterSecret: ""
|
masterSecret: ""
|
||||||
appKey: ""
|
appKey: ""
|
||||||
intent: ""
|
intent: ""
|
||||||
enable: false # true or false (bool)
|
enable: # true or false (bool)
|
||||||
channelID: ""
|
channelID: ""
|
||||||
channelName: ""
|
channelName: ""
|
||||||
fcm: #firebase cloud message 消息推送
|
channel:
|
||||||
serviceAccount: "openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json" #帐号文件,此处需要改修配置,并且这个文件放在 config目录下
|
HW:
|
||||||
|
category:
|
||||||
|
XM:
|
||||||
|
channelID:
|
||||||
|
OPPO:
|
||||||
|
channelID:
|
||||||
|
fcm: #firebase cloud message 消息推送
|
||||||
|
serviceAccount: #帐号文件,此处需要改修配置,并且这个文件放在 config目录下
|
||||||
enable: false
|
enable: false
|
||||||
|
mob: #袤博推送
|
||||||
|
appKey: #帐号文件,此处需要改修配置,并且这个文件放在 config目录下
|
||||||
|
pushUrl:
|
||||||
|
scheme:
|
||||||
|
appSecret:
|
||||||
|
enable: false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
manager:
|
manager:
|
||||||
#app管理员userID和对应的secret 建议修改。 用于管理后台登录,也可以用户管理后台对应的api
|
#app管理员userID和对应的secret 建议修改。 用于管理后台登录,也可以用户管理后台对应的api
|
||||||
appManagerUid: [ "openIM123456","openIM654321", "openIM333", "openIMAdmin" ]
|
appManagerUid: [ "openIM123456","openIM654321", "openIM333", "openIMAdmin"]
|
||||||
nickname: [ "系统通知","openIM654321", "openIM333", "openIMAdmin" ]
|
secrets: [ "openIM1","openIM2", "openIM333", "openIMAdmin"]
|
||||||
|
appSysNotificationName: "系统通知"
|
||||||
|
|
||||||
|
secret:
|
||||||
secret: tuoyun
|
|
||||||
# 多端互踢策略
|
# 多端互踢策略
|
||||||
# 1:多平台登录:Android、iOS、Windows、Mac 每种平台只能一个在线,web端可以多个同时在线
|
# 1:多平台登录:Android、iOS、Windows、Mac 每种平台只能一个在线,web端可以多个同时在线
|
||||||
multiloginpolicy: 1
|
multiloginpolicy: 1
|
||||||
|
|
||||||
#msg log insert to db
|
#msg log insert to db
|
||||||
chatpersistencemysql: true
|
chatpersistencemysql: true
|
||||||
|
#可靠性存储
|
||||||
|
reliablestorage: false
|
||||||
#消息缓存时间
|
#消息缓存时间
|
||||||
msgCacheTimeout: 86400
|
msgCacheTimeout: 86400
|
||||||
#群聊已读开启
|
#群聊已读开启
|
||||||
@@ -226,12 +279,21 @@ singleMessageHasReadReceiptEnable: true
|
|||||||
|
|
||||||
#token config
|
#token config
|
||||||
tokenpolicy:
|
tokenpolicy:
|
||||||
accessSecret: "OpenIM_server" #token生成相关,默认即可
|
accessSecret: #token生成相关,默认即可
|
||||||
# Token effective time day as a unit
|
# Token effective time day as a unit
|
||||||
accessExpire: 90 #token过期时间(天) 默认即可
|
accessExpire: #token过期时间(天) 默认即可
|
||||||
messageverify:
|
messageverify:
|
||||||
friendVerify: false
|
friendVerify:
|
||||||
|
|
||||||
|
# c2c:
|
||||||
|
# callbackBeforeSendMsg:
|
||||||
|
# switch: false
|
||||||
|
# timeoutStrategy: 1 #1:send
|
||||||
|
# callbackAfterSendMsg:
|
||||||
|
# switch: false
|
||||||
|
# state:
|
||||||
|
# stateChange:
|
||||||
|
# switch: false
|
||||||
#ios系统推送声音以及标记计数
|
#ios系统推送声音以及标记计数
|
||||||
iospush:
|
iospush:
|
||||||
pushSound: "xxx"
|
pushSound: "xxx"
|
||||||
@@ -240,7 +302,7 @@ iospush:
|
|||||||
|
|
||||||
callback:
|
callback:
|
||||||
# callback url 需要自行更换callback url
|
# callback url 需要自行更换callback url
|
||||||
callbackUrl: "http://127.0.0.1:10008/callback/open_im"
|
callbackUrl : "http://127.0.0.1:8080/callback"
|
||||||
# 开启关闭操作前后回调的配置
|
# 开启关闭操作前后回调的配置
|
||||||
callbackBeforeSendSingleMsg:
|
callbackBeforeSendSingleMsg:
|
||||||
enable: false # 回调是否启用
|
enable: false # 回调是否启用
|
||||||
@@ -256,6 +318,9 @@ callback:
|
|||||||
callbackAfterSendGroupMsg:
|
callbackAfterSendGroupMsg:
|
||||||
enable: false
|
enable: false
|
||||||
callbackTimeOut: 2
|
callbackTimeOut: 2
|
||||||
|
callbackAfterConsumeGroupMsg:
|
||||||
|
enable: false
|
||||||
|
callbackTimeOut: 2
|
||||||
callbackMsgModify:
|
callbackMsgModify:
|
||||||
enable: false
|
enable: false
|
||||||
callbackTimeOut: 2
|
callbackTimeOut: 2
|
||||||
@@ -302,6 +367,453 @@ callback:
|
|||||||
callbackTimeOut: 2
|
callbackTimeOut: 2
|
||||||
callbackFailedContinue: true # 回调超时是否继续
|
callbackFailedContinue: true # 回调超时是否继续
|
||||||
|
|
||||||
|
|
||||||
|
notification:
|
||||||
|
groupCreated:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "create group title" # xx create the group
|
||||||
|
desc: "create group desc"
|
||||||
|
ext: "create group ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "create the group" # xx create the group
|
||||||
|
|
||||||
|
groupInfoSet:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupInfoSet title"
|
||||||
|
desc: "groupInfoSet desc"
|
||||||
|
ext: "groupInfoSet ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "modified the group profile" # group info changed by xx
|
||||||
|
|
||||||
|
joinGroupApplication:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "joinGroupApplication title"
|
||||||
|
desc: "joinGroupApplication desc"
|
||||||
|
ext: "joinGroupApplication ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "apply to join the group" # group info changed by xx
|
||||||
|
|
||||||
|
memberQuit:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "memberQuit title"
|
||||||
|
desc: "memberQuit desc"
|
||||||
|
ext: "memberQuit ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "quit group msg" # group info changed by xx
|
||||||
|
|
||||||
|
groupApplicationAccepted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupApplicationAccepted title"
|
||||||
|
desc: "groupApplicationAccepted desc"
|
||||||
|
ext: "groupApplicationAccepted ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "was allowed to join the group" # group info changed by xx
|
||||||
|
|
||||||
|
groupApplicationRejected:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: " title"
|
||||||
|
desc: " desc"
|
||||||
|
ext: " ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "was rejected into the group" # group info changed by xx
|
||||||
|
|
||||||
|
groupOwnerTransferred:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupOwnerTransferred title"
|
||||||
|
desc: "groupOwnerTransferred desc"
|
||||||
|
ext: "groupOwnerTransferred ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "become a new group owner" # group info changed by xx
|
||||||
|
|
||||||
|
memberKicked:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "memberKicked title"
|
||||||
|
desc: "memberKicked desc"
|
||||||
|
ext: "memberKicked ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "was kicked out of the group" # group info changed by xx
|
||||||
|
|
||||||
|
memberInvited:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "memberInvited title"
|
||||||
|
desc: "memberInvited desc"
|
||||||
|
ext: "memberInvited ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "was invited into the group" # group info changed by xx
|
||||||
|
|
||||||
|
memberEnter:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "memberEnter title"
|
||||||
|
desc: "memberEnter desc"
|
||||||
|
ext: "memberEnter ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "entered the group" # group info changed by xx
|
||||||
|
|
||||||
|
groupDismissed:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupDismissed title"
|
||||||
|
desc: "groupDismissed desc"
|
||||||
|
ext: "groupDismissed ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group dismissed"
|
||||||
|
|
||||||
|
|
||||||
|
groupMuted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupMuted title"
|
||||||
|
desc: "groupMuted desc"
|
||||||
|
ext: "groupMuted ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group Muted"
|
||||||
|
|
||||||
|
groupCancelMuted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupCancelMuted title"
|
||||||
|
desc: "groupCancelMuted desc"
|
||||||
|
ext: "groupCancelMuted ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group Cancel Muted"
|
||||||
|
|
||||||
|
|
||||||
|
groupMemberMuted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupMemberMuted title"
|
||||||
|
desc: "groupMemberMuted desc"
|
||||||
|
ext: "groupMemberMuted ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group Member Muted"
|
||||||
|
|
||||||
|
groupMemberCancelMuted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupMemberCancelMuted title"
|
||||||
|
desc: "groupMemberCancelMuted desc"
|
||||||
|
ext: "groupMemberCancelMuted ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group Member Cancel Muted"
|
||||||
|
|
||||||
|
groupMemberInfoSet:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupMemberInfoSet title"
|
||||||
|
desc: "groupMemberInfoSet desc"
|
||||||
|
ext: "groupMemberInfoSet ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group member info set"
|
||||||
|
|
||||||
|
|
||||||
|
organizationChanged:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "organizationChanged title"
|
||||||
|
desc: "organizationChanged desc"
|
||||||
|
ext: "organizationChanged ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "organization changed"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#############################friend#################################
|
||||||
|
|
||||||
|
friendApplicationAdded:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "Somebody applies to add you as a friend"
|
||||||
|
desc: "Somebody applies to add you as a friend"
|
||||||
|
ext: "Somebody applies to add you as a friend"
|
||||||
|
defaultTips:
|
||||||
|
tips: "I applies to add you as a friend" #
|
||||||
|
|
||||||
|
friendApplicationApproved:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "Someone applies to add your friend application"
|
||||||
|
desc: "Someone applies to add your friend application"
|
||||||
|
ext: "Someone applies to add your friend application"
|
||||||
|
defaultTips:
|
||||||
|
tips: "I applies to add your friend application" #
|
||||||
|
|
||||||
|
|
||||||
|
friendApplicationRejected:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "Someone rejected your friend application"
|
||||||
|
desc: "Someone rejected your friend application"
|
||||||
|
ext: "Someone rejected your friend application"
|
||||||
|
defaultTips:
|
||||||
|
tips: "I rejected your friend application" #
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
friendAdded:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "We have become friends"
|
||||||
|
desc: "We have become friends"
|
||||||
|
ext: "We have become friends"
|
||||||
|
defaultTips:
|
||||||
|
tips: "We have become friends" #
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
friendDeleted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "deleted a friend"
|
||||||
|
desc: "deleted a friend"
|
||||||
|
ext: "deleted a friend"
|
||||||
|
defaultTips:
|
||||||
|
tips: "deleted a friend" #
|
||||||
|
|
||||||
|
|
||||||
|
friendRemarkSet:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "Your friend's profile has been changed"
|
||||||
|
desc: "Your friend's profile has been changed"
|
||||||
|
ext: "Your friend's profile has been changed"
|
||||||
|
defaultTips:
|
||||||
|
tips: "Your friend's profile has been changed" #
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
blackAdded:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "blocked a user"
|
||||||
|
desc: "blocked a user"
|
||||||
|
ext: "blocked a user"
|
||||||
|
defaultTips:
|
||||||
|
tips: "blocked a user" #
|
||||||
|
|
||||||
|
|
||||||
|
blackDeleted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "Remove a blocked user"
|
||||||
|
desc: "Remove a blocked user"
|
||||||
|
ext: "Remove a blocked user"
|
||||||
|
defaultTips:
|
||||||
|
tips: "Remove a blocked user"
|
||||||
|
|
||||||
|
friendInfoUpdated:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "friend info updated"
|
||||||
|
desc: "friend info updated"
|
||||||
|
ext: "friend info updated"
|
||||||
|
defaultTips:
|
||||||
|
tips: "friend info updated"
|
||||||
|
|
||||||
|
|
||||||
|
#####################user#########################
|
||||||
|
userInfoUpdated:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "Remove a blocked user"
|
||||||
|
desc: "Remove a blocked user"
|
||||||
|
ext: "Remove a blocked user"
|
||||||
|
defaultTips:
|
||||||
|
tips: "remove a blocked user"
|
||||||
|
|
||||||
|
#####################conversation#########################
|
||||||
|
conversationOptUpdate:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "conversation opt update"
|
||||||
|
desc: "conversation opt update"
|
||||||
|
ext: "conversation opt update"
|
||||||
|
defaultTips:
|
||||||
|
tips: "conversation opt update"
|
||||||
|
|
||||||
|
conversationSetPrivate:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "burn after reading"
|
||||||
|
desc: "burn after reading"
|
||||||
|
ext: "burn after reading"
|
||||||
|
defaultTips:
|
||||||
|
openTips: "burn after reading was opened"
|
||||||
|
closeTips: "burn after reading was closed"
|
||||||
|
|
||||||
|
###################workMoments################
|
||||||
|
workMomentsNotification:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "burn after reading"
|
||||||
|
desc: "burn after reading"
|
||||||
|
ext: "burn after reading"
|
||||||
|
defaultTips:
|
||||||
|
openTips: "burn after reading was opened"
|
||||||
|
closeTips: "burn after reading was closed"
|
||||||
|
|
||||||
|
###################organization################
|
||||||
|
joinDepartmentNotification:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "welcome user join department"
|
||||||
|
desc: "welcome user join department"
|
||||||
|
ext: "welcome user join department"
|
||||||
|
defaultTips:
|
||||||
|
tips: "welcome user join department"
|
||||||
|
|
||||||
|
#---------------demo configuration---------------------#
|
||||||
|
#The following configuration items are applied to openIM Demo configuration
|
||||||
|
#是否启动demo,如果自身没有账号体系,设置为true
|
||||||
|
demoswitch: true
|
||||||
|
demo:
|
||||||
|
listenIP: 0.0.0.0
|
||||||
|
#demo对外服务端口,默认即可,需要开放此端口或做nginx转发
|
||||||
|
openImDemoPort: [ 10004 ]
|
||||||
|
alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项,enable为true则必须修改,阿里云为默认短信验证方式
|
||||||
|
accessKeyId:
|
||||||
|
accessKeySecret:
|
||||||
|
signName:
|
||||||
|
verificationCodeTemplateCode:
|
||||||
|
enable: false
|
||||||
|
tencentsms: #腾讯云短信配置,在腾讯云申请成功后,修改以下选项,enable为true则必须修改
|
||||||
|
appID:
|
||||||
|
region:
|
||||||
|
secretID:
|
||||||
|
secretKey:
|
||||||
|
signName:
|
||||||
|
verificationCodeTemplateCode:
|
||||||
|
enable: true
|
||||||
|
superCode: 666666 #超级验证码,建议修改掉,收不到短信验证码时可以用此替代
|
||||||
|
needInvitationCode: false
|
||||||
|
# second
|
||||||
|
codeTTL: 60
|
||||||
|
useSuperCode: true
|
||||||
|
mail: #仅支持qq邮箱,具体操作参考 https://service.mail.qq.com/cgi-bin/help?subtype=1&id=28&no=1001256 必须修改
|
||||||
|
title:
|
||||||
|
senderMail:
|
||||||
|
senderAuthorizationCode:
|
||||||
|
smtpAddr:
|
||||||
|
smtpPort: #需开放此端口 出口方向
|
||||||
|
testDepartMentID: 001
|
||||||
|
imAPIURL: http://127.0.0.1:10002
|
||||||
|
onboardProcess: false # 是否开启注册流程
|
||||||
|
createOrganizationUserAndJoinDepartment: false
|
||||||
|
joinDepartmentIDList: [] # 用户注册进来默认加的部门ID列表 不填就随机
|
||||||
|
joinDepartmentGroups: false # 注册是否加部门群
|
||||||
|
oaNotification: false # 注册是否发送OA通知
|
||||||
|
|
||||||
|
workMoment:
|
||||||
|
onlyFriendCanSee: false
|
||||||
|
|
||||||
|
|
||||||
|
rtc:
|
||||||
|
signalTimeout: 35
|
||||||
|
|
||||||
# prometheus每个服务监听的端口数量需要和rpc port保持一致
|
# prometheus每个服务监听的端口数量需要和rpc port保持一致
|
||||||
prometheus:
|
prometheus:
|
||||||
enable: false
|
enable: false
|
||||||
@@ -312,7 +824,10 @@ prometheus:
|
|||||||
groupPrometheusPort: [ 20150 ]
|
groupPrometheusPort: [ 20150 ]
|
||||||
authPrometheusPort: [ 20160 ]
|
authPrometheusPort: [ 20160 ]
|
||||||
pushPrometheusPort: [ 20170 ]
|
pushPrometheusPort: [ 20170 ]
|
||||||
|
adminCmsPrometheusPort: [ 20200 ]
|
||||||
|
officePrometheusPort: [ 20210 ]
|
||||||
|
organizationPrometheusPort: [ 20220 ]
|
||||||
conversationPrometheusPort: [ 20230 ]
|
conversationPrometheusPort: [ 20230 ]
|
||||||
rtcPrometheusPort: [ 21300 ]
|
cachePrometheusPort: [ 20240 ]
|
||||||
|
realTimeCommPrometheusPort: [ 21300 ]
|
||||||
messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] # 端口数量和 script/path_info.cfg msg_transfer_service_num保持一致
|
messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] # 端口数量和 script/path_info.cfg msg_transfer_service_num保持一致
|
||||||
|
|
||||||
|
|||||||
@@ -1,313 +0,0 @@
|
|||||||
groupCreated:
|
|
||||||
isSendMsg: true #是否发送消息,false不发消息为无声的触发同步。true发消息需要触发会话,rpc notification直接发两次,一次消息一次通知, options字段isNotification是否为通知
|
|
||||||
reliabilityLevel: 1 # 1为online才发送 2为必达
|
|
||||||
unreadCount: false # 只在isSendMsg为true的情况下有作用
|
|
||||||
offlinePush:
|
|
||||||
enable: false # 开启该开关
|
|
||||||
title: "create group title" # xx create the group
|
|
||||||
desc: "create group desc"
|
|
||||||
ext: "create group ext"
|
|
||||||
|
|
||||||
# 不加消息contentType,content统一json 结构体使用pb的
|
|
||||||
|
|
||||||
|
|
||||||
groupInfoSet:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupInfoSet title"
|
|
||||||
desc: "groupInfoSet desc"
|
|
||||||
ext: "groupInfoSet ext"
|
|
||||||
|
|
||||||
|
|
||||||
joinGroupApplication:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "joinGroupApplication title"
|
|
||||||
desc: "joinGroupApplication desc"
|
|
||||||
ext: "joinGroupApplication ext"
|
|
||||||
|
|
||||||
memberQuit:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "memberQuit title"
|
|
||||||
desc: "memberQuit desc"
|
|
||||||
ext: "memberQuit ext"
|
|
||||||
|
|
||||||
groupApplicationAccepted:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupApplicationAccepted title"
|
|
||||||
desc: "groupApplicationAccepted desc"
|
|
||||||
ext: "groupApplicationAccepted ext"
|
|
||||||
|
|
||||||
groupApplicationRejected:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: " title"
|
|
||||||
desc: " desc"
|
|
||||||
ext: " ext"
|
|
||||||
|
|
||||||
|
|
||||||
groupOwnerTransferred:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupOwnerTransferred title"
|
|
||||||
desc: "groupOwnerTransferred desc"
|
|
||||||
ext: "groupOwnerTransferred ext"
|
|
||||||
|
|
||||||
memberKicked:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "memberKicked title"
|
|
||||||
desc: "memberKicked desc"
|
|
||||||
ext: "memberKicked ext"
|
|
||||||
|
|
||||||
memberInvited:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "memberInvited title"
|
|
||||||
desc: "memberInvited desc"
|
|
||||||
ext: "memberInvited ext"
|
|
||||||
|
|
||||||
memberEnter:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "memberEnter title"
|
|
||||||
desc: "memberEnter desc"
|
|
||||||
ext: "memberEnter ext"
|
|
||||||
|
|
||||||
groupDismissed:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupDismissed title"
|
|
||||||
desc: "groupDismissed desc"
|
|
||||||
ext: "groupDismissed ext"
|
|
||||||
|
|
||||||
groupMuted:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupMuted title"
|
|
||||||
desc: "groupMuted desc"
|
|
||||||
ext: "groupMuted ext"
|
|
||||||
|
|
||||||
groupCancelMuted:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupCancelMuted title"
|
|
||||||
desc: "groupCancelMuted desc"
|
|
||||||
ext: "groupCancelMuted ext"
|
|
||||||
defaultTips:
|
|
||||||
tips: "group Cancel Muted"
|
|
||||||
|
|
||||||
|
|
||||||
groupMemberMuted:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupMemberMuted title"
|
|
||||||
desc: "groupMemberMuted desc"
|
|
||||||
ext: "groupMemberMuted ext"
|
|
||||||
|
|
||||||
groupMemberCancelMuted:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupMemberCancelMuted title"
|
|
||||||
desc: "groupMemberCancelMuted desc"
|
|
||||||
ext: "groupMemberCancelMuted ext"
|
|
||||||
|
|
||||||
groupMemberInfoSet:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupMemberInfoSet title"
|
|
||||||
desc: "groupMemberInfoSet desc"
|
|
||||||
ext: "groupMemberInfoSet ext"
|
|
||||||
|
|
||||||
groupInfoSetAnnouncement:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupInfoSetAnnouncement title"
|
|
||||||
desc: "groupInfoSetAnnouncement desc"
|
|
||||||
ext: "groupInfoSetAnnouncement ext"
|
|
||||||
|
|
||||||
|
|
||||||
groupInfoSetName:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "groupInfoSetName title"
|
|
||||||
desc: "groupInfoSetName desc"
|
|
||||||
ext: "groupInfoSetName ext"
|
|
||||||
|
|
||||||
|
|
||||||
#############################friend#################################
|
|
||||||
friendApplicationAdded:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: false
|
|
||||||
title: "Somebody applies to add you as a friend"
|
|
||||||
desc: "Somebody applies to add you as a friend"
|
|
||||||
ext: "Somebody applies to add you as a friend"
|
|
||||||
|
|
||||||
friendApplicationApproved:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "Someone applies to add your friend application"
|
|
||||||
desc: "Someone applies to add your friend application"
|
|
||||||
ext: "Someone applies to add your friend application"
|
|
||||||
|
|
||||||
friendApplicationRejected:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "Someone rejected your friend application"
|
|
||||||
desc: "Someone rejected your friend application"
|
|
||||||
ext: "Someone rejected your friend application"
|
|
||||||
|
|
||||||
friendAdded:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "We have become friends"
|
|
||||||
desc: "We have become friends"
|
|
||||||
ext: "We have become friends"
|
|
||||||
|
|
||||||
friendDeleted:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "deleted a friend"
|
|
||||||
desc: "deleted a friend"
|
|
||||||
ext: "deleted a friend"
|
|
||||||
|
|
||||||
friendRemarkSet:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "Your friend's profile has been changed"
|
|
||||||
desc: "Your friend's profile has been changed"
|
|
||||||
ext: "Your friend's profile has been changed"
|
|
||||||
|
|
||||||
blackAdded:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "blocked a user"
|
|
||||||
desc: "blocked a user"
|
|
||||||
ext: "blocked a user"
|
|
||||||
|
|
||||||
blackDeleted:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "Remove a blocked user"
|
|
||||||
desc: "Remove a blocked user"
|
|
||||||
ext: "Remove a blocked user"
|
|
||||||
|
|
||||||
friendInfoUpdated:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "friend info updated"
|
|
||||||
desc: "friend info updated"
|
|
||||||
ext: "friend info updated"
|
|
||||||
|
|
||||||
#####################user#########################
|
|
||||||
userInfoUpdated:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "Remove a blocked user"
|
|
||||||
desc: "Remove a blocked user"
|
|
||||||
ext: "Remove a blocked user"
|
|
||||||
|
|
||||||
#####################conversation#########################
|
|
||||||
conversationChanged:
|
|
||||||
isSendMsg: false
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "conversation changed"
|
|
||||||
desc: "conversation changed"
|
|
||||||
ext: "conversation changed"
|
|
||||||
|
|
||||||
conversationSetPrivate:
|
|
||||||
isSendMsg: true
|
|
||||||
reliabilityLevel: 1
|
|
||||||
unreadCount: false
|
|
||||||
offlinePush:
|
|
||||||
enable: true
|
|
||||||
title: "burn after reading"
|
|
||||||
desc: "burn after reading"
|
|
||||||
ext: "burn after reading"
|
|
||||||
|
|
||||||
@@ -7,6 +7,9 @@ upstream im_api{
|
|||||||
upstream im_jssdk_gateway{
|
upstream im_jssdk_gateway{
|
||||||
server 127.0.0.1:10003; #IM jssdk服务器地址 根据部署情况可指定多台
|
server 127.0.0.1:10003; #IM jssdk服务器地址 根据部署情况可指定多台
|
||||||
}
|
}
|
||||||
|
upstream im_demo{
|
||||||
|
server 127.0.0.1:10004; #IM demo登录注册服务器地址 根据部署情况可指定多台
|
||||||
|
}
|
||||||
upstream storage {
|
upstream storage {
|
||||||
server 127.0.0.1:10005; #MinIO服务器地址 暂时支持1台
|
server 127.0.0.1:10005; #MinIO服务器地址 暂时支持1台
|
||||||
}
|
}
|
||||||
@@ -80,6 +83,14 @@ server {
|
|||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_pass http://im_jssdk_gateway/;
|
proxy_pass http://im_jssdk_gateway/;
|
||||||
}
|
}
|
||||||
|
location ^~/demo/ { # 10004 demo
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "Upgrade";
|
||||||
|
proxy_set_header X-real-ip $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_pass http://im_demo/;
|
||||||
|
}
|
||||||
location ^~/admin/ { #10006 admin
|
location ^~/admin/ { #10006 admin
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
etcd:
|
||||||
|
userName:
|
||||||
|
password:
|
||||||
|
secret: openIM123 # etcd 配置密钥
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
dbMysqlUserName: root #mysql用户名
|
||||||
|
dbMysqlPassword: openIM123 # mysql密码
|
||||||
|
|
||||||
|
mongo:
|
||||||
|
dbUserName: root #mongo用户名
|
||||||
|
dbPassword: openIM123 #mongo密码
|
||||||
|
|
||||||
|
redis:
|
||||||
|
dbUserName:
|
||||||
|
dbPassWord: openIM123 #redis密码
|
||||||
|
|
||||||
|
kafka:
|
||||||
|
SASLUserName:
|
||||||
|
SASLPassword:
|
||||||
|
|
||||||
|
credential:
|
||||||
|
minio:
|
||||||
|
endpoint: http://127.0.0.1:10005 #发图片视频文件需要填写
|
||||||
|
accessKeyID: root
|
||||||
|
secretAccessKey: openIM123
|
||||||
|
|
||||||
|
secret: tuoyun #建议修改
|
||||||
|
|
||||||
|
tokenpolicy:
|
||||||
|
accessSecret: "open_im_server" #token生成相关 建议修改
|
||||||
|
accessExpire: 90 #token过期时间(天) 默认即可
|
||||||
|
|
||||||
|
messageverify:
|
||||||
|
friendVerify: false #发送消息是否验证好友关系 false表示不验证好友关系
|
||||||
|
|
||||||
|
push:
|
||||||
|
getui:
|
||||||
|
pushUrl: "https://restapi.getui.com/v2/$appId"
|
||||||
|
masterSecret: "" #需添加
|
||||||
|
appKey: "" #需添加
|
||||||
|
enable: false #true启动个推推送
|
||||||
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# 先设为忽略所有内容
|
||||||
|
**/**
|
||||||
|
|
||||||
|
|
||||||
|
# 然后逐个排除
|
||||||
|
!open_im_*
|
||||||
+158
@@ -0,0 +1,158 @@
|
|||||||
|
|
||||||
|
GREEN_PREFIX="\033[32m"
|
||||||
|
COLOR_SUFFIX="\033[0m"
|
||||||
|
SKY_BLUE_PREFIX="\033[36m"
|
||||||
|
|
||||||
|
|
||||||
|
# 编译所有需要的组件源码
|
||||||
|
win-build-all:
|
||||||
|
go env -w GOOS=linux
|
||||||
|
|
||||||
|
make build-api && make build-msg-gateway && make build-msg-transfer && make build-push && make build-timer-task
|
||||||
|
make build-rpc-user && make build-rpc-friend && make build-rpc-group && make build-rpc-msg && make build-rpc-auth
|
||||||
|
make build-demo
|
||||||
|
|
||||||
|
go env -w GOOS=windows
|
||||||
|
|
||||||
|
# 编译 open_im_api
|
||||||
|
build-api:
|
||||||
|
echo -e ${GREEN_PREFIX} "open_im_api building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_api ../cmd/open_im_api/main.go
|
||||||
|
echo -e ${GREEN_PREFIX} "open_im_api build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 编译 open_im_msg_gateway
|
||||||
|
build-msg-gateway:
|
||||||
|
echo -e ${GREEN_PREFIX} "open_im_msg_gateway building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_msg_gateway ../cmd/open_im_msg_gateway/main.go
|
||||||
|
echo -e ${GREEN_PREFIX} "open_im_msg_gateway build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 编译 open_im_msg_transfer
|
||||||
|
build-msg-transfer:
|
||||||
|
echo -e ${GREEN_PREFIX} "open_im_msg_transfer building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_msg_transfer ../cmd/open_im_msg_transfer/main.go
|
||||||
|
echo -e ${GREEN_PREFIX} "open_im_msg_transfer build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 编译 open_im_push
|
||||||
|
build-push:
|
||||||
|
echo -e ${GREEN_PREFIX} "open_im_push building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_push ../cmd/open_im_push/main.go
|
||||||
|
echo -e ${GREEN_PREFIX} "open_im_push build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 编译 open_im_timer_task
|
||||||
|
build-timer-task:
|
||||||
|
echo -e ${GREEN_PREFIX} "open_im_timer_task building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_timer_task ../cmd/open_im_timer_task/main.go
|
||||||
|
echo -e ${GREEN_PREFIX} "open_im_timer_task build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 编译 build-rpc-user
|
||||||
|
build-rpc-user:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_user building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_rpc_user ../cmd/rpc/open_im_user/main.go
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_user build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 编译 build-rpc-friend
|
||||||
|
build-rpc-friend:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_friend building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_rpc_friend ../cmd/rpc/open_im_friend/main.go
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_friend build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 编译 build-rpc-group
|
||||||
|
build-rpc-group:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_group building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_rpc_group ../cmd/rpc/open_im_group/main.go
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_group build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 编译 build-rpc-auth
|
||||||
|
build-rpc-auth:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_auth building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_rpc_auth ../cmd/rpc/open_im_auth/main.go
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_auth build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 编译 build-rpc-msg
|
||||||
|
build-rpc-msg:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_msg building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_rpc_msg ../cmd/rpc/open_im_msg/main.go
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_msg build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 编译 open_im_demo
|
||||||
|
build-demo:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_demo building..." ${COLOR_SUFFIX}
|
||||||
|
go build -ldflags="-w -s" -o open_im_demo ../cmd/open_im_demo/main.go
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "open_im_demo build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包所有组件为镜像
|
||||||
|
image-all:
|
||||||
|
make image-api && make image-msg-gateway && make image-msg-transfer & make image-push && make image-timer-task
|
||||||
|
make image-rpc-user && make image-rpc-friend && make image-rpc-group && make image-rpc-msg && make image-rpc-auth
|
||||||
|
make image-demo
|
||||||
|
|
||||||
|
# 打包 open_im_api
|
||||||
|
image-api:
|
||||||
|
echo -e ${GREEN_PREFIX} "IMAGE:openim/api building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/api:latest -f ./dockerfiles/Dockerfile.api .
|
||||||
|
echo -e ${GREEN_PREFIX} "IMAGE:openim/api build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包 open_im_msg_gateway
|
||||||
|
image-msg-gateway:
|
||||||
|
echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_gateway building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/msg_gateway:latest -f ./dockerfiles/Dockerfile.msg_gateway .
|
||||||
|
echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_gateway build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包 open_im_msg_transfer
|
||||||
|
image-msg-transfer:
|
||||||
|
echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_transfer building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/msg_transfer:latest -f ./dockerfiles/Dockerfile.msg_transfer .
|
||||||
|
echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_transfer build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包 open_im_push
|
||||||
|
image-push:
|
||||||
|
echo -e ${GREEN_PREFIX} "IMAGE:openim/push building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/push:latest -f ./dockerfiles/Dockerfile.push .
|
||||||
|
echo -e ${GREEN_PREFIX} "IMAGE:openim/push build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包 open_im_timer_task
|
||||||
|
image-timer-task:
|
||||||
|
echo -e ${GREEN_PREFIX} "IMAGE:openim/timer_task building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/timer_task:latest -f ./dockerfiles/Dockerfile.timer_task .
|
||||||
|
echo -e ${GREEN_PREFIX} "IMAGE:openim/timer_task build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包 build-rpc-user
|
||||||
|
image-rpc-user:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_user building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/rpc_user:latest -f ./dockerfiles/Dockerfile.rpc_user .
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_user build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包 build-rpc-friend
|
||||||
|
image-rpc-friend:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_friend building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/rpc_friend:latest -f ./dockerfiles/Dockerfile.rpc_friend .
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_friend build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包 build-rpc-group
|
||||||
|
image-rpc-group:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_group building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/rpc_group:latest -f ./dockerfiles/Dockerfile.rpc_group .
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_group build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包 build-rpc-auth
|
||||||
|
image-rpc-auth:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_auth building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/rpc_auth:latest -f ./dockerfiles/Dockerfile.rpc_auth .
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_auth build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包 build-rpc-msg
|
||||||
|
image-rpc-msg:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_msg building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/rpc_msg:latest -f ./dockerfiles/Dockerfile.rpc_msg .
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_msg build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
# 打包 open_im_demo
|
||||||
|
image-demo:
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/demo building..." ${COLOR_SUFFIX}
|
||||||
|
docker build -t openim/demo:latest -f ./dockerfiles/Dockerfile.demo .
|
||||||
|
echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/demo build ok" ${COLOR_SUFFIX}
|
||||||
|
|
||||||
|
.PHONY: win-build-all build-api build-msg-gateway build-msg-transfer build-push
|
||||||
|
build-timer-task build-rpc-user build-rpc-friend build-rpc-group build-rpc-msg build-demo
|
||||||
|
image-all image-api image-msg-gateway image-msg-transfer image-push
|
||||||
|
image-timer-task image-rpc-user image-rpc-friend image-rpc-group image-rpc-msg image-demo
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
# 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.
|
||||||
|
serverversion: 1.0.3
|
||||||
|
#---------------Infrastructure configuration---------------------#
|
||||||
|
etcd:
|
||||||
|
etcdSchema: openIM
|
||||||
|
etcdAddr: [ openim_etcd:2379 ]
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
dbMysqlAddress: [ openim_mysql:3306 ] # openim_mysql 是对应的mysql服务的host
|
||||||
|
dbMysqlUserName: openIM
|
||||||
|
dbMysqlPassword: openIM
|
||||||
|
dbMysqlDatabaseName: openIM
|
||||||
|
dbTableName: eMsg
|
||||||
|
dbMsgTableNum: 1
|
||||||
|
dbMaxOpenConns: 20
|
||||||
|
dbMaxIdleConns: 10
|
||||||
|
dbMaxLifeTime: 120
|
||||||
|
|
||||||
|
mongo:
|
||||||
|
dbUri: ""#当dbUri值不为空则直接使用该值
|
||||||
|
dbAddress: [ openim_mongo:27017 ]
|
||||||
|
dbDirect: false
|
||||||
|
dbTimeout: 10
|
||||||
|
dbDatabase: openIM
|
||||||
|
dbSource: admin
|
||||||
|
dbUserName:
|
||||||
|
dbPassword:
|
||||||
|
dbMaxPoolSize: 20
|
||||||
|
dbRetainChatRecords: 7
|
||||||
|
|
||||||
|
redis:
|
||||||
|
dbAddress: openim_redis:6379
|
||||||
|
dbMaxIdle: 128
|
||||||
|
dbMaxActive: 0
|
||||||
|
dbIdleTimeout: 120
|
||||||
|
dbPassWord: openIM
|
||||||
|
|
||||||
|
kafka:
|
||||||
|
ws2mschat:
|
||||||
|
addr: [ openim_kafka:9092 ]
|
||||||
|
topic: "ws2ms_chat"
|
||||||
|
ms2pschat:
|
||||||
|
addr: [ openim_kafka:9092 ]
|
||||||
|
topic: "ms2ps_chat"
|
||||||
|
consumergroupid:
|
||||||
|
msgToMongo: mongo
|
||||||
|
msgToMySql: mysql
|
||||||
|
msgToPush: push
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------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
|
||||||
|
serverip: 0.0.0.0
|
||||||
|
|
||||||
|
# endpoints 内部组件间访问的端点host名称,访问时,可以内部直接访问 host:port 来访问
|
||||||
|
# 新增的这一段配置节,主要是位了注册到etcd时,可以使用同一network下的容器名(host)来访问不同的容器,拆分到不同容器后原来全部使用serverip的形式不能用了
|
||||||
|
endpoints:
|
||||||
|
api: openim_api
|
||||||
|
push: openim_push
|
||||||
|
msg_gateway: openim_msg_gateway
|
||||||
|
rpc_auth: openim_rpc_auth
|
||||||
|
rpc_friend: openim_rpc_friend
|
||||||
|
rpc_group: openim_rpc_group
|
||||||
|
rpc_msg: openim_rpc_msg
|
||||||
|
rpc_user: openim_rpc_user
|
||||||
|
|
||||||
|
api:
|
||||||
|
openImApiPort: [ 10000 ]
|
||||||
|
sdk:
|
||||||
|
openImSdkWsPort: [ 30000 ]
|
||||||
|
cmsapi:
|
||||||
|
openImCmsApiPort: [ 8000 ]
|
||||||
|
|
||||||
|
credential:
|
||||||
|
tencent:
|
||||||
|
appID:
|
||||||
|
region:
|
||||||
|
bucket:
|
||||||
|
secretID:
|
||||||
|
secretKey:
|
||||||
|
|
||||||
|
|
||||||
|
rpcport:
|
||||||
|
openImUserPort: [ 10100 ]
|
||||||
|
openImFriendPort: [ 10200 ]
|
||||||
|
openImOfflineMessagePort: [ 10300]
|
||||||
|
openImOnlineRelayPort: [ 10400 ]
|
||||||
|
openImGroupPort: [ 10500 ]
|
||||||
|
openImAuthPort: [ 10600 ]
|
||||||
|
openImPushPort: [ 10700 ]
|
||||||
|
openImStatisticsPort: [ 10800 ]
|
||||||
|
openImMessageCmsPort: [ 10900 ]
|
||||||
|
openImAdminCmsPort: [ 11000 ]
|
||||||
|
|
||||||
|
rpcregistername:
|
||||||
|
openImUserName: User
|
||||||
|
openImFriendName: Friend
|
||||||
|
openImOfflineMessageName: OfflineMessage
|
||||||
|
openImPushName: Push
|
||||||
|
openImOnlineMessageRelayName: OnlineMessageRelay
|
||||||
|
openImGroupName: Group
|
||||||
|
openImAuthName: Auth
|
||||||
|
|
||||||
|
log:
|
||||||
|
storageLocation: ../logs/
|
||||||
|
rotationTime: 24
|
||||||
|
remainRotationCount: 5
|
||||||
|
remainLogLevel: 6
|
||||||
|
elasticSearchSwitch: false
|
||||||
|
elasticSearchAddr: [ 127.0.0.1:9201 ]
|
||||||
|
elasticSearchUser: ""
|
||||||
|
elasticSearchPassword: ""
|
||||||
|
|
||||||
|
modulename:
|
||||||
|
longConnSvrName: msg_gateway
|
||||||
|
msgTransferName: msg_transfer
|
||||||
|
pushName: push
|
||||||
|
|
||||||
|
longconnsvr:
|
||||||
|
openImWsPort: [ 17778 ]
|
||||||
|
websocketMaxConnNum: 10000
|
||||||
|
websocketMaxMsgLen: 4096
|
||||||
|
websocketTimeOut: 10
|
||||||
|
|
||||||
|
push:
|
||||||
|
tpns:
|
||||||
|
ios:
|
||||||
|
accessID:
|
||||||
|
secretKey:
|
||||||
|
android:
|
||||||
|
accessID:
|
||||||
|
secretKey:
|
||||||
|
jpns:
|
||||||
|
appKey:
|
||||||
|
masterSecret:
|
||||||
|
pushUrl:
|
||||||
|
pushIntent:
|
||||||
|
manager:
|
||||||
|
appManagerUid: ["openIM123456","openIM654321"]
|
||||||
|
secrets: ["openIM1","openIM2"]
|
||||||
|
|
||||||
|
secret: tuoyun
|
||||||
|
|
||||||
|
multiloginpolicy: 1
|
||||||
|
|
||||||
|
#token config
|
||||||
|
tokenpolicy:
|
||||||
|
accessSecret: "open_im_server"
|
||||||
|
# Token effective time day as a unit
|
||||||
|
accessExpire: 7
|
||||||
|
|
||||||
|
messagecallback:
|
||||||
|
callbackSwitch: false
|
||||||
|
callbackUrl: "http://www.xxx.com/msg/judge"
|
||||||
|
#TimeOut use second as unit
|
||||||
|
callbackTimeOut: 10
|
||||||
|
|
||||||
|
|
||||||
|
#---------------demo configuration---------------------#
|
||||||
|
#The following configuration items are applied to openIM Demo configuration
|
||||||
|
demoswitch: true
|
||||||
|
demo:
|
||||||
|
openImDemoPort: [ 42233 ]
|
||||||
|
alismsverify:
|
||||||
|
accessKeyId:
|
||||||
|
accessKeySecret:
|
||||||
|
signName:
|
||||||
|
verificationCodeTemplateCode:
|
||||||
|
superCode: 666666
|
||||||
|
mail:
|
||||||
|
title:
|
||||||
|
senderMail:
|
||||||
|
senderAuthorizationCode:
|
||||||
|
smtpAddr:
|
||||||
|
smtpPort:
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_api $WORKDIR/main
|
||||||
|
COPY ./start_api.sh $$WORKDIR
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./start_api.sh
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_demo $WORKDIR/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_msg_gateway $WORKDIR/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,重命名可执行文件为 main,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_msg_transfer $WORKDIR/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_push $WORKDIR/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_rpc_auth $WORKDIR/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_rpc_friend $WORKDIR/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_rpc_group $WORKDIR/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_rpc_msg $WORKDIR/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_rpc_user $WORKDIR/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /app
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_timer_task $WORKDIR/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
|
||||||
|
chmod +x $WORKDIR/main
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
CMD ./main
|
||||||
+101
@@ -0,0 +1,101 @@
|
|||||||
|
version: "3.7"
|
||||||
|
networks:
|
||||||
|
openim:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: mysql:5.7
|
||||||
|
# ports:
|
||||||
|
# #- 13306:3306
|
||||||
|
# - 23306:33060
|
||||||
|
container_name: openim_mysql
|
||||||
|
volumes:
|
||||||
|
- ./components/mysql/data:/var/lib/mysql
|
||||||
|
- /etc/localtime:/etc/localtime
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: openIM
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
mongodb:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: mongo:4.4.5-bionic
|
||||||
|
# ports:
|
||||||
|
# - 37017:27017
|
||||||
|
container_name: openim_mongo
|
||||||
|
volumes:
|
||||||
|
- ./components/mongodb/data/db:/data/db
|
||||||
|
- ./components/mongodb/data/logs:/data/logs
|
||||||
|
- ./components/mongodb/data/conf:/etc/mongo
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
# - MONGO_INITDB_ROOT_USERNAME=openIM
|
||||||
|
# - MONGO_INITDB_ROOT_PASSWORD=openIM
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
redis:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: redis:6.2.4-alpine
|
||||||
|
# ports:
|
||||||
|
# - 16379:6379
|
||||||
|
container_name: openim_redis
|
||||||
|
volumes:
|
||||||
|
- ./components/redis/data:/data
|
||||||
|
#redis config file
|
||||||
|
#- ./components/redis/config/redis.conf:/usr/local/redis/config/redis.conf
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
restart: always
|
||||||
|
sysctls:
|
||||||
|
net.core.somaxconn: 1024
|
||||||
|
command: redis-server --requirepass openIM --appendonly yes
|
||||||
|
|
||||||
|
|
||||||
|
zookeeper:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: wurstmeister/zookeeper
|
||||||
|
# ports:
|
||||||
|
# - 2181:2181
|
||||||
|
container_name: openim_zookeeper
|
||||||
|
volumes:
|
||||||
|
- /etc/localtime:/etc/localtime
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
kafka:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: wurstmeister/kafka
|
||||||
|
container_name: openim_kafka
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
KAFKA_BROKER_ID: 0
|
||||||
|
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
||||||
|
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
|
||||||
|
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
|
||||||
|
depends_on:
|
||||||
|
- zookeeper
|
||||||
|
|
||||||
|
etcd:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: quay.io/coreos/etcd
|
||||||
|
# ports:
|
||||||
|
# - 2379:2379
|
||||||
|
# - 2380:2380
|
||||||
|
container_name: openim_etcd
|
||||||
|
volumes:
|
||||||
|
- /etc/timezone:/etc/timezone
|
||||||
|
- /etc/localtime:/etc/localtime
|
||||||
|
environment:
|
||||||
|
ETCDCTL_API: 3
|
||||||
|
restart: always
|
||||||
|
command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new
|
||||||
|
|
||||||
@@ -0,0 +1,223 @@
|
|||||||
|
version: "3.7"
|
||||||
|
networks:
|
||||||
|
openim:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
services:
|
||||||
|
api:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/api
|
||||||
|
container_name: openim_api
|
||||||
|
ports:
|
||||||
|
- 10000:10000 # API,必须开
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
# Dockerfile 里定义了配置文件的路径环境变量,CONFIG_NAME,默认指向了 /app/config/config.yaml
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
|
# depends_on:
|
||||||
|
# - kafka
|
||||||
|
# # - mysql
|
||||||
|
# # - mongodb
|
||||||
|
# - redis
|
||||||
|
# - etcd
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
options:
|
||||||
|
max-size: "1g"
|
||||||
|
max-file: "2"
|
||||||
|
|
||||||
|
msg_gateway:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/msg_gateway
|
||||||
|
container_name: openim_msg_gateway
|
||||||
|
ports:
|
||||||
|
- 17778:17778 # 消息,必须开
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
|
# depends_on:
|
||||||
|
# - kafka
|
||||||
|
# # - mysql
|
||||||
|
# # - mongodb
|
||||||
|
# - redis
|
||||||
|
# - etcd
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
options:
|
||||||
|
max-size: "1g"
|
||||||
|
max-file: "2"
|
||||||
|
|
||||||
|
msg_transfer:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/msg_transfer
|
||||||
|
container_name: openim_msg_transfer
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
|
# depends_on:
|
||||||
|
# - kafka
|
||||||
|
# # - mysql
|
||||||
|
# # - mongodb
|
||||||
|
# - redis
|
||||||
|
# - etcd
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
options:
|
||||||
|
max-size: "1g"
|
||||||
|
max-file: "2"
|
||||||
|
|
||||||
|
push:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/push
|
||||||
|
container_name: openim_push
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
|
# depends_on:
|
||||||
|
# - kafka
|
||||||
|
# # - mysql
|
||||||
|
# # - mongodb
|
||||||
|
# - redis
|
||||||
|
# - etcd
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
options:
|
||||||
|
max-size: "1g"
|
||||||
|
max-file: "2"
|
||||||
|
|
||||||
|
timer_task:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/timer_task
|
||||||
|
container_name: openim_timer_task
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
|
# depends_on:
|
||||||
|
# - kafka
|
||||||
|
# # - mysql
|
||||||
|
# # - mongodb
|
||||||
|
# - redis
|
||||||
|
# - etcd
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
options:
|
||||||
|
max-size: "1g"
|
||||||
|
max-file: "2"
|
||||||
|
|
||||||
|
rpc_user:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/rpc_user
|
||||||
|
container_name: openim_rpc_user
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
|
# depends_on:
|
||||||
|
# - kafka
|
||||||
|
# # - mysql
|
||||||
|
# # - mongodb
|
||||||
|
# - redis
|
||||||
|
# - etcd
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
options:
|
||||||
|
max-size: "1g"
|
||||||
|
max-file: "2"
|
||||||
|
|
||||||
|
rpc_friend:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/rpc_friend
|
||||||
|
container_name: openim_rpc_friend
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
|
# depends_on:
|
||||||
|
# - kafka
|
||||||
|
# # - mysql
|
||||||
|
# # - mongodb
|
||||||
|
# - redis
|
||||||
|
# - etcd
|
||||||
|
|
||||||
|
rpc_group:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/rpc_group
|
||||||
|
container_name: openim_rpc_group
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
|
# depends_on:
|
||||||
|
# - kafka
|
||||||
|
# # - mysql
|
||||||
|
# # - mongodb
|
||||||
|
# - redis
|
||||||
|
# - etcd
|
||||||
|
|
||||||
|
rpc_auth:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/rpc_auth
|
||||||
|
container_name: openim_rpc_auth
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
|
# depends_on:
|
||||||
|
# - kafka
|
||||||
|
# # - mysql
|
||||||
|
# # - mongodb
|
||||||
|
# - redis
|
||||||
|
# - etcd
|
||||||
|
|
||||||
|
rpc_msg:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/rpc_msg
|
||||||
|
container_name: openim_rpc_msg
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
|
# depends_on:
|
||||||
|
# - kafka
|
||||||
|
# # - mysql
|
||||||
|
# # - mongodb
|
||||||
|
# - redis
|
||||||
|
# - etcd
|
||||||
|
|
||||||
|
demo:
|
||||||
|
networks:
|
||||||
|
- openim
|
||||||
|
image: openim/demo
|
||||||
|
container_name: openim_demo
|
||||||
|
ports:
|
||||||
|
- 42233:42233
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
|
- ./config/config.yaml:/app/config/config.yaml
|
||||||
|
- ./db/sdk:/app/db/sdk
|
||||||
|
restart: always
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
### 以docker-compose 形式单独部署
|
||||||
|
```sh
|
||||||
|
# 查看 ./Makefile ,先编译各个需要的源码到 ../bin
|
||||||
|
# win-* 表示在win平台编译位linux二进制,其实就是处理了 go env -w GOOS=linux
|
||||||
|
make win-build-all
|
||||||
|
|
||||||
|
# 得到各个二进制程序之后,打包为镜像
|
||||||
|
# 目前没有处理 Open-IM-SDK-Core ,需要的话可以自己单独处理这个模块
|
||||||
|
make image-all
|
||||||
|
|
||||||
|
# docker-compose.yaml 分成了两部分,一部分是openIM的镜像容器 openim.yaml,一部分是依赖的环境 env.yaml
|
||||||
|
# 两部分使用一个外部的网络来联通,所以首先创建用到的 network
|
||||||
|
docker network create openim --attachable=true -d bridge
|
||||||
|
|
||||||
|
# 处理openim组件需要的挂载目录,主要是处理config目录
|
||||||
|
mkdir ./config
|
||||||
|
cp ./config.example.yaml ./config/config.yaml # 修改 ./config/config.yaml 内容,比如各个依赖组件的 host
|
||||||
|
|
||||||
|
# 然后拉起env.yaml
|
||||||
|
docker-compose -f ./env.yaml up -d
|
||||||
|
|
||||||
|
# 等env 容器全部拉起成功之后,拉起openim.yaml
|
||||||
|
docker-compose -f ./openim.yaml up -d
|
||||||
|
|
||||||
|
# 查看容器运行,推荐使用下 portainer ,web查看容器情况,查看日志等等
|
||||||
|
docker container ps -a | grep openim
|
||||||
|
|
||||||
|
# 正常应该是查看api,demo等的容器日志,看到gin打印的路由日志才算是成功
|
||||||
|
```
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /Open-IM-Server
|
||||||
|
ENV CMDDIR $WORKDIR/cmd
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_admin_cms $WORKDIR/cmd/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||||
|
chmod +x $WORKDIR/cmd/main
|
||||||
|
RUN apt-get -qq update \
|
||||||
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
|
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config", "/Open-IM-Server/script"]
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $CMDDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: admin-cms-deployment
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: admin-cms # 选择这个指定标签执行
|
||||||
|
replicas: 1 # 运行pod数量
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: admin-cms # 标签
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: admin-cms
|
||||||
|
image: openim/admin_cms:v2.3.8
|
||||||
|
# imagePullPolicy: Always #每次启动都重新拉取镜像
|
||||||
|
ports:
|
||||||
|
- containerPort: 10200
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /Open-IM-Server/config
|
||||||
|
readOnly: true
|
||||||
|
env:
|
||||||
|
- name: CONFIG_NAME
|
||||||
|
value: "/Open-IM-Server"
|
||||||
|
- name: USUAL_CONFIG_NAME
|
||||||
|
value: "/Open-IM-Server"
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
projected:
|
||||||
|
sources:
|
||||||
|
- configMap:
|
||||||
|
name: openim-config
|
||||||
|
- configMap:
|
||||||
|
name: openim-usualconfig
|
||||||
|
|
||||||
|
strategy: #更新策略
|
||||||
|
type: RollingUpdate # 滚动更新
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /Open-IM-Server
|
||||||
|
ENV CMDDIR $WORKDIR/cmd
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_api $WORKDIR/cmd/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||||
|
chmod +x $WORKDIR/cmd/main
|
||||||
|
RUN apt-get -qq update \
|
||||||
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
|
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $CMDDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: api-deployment
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: api # 选择这个指定标签执行
|
||||||
|
replicas: 1 # 运行pod数量
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: api # 标签
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: api
|
||||||
|
image: openim/api:v2.3.8
|
||||||
|
# imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- containerPort: 10002
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /Open-IM-Server/config
|
||||||
|
readOnly: true
|
||||||
|
env:
|
||||||
|
- name: CONFIG_NAME
|
||||||
|
value: "/Open-IM-Server"
|
||||||
|
- name: USUAL_CONFIG_NAME
|
||||||
|
value: "/Open-IM-Server"
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
projected:
|
||||||
|
sources:
|
||||||
|
- configMap:
|
||||||
|
name: openim-config
|
||||||
|
- configMap:
|
||||||
|
name: openim-usualconfig
|
||||||
|
strategy: #更新策略
|
||||||
|
type: RollingUpdate # 滚动更新
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: api
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: api-port
|
||||||
|
protocol: TCP
|
||||||
|
port: 10002
|
||||||
|
targetPort: 10002
|
||||||
|
selector:
|
||||||
|
app: api
|
||||||
|
type: NodePort
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /Open-IM-Server
|
||||||
|
ENV CMDDIR $WORKDIR/cmd
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_auth $WORKDIR/cmd/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||||
|
chmod +x $WORKDIR/cmd/main
|
||||||
|
RUN apt-get -qq update \
|
||||||
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
|
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR $CMDDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: auth-deployment
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: auth # 选择这个指定标签执行
|
||||||
|
replicas: 1 # 运行pod数量
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: auth # 标签
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: auth
|
||||||
|
image: openim/auth:v2.3.8
|
||||||
|
# imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- containerPort: 10160
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /Open-IM-Server/config
|
||||||
|
readOnly: true
|
||||||
|
env:
|
||||||
|
- name: CONFIG_NAME
|
||||||
|
value: "/Open-IM-Server"
|
||||||
|
- name: USUAL_CONFIG_NAME
|
||||||
|
value: "/Open-IM-Server"
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
projected:
|
||||||
|
sources:
|
||||||
|
- configMap:
|
||||||
|
name: openim-config
|
||||||
|
- configMap:
|
||||||
|
name: openim-usualconfig
|
||||||
|
strategy: #更新策略
|
||||||
|
type: RollingUpdate # 滚动更新
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#/bin/sh
|
||||||
|
source ./path_info.cfg
|
||||||
|
|
||||||
|
# images version
|
||||||
|
version=v2.3.8
|
||||||
|
git pull
|
||||||
|
cd ../script/; ./build_all_service.sh
|
||||||
|
cd ../deploy_k8s/
|
||||||
|
|
||||||
|
for i in ${service[*]}
|
||||||
|
do
|
||||||
|
mv ../bin/open_im_${i} ./${i}/
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "move success"
|
||||||
|
|
||||||
|
echo "start to build images"
|
||||||
|
|
||||||
|
for i in ${service[*]}
|
||||||
|
do
|
||||||
|
echo "start to build images" $i
|
||||||
|
cd $i
|
||||||
|
image="openim/${i}:$version"
|
||||||
|
docker build -t $image . -f ./${i}.Dockerfile
|
||||||
|
echo "build ${dockerfile} success"
|
||||||
|
docker push $image
|
||||||
|
echo "push ${image} success "
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
|
||||||
Vendored
+20
@@ -0,0 +1,20 @@
|
|||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /Open-IM-Server
|
||||||
|
ENV CMDDIR $WORKDIR/cmd
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_cache $WORKDIR/cmd/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||||
|
chmod +x $WORKDIR/cmd/main
|
||||||
|
RUN apt-get -qq update \
|
||||||
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
|
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||||
|
|
||||||
|
WORKDIR $CMDDIR
|
||||||
|
CMD ./main
|
||||||
Vendored
+40
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: cache-deployment
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: cache # 选择这个指定标签执行
|
||||||
|
replicas: 1 # 运行pod数量
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: cache # 标签
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: cache
|
||||||
|
image: openim/cache:v2.3.8
|
||||||
|
# imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- containerPort: 10240
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /Open-IM-Server/config
|
||||||
|
readOnly: true
|
||||||
|
env:
|
||||||
|
- name: CONFIG_NAME
|
||||||
|
value: "/Open-IM-Server"
|
||||||
|
- name: USUAL_CONFIG_NAME
|
||||||
|
value: "/Open-IM-Server"
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
projected:
|
||||||
|
sources:
|
||||||
|
- configMap:
|
||||||
|
name: openim-config
|
||||||
|
- configMap:
|
||||||
|
name: openim-usualconfig
|
||||||
|
strategy: #更新策略
|
||||||
|
type: RollingUpdate # 滚动更新
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /Open-IM-Server
|
||||||
|
ENV CMDDIR $WORKDIR/cmd
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_cms_api $WORKDIR/cmd/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||||
|
chmod +x $WORKDIR/cmd/main
|
||||||
|
RUN apt-get -qq update \
|
||||||
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
|
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||||
|
|
||||||
|
WORKDIR $CMDDIR
|
||||||
|
CMD ./main
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: cms-api-deployment
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: cms-api # 选择这个指定标签执行
|
||||||
|
replicas: 1 # 运行pod数量
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: cms-api # 标签
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: cms-api
|
||||||
|
image: openim/cms_api:v2.3.8
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- containerPort: 10006
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /Open-IM-Server/config
|
||||||
|
readOnly: true
|
||||||
|
env:
|
||||||
|
- name: CONFIG_NAME
|
||||||
|
value: "/Open-IM-Server"
|
||||||
|
- name: USUAL_CONFIG_NAME
|
||||||
|
value: "/Open-IM-Server"
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
projected:
|
||||||
|
sources:
|
||||||
|
- configMap:
|
||||||
|
name: openim-config
|
||||||
|
- configMap:
|
||||||
|
name: openim-usualconfig
|
||||||
|
strategy: #更新策略
|
||||||
|
type: RollingUpdate # 滚动更新
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: cms-api
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: cms-api-port
|
||||||
|
protocol: TCP
|
||||||
|
port: 10006
|
||||||
|
targetPort: 10006
|
||||||
|
selector:
|
||||||
|
app: cms-api
|
||||||
|
type: NodePort
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
# 设置固定的项目路径
|
||||||
|
ENV WORKDIR /Open-IM-Server
|
||||||
|
ENV CMDDIR $WORKDIR/cmd
|
||||||
|
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||||
|
|
||||||
|
# 将可执行文件复制到目标目录
|
||||||
|
ADD ./open_im_conversation $WORKDIR/cmd/main
|
||||||
|
|
||||||
|
# 创建用于挂载的几个目录,添加可执行权限
|
||||||
|
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||||
|
chmod +x $WORKDIR/cmd/main
|
||||||
|
RUN apt-get -qq update \
|
||||||
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
|
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||||
|
|
||||||
|
WORKDIR $CMDDIR
|
||||||
|
CMD ./main
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user