From ef446aa3d7d1f055ab42a38eee96ce36eabc61d4 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Tue, 22 Aug 2023 19:17:15 +0800 Subject: [PATCH] feat: delele go work sum Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- .env | 20 ++-------- .gitignore | 6 +++ config/config.yaml | 71 +++++++++++++++------------------- scripts/install/environment.sh | 4 +- 4 files changed, 42 insertions(+), 59 deletions(-) diff --git a/.env b/.env index b72096696..412b75076 100644 --- a/.env +++ b/.env @@ -1,19 +1,5 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# 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. - USER=root PASSWORD=openIM123 -MINIO_ENDPOINT=http://14.155.127.181:10005 -API_URL=http://14.155.127.181:10002 -DATA_DIR=/root/workspaces/openim/openim-server +MINIO_ENDPOINT=http://127.0.0.1:10005 +API_URL=http://127.0.0.1:10002/object/ +DATA_DIR=./ \ No newline at end of file diff --git a/.gitignore b/.gitignore index 12322d9d6..39f7ef37a 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,11 @@ bin/ output/ _output/ +### OpenIM Config ### +./config/config.yaml +.env + + ### OpenIM deploy ### deploy/openim_demo deploy/openim-api @@ -157,6 +162,7 @@ vendor/ # Go workspace file # go.work +# go.work.sum ### JetBrains ### # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider diff --git a/config/config.yaml b/config/config.yaml index 942f3b7b7..27f01fb8b 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,6 +1,6 @@ # Copyright © 2023 OpenIM. All rights reserved. # -# Licensed under the Apache License, Version 2.0 (the License); +# 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 # @@ -13,10 +13,7 @@ # limitations under the License. # ----------------------------------------------------------------- -# TODO: This config file is the template file -# --| source: deployments/templates/openim.yaml -# --| env: scripts/install/environment -# --| target: config/config.yaml +# Infrastructural configurations, please modify based on your setup # ----------------------------------------------------------------- ###################### Zookeeper ###################### @@ -29,8 +26,8 @@ zookeeper: schema: openim address: [ 127.0.0.1:2181 ] - username: '' - password: '' + username: + password: ###################### Mysql ###################### # MySQL configuration @@ -60,23 +57,23 @@ mysql: # Default MongoDB database name # Maximum connection pool size mongo: - uri: '' + uri: address: [ 127.0.0.1:37017 ] database: openIM_v3 username: root password: openIM123 maxPoolSize: 100 -###################### Redis configuration information ###################### +###################### Redis ###################### # Redis configuration # # Username is required only for Redis version 6.0+ redis: address: [ 127.0.0.1:16379 ] - username: '' + username: password: openIM123 -###################### Kafka configuration information ###################### +###################### Kafka ###################### # Kafka configuration # # Kafka username @@ -84,8 +81,8 @@ redis: # It's not recommended to modify this topic name # Consumer group ID, it's not recommended to modify kafka: - username: '' - password: '' + username: + password: addr: [ 127.0.0.1:9092 ] latestMsgToRedis: topic: "latestMsgToRedis" @@ -99,16 +96,16 @@ kafka: msgToMySql: mysql msgToPush: push -###################### RPC configuration information ###################### +###################### RPC ###################### # RPC configuration # # IP address to register with zookeeper when starting RPC, the IP and corresponding rpcPort should be accessible by api/gateway # Default listen IP is 0.0.0.0 rpc: - registerIP: '' + registerIP: listenIP: 0.0.0.0 -###################### API configuration information ###################### +###################### API ###################### # API configuration # # API service port @@ -117,7 +114,7 @@ api: openImApiPort: [ 10002 ] listenIP: 0.0.0.0 -###################### Object configuration information ###################### +###################### Gateway ###################### # Object storage configuration # # Use minio for object storage @@ -135,31 +132,29 @@ object: apiURL: "http://127.0.0.1:10002" minio: bucket: "openim" - endpoint: "http://14.155.127.181:10005" + endpoint: "http://127.0.0.1:10005" accessKeyID: "root" secretAccessKey: "openIM123" - sessionToken: '' - signEndpoint: "http://14.155.127.181:10005" + sessionToken: "" + signEndpoint: "http://127.0.0.1:10005" cos: - bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com - secretID: '' - secretKey: '' - sessionToken: '' + bucketURL: "https://temp-1252357374.cos.ap-chengdu.myqcloud.com" + secretID: "" + secretKey: "" + sessionToken: "" oss: endpoint: "https://oss-cn-chengdu.aliyuncs.com" bucket: "demo-9999999" bucketURL: "https://demo-9999999.oss-cn-chengdu.aliyuncs.com" - accessKeyID: '' - accessKeySecret: '' - sessionToken: '' + accessKeyID: "" + accessKeySecret: "" + sessionToken: "" - -###################### RPC Port Configuration ###################### # RPC service ports # These ports are passed into the program by the script and are not recommended to modify # For launching multiple programs, just fill in multiple ports separated by commas # For example, [10110, 10111] -rpcPort: +rpcPort: openImUserPort: [ 10110 ] openImFriendPort: [ 10120 ] openImMessagePort: [ 10130 ] @@ -170,7 +165,6 @@ rpcPort: openImConversationPort: [ 10180 ] openImThirdPort: [ 10190 ] -###################### RPC Register Name Configuration ###################### # RPC service names for registration, it's not recommended to modify these rpcRegisterName: openImUserName: User @@ -183,7 +177,6 @@ rpcRegisterName: openImConversationName: Conversation openImThirdName: Third -###################### Log Configuration ###################### # Log configuration # # Storage directory @@ -194,15 +187,14 @@ rpcRegisterName: # Whether to output in json format # Whether to include stack trace in logs log: - storageLocation: /root/workspaces/openim/openim-server/logs/ + storageLocation: ../../../../../logs/ rotationTime: 24 remainRotationCount: 2 remainLogLevel: 6 - isStdout: false + isStdout: false isJson: false withStack: false -###################### Variables definition ###################### # Long connection server configuration # # Websocket port for msg_gateway @@ -244,8 +236,8 @@ push: # Built-in app manager user IDs # Built-in app manager nicknames manager: - userID: [ "openIM123456", "openIM654321", "openIMAdmin" ] - nickname: [ "system1", "system2", "system3" ] + userID: [ "openIM123456","openIM654321","openIMAdmin" ] + nickname: [ "system1","system2", "system3" ] # Multi-platform login policy # For each platform(Android, iOS, Windows, Mac, web), only one can be online at a time @@ -299,7 +291,6 @@ iosPush: badgeCount: true production: false -###################### Third-party service configuration ###################### # Callback configuration # # Callback URL @@ -369,7 +360,7 @@ callback: failedContinue: true ###################### Prometheus ###################### -# Prometheus configuration for various services +# Prometheus configuration # The number of Prometheus ports per service needs to correspond to rpcPort # The number of ports needs to be consistent with msg_transfer_service_num in script/path_info.sh prometheus: @@ -384,4 +375,4 @@ prometheus: conversationPrometheusPort: [ 20230 ] rtcPrometheusPort: [ 21300 ] thirdPrometheusPort: [ 21301 ] - messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] # List of ports + messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] \ No newline at end of file diff --git a/scripts/install/environment.sh b/scripts/install/environment.sh index ade26b262..62cd3eb98 100755 --- a/scripts/install/environment.sh +++ b/scripts/install/environment.sh @@ -101,11 +101,11 @@ def "MONGO_MAX_POOL_SIZE" "100" # 最 ###################### Object 配置信息 ###################### def "OBJECT_ENABLE" "minio" # 对象是否启用 -def "OBJECT_APIURL" "http://127.0.0.1:10002" # 对象的API地址 +def "OBJECT_APIURL" "http://${IP}:10002" # 对象的API地址 def "MINIO_BUCKET" "openim" # MinIO的存储桶名称 def "MINIO_PORT" "10005" # MinIO的端口 # MinIO的端点URL -readonly MINIO_ENDPOINT=${MINIO_ENDPOINT:-"http://${IP}:${MINIO_PORT}"} +readonly MINIO_ENDPOINT=${MINIO_ENDPOINT:-"http://127.0.0.1:${MINIO_PORT}"} def "MINIO_ACCESS_KEY" "${USER}" # MinIO的访问密钥ID def "MINIO_SECRET_KEY" "${PASSWORD}" # MinIO的密钥 def "MINIO_SESSION_TOKEN" # MinIO的会话令牌