git clone -b feat/test 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
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.
@ -161,10 +160,15 @@ export SERVER_BRANCH="main"
# 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](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/environment.md).
Next, update the configuration using make init:
```bash
@ -187,11 +191,26 @@ 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](https://github.com/OpenIMSDK/Open-IM-Server/tags).
We have our own version management policy, if you are interested in our version management, I recommend reading [📚 OpenIM Version](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md), 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`:
The `config/config.yaml` file has detailed configuration instructions for the storage components.
The config file is available via [environment.sh](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/scripts/install/environment.sh) configuration [openim.yaml](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployments/templates/openim.yaml) template, and then through the `make init` to automatically generate a new configuration.
- Zookeeper
- Used for RPC service discovery and registration, cluster support.
```bash
zookeeper:
schema: openim #Not recommended to modify
address: [ 127.0.0.1:2181 ] #address
username: #username
password: #password
```
- MySQL
- Used for storing users, relationships, and groups, supports master-slave database.
```bash
mysql:
address: [ 127.0.0.1:13306 ] #address
username: root #username
password: openIM123 #password
database: openIM_v2 #Not recommended to modify
maxOpenConn: 1000 #maximum connection
maxIdleConn: 100 #maximum idle connection
maxLifeTime: 60 #maximum time a connection can be reused (seconds)
#### **1. Recommended using environment variables:**
```bash
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
# API_URL: under network environment, set OpenIM Server API address
export API_URL="http://127.0.0.1:10002"
```
Next, update the configuration using `make init`:
```bash
make init
```
#### **2. Modify the automation script:**
```bash
scripts/install/environment.sh
```
Next, update the configuration using `make init`:
```bash
make init
```
#### 3. Modify `config.yaml` and `.env` files (but will be overwritten when using `make init` again).
The `config/config.yaml` file has detailed configuration instructions for the storage components.
The config file is available via [environment.sh](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/scripts/install/environment.sh) configuration [openim.yaml](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployments/templates/openim.yaml) template, and then through the `make init` to automatically generate a new configuration.
## Configuration Details
###### Zookeeper
- **Purpose**: Used for RPC service discovery and registration, cluster support.
```bash
zookeeper:
schema: openim # Not recommended to modify
address: [ 127.0.0.1:2181 ] # Address
username: # Username
password: # Password
```
###### MySQL
- **Purpose**: Used for storing users, relationships, and groups. Supports master-slave database.
```bash
mysql:
address: [ 127.0.0.1:13306 ] # Address
username: root # Username
password: openIM123 # Password
database: openIM_v2 # Not recommended to modify
maxOpenConn: 1000 # Maximum connection
maxIdleConn: 100 # Maximum idle connection
maxLifeTime: 60 # Max time a connection can be reused (seconds)
@ -19,7 +19,7 @@ You can use tools like PuTTY or other SSH clients to log in to your Ubuntu serve
Generally, a project will involve multiple developers. Instead of provisioning a server for every developer, many organizations share a single development machine among developers. To simulate this real-world scenario, we'll use a standard user for development. To create the `openim` user:
```
bashCopy code# adduser openim # Create the openim user, which developers will use for login and development.
# adduser openim # Create the openim user, which developers will use for login and development.
# passwd openim # Set the login password for openim.
```
@ -30,7 +30,7 @@ Working with a non-root user ensures the system's safety and is a good practice.
Often, even standard users need root privileges. Instead of frequently asking the system administrator for the root password, you can add the standard user to the sudoers. This allows them to temporarily gain root access using the sudo command. To add the `openim` user to sudoers:
```
bashCopy code
# sed -i '/^root.*ALL=(ALL:ALL).*ALL/a\openim\tALL=(ALL) \tALL' /etc/sudoers
```
@ -45,7 +45,7 @@ Assuming we're using the **openim** user, log in using PuTTY or other SSH client
The first step after logging into a new server is to configure the `$HOME/.bashrc` file. It makes the Linux shell more user-friendly by setting environment variables like `LANG` and `PS1`. Here's how the configuration would look:
```
bashCopy code# .bashrc
# .bashrc
# User specific aliases and functions
@ -82,7 +82,7 @@ The OpenIM project on Ubuntu may have various dependencies. Some are direct, and
You can use the `apt` command to install the required tools on Ubuntu:
@ -82,7 +82,7 @@ We reinforce our approach to branch management and versioning with stringent tes
The workflow to address a bug fix might follow these steps:
```bash
bashCopy codebashCopy code# Checkout the branch for the version that needs the bug fix
# Checkout the branch for the version that needs the bug fix
git checkout release-v3.1
# Create a new branch for the bug fix
@ -121,4 +121,3 @@ Throughout this process, active communication within the team is pivotal to main
## Docker Images Version Management
For more details on managing Docker image versions, visit [OpenIM Docker Images Administration](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md).