Merge branch 'v2.3.0release' of github.com:OpenIMSDK/Open-IM-Server into v2.3.0release

pull/351/head
wangchuxiao 2 years ago
commit 978a7e209e

@ -0,0 +1,3 @@
USER=root
PASSWORD=openIM
DATA_DIR=./

@ -1,6 +1,5 @@
version: "3"
#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"
services: services:
mysql: mysql:
image: mysql:5.7 image: mysql:5.7
@ -9,10 +8,10 @@ services:
- 23306:33060 - 23306:33060
container_name: mysql container_name: mysql
volumes: volumes:
- ./components/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: openIM MYSQL_ROOT_PASSWORD: ${PASSWORD}
restart: always restart: always
mongodb: mongodb:
@ -22,19 +21,17 @@ services:
container_name: mongo container_name: mongo
command: --wiredTigerCacheSizeGB 1 command: --wiredTigerCacheSizeGB 1
volumes: volumes:
- ./components/mongodb/data/db:/data/db - ${DATA_DIR}/components/mongodb/data/db:/data/db
- ./components/mongodb/data/logs:/data/logs - ${DATA_DIR}/components/mongodb/data/logs:/data/logs
- ./components/mongodb/data/conf:/etc/mongo - ${DATA_DIR}/components/mongodb/data/conf:/etc/mongo
# - ./script/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh - ./script/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro
environment: environment:
- TZ=Asia/Shanghai - TZ=Asia/Shanghai
# cache # cache
- wiredTigerCacheSizeGB=1 - wiredTigerCacheSizeGB=1
# - MONGO_USERNAME=openIM - MONGO_INITDB_ROOT_USERNAME=${USER}
# - MONGO_PASSWORD=openIM - MONGO_INITDB_ROOT_PASSWORD=${PASSWORD}
# - MONGO_INITDB_ROOT_USERNAME=root - MONGO_INITDB_DATABASE=openIM
# - MONGO_INITDB_ROOT_PASSWORD=root
# - MONGO_INITDB_DATABASE=openIM
restart: always restart: always
redis: redis:
@ -43,15 +40,15 @@ services:
- 16379:6379 - 16379:6379
container_name: redis container_name: redis
volumes: volumes:
- ./components/redis/data:/data - ${DATA_DIR}/components/redis/data:/data
#redis config file #redis config file
- ./components/redis/config/redis.conf:/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
sysctls: sysctls:
net.core.somaxconn: 1024 net.core.somaxconn: 1024
command: redis-server --requirepass openIM --appendonly yes command: redis-server --requirepass ${PASSWORD} --appendonly yes
zookeeper: zookeeper:
@ -108,19 +105,19 @@ services:
- /mnt/data:/data - /mnt/data:/data
- /mnt/config:/root/.minio - /mnt/config:/root/.minio
environment: environment:
MINIO_ROOT_USER: user12345 MINIO_ROOT_USER: ${USER}
MINIO_ROOT_PASSWORD: key12345 MINIO_ROOT_PASSWORD: ${PASSWORD}
restart: always restart: always
command: minio server /data --console-address ':9090' command: minio server /data --console-address ':9090'
open_im_server: open_im_server:
image: openim/open_im_server:v2.3.3 image: openim/open_im_server:v2.3.2
container_name: open_im_server container_name: open_im_server
volumes: volumes:
- ./logs:/Open-IM-Server/logs - ./logs:/Open-IM-Server/logs
- ./config/config.yaml:/Open-IM-Server/config/config.yaml - ./config/config.yaml:/Open-IM-Server/config/config.yaml
- ./db/sdk:/Open-IM-Server/db/sdk - ${DATA_DIR}/db/sdk:/Open-IM-Server/db/sdk
- ./script:/Open-IM-Server/script - ./script:/Open-IM-Server/script
restart: always restart: always
depends_on: depends_on:
@ -140,8 +137,8 @@ services:
prometheus: prometheus:
image: prom/prometheus image: prom/prometheus
volumes: volumes:
- ./docker-compose_cfg/prometheus-compose.yml:/etc/prometheus/prometheus.yml - ${DATA_DIR}/docker-compose_cfg/prometheus-compose.yml:/etc/prometheus/prometheus.yml
# - ./components/prometheus_data:/prometheus # - ${DATA_DIR}/components/prometheus_data:/prometheus
container_name: prometheus container_name: prometheus
ports: ports:
- 9091:9091 - 9091:9091
@ -153,20 +150,17 @@ services:
grafana: grafana:
image: grafana/grafana image: grafana/grafana
volumes: volumes:
- ./docker-compose_cfg/datasource-compose.yaml:/etc/grafana/provisioning/datasources/datasource.yaml # - ./grafana/dashboards/dashboard.json:/var/lib/grafana/dashboards/dashboard.json
- ./docker-compose_cfg/grafana.ini:/etc/grafana/grafana.ini # - ./grafana/provisioning/dashboard.yaml:/etc/grafana/provisioning/dashboards/dashboard.yaml
# - ./docker-compose_cfg/node-exporter-full_rev1.json:/var/lib/grafana/dashboards/node-exporter-full_rev1.json - ${DATA_DIR}/docker-compose_cfg/datasource-compose.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
# - ./components/grafana:/var/lib/grafana - ${DATA_DIR}/docker-compose_cfg/grafana.ini:/etc/grafana/grafana.ini
- ./docker-compose_cfg/grafana.db:/var/lib/grafana/grafana.db - ${DATA_DIR}/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:
- 10007:10007 - 10007:10007
depends_on: depends_on:
- prometheus - prometheus
network_mode: "host" network_mode: "host"
privileged: true
user: root
# -rw-r-----
node-exporter: node-exporter:
image: quay.io/prometheus/node-exporter image: quay.io/prometheus/node-exporter

@ -578,7 +578,7 @@ func init() {
panic(err.Error()) panic(err.Error())
} }
} else { } else {
bytes, err := ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml")) bytes, err := ioutil.ReadFile("../config/config.yaml")
if err != nil { if err != nil {
panic(err.Error()) panic(err.Error())
} }

@ -3,7 +3,6 @@ package db
import ( import (
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
"fmt" "fmt"
"sync"
"time" "time"
"gorm.io/driver/mysql" "gorm.io/driver/mysql"
@ -12,7 +11,7 @@ import (
) )
type mysqlDB struct { type mysqlDB struct {
sync.RWMutex //sync.RWMutex
db *gorm.DB db *gorm.DB
} }

@ -17,6 +17,6 @@ func SetClientInitConfig(m map[string]interface{}) error {
func GetClientInitConfig() (db.ClientInitConfig, error) { func GetClientInitConfig() (db.ClientInitConfig, error) {
var config db.ClientInitConfig var config db.ClientInitConfig
err := db.DB.MysqlDB.DefaultGormDB().Model((&db.ClientInitConfig{})).First(&config).Error err := db.DB.MysqlDB.DefaultGormDB().Model(&db.ClientInitConfig{}).First(&config).Error
return config, err return config, err
} }

@ -31,7 +31,6 @@ message UserTokenResp {
} }
message ForceLogoutReq { message ForceLogoutReq {
int32 Platform = 1; int32 Platform = 1;
string FromUserID = 2; string FromUserID = 2;
@ -56,8 +55,6 @@ message ParseTokenResp{
} }
service Auth { service Auth {
rpc UserRegister(UserRegisterReq) returns(UserRegisterResp); rpc UserRegister(UserRegisterReq) returns(UserRegisterResp);
rpc UserToken(UserTokenReq) returns(UserTokenResp); rpc UserToken(UserTokenReq) returns(UserTokenResp);

Loading…
Cancel
Save