From 2628874a2668bdac411de467646ca4aec6663dca Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Sat, 9 Sep 2023 15:57:46 +0800
Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=AF=20Optimize=20the=20deployment=20sc?=
=?UTF-8?q?heme=20to=20provide=20kubernetes=20deployment=20strategy=20(#10?=
=?UTF-8?q?50)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: fix openim web port
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: fix openim web port
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: github gh images
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: github gh images
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: go mod package
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
.env | 2 +-
README.md | 73 +++++++---------------------------------------
config/config.yaml | 4 +--
scripts/demo.sh | 23 +++++++++++++--
4 files changed, 34 insertions(+), 68 deletions(-)
diff --git a/.env b/.env
index b2252cc9c..2f2766ef6 100644
--- a/.env
+++ b/.env
@@ -30,7 +30,7 @@ MINIO_ENDPOINT=http://172.28.0.1:10005
# Base URL for the application programming interface (API).
# 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.
# Default: DATA_DIR=./
diff --git a/README.md b/README.md
index 504dcd012..d1af632bf 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,7 @@
+
@@ -81,7 +82,7 @@ Further enhancing your experience, we also provide an SDK client, wherein most c
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)
@@ -111,7 +112,7 @@ Further enhancing your experience, we also provide an SDK client, wherein most c
## :rocket: Quick Start
-You can quickly learn OpenIM engineering solutions, all it takes is one simple command:
+You can quickly learn OpenIM engineering solutions, all it takes is one simple command:
```bash
$ make demo
@@ -119,64 +120,18 @@ $ 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
+ Deploying with Docker Compose
+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**
+>
> 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
-```
-
-
Compile from Source
@@ -211,16 +166,11 @@ Deploy basic components at the click of a command:
```bash
# 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 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.
-Use `make check` to check all component starts
-
-```bash
-$ make check
-```
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
- Open IM Ports
+ Open IM and Chat Ports
++ oepnim-server warehouse: https://github.com/openimsdk/open-im-server
| 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:10005 | Required when choosing minio storage (openIM uses minio storage by default) | Port release or nginx reverse proxy, and firewall off |
-
-
- Open Chat Ports
-
+ chat warehouse: https://github.com/OpenIMSDK/chat
diff --git a/config/config.yaml b/config/config.yaml
index c1059581b..9d6b3c335 100644
--- a/config/config.yaml
+++ b/config/config.yaml
@@ -132,14 +132,14 @@ api:
# minio.signEndpoint is minio public network address
object:
enable: "minio"
- apiURL: "http://172.28.0.1:10002"
+ apiURL: "http://http://127.0.0.1:10002"
minio:
bucket: "openim"
endpoint: "http://172.28.0.1:10005"
accessKeyID: "root"
secretAccessKey: "openIM123"
sessionToken: ''
- signEndpoint: "http://172.28.0.1:10005"
+ signEndpoint: "http://127.0.0.1:10005"
cos:
bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com
secretID: ''
diff --git a/scripts/demo.sh b/scripts/demo.sh
index 51a8a7aa7..329e04f0f 100755
--- a/scripts/demo.sh
+++ b/scripts/demo.sh
@@ -13,6 +13,20 @@
# See the License for the specific language governing permissions and
# 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 green=$(tput bold; tput setaf 2)
readonly yellow=$(tput bold; tput setaf 3)
@@ -58,8 +72,11 @@ clear
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::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 --f basic-openim-server-dependency.yml up -d"
+openim::util::run "docker compose up -d"
+clear
+
+openim::util::desc "========> Use make init-githooks Initialize git hooks "
+openim::util::run "make init-githooks"
clear
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::run "make add-copyright"
clear
+
+exit 0