Merge branch 'openimsdk:main' into main

pull/1067/head
withchao 2 years ago committed by GitHub
commit 8bd50e2bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,7 +30,7 @@ MINIO_ENDPOINT=http://172.28.0.1:10005
# Base URL for the application programming interface (API). # Base URL for the application programming interface (API).
# Default: API_URL=http://172.28.0.1:10002 # Default: API_URL=http://172.28.0.1:10002
API_URL=http://172.28.0.1:10002 API_URL=http://127.0.0.1:10002
# Directory path for storing data files or related information. # Directory path for storing data files or related information.
# Default: DATA_DIR=./ # Default: DATA_DIR=./

@ -84,7 +84,7 @@ jobs:
id: meta2 id: meta2
uses: docker/metadata-action@v4.6.0 uses: docker/metadata-action@v4.6.0
with: with:
images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-web
- name: Log in to AliYun Docker Hub - name: Log in to AliYun Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v2
@ -117,7 +117,7 @@ jobs:
id: meta3 id: meta3
uses: docker/metadata-action@v4.6.0 uses: docker/metadata-action@v4.6.0
with: with:
images: ghcr.io/openimsdk/openim-server images: ghcr.io/openimsdk/openim-web
- name: Log in to GitHub Container Registry - name: Log in to GitHub Container Registry
uses: docker/login-action@v2 uses: docker/login-action@v2

@ -89,9 +89,9 @@ $ git-chglog --config custom/dir/config.yml
## create next tag ## create next tag
```bash ```bash
git-chglog --next-tag 2.0.0 -o CHANGELOG.md $ git-chglog --next-tag 2.0.0 -o CHANGELOG.md
git commit -am "release 2.0.0" $ git commit -am "release 2.0.0"
git tag 2.0.0 $ git tag 2.0.0
``` ```
| Query | Description | Example | | Query | Description | Example |
@ -112,6 +112,9 @@ git tag 2.0.0
+ [OpenIM CHANGELOG-V2.9](CHANGELOG-2.9.md) + [OpenIM CHANGELOG-V2.9](CHANGELOG-2.9.md)
+ [OpenIM CHANGELOG-V3.0](CHANGELOG-3.0.md) + [OpenIM CHANGELOG-V3.0](CHANGELOG-3.0.md)
+ [OpenIM CHANGELOG-V3.1](CHANGELOG-3.1.md) + [OpenIM CHANGELOG-V3.1](CHANGELOG-3.1.md)
+ [OpenIM CHANGELOG-V3.2](CHANGELOG-3.2.md)
+ [OpenIM CHANGELOG-V3.3](CHANGELOG-3.3.md)
## Introduction ## Introduction
@ -121,7 +124,7 @@ In both the open-source and closed-source software development communities, it i
The most common format for version numbers is as follows: The most common format for version numbers is as follows:
``` ```bash
major.minor[.patch[.build]] major.minor[.patch[.build]]
``` ```

@ -25,7 +25,7 @@ WORKDIR ${SERVER_WORKDIR}
# Copy scripts and binary files to the production image # Copy scripts and binary files to the production image
COPY --from=builder ${OPENIM_SERVER_BINDIR} /openim/openim-server/_output/bin COPY --from=builder ${OPENIM_SERVER_BINDIR} /openim/openim-server/_output/bin
COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts # COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts
COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config # COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config
CMD ["/openim/openim-server/scripts/docker-start-all.sh"] CMD ["/openim/openim-server/scripts/docker-start-all.sh"]

