Go to file
Xinwei Xiong da8912121f
fix: add openim server deploy (#1036)
* fix: add openim server deploy

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add openim im ctl

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add more deployment docs

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add openim save images and release

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* build: set IBM sarama and set k8s deployment helm

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: add openim code fix

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: add openim code fix

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

---------

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
2023-09-07 17:38:09 +08:00
.docker-compose_cfg feat: add license 2023-07-10 18:13:30 +08:00
.github fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
CHANGELOG fix: Fix Bug related issues with OpenIM actions PR (#921) 2023-08-23 08:45:52 +00:00
assets Large refactoring projects: OpenIM automation, scripting, and openimctl refactoring (#825) 2023-08-23 09:09:51 +08:00
build 🔥Super feat: OpenIM CTL optimization is supported (#926) 2023-09-05 16:31:40 +08:00
cmd 🔥Super feat: OpenIM CTL optimization is supported (#926) 2023-09-05 16:31:40 +08:00
config 🔥Super feat: OpenIM CTL optimization is supported (#926) 2023-09-05 16:31:40 +08:00
deployments fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
docs fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
internal fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
pkg fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
scripts fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
test fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
tools fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
.dockerignore 🔥Super feat: OpenIM CTL optimization is supported (#926) 2023-09-05 16:31:40 +08:00
.env 🔥Super feat: OpenIM CTL optimization is supported (#926) 2023-09-05 16:31:40 +08:00
.gitignore fix: Fix Bug related issues with OpenIM actions PR (#921) 2023-08-23 08:45:52 +00:00
.golangci.yml fix: Fix Bug related issues with OpenIM actions PR (#921) 2023-08-23 08:45:52 +00:00
CHANGELOG.md feat: add link file 2023-07-10 18:19:25 +08:00
CODE_OF_CONDUCT.md docs: update create CODE_OF_CONDUCT.md (#705) 2023-07-29 13:04:14 +00:00
CONTRIBUTING.md 🔥Super feat: OpenIM CTL optimization is supported (#926) 2023-09-05 16:31:40 +08:00
Dockerfile 🔥Super feat: OpenIM CTL optimization is supported (#926) 2023-09-05 16:31:40 +08:00
LICENSE v3 - main to cut out 2023-06-29 22:35:31 +08:00
Makefile 🔥Super feat: OpenIM CTL optimization is supported (#926) 2023-09-05 16:31:40 +08:00
README-zh_CN.md fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
README.md fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
docker-compose.yml fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
go.mod fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
go.sum fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
go.work fix: add openim server deploy (#1036) 2023-09-07 17:38:09 +08:00
install.sh 🔥Super feat: OpenIM CTL optimization is supported (#926) 2023-09-05 16:31:40 +08:00
install_guide.sh Large refactoring projects: OpenIM automation, scripting, and openimctl refactoring (#825) 2023-08-23 09:09:51 +08:00

README.md

Open source Instant Messaging Server

A+ good first

English 简体中文 Docs

About OpenIM

Open-IM-Server, meticulously developed in pure Golang, is a powerful instant messaging server. Its distinct communication method, employing pb+websocket, views every interaction as a message, streamlining customization without altering server code. Built on a microservice architecture, it offers deployment through clusters for outstanding performance and scalability.

Open-IM-Server is more than an instant messaging server; it's a powerful tool for incorporating real-time networking into your applications, positioning itself as your premier choice for integration! 🚀

Please be aware that Open-IM-Server does not function as a standalone product and does not offer built-in account registration or login services. To ease your implementation process, we've open-sourced the chat repository, which comprises these features. Deploying this chat business server in conjunction with Open-IM-Server expedites the setup of a comprehensive chat product. 👥

Further enhancing your experience, we also provide an SDK client, wherein most complex logics are implemented. The SDK repository can be found at this link. The chat repository is our business server while the 'core' represents the high-level encapsulation of the SDK, synergistically working together to deliver superior results.

🌟 Why OpenIM

🔍 Function screenshot display

💻🔄📱 Multi Terminal Synchronization 🔄🖥️ 📅 Efficient Meetings 🚀💼
multiple-message efficient-meetings
📲🔄 One-to-one and Group Chats 👥🗣️ 🎁💻 Special Features - Custom Messages ✉️🎨
group-chat special-function
  1. Comprehensive Message Type Support 💬

    Supports almost all types of messages, including text, images, emojis, voice, video, geographical location, files, quotes, business cards, system notifications, custom messages and more

    Supports one-on-one and multi-person audio and video calls

    Provides terminal support for multiple platforms such as iOS, Android, Flutter, uni-app, ReactNative, Electron, Web, H5

  2. Efficient Meetings Anytime, Anywhere 🌎

    Based on IM (Instant Messaging) with 100% reliable forced signaling capabilities, it paves the way for IM systems, deeply integrated with chat applications

    Supports hundreds of people in a single meeting, with subscription numbers reaching thousands, and server-side audio and video recording

  3. One-on-one and Group Chats for Various Social Scenarios 👥

    OpenIM has four roles: application administrator, group owner, group administrator, and regular member

    Powerful group features such as muting, group announcements, group validation, unlimited group members, and loading group messages as needed

  4. Unique Features 🌟

    Supports read-and-burn private chats, customizable duration

    Message editing function broadens social scenarios, making instant communication more diverse and interesting

  5. Open Source 👐

    The code of OpenIM is open source, self-controlled data, aimed at building a globally leading IM open source community, including client SDK and server

    Based on open source Server, many excellent open source projects have been developed, such as OpenKF (Open source AI customer service system)

  6. Easy to Expand 🔧

    The OpenIM server is implemented in Golang, introducing an innovative "everything is a message" communication model, simplifying the implementation of custom messages and extended features

  7. High Performance 🏎️

    OpenIM supports a hierarchical governance architecture in the cluster, tested by a large number of users, and abstracts the storage model of online messages, offline messages, and historical messages

  8. Full Platform Support 📺

    Supports native iOS, Android; cross-platform Flutter, uni-app, ReactNative; major web front-end frameworks such as React, Vue; applets; and PC platforms supported by Electron

  9. The ultimate deployment experience 🤖

    Supports cluster deployment

    Supports multi-architecture mirroring, our Docker images are hosted not only on GitHub but also on Alibaba Cloud and Docker Hub supporting multiple architectures. Visit our GitHub packages and read our version management document for more information.

  10. A large ecosystem of open source communities 🤲

    We have tens of thousands of users and many solutions to problems.

    We have a large open source community called OpenIMSDK that runs the core modules, we have an open source community called openim-sigs to explore more IM-based infrastructure products.

🚀 Quick Start

You can quickly learn OpenIM engineering solutions, all it takes is one simple command:

$ make demo

🤲 In order to facilitate the user experience, we have provided a variety of deployment solutions, you can choose your own deployment method according to the list below:

Deploying with Docker Compose

docker compose will not be maintained in future versions, but it is still the easiest and most convenient way to organize docker compose deployments into a separate project https://github.com/openim-sigs/openim-docker to maintain.

1. Clone the project

git clone -b main https://github.com/openim-sigs/openim-docker openim/openim-docker && export openim=$(pwd)/openim && cd $openim/openim-docker  && ./scripts/init-config.sh && docker-compose up -d

Note If you don't know OpenIM's versioning policy, 📚Read our release policy: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md

2. Configure the config file

If you tried to get started quickly with make demo, then you know that our config file is generated by automation.

You can use make init to quickly initialize a configuration file

Modify the automation script:

cat scripts/install/environment.sh
  1. Recommended using environment variables:
export PASSWORD="openIM123" # Set password
export USER="root" # Set username
# Choose chat version and server version https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md, eg: main, release-v*.*
export CHAT_BRANCH="main"
export SERVER_BRANCH="main"
#... Other environment variables
# MONGO_USERNAME: This sets the MongoDB username
# MONGO_PASSWORD: Set the MongoDB password
# MONGO_DATABASE: Sets the MongoDB database name
# MINIO_ENDPOINT: set the MinIO service address
# DOCKER_BRIDGE_SUBNET: set the docker bridge network address
export DOCKER_BRIDGE_SUBNET="172.28.0.0/16"
# API_URL: under network environment, set OpenIM Server API address
export API_URL="http://127.0.0.1:10002"

If you wish to use more custom features, read our config documentation.

Next, update the configuration using make init:

$ make init
$ git diff
Compile from Source

Ur need Go 1.18 or higher version, and make.

go version && make --version || echo "Error: One of the commands failed."

Version Details: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md

You can get the version number from the command below or from github releases.

$ curl --silent "https://api.github.com/repos/OpenIMSDK/Open-IM-Server/releases" | jq -r '.[].tag_name'

We have our own version management policy, if you are interested in our version management, I recommend reading 📚 OpenIM Version, We recommend using stable versions such as v3.3.0 and v3.2.0 whenever possible. v3.1.1-alpha.3 as well as v3.3.0-beta.0 and v3.2.0-rc.0 are pre-release or beta versions and are not recommended.

Set OPENIM_VERSION environment variables for the latest OPENIM_VERSION number, or replace the OPENIM_VERSION for you to install the OpenIM-Server OPENIM_VERSION:

$ OPENIM_VERSION=`curl -s https://api.github.com/repos/OpenIMSDK/Open-IM-Server/releases/latest | grep -oE '"tag_name": "[^"]+"' | head -n1 | cut -d'"' -f4`
# OPENIM_VERSION=v3.3.0

Deploy basic components at the click of a command:

# install openim dependency
$ git clone https://github.com/OpenIMSDK/Open-IM-Server openim/openim-server && export openim=$(pwd)/openim/openim-server && cd $openim/openim-server && git checkout $OPENIM_VERSION
$ curl https://raw.githubusercontent.com/OpenIMSDK/openim-docker/main/example/basic-openim-server-dependency.yml -o basic-openim-server-dependency.yml && make init && docker compose -f basic-openim-server-dependency.yml up -d && make start

make help to help you see the instructions supported by OpenIM.

Use make check to check all component starts

$ make check

You can use the make help-all see OpenIM in action.

Component Configuration Instructions

Read: Configuration center documenthttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/environment.md

Deployed with kubernetes

Read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployments/README.md

Open IM Ports
TCP Port Description Operation
TCP:10001 ws protocol, message port such as message sending, pushing etc, used for client SDK Port release or nginx reverse proxy, and firewall off
TCP:10002 api port, such as user, friend, group, message interfaces. Port release or nginx reverse proxy, and firewall off
TCP:10005 Required when choosing minio storage (openIM uses minio storage by default) Port release or nginx reverse proxy, and firewall off
Open Chat Ports
TCP Port Description Operation
TCP:10008 Business system, such as registration, login etc Port release or nginx reverse proxy, and firewall off
TCP:10009 Management backend, such as statistics, banning etc Port release or nginx reverse proxy, and firewall off

OpenIM isn't just an open-source instant messaging component, it's an integral part of your application ecosystem. Check out this diagram to understand how AppServer, AppClient, Open-IM-Server, and Open-IM-SDK interact.

App-OpenIM Relationship

🏗️ Overall Architecture

Delve into the heart of Open-IM-Server's functionality with our architecture diagram.

Overall Architecture

🛠️ To start developing OpenIM

OpenIM Our goal is to build a top-level open source community. We have a set of standards, in the Community repository.

If you'd like to contribute to this Open-IM-Server repository, please read our contributor documentation.

Before you start, please make sure your changes are in demand. The best for that is to create a new discussion OR Slack Communication, or if you find an issue, report it first.

👥 Community

📆 Community Meetings

We want anyone to get involved in our community and contributing code, we offer gifts and rewards, and we welcome you to join us every Thursday night.

Our conference is in the OpenIM Slack 🎯, then you can search the Open-IM-Server pipeline to join

We take notes of each biweekly meeting in GitHub discussions, Our historical meeting notes, as well as replays of the meetings are available at Google Docs 📑.

👀 Who are using OpenIM

Check out our user case studies page for a list of the project users. Don't hesitate to leave a 📝comment and share your use case.

📄 License

OpenIM is licensed under the Apache 2.0 license. See LICENSE for the full license text.

The OpenIM logo, including its variations and animated versions, displayed in this repository OpenIM under the assets/logo and assets/logo-gif directories, are protected by copyright laws.

🔮 Thanks to our contributors!