@ -16,6 +16,7 @@
<a href="https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q"><img src="https://img.shields.io/badge/Slack-300%2B-blueviolet?logo=slack&amp;logoColor=white"></a> <a href="https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q"><img src="https://img.shields.io/badge/Slack-300%2B-blueviolet?logo=slack&amp;logoColor=white"></a>
<a href="https://github.com/openimsdk/open-im-server/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green"></a> <a href="https://github.com/openimsdk/open-im-server/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green"></a>
<a href="https://golang.org/"><img src="https://img.shields.io/badge/Language-Go-blue.svg"></a> <a href="https://golang.org/"><img src="https://img.shields.io/badge/Language-Go-blue.svg"></a>
<a href="https://pkg.go.dev/github.com/openimsdk/open-im-server/v3"><img src="https://pkg.go.dev/badge/github.com/openimsdk/open-im-server/v3.svg" alt="Go Reference"></a>
</p> </p>
</p> </p>
@ -81,7 +82,7 @@ Further enhancing your experience, we also provide an SDK client, wherein most c
5. **Open Source :open_hands:** 5. **Open Source :open_hands:**
✅ 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 ✅ The code of OpenIM is open source, self-controlled data, aimed at building a globally leading [IM open source community](https://github.com/OpenIMSDK), including [client SDK](https://github.com/openimsdk/openim-sdk-core) and server
✅ Based on open source Server, many excellent open source projects have been developed, such as [OpenKF](https://github.com/OpenIMSDK/OpenKF) (Open source AI customer service system) ✅ Based on open source Server, many excellent open source projects have been developed, such as [OpenKF](https://github.com/OpenIMSDK/OpenKF) (Open source AI customer service system)
@ -121,62 +122,16 @@ $ make demo
<details> <summary>Deploying with Docker Compose</summary> <details> <summary>Deploying with Docker Compose</summary>
It is recommended to use Docker Compose for deployment, which can easily and quickly deploy the entire OpenIM service on a single node
> 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. + [https://github.com/openimsdk/openim-docker](https://github.com/openimsdk/openim-docker)
**1. Clone the project**
```bash
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** > **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 > 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:
```bash
cat scripts/install/environment.sh
```
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
# 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
$ make init
$ git diff
```
</details> </details>
<details> <summary>Compile from Source</summary> <details> <summary>Compile from Source</summary>
@ -211,16 +166,11 @@ Deploy basic components at the click of a command:
```bash ```bash
# install openim dependency # 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 $ 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 init && docker compose -f basic-openim-server-dependency.yml up -d && make start && make check
``` ```
> `make help` to help you see the instructions supported by OpenIM. > `make help` to help you see the instructions supported by OpenIM.
Use `make check` to check all component starts
```bash
$ make check
```
You can use the `make help-all` see OpenIM in action. You can use the `make help-all` see OpenIM in action.
@ -240,8 +190,9 @@ Read: https://github.com/openimsdk/open-im-server/blob/main/deployments/README.m
</details> </details>
<details> <summary>Open IM Ports</summary> <details> <summary>Open IM and Chat Ports</summary>
+ oepnim-server warehouse: https://github.com/openimsdk/open-im-server
| TCP Port | Description | Operation | | TCP Port | Description | Operation |
| --------- | ------------------------------------------------------------ | ----------------------------------------------------- | | --------- | ------------------------------------------------------------ | ----------------------------------------------------- |
@ -249,10 +200,6 @@ Read: https://github.com/openimsdk/open-im-server/blob/main/deployments/README.m
| TCP:10002 | api port, such as user, friend, group, message interfaces. | 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 | | TCP:10005 | Required when choosing minio storage (openIM uses minio storage by default) | Port release or nginx reverse proxy, and firewall off |
</details>
<details> <summary>Open Chat Ports</summary>
+ chat warehouse: https://github.com/OpenIMSDK/chat + chat warehouse: https://github.com/OpenIMSDK/chat

@ -132,14 +132,14 @@ api:
# minio.signEndpoint is minio public network address # minio.signEndpoint is minio public network address
object: object:
enable: "minio" enable: "minio"
apiURL: "http://172.28.0.1:10002" apiURL: "http://http://127.0.0.1:10002"
minio: minio:
bucket: "openim" bucket: "openim"
endpoint: "http://172.28.0.1:10005" endpoint: "http://172.28.0.1:10005"
accessKeyID: "root" accessKeyID: "root"
secretAccessKey: "openIM123" secretAccessKey: "openIM123"
sessionToken: '' sessionToken: ''
signEndpoint: "http://172.28.0.1:10005" signEndpoint: "http://127.0.0.1:10005"
cos: cos:
bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com
secretID: '' secretID: ''

@ -1,4 +1,4 @@
#fixme Clone openIM Server project before using docker-compose,project addresshttps://github.com/openimsdk/open-im-server.git #fixme Clone openIM Server project before using docker-compose,project addresshttps://github.com/OpenIMSDK/Open-IM-Server.git
version: '3' version: '3'
networks: networks:
@ -10,29 +10,6 @@ networks:
- subnet: '${DOCKER_BRIDGE_SUBNET}' - subnet: '${DOCKER_BRIDGE_SUBNET}'
gateway: '${DOCKER_BRIDGE_GATEWAY}' gateway: '${DOCKER_BRIDGE_GATEWAY}'
volumes:
mysql_data:
mongodb_data:
mongodb_logs:
mongodb_config:
redis_data:
redis_config:
kafka_data:
minio_data:
minio_config:
openim_server_logs:
openim_server_output:
openim_server_config:
openim_server_scripts:
openim_chat_logs:
openim_chat_output:
openim_chat_config:
openim_chat_scripts:
openim_server_prometheus_config:
openim_server_grafana_datasource:
openim_server_grafana_config:
openim_server_grafana_dashboard:
services: services:
mysql: mysql:
image: mysql:5.7 image: mysql:5.7
@ -40,7 +17,7 @@ services:
- "${MYSQL_PORT}:3306" - "${MYSQL_PORT}:3306"
container_name: mysql container_name: mysql
volumes: volumes:
- mysql_data:/var/lib/mysql - "${DATA_DIR}/components/mysql/data:/var/lib/mysql"
- "/etc/localtime:/etc/localtime" - "/etc/localtime:/etc/localtime"
environment: environment:
MYSQL_ROOT_PASSWORD: "${MYSQL_PASSWORD}" MYSQL_ROOT_PASSWORD: "${MYSQL_PASSWORD}"
@ -56,10 +33,10 @@ services:
container_name: mongo container_name: mongo
command: --wiredTigerCacheSizeGB 1 --auth command: --wiredTigerCacheSizeGB 1 --auth
volumes: volumes:
- mongodb_data:/data/db - "${DATA_DIR}/components/mongodb/data/db:/data/db"
- mongodb_logs:/data/logs - "${DATA_DIR}/components/mongodb/data/logs:/data/logs"
- mongodb_config:/etc/mongo - "${DATA_DIR}/components/mongodb/data/conf:/etc/mongo"
- "./scripts/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro" - ./scripts/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro"
environment: environment:
- TZ=Asia/Shanghai - TZ=Asia/Shanghai
- wiredTigerCacheSizeGB=1 - wiredTigerCacheSizeGB=1
@ -77,8 +54,8 @@ services:
ports: ports:
- "${REDIS_PORT}:6379" - "${REDIS_PORT}:6379"
volumes: volumes:
- redis_data:/data - "${DATA_DIR}/components/redis/data:/data"
- redis_config:/usr/local/redis/config/redis.conf - "${DATA_DIR}/components/redis/config/redis.conf:/usr/local/redis/config/redis.conf"
environment: environment:
TZ: Asia/Shanghai TZ: Asia/Shanghai
restart: always restart: always
@ -118,8 +95,6 @@ services:
bash -c " bash -c "
/opt/bitnami/scripts/kafka/run.sh & sleep 5; /opt/bitnami/kafka/create_topic.sh; wait /opt/bitnami/scripts/kafka/run.sh & sleep 5; /opt/bitnami/kafka/create_topic.sh; wait
" "
extra_hosts:
- "host.docker.internal:host-gateway"
environment: environment:
- TZ=Asia/Shanghai - TZ=Asia/Shanghai
- KAFKA_CFG_NODE_ID=0 - KAFKA_CFG_NODE_ID=0
@ -140,8 +115,8 @@ services:
- "9090:9090" - "9090:9090"
container_name: minio container_name: minio
volumes: volumes:
- minio_data:/data - "${DATA_DIR}/components/mnt/data:/data"
- minio_config:/root/.minio - "${DATA_DIR}/components/mnt/config:/root/.minio"
environment: environment:
MINIO_ROOT_USER: "${MINIO_ACCESS_KEY}" MINIO_ROOT_USER: "${MINIO_ACCESS_KEY}"
MINIO_ROOT_PASSWORD: "${MINIO_SECRET_KEY}" MINIO_ROOT_PASSWORD: "${MINIO_SECRET_KEY}"
@ -153,6 +128,8 @@ services:
openim-web: openim-web:
image: ghcr.io/openimsdk/openim-web:latest image: ghcr.io/openimsdk/openim-web:latest
# image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-web:latest
# image: openim/openim-web:latest
container_name: openim-web container_name: openim-web
environment: environment:
- OPENIM_WEB_DIST_PATH=${OPENIM_WEB_DIST_PATH} - OPENIM_WEB_DIST_PATH=${OPENIM_WEB_DIST_PATH}
@ -165,8 +142,8 @@ services:
ipv4_address: ${OPENIM_WEB_NETWORK_ADDRESS} ipv4_address: ${OPENIM_WEB_NETWORK_ADDRESS}
# openim-server: # openim-server:
# # image: ghcr.io/openimsdk/openim-server:main # image: ghcr.io/openimsdk/openim-server:main
# image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:main # # image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:main
# # image: openim/openim-server:main # # image: openim/openim-server:main
# # build: . # # build: .
# container_name: openim-server # container_name: openim-server
@ -180,7 +157,7 @@ services:
# retries: 5 # retries: 5
# volumes: # volumes:
# - ./logs:/openim/openim-server/logs # - ./logs:/openim/openim-server/logs
# - ./_output:/openim/openim-server/_output # - ./_output/logs:/openim/openim-server/_output/logs
# - ./config:/openim/openim-server/config # - ./config:/openim/openim-server/config
# - ./scripts:/openim/openim-server/scripts # - ./scripts:/openim/openim-server/scripts
# restart: always # restart: always
@ -199,69 +176,31 @@ services:
# server: # server:
# ipv4_address: ${OPENIM_SERVER_NETWORK_ADDRESS} # ipv4_address: ${OPENIM_SERVER_NETWORK_ADDRESS}
# openim-chat:
# # image: ghcr.io/openimsdk/openim-chat:main
# image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat:main
# # image: ghcr.io/openimsdk/openim-chat:main
# container_name: openim-chat
# healthcheck:
# test: ["CMD", "/openim/openim-chat/scripts/check_all.sh"]
# interval: 300s
# timeout: 10s
# retries: 5
# ports:
# - ${OPENIM_CHAT_API_PORT}:10008
# - ${OPENIM_ADMIN_API_PORT}:10009
# volumes:
# - openim_chat_logs:/openim/openim-chat/logs
# - openim_chat_output:/openim/openim-chat/_output
# - openim_chat_config:/openim/openim-chat/config
# - openim_chat_scripts:/openim/openim-chat/scripts
# restart: always
# user: root:root
# depends_on:
# - mysql
# - mongodb
# - redis
# - minio
# - server
# logging:
# driver: json-file
# options:
# max-size: "1g"
# max-file: "2"
# networks:
# server:
# ipv4_address: ${OPENIM_CHAT_NETWORK_ADDRESS}
# prometheus: # prometheus:
# image: prom/prometheus # image: prom/prometheus
# volumes: # volumes:
# - openim_server_prometheus_config:/etc/prometheus # - ./.docker-compose_cfg/prometheus-compose.yml:/etc/prometheus/prometheus.yml
# container_name: prometheus # container_name: prometheus
# ports: # ports:
# - ${PROMETHEUS_PORT}:9091 # - ${PROMETHEUS_PORT}:9091
# command: --web.listen-address=:9091 --config.file="/etc/prometheus" # depends_on:
# - openim-server
# command: --web.listen-address=:9091 --config.file="/etc/prometheus/prometheus.yml"
# networks: # networks:
# server: # openim-server:
# ipv4_address: ${PROMETHEUS_NETWORK_ADDRESS} # ipv4_address: ${PROMETHEUS_NETWORK_ADDRESS}
# grafana: # grafana:
# image: grafana/grafana # image: grafana/grafana
# volumes: # volumes:
# - openim_server_grafana_datasource:/etc/grafana/provisioning/datasources # - ./.docker-compose_cfg/datasource-compose.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
# - openim_server_grafana_config:/etc/grafana # - ./.docker-compose_cfg/grafana.ini:/etc/grafana/grafana.ini
# - openim_server_grafana_dashboard:/var/lib/grafana/dashboards # - ./.docker-compose_cfg/node-exporter-full_rev1.json:/var/lib/grafana/dashboards/node-exporter-full_rev1.json
# container_name: grafana # container_name: grafana
# ports: # ports:
# - ${GRAFANA_PORT}:3000 # - ${GRAFANA_PORT}:3000
# depends_on:
# - prometheus
# networks: # networks:
# server: # openim-server:
# ipv4_address: ${GRAFANA_NETWORK_ADDRESS} # ipv4_address: ${GRAFANA_NETWORK_ADDRESS}
# node-exporter:
# image: quay.io/prometheus/node-exporter
# container_name: node-exporter
# restart: always
# ports:
# - "9100:9100"

@ -13,6 +13,20 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
if ! command -v pv &> /dev/null
then
echo "pv not found, installing..."
if [ -e /etc/debian_version ]; then
sudo apt-get update
sudo apt-get install -y pv
elif [ -e /etc/redhat-release ]; then
sudo yum install -y pv
else
echo "Unsupported OS, please install pv manually."
exit 1
fi
fi
readonly t_reset=$(tput sgr0) readonly t_reset=$(tput sgr0)
readonly green=$(tput bold; tput setaf 2) readonly green=$(tput bold; tput setaf 2)
readonly yellow=$(tput bold; tput setaf 3) readonly yellow=$(tput bold; tput setaf 3)
@ -58,8 +72,11 @@ clear
openim::util::desc "========> Start the basic openim docker components" openim::util::desc "========> Start the basic openim docker components"
openim::util::desc "========> You can use docker-compose ps to check the status of the container" openim::util::desc "========> You can use docker-compose ps to check the status of the container"
openim::util::run "curl https://raw.githubusercontent.com/OpenIMSDK/openim-docker/main/example/basic-openim-server-dependency.yml -o basic-openim-server-dependency.yml" openim::util::run "docker compose up -d"
openim::util::run "docker compose up --f basic-openim-server-dependency.yml up -d" clear
openim::util::desc "========> Use make init-githooks Initialize git hooks "
openim::util::run "make init-githooks"
clear clear
openim::util::desc "The specification is pretty high, you need to be bound on your branch name, as well as commit messages" openim::util::desc "The specification is pretty high, you need to be bound on your branch name, as well as commit messages"
@ -133,3 +150,5 @@ clear
openim::util::desc "Add copyright" openim::util::desc "Add copyright"
openim::util::run "make add-copyright" openim::util::run "make add-copyright"
clear clear
exit 0

@ -71,7 +71,7 @@ function openim::push::start()
for (( i=0; i<${#OPENIM_PUSH_PORTS_ARRAY[@]}; i++ )); do for (( i=0; i<${#OPENIM_PUSH_PORTS_ARRAY[@]}; i++ )); do
openim::log::info "start push process, port: ${OPENIM_PUSH_PORTS_ARRAY[$i]}, prometheus port: ${PUSH_PROM_PORTS_ARRAY[$i]}" openim::log::info "start push process, port: ${OPENIM_PUSH_PORTS_ARRAY[$i]}, prometheus port: ${PUSH_PROM_PORTS_ARRAY[$i]}"
nohup ${OPENIM_PUSH_BINARY} --port ${OPENIM_PUSH_PORTS_ARRAY[$i]} --prometheus_port ${PUSH_PROM_PORTS_ARRAY[$i]} >> ${LOG_FILE} 2>&1 & nohup ${OPENIM_PUSH_BINARY} --port ${OPENIM_PUSH_PORTS_ARRAY[$i]} -c ${OPENIM_PUSH_CONFIG} --prometheus_port ${PUSH_PROM_PORTS_ARRAY[$i]} >> ${LOG_FILE} 2>&1 &
done done
openim::util::check_process_names ${SERVER_NAME} openim::util::check_process_names ${SERVER_NAME}

Loading…
Cancel
Save