From 8a77306de7aa319a8030cdb8f41f4baad72da187 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Thu, 27 Jul 2023 12:31:06 +0800
Subject: [PATCH 01/48] feat: add openim log (#679)
* feat: add openim log
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add openim install scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: config env command
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: config env command
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
.goreleaser.yaml | 37 +--
Makefile | 10 +
config/config.yaml | 20 +-
install.sh | 560 ++++++++++++++++++++++++++++++++
scripts/advertise.sh | 122 +++++++
scripts/make-rules/copyright.mk | 6 +
scripts/make-rules/golang.mk | 6 +
scripts/style_info.sh | 2 +
8 files changed, 733 insertions(+), 30 deletions(-)
create mode 100755 install.sh
create mode 100755 scripts/advertise.sh
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index cbb9ba483..996a53745 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -343,11 +343,11 @@ dockers:
use: buildx
build_flag_templates:
- "--pull"
- - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/goreleaser/goreleaser/main/README.md"
- - "--label=io.artifacthub.package.logo-url=https://goreleaser.com/static/avatar.png"
- - '--label=io.artifacthub.package.maintainers=[{"name":"Carlos Alexandro Becker","email":"carlos@carlosbecker.dev"}]'
- - "--label=io.artifacthub.package.license=MIT"
- - "--label=org.opencontainers.image.description=Deliver Go binaries as fast and easily as possible"
+ - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md"
+ - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png"
+ - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]'
+ - "--label=io.artifacthub.package.license=Apace-2.0"
+ - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
@@ -363,11 +363,11 @@ dockers:
use: buildx
build_flag_templates:
- "--pull"
- - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/goreleaser/goreleaser/main/README.md"
- - "--label=io.artifacthub.package.logo-url=https://goreleaser.com/static/avatar.png"
- - '--label=io.artifacthub.package.maintainers=[{"name":"Carlos Alexandro Becker","email":"carlos@carlosbecker.dev"}]'
- - "--label=io.artifacthub.package.license=MIT"
- - "--label=org.opencontainers.image.description=Deliver Go binaries as fast and easily as possible"
+ - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md"
+ - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png"
+ - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]'
+ - "--label=io.artifacthub.package.license=Apace-2.0"
+ - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
@@ -505,19 +505,16 @@ release:
- ## Contact Us
+ ## Get Involved with OpenIM!
- We value close connections with our users, developers, and contributors here at OpenIMSDK. With a large community and maintainer team, we're always here to help and support you. Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us.
+ **Here are some ways to get involved with the OpenIM community:**
- Our most recommended way to get in touch is through [Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg). Even if you're in China, Slack is usually not blocked by firewalls, making it an easy way to connect with us. Our Slack community is the ideal place to discuss and share ideas and suggestions with other users and developers of OpenIMSDK. You can ask technical questions, seek help, or share your experiences with other users of OpenIMSDK.
+ 📢 **Slack Channel**: Join our Slack channels for discussions, communication, and support. Click [here](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg) to join the Open-IM-Server Slack team channel.
- In [OpenIM community is recruiting new members! discussion](https://github.com/orgs/OpenIMSDK/discussions/426) please leave your information, convenient we will better developers around the small gift to send to your hands.
+ 📧 **Gmail Contact**: If you have any questions, suggestions, or feedback for our open-source projects, please feel free to [contact us via email](https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=winxu81@gmail.com).
- In addition to Slack, we also offer the following ways to get in touch:
+ 📖 **Blog**: Stay up-to-date with OpenIM-Server projects and trends by reading our [blog](https://doc.rentsoft.cn/). We share the latest developments, tech trends, and other interesting information related to OpenIM.
- +
: We also have Slack channels for you to communicate and discuss. To join, visit https://slack.com/ and join our [👀 Open-IM-Server slack](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg) team channel.
- +
: Get in touch with us on [Gmail](winxu81@gmail.com). If you have any questions or issues that need resolving, or any suggestions and feedback for our open source projects, please feel free to contact us via email.
- +
: Read our [blog](https://doc.rentsoft.cn/). Our blog is a great place to stay up-to-date with Open-IM-Server projects and trends. On the blog, we share our latest developments, tech trends, and other interesting information.
- +
: Add [Wechat](https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg) and indicate that you are a user or developer of Open-IM-Server. We will process your request as soon as possible.
+ 📱 **WeChat**: Add us on WeChat (QR Code) and indicate that you are a user or developer of Open-IM-Server. We'll process your request as soon as possible.
- Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us.
+ Remember, your contributions play a vital role in making OpenIM successful, and we look forward to your active participation in our community! 🙌
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 74e183543..de6570dd9 100644
--- a/Makefile
+++ b/Makefile
@@ -68,6 +68,11 @@ multiarch:
install:
@$(MAKE) go.install
+## check: Check OpenIM deployment ✨
+.PHONY: check
+check:
+ @$(MAKE) go.check
+
## tidy: tidy go.mod ✨
.PHONY: tidy
tidy:
@@ -176,6 +181,11 @@ verify-copyright:
add-copyright:
@$(MAKE) copyright.add
+## advertise: Project introduction, become a contributor ✨
+.PHONY: advertise
+advertise:
+ @$(MAKE) copyright.advertise
+
## release: release the project ✨
.PHONY: release
release: release.verify release.ensure-tag
diff --git a/config/config.yaml b/config/config.yaml
index 1c01031dc..3f43a7a69 100644
--- a/config/config.yaml
+++ b/config/config.yaml
@@ -24,8 +24,8 @@ zookeeper:
mysql:
address: [ 127.0.0.1:13306 ] #目前仅支持单机
- username: root #用户名
- password: openIM123 #密码
+ username: root
+ password: openIM123
database: openIM_v3 #不建议修改
maxOpenConn: 1000 #最大连接数
maxIdleConn: 100 #最大空闲连接数
@@ -37,14 +37,14 @@ mongo:
uri: #不为空则直接使用该值
address: [ 127.0.0.1:37017 ] #单机时为mongo地址,使用分片集群时,为mongos地址
database: openIM_v3 #mongo db 默认即可
- username: root #用户名
- password: openIM123 #密码
+ username: root
+ password: openIM123
maxPoolSize: 100
redis:
address: [ 127.0.0.1:16379 ] #
username: #only redis version 6.0+ need username
- password: openIM123 #密码
+ password: openIM123
kafka:
username: #用户名
@@ -77,9 +77,9 @@ object:
apiURL: "http://127.0.0.1:10002/object/" #地址需要app能访问到
minio:
bucket: "openim" #不建议修改
- endpoint: "http://127.0.0.1:10005" #minio对外服务的ip和端口,app要能访问此ip和端口
- accessKeyID: "root" #ID
- secretAccessKey: "openIM123" #秘钥
+ endpoint: http://127.0.0.1:10005 #地址需要app能够访问
+ accessKeyID: root
+ secretAccessKey: openIM123
sessionToken: "" #token
cos: #tencent cos
bucketURL: "https://temp-1252357374.cos.ap-chengdu.myqcloud.com"
@@ -167,7 +167,7 @@ retainChatRecords: 365 #mongo保存离线消息
chatRecordsClearTime: "0 2 * * 3" #每周三凌晨2点清理mongo中的过期(超过retainChatRecords时间)消息,这个删除是为了清理满足上个配置retainChatRecords的过期消息,不会发送通知,仅仅作为清理磁盘使用
msgDestructTime: "0 2 * * *" #消息自动删除时间,每天凌晨2点删除过期消息,这个删除是为了删除保留时间超过超过会话字段msg_destruct_time(秒)的消息。
-secret: tuoyun #秘钥,获取token时校验
+secret: openIM123
tokenPolicy:
expire: 90 #过期时间(天)
@@ -257,4 +257,4 @@ prometheus: #prometheus每个服务的端口数量需要和rpcPort保持对应
conversationPrometheusPort: [ 20230 ]
rtcPrometheusPort: [ 21300 ]
thirdPrometheusPort: [ 21301 ]
- messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] #端口数量需要和script/path_info.sh中的msg_transfer_service_num保持一致
+ messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] #端口数量需要和script/path_info.sh中的msg_transfer_service_num保持一致
\ No newline at end of file
diff --git a/install.sh b/install.sh
new file mode 100755
index 000000000..0c3a3945e
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,560 @@
+#!/bin/bash
+# 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.
+#
+# https://gist.github.com/cubxxw/28f997f2c9aff408630b072f010c1d64
+#
+
+set -e
+set -o pipefail
+
+
+############### OpenIM Github ###############
+# ... rest of the script ...
+
+# TODO
+# You can configure this script in three ways.
+# 1. First, set the variables in this column with more comments.
+# 2. The second is to pass an environment variable via a flag such as --help.
+# 3. The third way is to set the variable externally, or pass it in as an environment variable
+
+# Default configuration for OpenIM Repo
+# The OpenIM Repo settings can be customized according to your needs.
+
+# OpenIM Repo owner, by default it's set to "OpenIMSDK". If you're using a different owner, replace accordingly.
+OWNER="OpenIMSDK"
+
+# The repository name, by default it's "Open-IM-Server". If you're using a different repository, replace accordingly.
+REPO="Open-IM-Server"
+
+# Version of Go you want to use, make sure it is compatible with your OpenIM-Server requirements.
+# Default is 1.18, if you want to use a different version, replace accordingly.
+GO_VERSION="1.18"
+
+# Default HTTP_PORT is 80. If you want to use a different port, uncomment and replace the value.
+# HTTP_PORT=80
+
+# CPU core number for concurrent execution. By default it's determined automatically.
+# Uncomment the next line if you want to set it manually.
+# CPU=$(grep -c ^processor /proc/cpuinfo)
+
+# By default, the script uses the latest tag from OpenIM-Server releases.
+# If you want to use a specific tag, uncomment and replace "v3.0.0" with the desired tag.
+# LATEST_TAG=v3.0.0
+
+# Default OpenIM install directory is /tmp. If you want to use a different directory, uncomment and replace "/test".
+# DOWNLOAD_OPENIM_DIR="/test"
+
+# GitHub proxy settings. If you are using a proxy, uncomment and replace the empty field with your proxy URL.
+PROXY=
+
+# If you have a GitHub token, replace the empty field with your token.
+GITHUB_TOKEN=
+
+# Default user is "root". If you need to modify it, uncomment and replace accordingly.
+# USER=root
+
+# Default password for redis, mysql, mongo, as well as accessSecret in config/config.yaml.
+# Remember, it should be a combination of 8 or more numbers and letters. If you want to set a different password, uncomment and replace "openIM123".
+# PASSWORD=openIM123
+
+# Default endpoint for minio's external service IP and port. If you want to use a different endpoint, uncomment and replace.
+# ENDPOINT=http://127.0.0.1:10005
+
+# Default API_URL, replace if necessary.
+# API_URL=http://127.0.0.1:10002/object/
+
+# Default data directory. If you want to specify a different directory, uncomment and replace "./".
+# DATA_DIR=./
+
+############### OpenIM Functions ###############
+# Install horizon of the script
+#
+# Pre-requisites:
+# - git
+# - make
+# - jq
+# - docker
+# - docker-compose
+# - go
+#
+
+# Check if the script is run as root
+function check_isroot() {
+ if [ "$EUID" -ne 0 ]; then
+ fatal "Please run the script as root or use sudo."
+ fi
+}
+
+# check if the current directory is a OpenIM git repository
+function check_git_repo() {
+ if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
+ # Inside a git repository
+ for remote in $(git remote); do
+ repo_url=$(git remote get-url $remote)
+ if [[ $repo_url == "https://github.com/OpenIMSDK/Open-IM-Server.git" || \
+ $repo_url == "https://github.com/OpenIMSDK/Open-IM-Server" || \
+ $repo_url == "git@github.com:OpenIMSDK/Open-IM-Server.git" ]]; then
+ # If it's OpenIMSDK repository
+ info "Current directory is OpenIMSDK git repository."
+ info "Executing installation directly."
+ install_openim
+ exit 0
+ fi
+ debug "Remote: $remote, URL: $repo_url"
+ done
+ # If it's not OpenIMSDK repository
+ debug "Current directory is not OpenIMSDK git repository."
+ fi
+ info "Current directory is not a git repository."
+}
+
+# Function to update and install necessary tools
+function install_tools() {
+ info "Checking and installing necessary tools, about git, make, jq, docker, docker-compose."
+ local tools=("git" "make" "jq" "docker" "docker-compose")
+ local install_cmd update_cmd os
+
+ if grep -qEi "debian|buntu|mint" /etc/os-release; then
+ os="Ubuntu"
+ install_cmd="sudo apt install -y"
+ update_cmd="sudo apt update"
+ elif grep -qEi "fedora|rhel" /etc/os-release; then
+ os="CentOS"
+ install_cmd="sudo yum install -y"
+ update_cmd="sudo yum update"
+ else
+ fatal "Unsupported OS, please use Ubuntu or CentOS."
+ fi
+
+ debug "Detected OS: $os"
+ info "Updating system package repositories..."
+ $update_cmd
+
+ for tool in "${tools[@]}"; do
+ if ! command -v $tool &> /dev/null; then
+ warn "$tool is not installed. Installing now..."
+ $install_cmd $tool
+ success "$tool has been installed successfully."
+ else
+ info "$tool is already installed."
+ fi
+ done
+}
+
+# Function to check if Docker and Docker Compose are installed
+function check_docker() {
+ if ! command -v docker &> /dev/null; then
+ fatal "Docker is not installed. Please install Docker first."
+ fi
+ if ! command -v docker-compose &> /dev/null; then
+ fatal "Docker Compose is not installed. Please install Docker Compose first."
+ fi
+}
+
+# Function to download and install Go if it's not already installed
+function install_go() {
+ command -v go >/dev/null 2>&1
+ # Determines if GO_VERSION is defined
+ if [ -z "$GO_VERSION" ]; then
+ GO_VERSION="1.18"
+ fi
+
+ if [[ $? -ne 0 ]]; then
+ warn "Go is not installed. Installing now..."
+ curl -LO "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz"
+ if [ $? -ne 0 ]; then
+ fatal "Download failed! Please check your network connectivity."
+ fi
+ sudo tar -C /usr/local -xzf "go${GO_VERSION}.linux-amd64.tar.gz"
+ echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
+ source ~/.bashrc
+ success "Go has been installed successfully."
+ else
+ info "Go is already installed."
+ fi
+}
+
+function download_source_code() {
+
+ # If LATEST_TAG was not defined outside the function, get it here example: v3.0.1-beta.1
+ if [ -z "$LATEST_TAG" ]; then
+ LATEST_TAG=$(curl -s "https://api.github.com/repos/$OWNER/$REPO/tags" | jq -r '.[0].name')
+ fi
+
+ # If LATEST_TAG is still empty, set a default value
+ local DEFAULT_TAG="v3.0.0"
+
+ LATEST_TAG="${LATEST_TAG:-$DEFAULT_TAG}"
+
+ debug "DEFAULT_TAG: $DEFAULT_TAG"
+ info "Use OpenIM Version LATEST_TAG: $LATEST_TAG"
+
+ # If MODIFIED_TAG was not defined outside the function, modify it here,example: 3.0.1-beta.1
+ if [ -z "$MODIFIED_TAG" ]; then
+ MODIFIED_TAG=$(echo $LATEST_TAG | sed 's/v//')
+ fi
+
+ # If MODIFIED_TAG is still empty, set a default value
+ local DEFAULT_MODIFIED_TAG="${DEFAULT_TAG#v}"
+ MODIFIED_TAG="${MODIFIED_TAG:-$DEFAULT_MODIFIED_TAG}"
+
+ debug "MODIFIED_TAG: $MODIFIED_TAG"
+
+ # Construct the tarball URL
+ TARBALL_URL="${PROXY}https://github.com/$OWNER/$REPO/archive/refs/tags/$LATEST_TAG.tar.gz"
+
+ info "Downloaded OpenIM TARBALL_URL: $TARBALL_URL"
+
+ info "Starting the OpenIM automated one-click deployment script."
+
+ # Set the download and extract directory to /tmp
+ if [ -z "$DOWNLOAD_OPENIM_DIR" ]; then
+ DOWNLOAD_OPENIM_DIR="/tmp"
+ fi
+
+ # Check if /tmp directory exists
+ if [ ! -d "$DOWNLOAD_OPENIM_DIR" ]; then
+ warn "$DOWNLOAD_OPENIM_DIR does not exist. Creating it..."
+ mkdir -p "$DOWNLOAD_OPENIM_DIR"
+ fi
+
+ info "Downloading OpenIM source code from $TARBALL_URL to $DOWNLOAD_OPENIM_DIR"
+
+ curl -L -o "${DOWNLOAD_OPENIM_DIR}/${MODIFIED_TAG}.tar.gz" $TARBALL_URL
+
+ tar -xzvf "${DOWNLOAD_OPENIM_DIR}/${MODIFIED_TAG}.tar.gz" -C "$DOWNLOAD_OPENIM_DIR"
+ cd "$DOWNLOAD_OPENIM_DIR/$REPO-$MODIFIED_TAG"
+ git init && git add . && git commit -m "init" --no-verify
+
+ success "Source code downloaded and extracted to $REPO-$MODIFIED_TAG"
+}
+
+function set_openim_env() {
+ warn "This command can only be executed once. It will modify the component passwords in docker-compose based on the PASSWORD variable in .env, and modify the component passwords in config/config.yaml. If the password in .env changes, you need to first execute docker-compose down; rm components -rf and then execute this command."
+ # Set default values for user input
+ # If the USER environment variable is not set, it defaults to 'root'
+ if [ -z "$USER" ]; then
+ USER="root"
+ debug "USER is not set. Defaulting to 'root'."
+ fi
+
+ # If the PASSWORD environment variable is not set, it defaults to 'openIM123'
+ # This password applies to redis, mysql, mongo, as well as accessSecret in config/config.yaml
+ if [ -z "$PASSWORD" ]; then
+ PASSWORD="openIM123"
+ debug "PASSWORD is not set. Defaulting to 'openIM123'."
+ fi
+
+ # If the ENDPOINT environment variable is not set, it defaults to 'http://127.0.0.1:10005'
+ # This is minio's external service IP and port, or it could be a domain like storage.xx.xx
+ # The app must be able to access this IP and port or domain
+ if [ -z "$ENDPOINT" ]; then
+ ENDPOINT="http://127.0.0.1:10005"
+ debug "ENDPOINT is not set. Defaulting to 'http://127.0.0.1:10005'."
+ fi
+
+ # If the API_URL environment variable is not set, it defaults to 'http://127.0.0.1:10002/object/'
+ # The app must be able to access this IP and port or domain
+ if [ -z "$API_URL" ]; then
+ API_URL="http://127.0.0.1:10002/object/"
+ debug "API_URL is not set. Defaulting to 'http://127.0.0.1:10002/object/'."
+ fi
+
+ # If the DATA_DIR environment variable is not set, it defaults to the current directory './'
+ # This can be set to a directory with large disk space
+ if [ -z "$DATA_DIR" ]; then
+ DATA_DIR="./"
+ debug "DATA_DIR is not set. Defaulting to './'."
+ fi
+}
+
+function install_openim() {
+ info "Installing OpenIM"
+ make -j${CPU} install V=1
+
+ info "Checking installation"
+ make check
+
+ success "OpenIM installation completed successfully. Happy chatting!"
+}
+
+############### OpenIM Help ###############
+
+# Function to display help message
+function cmd_help() {
+ openim_color
+ color_echo ${BRIGHT_GREEN_PREFIX} "Usage: $0 [options]"
+ color_echo ${BRIGHT_GREEN_PREFIX} "Options:"
+ echo
+ color_echo ${BLUE_PREFIX} "-i, --install ${CYAN_PREFIX}Execute the installation logic of the script${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-u, --user ${CYAN_PREFIX}set user (default: root)${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-p, --password ${CYAN_PREFIX}set password (default: openIM123)${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-e, --endpoint ${CYAN_PREFIX}set endpoint (default: http://127.0.0.1:10005)${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-a, --api ${CYAN_PREFIX}set API URL (default: http://127.0.0.1:10002/object/)${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-d, --directory ${CYAN_PREFIX}set directory for large disk space (default: ./)${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-h, --help ${CYAN_PREFIX}display this help message and exit${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-cn, --china ${CYAN_PREFIX}set to use the Chinese domestic proxy${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-t, --tag ${CYAN_PREFIX}specify the tag (default option, set to latest if not specified)${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-r, --release ${CYAN_PREFIX}specify the release branch (cannot be used with the tag option)${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-g, --go-version ${CYAN_PREFIX}set the Go language version (default: GO_VERSION=\"1.18\")${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-i, --install-dir ${CYAN_PREFIX}set the OpenIM installation directory (default: /tmp)${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-gt, --github-token ${CYAN_PREFIX}set the GITHUB_TOKEN (default: not set)${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "--cpu ${CYAN_PREFIX}set the number of concurrent processes${COLOR_SUFFIX}"
+ echo
+ color_echo ${RED_PREFIX} "Note: Only one of the -t/--tag or -r/--release options can be used at a time.${COLOR_SUFFIX}"
+ color_echo ${RED_PREFIX} "If both are used or none of them are used, the -t/--tag option will be prioritized.${COLOR_SUFFIX}"
+ echo
+ exit 1
+}
+
+function parseinput() {
+ # set default values
+ # USER=root
+ # PASSWORD=openIM123
+ # ENDPOINT=http://127.0.0.1:10005
+ # API=http://127.0.0.1:10002/object/
+ # DIRECTORY=./
+ # CHINA=false
+ # TAG=latest
+ # RELEASE=""
+ # GO_VERSION=1.18
+ # INSTALL_DIR=/tmp
+ # GITHUB_TOKEN=""
+ # CPU=$(nproc)
+
+ if [ $# -eq 0 ]; then
+ cmd_help
+ exit 1
+ fi
+
+ while [ $# -gt 0 ]; do
+ case $1 in
+ -h|--help)
+ cmd_help
+ exit
+ ;;
+ -u|--user)
+ shift
+ USER=$1
+ ;;
+ -p|--password)
+ shift
+ PASSWORD=$1
+ ;;
+ -e|--endpoint)
+ shift
+ ENDPOINT=$1
+ ;;
+ -a|--api)
+ shift
+ API=$1
+ ;;
+ -d|--directory)
+ shift
+ DIRECTORY=$1
+ ;;
+ -cn|--china)
+ CHINA=true
+ ;;
+ -t|--tag)
+ shift
+ TAG=$1
+ ;;
+ -r|--release)
+ shift
+ RELEASE=$1
+ ;;
+ -g|--go-version)
+ shift
+ GO_VERSION=$1
+ ;;
+ -i|--install-dir)
+ shift
+ INSTALL_DIR=$1
+ ;;
+ -gt|--github-token)
+ shift
+ GITHUB_TOKEN=$1
+ ;;
+ --cpu)
+ shift
+ CPU=$1
+ ;;
+ -i|--install)
+ openim_main
+ exit
+ ;;
+ *)
+ echo "Unknown option: $1"
+ cmd_help
+ exit 1
+ ;;
+ esac
+ shift
+ done
+}
+
+############### OpenIM LOGO ###############
+# Set text color to cyan for header and URL
+print_with_delay() {
+ text="$1"
+ delay="$2"
+
+ for i in $(seq 0 $((${#text}-1))); do
+ printf "${text:$i:1}"
+ sleep $delay
+ done
+ printf "\n"
+}
+
+print_progress() {
+ total="$1"
+ delay="$2"
+
+ printf "["
+ for i in $(seq 1 $total); do
+ printf "#"
+ sleep $delay
+ done
+ printf "]\n"
+}
+
+# Function for colored echo
+color_echo() {
+ COLOR=$1
+ shift
+ echo -e "${COLOR}===> $* ${COLOR_SUFFIX}"
+}
+
+# Color definitions
+function openim_color() {
+ COLOR_SUFFIX="\033[0m" # End all colors and special effects
+
+ BLACK_PREFIX="\033[30m" # Black prefix
+ RED_PREFIX="\033[31m" # Red prefix
+ GREEN_PREFIX="\033[32m" # Green prefix
+ YELLOW_PREFIX="\033[33m" # Yellow prefix
+ BLUE_PREFIX="\033[34m" # Blue prefix
+ SKY_BLUE_PREFIX="\033[36m" # Sky blue prefix
+ WHITE_PREFIX="\033[37m" # White prefix
+ BOLD_PREFIX="\033[1m" # Bold prefix
+ UNDERLINE_PREFIX="\033[4m" # Underline prefix
+ ITALIC_PREFIX="\033[3m" # Italic prefix
+ BRIGHT_GREEN_PREFIX='\033[1;32m' # Bright green prefix
+
+ CYAN_PREFIX="\033[0;36m" # Cyan prefix
+}
+
+# --- helper functions for logs ---
+info()
+{
+ echo -e "[${GREEN_PREFIX}INFO${COLOR_SUFFIX}] " "$@"
+}
+warn()
+{
+ echo -e "[${YELLOW_PREFIX}WARN${COLOR_SUFFIX}] " "$@" >&2
+}
+fatal()
+{
+ echo -e "[${RED_PREFIX}ERROR${COLOR_SUFFIX}] " "$@" >&2
+ exit 1
+}
+debug()
+{
+ echo -e "[${BLUE_PREFIX}DEBUG${COLOR_SUFFIX}]===> " "$@"
+}
+success()
+{
+ echo -e "${BRIGHT_GREEN_PREFIX}=== [SUCCESS] ===${COLOR_SUFFIX}\n=> " "$@"
+}
+
+function openim_logo() {
+ # Set text color to cyan for header and URL
+ echo -e "\033[0;36m"
+
+ # Display fancy ASCII Art logo
+ # look http://patorjk.com/software/taag/#p=display&h=1&v=1&f=Doh&t=OpenIM
+ print_with_delay '
+
+
+ OOOOOOOOO IIIIIIIIIIMMMMMMMM MMMMMMMM
+ OO:::::::::OO I::::::::IM:::::::M M:::::::M
+ OO:::::::::::::OO I::::::::IM::::::::M M::::::::M
+O:::::::OOO:::::::O II::::::IIM:::::::::M M:::::::::M
+O::::::O O::::::Oppppp ppppppppp eeeeeeeeeeee nnnn nnnnnnnn I::::I M::::::::::M M::::::::::M
+O:::::O O:::::Op::::ppp:::::::::p ee::::::::::::ee n:::nn::::::::nn I::::I M:::::::::::M M:::::::::::M
+O:::::O O:::::Op:::::::::::::::::p e::::::eeeee:::::een::::::::::::::nn I::::I M:::::::M::::M M::::M:::::::M
+O:::::O O:::::Opp::::::ppppp::::::pe::::::e e:::::enn:::::::::::::::n I::::I M::::::M M::::M M::::M M::::::M
+O:::::O O:::::O p:::::p p:::::pe:::::::eeeee::::::e n:::::nnnn:::::n I::::I M::::::M M::::M::::M M::::::M
+O:::::O O:::::O p:::::p p:::::pe:::::::::::::::::e n::::n n::::n I::::I M::::::M M:::::::M M::::::M
+O:::::O O:::::O p:::::p p:::::pe::::::eeeeeeeeeee n::::n n::::n I::::I M::::::M M:::::M M::::::M
+O::::::O O::::::O p:::::p p::::::pe:::::::e n::::n n::::n I::::I M::::::M MMMMM M::::::M
+O:::::::OOO:::::::O p:::::ppppp:::::::pe::::::::e n::::n n::::nII::::::IIM::::::M M::::::M
+ OO:::::::::::::OO p::::::::::::::::p e::::::::eeeeeeee n::::n n::::nI::::::::IM::::::M M::::::M
+ OO:::::::::OO p::::::::::::::pp ee:::::::::::::e n::::n n::::nI::::::::IM::::::M M::::::M
+ OOOOOOOOO p::::::pppppppp eeeeeeeeeeeeee nnnnnn nnnnnnIIIIIIIIIIMMMMMMMM MMMMMMMM
+ p:::::p
+ p:::::p
+ p:::::::p
+ p:::::::p
+ p:::::::p
+ ppppppppp
+
+ ' 0.0001
+
+ # Display product URL
+ print_with_delay "Discover more and contribute at: https://github.com/OpenIMSDK/Open-IM-Server" 0.01
+
+ # Reset text color back to normal
+ echo -e "\033[0m"
+
+ # Set text color to green for product description
+ echo -e "\033[1;32m"
+
+ print_with_delay "Open-IM-Server: Reinventing Instant Messaging" 0.01
+ print_progress 50 0.02
+
+ print_with_delay "Open-IM-Server is not just a product; it's a revolution. It's about bringing the power of seamless, real-time messaging to your fingertips. And it's about joining a global community of developers, dedicated to pushing the boundaries of what's possible." 0.01
+
+ print_progress 50 0.02
+
+ # Reset text color back to normal
+ echo -e "\033[0m"
+
+ # Set text color to yellow for the Slack link
+ echo -e "\033[1;33m"
+
+ print_with_delay "Join our developer community on Slack: https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg" 0.01
+
+ # Reset text color back to normal
+ echo -e "\033[0m"
+}
+
+# Main function to run the script
+function openim_main() {
+ check_git_repo
+ check_isroot
+ openim_color
+ install_tools
+ check_docker
+ install_go
+ download_source_code
+ set_openim_env
+ install_openim
+ openim_logo
+
+}
+
+parseinput "$@"
\ No newline at end of file
diff --git a/scripts/advertise.sh b/scripts/advertise.sh
new file mode 100755
index 000000000..c1cd63f56
--- /dev/null
+++ b/scripts/advertise.sh
@@ -0,0 +1,122 @@
+#!/bin/bash
+
+set -e
+set -o pipefail
+
+trap 'echo "Script interrupted."; exit 1' INT
+
+# Function for colored echo
+function color_echo() {
+ COLOR=$1
+ shift
+ echo -e "${COLOR}===> $* ${COLOR_SUFFIX}"
+}
+
+# Color definitions
+function openim_color() {
+ COLOR_SUFFIX="\033[0m" # End all colors and special effects
+
+ BLACK_PREFIX="\033[30m" # Black prefix
+ RED_PREFIX="\033[31m" # Red prefix
+ GREEN_PREFIX="\033[32m" # Green prefix
+ YELLOW_PREFIX="\033[33m" # Yellow prefix
+ BLUE_PREFIX="\033[34m" # Blue prefix
+ SKY_BLUE_PREFIX="\033[36m" # Sky blue prefix
+ WHITE_PREFIX="\033[37m" # White prefix
+ BOLD_PREFIX="\033[1m" # Bold prefix
+ UNDERLINE_PREFIX="\033[4m" # Underline prefix
+ ITALIC_PREFIX="\033[3m" # Italic prefix
+
+ CYAN_PREFIX="\033[0;36m" # Cyan prefix
+}
+
+function print_with_delay() {
+ text="$1"
+ delay="$2"
+ color="$3"
+
+ for i in $(seq 0 $((${#text}-1))); do
+ printf "${color}${text:$i:1}${COLOR_SUFFIX}"
+ sleep $delay
+ done
+ printf "\n"
+}
+
+function print_progress() {
+ total="$1"
+ delay="$2"
+ color="$3"
+
+ printf "${color}["
+ for i in $(seq 1 $total); do
+ printf "#"
+ sleep $delay
+ done
+ printf "]${COLOR_SUFFIX}\n"
+}
+function openim_logo() {
+ # Set text color to cyan for header and URL
+ echo -e "\033[0;36m"
+
+ # Display fancy ASCII Art logo
+ # look http://patorjk.com/software/taag/#p=display&h=1&v=1&f=Doh&t=OpenIM
+ print_with_delay '
+
+
+ OOOOOOOOO IIIIIIIIIIMMMMMMMM MMMMMMMM
+ OO:::::::::OO I::::::::IM:::::::M M:::::::M
+ OO:::::::::::::OO I::::::::IM::::::::M M::::::::M
+O:::::::OOO:::::::O II::::::IIM:::::::::M M:::::::::M
+O::::::O O::::::Oppppp ppppppppp eeeeeeeeeeee nnnn nnnnnnnn I::::I M::::::::::M M::::::::::M
+O:::::O O:::::Op::::ppp:::::::::p ee::::::::::::ee n:::nn::::::::nn I::::I M:::::::::::M M:::::::::::M
+O:::::O O:::::Op:::::::::::::::::p e::::::eeeee:::::een::::::::::::::nn I::::I M:::::::M::::M M::::M:::::::M
+O:::::O O:::::Opp::::::ppppp::::::pe::::::e e:::::enn:::::::::::::::n I::::I M::::::M M::::M M::::M M::::::M
+O:::::O O:::::O p:::::p p:::::pe:::::::eeeee::::::e n:::::nnnn:::::n I::::I M::::::M M::::M::::M M::::::M
+O:::::O O:::::O p:::::p p:::::pe:::::::::::::::::e n::::n n::::n I::::I M::::::M M:::::::M M::::::M
+O:::::O O:::::O p:::::p p:::::pe::::::eeeeeeeeeee n::::n n::::n I::::I M::::::M M:::::M M::::::M
+O::::::O O::::::O p:::::p p::::::pe:::::::e n::::n n::::n I::::I M::::::M MMMMM M::::::M
+O:::::::OOO:::::::O p:::::ppppp:::::::pe::::::::e n::::n n::::nII::::::IIM::::::M M::::::M
+ OO:::::::::::::OO p::::::::::::::::p e::::::::eeeeeeee n::::n n::::nI::::::::IM::::::M M::::::M
+ OO:::::::::OO p::::::::::::::pp ee:::::::::::::e n::::n n::::nI::::::::IM::::::M M::::::M
+ OOOOOOOOO p::::::pppppppp eeeeeeeeeeeeee nnnnnn nnnnnnIIIIIIIIIIMMMMMMMM MMMMMMMM
+ p:::::p
+ p:::::p
+ p:::::::p
+ p:::::::p
+ p:::::::p
+ ppppppppp
+
+ ' 0.0001
+
+ # Display product URL
+ print_with_delay "Discover more and contribute at: https://github.com/OpenIMSDK/Open-IM-Server" 0.01
+
+ # Reset text color back to normal
+ echo -e "\033[0m"
+
+ # Set text color to green for product description
+ echo -e "\033[1;32m"
+
+ print_with_delay "Open-IM-Server: Reinventing Instant Messaging" 0.01
+ print_progress 50 0.02
+
+ print_with_delay "Open-IM-Server is not just a product; it's a revolution. It's about bringing the power of seamless, real-time messaging to your fingertips. And it's about joining a global community of developers, dedicated to pushing the boundaries of what's possible." 0.01
+
+ print_progress 50 0.02
+
+ # Reset text color back to normal
+ echo -e "\033[0m"
+
+ # Set text color to yellow for the Slack link
+ echo -e "\033[1;33m"
+
+ print_with_delay "Join our developer community on Slack: https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg" 0.01
+
+ # Reset text color back to normal
+ echo -e "\033[0m"
+}
+
+function main() {
+ openim_logo
+}
+main "$@"
diff --git a/scripts/make-rules/copyright.mk b/scripts/make-rules/copyright.mk
index 319e46945..2b7a04082 100644
--- a/scripts/make-rules/copyright.mk
+++ b/scripts/make-rules/copyright.mk
@@ -51,6 +51,12 @@ copyright.add: tools.verify.addlicense
# -y string
# copyright year(s) (default "2023")
+## copyright.advertise: Advertise the license of the project
+.PHONY: copyright.advertise
+copyright.advertise:
+ @chmod +x $(ROOT_DIR)/scripts/advertise.sh
+ @$(ROOT_DIR)/scripts/advertise.sh
+
## copyright.help: Show copyright help
.PHONY: copyright.help
copyright.help: scripts/make-rules/copyright.mk
diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk
index 282649d7e..00e0fee47 100644
--- a/scripts/make-rules/golang.mk
+++ b/scripts/make-rules/golang.mk
@@ -137,6 +137,12 @@ go.install:
@echo "===========> Installing deployment openim"
@$(ROOT_DIR)/scripts/install_im_server.sh
+## go.check: Check OpenIM deployment
+.PHONY: go.check
+go.check:
+ @echo "===========> Checking OpenIM deployment"
+ @$(ROOT_DIR)/scripts/check_all.sh
+
## go.multiarch: Build multi-arch binaries
.PHONY: go.build.multiarch
go.build.multiarch: go.build.verify $(foreach p,$(PLATFORMS),$(addprefix go.build., $(addprefix $(p)., $(BINS))))
diff --git a/scripts/style_info.sh b/scripts/style_info.sh
index 3c747dd0c..b56eceeff 100755
--- a/scripts/style_info.sh
+++ b/scripts/style_info.sh
@@ -28,6 +28,8 @@ BOLD_PREFIX="\033[1m" # Bold prefix
UNDERLINE_PREFIX="\033[4m" # Underline prefix
ITALIC_PREFIX="\033[3m" # Italic prefix
+CYAN_PREFIX="033[0;36m" # Cyan prefix
+
BACKGROUND_BLACK="\033[40m" # Black background
BACKGROUND_RED="\033[41m" # Red background
BACKGROUND_GREEN="\033[42m" # Green background
From 8a4be458041a4604cadfac788952d17961292c0a Mon Sep 17 00:00:00 2001
From: withchao <48119764+withchao@users.noreply.github.com>
Date: Thu, 27 Jul 2023 12:31:27 +0800
Subject: [PATCH 02/48] fix: sql injection risk (#678)
Signed-off-by: withchao <993506633@qq.com>
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 7acda0e12..e4bc8edc6 100644
--- a/go.mod
+++ b/go.mod
@@ -38,7 +38,7 @@ require github.com/google/uuid v1.3.0
require (
github.com/OpenIMSDK/protocol v0.0.1
- github.com/OpenIMSDK/tools v0.0.4
+ github.com/OpenIMSDK/tools v0.0.5
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
github.com/go-redis/redis v6.15.9+incompatible
github.com/go-sql-driver/mysql v1.6.0
diff --git a/go.sum b/go.sum
index 28b2c5c32..0089e1924 100644
--- a/go.sum
+++ b/go.sum
@@ -18,8 +18,8 @@ firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIw
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/OpenIMSDK/protocol v0.0.1 h1:Q6J1jCU00dfqmguxw2XI+IGcVfBAkb5Tz8LgvyeNkk0=
github.com/OpenIMSDK/protocol v0.0.1/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
-github.com/OpenIMSDK/tools v0.0.4 h1:aSC5FWO/0ccxuLHs+E1Eeyj+XWL/2CzLy1XGmQgpaU4=
-github.com/OpenIMSDK/tools v0.0.4/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
+github.com/OpenIMSDK/tools v0.0.5 h1:yBVHJ3EpIDcp8VFKPjuGr6MQvFa3t4JByZ+vmeC06/Q=
+github.com/OpenIMSDK/tools v0.0.5/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
github.com/Shopify/sarama v1.29.0 h1:ARid8o8oieau9XrHI55f/L3EoRAhm9px6sonbD7yuUE=
github.com/Shopify/sarama v1.29.0/go.mod h1:2QpgD79wpdAESqNQMxNc0KYMkycd4slxGdV3TWSVqrU=
From 0bc8b9259e942bf378c68150dfe5a9bc7f5e190f Mon Sep 17 00:00:00 2001
From: WangchuXiao
Date: Thu, 27 Jul 2023 12:32:08 +0800
Subject: [PATCH 03/48] new feat: sync designated model data (#668)
* new feature: add batch send msg
* new feature: add batch send msg
* new feature: add batch send msg
* new feature: add batch send msg
* new feature: add batch send msg
* new feature: add batch send msg
* fix bug: multiple gateway kick user
* fix bug: multiple gateway kick user
* fix bug: multiple gateway kick user
* fix bug: multiple gateway kick user
* fix bug: multiple gateway kick user
* MsgDestructTime
* fix bug: msg destruct sql
* fix bug: msg destruct
* fix bug: msg destruct
* fix bug: msg destruct sql
* fix bug: msg destruct sql
* fix bug: msg destruct sql
* fix bug: msg destruct sql
* debug: print stack
* debug: print stack
* debug: print stack
* fix bug: msg destruct sql
Signed-off-by: wangchuxiao
* fix bug: msg notification self 2 self push twice
* fix bug: heartbeat get self notification
* fix bug: init grpc conn in one process
* fix bug: grpc conn
Signed-off-by: wangchuxiao
* fix bug: zk client recreate node when reconn
* fix bug: set friend mark args error
* fix bug: rpc client intercepter called twice
Signed-off-by: wangchuxiao
* cicd: robot automated Change
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* test: document msg num set 100
* new feat: sync designated model
* new feat: sync designated model
* new feat: sync designated model
* new feat: sync designated model
* new feat: sync designated model
* new feat: sync designated model
* new feat: sync designated model
* merge code
* merge code
---------
Signed-off-by: wangchuxiao
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: wangchuxiao-dev
---
internal/api/friend.go | 8 ++++
internal/api/group.go | 4 ++
internal/api/route.go | 3 ++
internal/rpc/conversation/conversaion.go | 6 +--
internal/rpc/friend/friend.go | 19 +++++---
internal/rpc/group/group.go | 48 +++++++++++++++++--
internal/rpc/user/user.go | 12 ++---
pkg/apistruct/manage.go | 2 +-
pkg/common/db/controller/friend.go | 5 ++
pkg/common/db/controller/group.go | 5 ++
.../db/relation/friend_request_model.go | 11 +++++
pkg/common/db/relation/group_request_model.go | 5 ++
.../db/table/relation/friend_request.go | 2 +-
pkg/common/db/table/relation/group_request.go | 1 +
pkg/rpcclient/notification/conevrsation.go | 19 ++++----
15 files changed, 118 insertions(+), 32 deletions(-)
diff --git a/internal/api/friend.go b/internal/api/friend.go
index 7af614fa4..f64a99ef3 100644
--- a/internal/api/friend.go
+++ b/internal/api/friend.go
@@ -44,6 +44,10 @@ func (o *FriendApi) GetFriendApplyList(c *gin.Context) {
a2r.Call(friend.FriendClient.GetPaginationFriendsApplyTo, o.Client, c)
}
+func (o *FriendApi) GetDesignatedFriendsApply(c *gin.Context) {
+ a2r.Call(friend.FriendClient.GetDesignatedFriendsApply, o.Client, c)
+}
+
func (o *FriendApi) GetSelfApplyList(c *gin.Context) {
a2r.Call(friend.FriendClient.GetPaginationFriendsApplyFrom, o.Client, c)
}
@@ -52,6 +56,10 @@ func (o *FriendApi) GetFriendList(c *gin.Context) {
a2r.Call(friend.FriendClient.GetPaginationFriends, o.Client, c)
}
+func (o *FriendApi) GetDesignatedFriends(c *gin.Context) {
+ a2r.Call(friend.FriendClient.GetDesignatedFriends, o.Client, c)
+}
+
func (o *FriendApi) SetFriendRemark(c *gin.Context) {
a2r.Call(friend.FriendClient.SetFriendRemark, o.Client, c)
}
diff --git a/internal/api/group.go b/internal/api/group.go
index 2603bb858..ab397a8ac 100644
--- a/internal/api/group.go
+++ b/internal/api/group.go
@@ -60,6 +60,10 @@ func (o *GroupApi) GetUserReqGroupApplicationList(c *gin.Context) {
a2r.Call(group.GroupClient.GetUserReqApplicationList, o.Client, c)
}
+func (o *GroupApi) GetGroupUsersReqApplicationList(c *gin.Context) {
+ a2r.Call(group.GroupClient.GetGroupUsersReqApplicationList, o.Client, c)
+}
+
func (o *GroupApi) GetGroupsInfo(c *gin.Context) {
a2r.Call(group.GroupClient.GetGroupsInfo, o.Client, c)
}
diff --git a/internal/api/route.go b/internal/api/route.go
index 262283019..4a4f92cc0 100644
--- a/internal/api/route.go
+++ b/internal/api/route.go
@@ -86,8 +86,10 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
f := NewFriendApi(*friendRpc)
friendRouterGroup.POST("/delete_friend", f.DeleteFriend)
friendRouterGroup.POST("/get_friend_apply_list", f.GetFriendApplyList)
+ friendRouterGroup.POST("/get_designated_friend_apply", f.GetDesignatedFriendsApply)
friendRouterGroup.POST("/get_self_friend_apply_list", f.GetSelfApplyList)
friendRouterGroup.POST("/get_friend_list", f.GetFriendList)
+ friendRouterGroup.POST("/get_designated_friends", f.GetDesignatedFriends)
friendRouterGroup.POST("/add_friend", f.ApplyToAddFriend)
friendRouterGroup.POST("/add_friend_response", f.RespondFriendApply)
friendRouterGroup.POST("/set_friend_remark", f.SetFriendRemark)
@@ -108,6 +110,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
groupRouterGroup.POST("/transfer_group", g.TransferGroupOwner)
groupRouterGroup.POST("/get_recv_group_applicationList", g.GetRecvGroupApplicationList)
groupRouterGroup.POST("/get_user_req_group_applicationList", g.GetUserReqGroupApplicationList)
+ groupRouterGroup.POST("/get_group_users_req_application_list", g.GetGroupUsersReqApplicationList)
groupRouterGroup.POST("/get_groups_info", g.GetGroupsInfo)
groupRouterGroup.POST("/kick_group", g.KickGroupMember)
groupRouterGroup.POST("/get_group_members_info", g.GetGroupMembersInfo)
diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go
index 753a45722..6030bfa55 100644
--- a/internal/rpc/conversation/conversaion.go
+++ b/internal/rpc/conversation/conversaion.go
@@ -107,7 +107,7 @@ func (c *conversationServer) SetConversation(ctx context.Context, req *pbConvers
if err != nil {
return nil, err
}
- _ = c.conversationNotificationSender.ConversationChangeNotification(ctx, req.Conversation.OwnerUserID)
+ _ = c.conversationNotificationSender.ConversationChangeNotification(ctx, req.Conversation.OwnerUserID, []string{req.Conversation.ConversationID})
resp := &pbConversation.SetConversationResp{}
return resp, nil
}
@@ -170,7 +170,7 @@ func (c *conversationServer) SetConversations(ctx context.Context, req *pbConver
return nil, err
}
for _, userID := range req.UserIDs {
- c.conversationNotificationSender.ConversationSetPrivateNotification(ctx, userID, req.Conversation.UserID, req.Conversation.IsPrivateChat.Value)
+ c.conversationNotificationSender.ConversationSetPrivateNotification(ctx, userID, req.Conversation.UserID, req.Conversation.IsPrivateChat.Value, req.Conversation.ConversationID)
}
}
if req.Conversation.BurnDuration != nil {
@@ -181,7 +181,7 @@ func (c *conversationServer) SetConversations(ctx context.Context, req *pbConver
return nil, err
}
for _, v := range req.UserIDs {
- c.conversationNotificationSender.ConversationChangeNotification(ctx, v)
+ c.conversationNotificationSender.ConversationChangeNotification(ctx, v, []string{req.Conversation.ConversationID})
}
return &pbConversation.SetConversationsResp{}, nil
}
diff --git a/internal/rpc/friend/friend.go b/internal/rpc/friend/friend.go
index 9ef38ef3c..7f3be3439 100644
--- a/internal/rpc/friend/friend.go
+++ b/internal/rpc/friend/friend.go
@@ -83,11 +83,6 @@ func Start(client registry.SvcDiscoveryRegistry, server *grpc.Server) error {
return nil
}
-func (s *friendServer) GetDesignatedFriendsApply(ctx context.Context, req *pbfriend.GetDesignatedFriendsApplyReq) (*pbfriend.GetDesignatedFriendsApplyResp, error) {
- //TODO implement me
- panic("implement me")
-}
-
// ok.
func (s *friendServer) ApplyToAddFriend(
ctx context.Context,
@@ -245,6 +240,19 @@ func (s *friendServer) GetDesignatedFriends(
return resp, nil
}
+func (s *friendServer) GetDesignatedFriendsApply(ctx context.Context, req *pbfriend.GetDesignatedFriendsApplyReq) (resp *pbfriend.GetDesignatedFriendsApplyResp, err error) {
+ friendRequests, err := s.friendDatabase.FindBothFriendRequests(ctx, req.FromUserID, req.ToUserID)
+ if err != nil {
+ return nil, err
+ }
+ resp = &pbfriend.GetDesignatedFriendsApplyResp{}
+ resp.FriendRequests, err = convert.FriendRequestDB2Pb(ctx, friendRequests, s.userRpcClient.GetUsersInfoMap)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
// ok 获取接收到的好友申请(即别人主动申请的).
func (s *friendServer) GetPaginationFriendsApplyTo(
ctx context.Context,
@@ -303,7 +311,6 @@ func (s *friendServer) IsFriend(
return resp, nil
}
-// ok.
func (s *friendServer) GetPaginationFriends(
ctx context.Context,
req *pbfriend.GetPaginationFriendsReq,
diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go
index bcadc61a3..4ce3d4216 100644
--- a/internal/rpc/group/group.go
+++ b/internal/rpc/group/group.go
@@ -95,11 +95,6 @@ type groupServer struct {
msgRpcClient rpcclient.MessageRpcClient
}
-func (s *groupServer) GetGroupUsersReqApplicationList(ctx context.Context, req *pbGroup.GetGroupUsersReqApplicationListReq) (*pbGroup.GetGroupUsersReqApplicationListResp, error) {
- //TODO implement me
- panic("implement me")
-}
-
func (s *groupServer) CheckGroupAdmin(ctx context.Context, groupID string) error {
if !authverify.IsAppManagerUid(ctx) {
groupMember, err := s.GroupDatabase.TakeGroupMember(ctx, groupID, mcontext.GetOpUserID(ctx))
@@ -1445,3 +1440,46 @@ func (s *groupServer) GetGroupMemberRoleLevel(ctx context.Context, req *pbGroup.
})
return resp, nil
}
+
+func (s *groupServer) GetGroupUsersReqApplicationList(ctx context.Context, req *pbGroup.GetGroupUsersReqApplicationListReq) (*pbGroup.GetGroupUsersReqApplicationListResp, error) {
+ resp := &pbGroup.GetGroupUsersReqApplicationListResp{}
+ total, requests, err := s.GroupDatabase.FindGroupRequests(ctx, req.GroupID, req.UserIDs)
+ if err != nil {
+ return nil, err
+ }
+ if len(requests) == 0 {
+ return resp, nil
+ }
+ groupIDs := utils.Distinct(utils.Slice(requests, func(e *relationTb.GroupRequestModel) string {
+ return e.GroupID
+ }))
+ groups, err := s.GroupDatabase.FindGroup(ctx, groupIDs)
+ if err != nil {
+ return nil, err
+ }
+ groupMap := utils.SliceToMap(groups, func(e *relationTb.GroupModel) string {
+ return e.GroupID
+ })
+ if ids := utils.Single(groupIDs, utils.Keys(groupMap)); len(ids) > 0 {
+ return nil, errs.ErrGroupIDNotFound.Wrap(strings.Join(ids, ","))
+ }
+ owners, err := s.FindGroupMember(ctx, groupIDs, nil, []int32{constant.GroupOwner})
+ if err != nil {
+ return nil, err
+ }
+ ownerMap := utils.SliceToMap(owners, func(e *relationTb.GroupMemberModel) string {
+ return e.GroupID
+ })
+ if ids := utils.Single(groupIDs, utils.Keys(ownerMap)); len(ids) > 0 {
+ return nil, errs.ErrData.Wrap("group no owner", strings.Join(ids, ","))
+ }
+ groupMemberNum, err := s.GroupDatabase.MapGroupMemberNum(ctx, groupIDs)
+ if err != nil {
+ return nil, err
+ }
+ resp.GroupRequests = utils.Slice(requests, func(e *relationTb.GroupRequestModel) *sdkws.GroupRequest {
+ return convert.Db2PbGroupRequest(e, nil, convert.Db2PbGroupInfo(groupMap[e.GroupID], ownerMap[e.GroupID].UserID, uint32(groupMemberNum[e.GroupID])))
+ })
+ resp.Total = total
+ return resp, nil
+}
diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go
index f95e66c0d..fb6518a7e 100644
--- a/internal/rpc/user/user.go
+++ b/internal/rpc/user/user.go
@@ -17,10 +17,11 @@ package user
import (
"context"
"errors"
- "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
"strings"
"time"
+ "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
+
"github.com/OpenIMSDK/tools/log"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
@@ -50,11 +51,6 @@ type userServer struct {
RegisterCenter registry.SvcDiscoveryRegistry
}
-func (s *userServer) SubscribeOrCancelUsersStatus(ctx context.Context, req *pbuser.SubscribeOrCancelUsersStatusReq) (*pbuser.SubscribeOrCancelUsersStatusResp, error) {
- //TODO implement me
- panic("implement me")
-}
-
func Start(client registry.SvcDiscoveryRegistry, server *grpc.Server) error {
db, err := relation.NewGormDB()
if err != nil {
@@ -246,3 +242,7 @@ func (s *userServer) GetAllUserID(ctx context.Context, req *pbuser.GetAllUserIDR
}
return &pbuser.GetAllUserIDResp{UserIDs: userIDs}, nil
}
+
+func (s *userServer) SubscribeOrCancelUsersStatus(ctx context.Context, req *pbuser.SubscribeOrCancelUsersStatusReq) (resp *pbuser.SubscribeOrCancelUsersStatusResp, err error) {
+ panic("implement me")
+}
diff --git a/pkg/apistruct/manage.go b/pkg/apistruct/manage.go
index 3a2945b37..eef38e403 100644
--- a/pkg/apistruct/manage.go
+++ b/pkg/apistruct/manage.go
@@ -33,7 +33,7 @@ type SendMsg struct {
}
type SendMsgReq struct {
- RecvID string `json:"recvID" binding:"required_if" message:"recvID is required if sessionType is SingleChatType or NotificationChatType"`
+ RecvID string `json:"recvID" binding:"required_if" message:"recvID is required if sessionType is SingleChatType or NotificationChatType"`
SendMsg
}
diff --git a/pkg/common/db/controller/friend.go b/pkg/common/db/controller/friend.go
index c44c1662e..cab838bb4 100644
--- a/pkg/common/db/controller/friend.go
+++ b/pkg/common/db/controller/friend.go
@@ -75,6 +75,7 @@ type FriendDatabase interface {
friendUserIDs []string,
) (friends []*relation.FriendModel, err error)
FindFriendUserIDs(ctx context.Context, ownerUserID string) (friendUserIDs []string, err error)
+ FindBothFriendRequests(ctx context.Context, fromUserID, toUserID string) (friends []*relation.FriendRequestModel, err error)
}
type friendDatabase struct {
@@ -363,3 +364,7 @@ func (f *friendDatabase) FindFriendUserIDs(
) (friendUserIDs []string, err error) {
return f.cache.GetFriendIDs(ctx, ownerUserID)
}
+
+func (f *friendDatabase) FindBothFriendRequests(ctx context.Context, fromUserID, toUserID string) (friends []*relation.FriendRequestModel, err error) {
+ return f.friendRequest.FindBothFriendRequests(ctx, fromUserID, toUserID)
+}
diff --git a/pkg/common/db/controller/group.go b/pkg/common/db/controller/group.go
index af97d87ca..e2b5f90b3 100644
--- a/pkg/common/db/controller/group.go
+++ b/pkg/common/db/controller/group.go
@@ -110,6 +110,7 @@ type GroupDatabase interface {
// GroupRequest
CreateGroupRequest(ctx context.Context, requests []*relationTb.GroupRequestModel) error
TakeGroupRequest(ctx context.Context, groupID string, userID string) (*relationTb.GroupRequestModel, error)
+ FindGroupRequests(ctx context.Context, groupID string, userIDs []string) (int64, []*relationTb.GroupRequestModel, error)
PageGroupRequestUser(
ctx context.Context,
userID string,
@@ -576,3 +577,7 @@ func (g *groupDatabase) CountTotal(ctx context.Context, before *time.Time) (coun
func (g *groupDatabase) CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) {
return g.groupDB.CountRangeEverydayTotal(ctx, start, end)
}
+
+func (g *groupDatabase) FindGroupRequests(ctx context.Context, groupID string, userIDs []string) (int64, []*relationTb.GroupRequestModel, error) {
+ return g.groupRequestDB.FindGroupRequests(ctx, groupID, userIDs)
+}
diff --git a/pkg/common/db/relation/friend_request_model.go b/pkg/common/db/relation/friend_request_model.go
index 9f5cbbfee..d17cc680b 100644
--- a/pkg/common/db/relation/friend_request_model.go
+++ b/pkg/common/db/relation/friend_request_model.go
@@ -147,3 +147,14 @@ func (f *FriendRequestGorm) FindFromUserID(
)
return
}
+
+func (f *FriendRequestGorm) FindBothFriendRequests(ctx context.Context, fromUserID, toUserID string) (friends []*relation.FriendRequestModel, err error) {
+ err = utils.Wrap(
+ f.db(ctx).
+ Where("(from_user_id = ? AND to_user_id = ?) OR (from_user_id = ? AND to_user_id = ?)", fromUserID, toUserID, toUserID, fromUserID).
+ Find(&friends).
+ Error,
+ "",
+ )
+ return
+}
diff --git a/pkg/common/db/relation/group_request_model.go b/pkg/common/db/relation/group_request_model.go
index a38f1f782..7c0497aaf 100644
--- a/pkg/common/db/relation/group_request_model.go
+++ b/pkg/common/db/relation/group_request_model.go
@@ -110,3 +110,8 @@ func (g *GroupRequestGorm) PageGroup(
showNumber,
)
}
+
+func (g *GroupRequestGorm) FindGroupRequests(ctx context.Context, groupID string, userIDs []string) (total int64, groupRequests []*relation.GroupRequestModel, err error) {
+ err = g.DB.WithContext(ctx).Where("group_id = ? and user_id in ?", groupID, userIDs).Find(&groupRequests).Error
+ return int64(len(groupRequests)), groupRequests, utils.Wrap(err, utils.GetSelfFuncName())
+}
diff --git a/pkg/common/db/table/relation/friend_request.go b/pkg/common/db/table/relation/friend_request.go
index 794f33aaf..51ea0ef6e 100644
--- a/pkg/common/db/table/relation/friend_request.go
+++ b/pkg/common/db/table/relation/friend_request.go
@@ -61,6 +61,6 @@ type FriendRequestModelInterface interface {
fromUserID string,
pageNumber, showNumber int32,
) (friendRequests []*FriendRequestModel, total int64, err error)
-
+ FindBothFriendRequests(ctx context.Context, fromUserID, toUserID string) (friends []*FriendRequestModel, err error)
NewTx(tx any) FriendRequestModelInterface
}
diff --git a/pkg/common/db/table/relation/group_request.go b/pkg/common/db/table/relation/group_request.go
index ba68bcd7b..063b83938 100644
--- a/pkg/common/db/table/relation/group_request.go
+++ b/pkg/common/db/table/relation/group_request.go
@@ -47,6 +47,7 @@ type GroupRequestModelInterface interface {
Delete(ctx context.Context, groupID string, userID string) (err error)
UpdateHandler(ctx context.Context, groupID string, userID string, handledMsg string, handleResult int32) (err error)
Take(ctx context.Context, groupID string, userID string) (groupRequest *GroupRequestModel, err error)
+ FindGroupRequests(ctx context.Context, groupID string, userIDs []string) (int64, []*GroupRequestModel, error)
Page(
ctx context.Context,
userID string,
diff --git a/pkg/rpcclient/notification/conevrsation.go b/pkg/rpcclient/notification/conevrsation.go
index 9c8066d00..a5f57c570 100644
--- a/pkg/rpcclient/notification/conevrsation.go
+++ b/pkg/rpcclient/notification/conevrsation.go
@@ -31,23 +31,22 @@ func NewConversationNotificationSender(msgRpcClient *rpcclient.MessageRpcClient)
}
// SetPrivate调用.
-func (c *ConversationNotificationSender) ConversationSetPrivateNotification(
- ctx context.Context,
- sendID, recvID string,
- isPrivateChat bool,
-) error {
+func (c *ConversationNotificationSender) ConversationSetPrivateNotification(ctx context.Context, sendID, recvID string,
+ isPrivateChat bool, conversationID string) error {
tips := &sdkws.ConversationSetPrivateTips{
- RecvID: recvID,
- SendID: sendID,
- IsPrivate: isPrivateChat,
+ RecvID: recvID,
+ SendID: sendID,
+ IsPrivate: isPrivateChat,
+ ConversationID: conversationID,
}
return c.Notification(ctx, sendID, recvID, constant.ConversationPrivateChatNotification, tips)
}
// 会话改变.
-func (c *ConversationNotificationSender) ConversationChangeNotification(ctx context.Context, userID string) error {
+func (c *ConversationNotificationSender) ConversationChangeNotification(ctx context.Context, userID string, conversationIDs []string) error {
tips := &sdkws.ConversationUpdateTips{
- UserID: userID,
+ UserID: userID,
+ ConversationIDList: conversationIDs,
}
return c.Notification(ctx, userID, userID, constant.ConversationChangeNotification, tips)
}
From a86d24cfd105874417a215cfb6bc15b7dc0e644d Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Thu, 27 Jul 2023 14:38:46 +0800
Subject: [PATCH 04/48] feat: config env optimize (#680)
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
.env | 6 +-
config/config.yaml | 282 +++++++++++++++++++++++++++++++--------------
install.sh | 8 +-
3 files changed, 205 insertions(+), 91 deletions(-)
diff --git a/.env b/.env
index e7971a07a..910d864b8 100644
--- a/.env
+++ b/.env
@@ -1,5 +1,5 @@
USER=root
PASSWORD=openIM123
-MINIO_ENDPOINT=http://116.30.3.80:10005
-API_URL=http://116.30.3.80:10002/object/
-DATA_DIR=./
+MINIO_ENDPOINT=http://113.99.98.99:10005
+API_URL=http://113.99.98.99:10002/object/
+DATA_DIR=./
\ No newline at end of file
diff --git a/config/config.yaml b/config/config.yaml
index 3f43a7a69..74c864fc3 100644
--- a/config/config.yaml
+++ b/config/config.yaml
@@ -12,81 +12,133 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#OpenIM config
-
-
-#---------------Infrastructure configuration---------------------#
+# -----------------------------------------------------------------
+# Infrastructural configurations, please modify based on your setup
+# -----------------------------------------------------------------
+
+###################### Zookeeper ######################
+# Zookeeper configuration
+# It's not recommended to modify the schema
+#
+# Zookeeper address
+# Zookeeper username
+# Zookeeper password
zookeeper:
- schema: openim #不建议修改
- address: [ 127.0.0.1:2181 ] #
- username: #用户名
- password: #密码
-
+ schema: openim
+ address: [ 127.0.0.1:2181 ]
+ username:
+ password:
+
+###################### Mysql ######################
+# MySQL configuration
+# Currently, only single machine setup is supported
+#
+# Maximum number of open connections
+# Maximum number of idle connections
+# Maximum lifetime in seconds a connection can be reused
+# Log level: 1=slient, 2=error, 3=warn, 4=info
+# Slow query threshold in milliseconds
mysql:
- address: [ 127.0.0.1:13306 ] #目前仅支持单机
+ address: [ 127.0.0.1:13306 ]
username: root
password: openIM123
- database: openIM_v3 #不建议修改
- maxOpenConn: 1000 #最大连接数
- maxIdleConn: 100 #最大空闲连接数
- maxLifeTime: 60 #连接可以重复使用的最长时间(秒)
- logLevel: 4 #日志级别 1=slient 2=error 3=warn 4=info
- slowThreshold: 500 #慢语句阈值 (毫秒)
-
+ database: openIM_v3
+ maxOpenConn: 1000
+ maxIdleConn: 100
+ maxLifeTime: 60
+ logLevel: 4
+ slowThreshold: 500
+
+###################### Mongo ######################
+# MongoDB configuration
+# If uri is not empty, it will be used directly
+#
+# MongoDB address for standalone setup, Mongos address for sharded cluster setup
+# Default MongoDB database name
+# Maximum connection pool size
mongo:
- uri: #不为空则直接使用该值
- address: [ 127.0.0.1:37017 ] #单机时为mongo地址,使用分片集群时,为mongos地址
- database: openIM_v3 #mongo db 默认即可
+ uri:
+ address: [ 127.0.0.1:37017 ]
+ database: openIM_v3
username: root
password: openIM123
- maxPoolSize: 100
+ maxPoolSize: 100
+###################### Redis ######################
+# Redis configuration
+#
+# Username is required only for Redis version 6.0+
redis:
- address: [ 127.0.0.1:16379 ] #
- username: #only redis version 6.0+ need username
+ address: [ 127.0.0.1:16379 ]
+ username:
password: openIM123
+###################### Kafka ######################
+# Kafka configuration
+#
+# Kafka username
+# Kafka password
+# It's not recommended to modify this topic name
+# Consumer group ID, it's not recommended to modify
kafka:
- username: #用户名
- password: #密码
- addr: [ 127.0.0.1:9092 ] #
+ username:
+ password:
+ addr: [ 127.0.0.1:9092 ]
latestMsgToRedis:
- topic: "latestMsgToRedis" #不建议修改
+ topic: "latestMsgToRedis"
offlineMsgToMongo:
- topic: "offlineMsgToMongoMysql" #不建议修改
+ topic: "offlineMsgToMongoMysql"
msgToPush:
- topic: "msgToPush" #不建议修改
- consumerGroupID: #消费者组,不建议修改
- msgToRedis: redis #
- msgToMongo: mongo #
- msgToMySql: mysql #
- msgToPush: push #
-
-
+ topic: "msgToPush"
+ consumerGroupID:
+ msgToRedis: redis
+ msgToMongo: mongo
+ msgToMySql: mysql
+ msgToPush: push
+
+###################### 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: #作为rpc启动时,注册到zookeeper的IP,api/gateway能访问到此ip和对应的rpcPort中的端口
- listenIP: #默认为0.0.0.0
-
+ registerIP:
+ listenIP: 0.0.0.0
+###################### API ######################
+# API configuration
+#
+# API service port
+# Default listen IP is 0.0.0.0
api:
- openImApiPort: [ 10002 ] #api服务端口
- listenIP: #默认为0.0.0.0
+ openImApiPort: [ 10002 ]
+ listenIP: 0.0.0.0
+###################### Gateway ######################
+# Object storage configuration
+#
+# Use minio for object storage
+# API URL should be accessible by the app
+# It's not recommended to modify the bucket name
+# Endpoint should be accessible by the app
+# Session token
+# Configuration for Tencent COS
+# Configuration for Aliyun OSS
object:
- enable: "minio" #使用minio
- apiURL: "http://127.0.0.1:10002/object/" #地址需要app能访问到
+ enable: "minio"
+ apiURL: "http://127.0.0.1:10002/object/"
minio:
- bucket: "openim" #不建议修改
- endpoint: http://127.0.0.1:10005 #地址需要app能够访问
+ bucket: "openim"
+ endpoint: http://127.0.0.1:10005
accessKeyID: root
secretAccessKey: openIM123
- sessionToken: "" #token
- cos: #tencent cos
+ sessionToken: ""
+ cos:
bucketURL: "https://temp-1252357374.cos.ap-chengdu.myqcloud.com"
secretID: ""
secretKey: ""
sessionToken: ""
- oss: #ali oss
+ oss:
endpoint: "https://oss-cn-chengdu.aliyuncs.com"
bucket: "demo-9999999"
bucketURL: "https://demo-9999999.oss-cn-chengdu.aliyuncs.com"
@@ -94,7 +146,11 @@ object:
accessKeySecret: ""
sessionToken: ""
-rpcPort: #rpc服务端口,不建议修改,端口由脚本读取后传入程序,如启动多个程序,只需要填入多个端口,用逗号隔开,如 [10110, 10111]
+# 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:
openImUserPort: [ 10110 ]
openImFriendPort: [ 10120 ]
openImMessagePort: [ 10130 ]
@@ -105,7 +161,8 @@ rpcPort: #rpc服务端口,不建议修改,端口由脚本读取后传入程
openImConversationPort: [ 10180 ]
openImThirdPort: [ 10190 ]
-rpcRegisterName: #rpc注册服务名,不建议修改
+# RPC service names for registration, it's not recommended to modify these
+rpcRegisterName:
openImUserName: User
openImFriendName: Friend
openImMsgName: Msg
@@ -116,78 +173,132 @@ rpcRegisterName: #rpc注册服务名,不建议修改
openImConversationName: Conversation
openImThirdName: Third
+# Log configuration
+#
+# Storage directory
+# Log rotation time
+# Maximum number of logs to retain
+# Log level, 6 means all levels
+# Whether to output to stdout
+# Whether to output in json format
+# Whether to include stack trace in logs
log:
- storageLocation: ../../../../../logs/ #存放目录
- rotationTime: 24 #日志旋转时间
- remainRotationCount: 2 #日志数量
- remainLogLevel: 6 #日志级别 6表示全都打印,
- isStdout: false
- isJson: false
+ storageLocation: ../../../../../logs/
+ rotationTime: 24
+ remainRotationCount: 2
+ remainLogLevel: 6
+ isStdout: false
+ isJson: false
withStack: false
+# Long connection server configuration
+#
+# Websocket port for msg_gateway
+# Maximum number of websocket connections
+# Maximum length of websocket request package
+# Websocket connection handshake timeout
longConnSvr:
- openImWsPort: [ 10001 ] #msg_gateway的websocket端口
- websocketMaxConnNum: 100000 #websocket最大连接数
- websocketMaxMsgLen: 4096 #websocket请求包最大长度
- websocketTimeout: 10 #websocket连接握手超时时间
+ openImWsPort: [ 10001 ]
+ websocketMaxConnNum: 100000
+ websocketMaxMsgLen: 4096
+ websocketTimeout: 10
+# Push notification service configuration
+#
+# Use GeTui for push notifications
+# GeTui offline push configuration
+# FCM offline push configuration
+# Account file, place it in the config directory
+# JPush configuration, modify these after applying in JPush backend
push:
enable: getui
- geTui: #个推离线推送
+ geTui:
pushUrl: "https://restapi.getui.com/v2/$appId"
masterSecret: ""
appKey: ""
intent: ""
channelID: ""
channelName: ""
- fcm: #fcm离线推送
- serviceAccount: "x.json" #帐号文件,并放在 config目录下
- jpns: #极光推送 在极光后台申请后,修改以下四项
+ fcm:
+ serviceAccount: "x.json"
+ jpns:
appKey:
masterSecret:
pushUrl:
pushIntent:
+# App manager configuration
+#
+# Built-in app manager user IDs
+# Built-in app manager nicknames
manager:
- userID: [ "openIM123456","openIM654321","openIMAdmin" ] #内置的app管理员userID
- nickname: [ "system1","system2", "system3" ] #内置的app管理员nickname
+ 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
+multiLoginPolicy: 1
+# Whether to store messages in MySQL, messages in MySQL are only used for management background
+chatPersistenceMysql: true
+# Message cache timeout in seconds, it's not recommended to modify
+msgCacheTimeout: 86400
-multiLoginPolicy: 1 #多平台登录:Android、iOS、Windows、Mac、web 每种平台只能有一个在线
+# Whether to enable read receipts for group chat
+groupMessageHasReadReceiptEnable: true
+# Whether to enable read receipts for single chat
+singleMessageHasReadReceiptEnable: true
-chatPersistenceMysql: true #消息是否存入mysql,mysql中的消息仅用于管理后台使用
-msgCacheTimeout: 86400 #信消息缓存时间秒,不建议修改
-groupMessageHasReadReceiptEnable: true #群聊已读是否开启
-singleMessageHasReadReceiptEnable: true #单聊已读是否开启
+# MongoDB offline message retention period in days
+retainChatRecords: 365
-retainChatRecords: 365 #mongo保存离线消息时间(天)
-chatRecordsClearTime: "0 2 * * 3" #每周三凌晨2点清理mongo中的过期(超过retainChatRecords时间)消息,这个删除是为了清理满足上个配置retainChatRecords的过期消息,不会发送通知,仅仅作为清理磁盘使用
-msgDestructTime: "0 2 * * *" #消息自动删除时间,每天凌晨2点删除过期消息,这个删除是为了删除保留时间超过超过会话字段msg_destruct_time(秒)的消息。
+# Schedule to clear expired messages(older than retainChatRecords days) in MongoDB every Wednesday at 2am
+# This deletion is just for cleaning up disk usage according to previous configuration retainChatRecords, no notification will be sent
+chatRecordsClearTime: "0 2 * * 3"
+# Schedule to auto delete messages every day at 2am
+# This deletion is for messages that have been retained for more than msg_destruct_time (seconds) in the conversation field
+msgDestructTime: "0 2 * * *"
+
+# Secret key
secret: openIM123
+# Token policy
+#
+# Token expiration period in days
tokenPolicy:
- expire: 90 #过期时间(天)
+ expire: 90
+# Message verification policy
+#
+# Whether to verify friendship when sending messages
messageVerify:
- friendVerify: false #发送消息时是否验证好友关系
+ friendVerify: false
-#ios系统推送声音以及标记计数
+# iOS push notification configuration
+#
+# iOS push notification sound
+# Whether to count badge
+# Whether it's production environment
iosPush:
pushSound: "xxx"
badgeCount: true
production: false
+# Callback configuration
+#
+# Callback URL
+# Whether to enable this callback event
+# Timeout in seconds
+# Whether to continue execution if callback fails
callback:
- # 回调callback
url:
beforeSendSingleMsg:
- enable: false #是否启用此回调事件
- timeout: 5 #超时时间(秒)
- failedContinue: true #如回调失败是否继续往后执行
+ enable: false
+ timeout: 5
+ failedContinue: true
afterSendSingleMsg:
enable: false
timeout: 5
@@ -244,8 +355,11 @@ callback:
timeout: 5
failedContinue: true
-
-prometheus: #prometheus每个服务的端口数量需要和rpcPort保持对应
+###################### Prometheus ######################
+# 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:
enable: false
userPrometheusPort: [ 20110 ]
friendPrometheusPort: [ 20120 ]
@@ -257,4 +371,4 @@ prometheus: #prometheus每个服务的端口数量需要和rpcPort保持对应
conversationPrometheusPort: [ 20230 ]
rtcPrometheusPort: [ 21300 ]
thirdPrometheusPort: [ 21301 ]
- messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] #端口数量需要和script/path_info.sh中的msg_transfer_service_num保持一致
\ No newline at end of file
+ messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ]
\ No newline at end of file
diff --git a/install.sh b/install.sh
index 0c3a3945e..f9b9b7ec4 100755
--- a/install.sh
+++ b/install.sh
@@ -308,9 +308,9 @@ function cmd_help() {
color_echo ${BLUE_PREFIX} "-cn, --china ${CYAN_PREFIX}set to use the Chinese domestic proxy${COLOR_SUFFIX}"
color_echo ${BLUE_PREFIX} "-t, --tag ${CYAN_PREFIX}specify the tag (default option, set to latest if not specified)${COLOR_SUFFIX}"
color_echo ${BLUE_PREFIX} "-r, --release ${CYAN_PREFIX}specify the release branch (cannot be used with the tag option)${COLOR_SUFFIX}"
- color_echo ${BLUE_PREFIX} "-g, --go-version ${CYAN_PREFIX}set the Go language version (default: GO_VERSION=\"1.18\")${COLOR_SUFFIX}"
- color_echo ${BLUE_PREFIX} "-i, --install-dir ${CYAN_PREFIX}set the OpenIM installation directory (default: /tmp)${COLOR_SUFFIX}"
color_echo ${BLUE_PREFIX} "-gt, --github-token ${CYAN_PREFIX}set the GITHUB_TOKEN (default: not set)${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "-g, --go-version ${CYAN_PREFIX}set the Go language version (default: GO_VERSION=\"1.18\")${COLOR_SUFFIX}"
+ color_echo ${BLUE_PREFIX} "--install-dir ${CYAN_PREFIX}set the OpenIM installation directory (default: /tmp)${COLOR_SUFFIX}"
color_echo ${BLUE_PREFIX} "--cpu ${CYAN_PREFIX}set the number of concurrent processes${COLOR_SUFFIX}"
echo
color_echo ${RED_PREFIX} "Note: Only one of the -t/--tag or -r/--release options can be used at a time.${COLOR_SUFFIX}"
@@ -380,7 +380,7 @@ function parseinput() {
shift
GO_VERSION=$1
;;
- -i|--install-dir)
+ --install-dir)
shift
INSTALL_DIR=$1
;;
@@ -435,7 +435,7 @@ print_progress() {
color_echo() {
COLOR=$1
shift
- echo -e "${COLOR}===> $* ${COLOR_SUFFIX}"
+ echo -e "${COLOR} $* ${COLOR_SUFFIX}"
}
# Color definitions
From 68e521d198a6292514766548c32aa6b416a9a4ea Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Thu, 27 Jul 2023 15:00:33 +0800
Subject: [PATCH 05/48] feat: config env optimize (#683)
* feat: config env optimize
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* docs: add readme docs
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
config/config.yaml | 2 +-
scripts/README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 70 insertions(+), 2 deletions(-)
diff --git a/config/config.yaml b/config/config.yaml
index 74c864fc3..6bf3cf06e 100644
--- a/config/config.yaml
+++ b/config/config.yaml
@@ -142,7 +142,7 @@ object:
endpoint: "https://oss-cn-chengdu.aliyuncs.com"
bucket: "demo-9999999"
bucketURL: "https://demo-9999999.oss-cn-chengdu.aliyuncs.com"
- accessKeyID: ""
+ accessKeyID: root
accessKeySecret: ""
sessionToken: ""
diff --git a/scripts/README.md b/scripts/README.md
index 04bda00ae..da21596d6 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -1,4 +1,72 @@
-# `/scripts`
+# OpenIM Scripts Directory Structure
+
+This document outlines the directory structure for scripts in the OpenIM Server project. These scripts play a critical role in various areas like building, deploying, running and managing the services of OpenIM.
+
+```bash
+scripts/
+├── LICENSE # License related files
+│ ├── LICENSE # The license file
+│ └── LICENSE_TEMPLATES # Template for license file
+├── README.md # Readme file for scripts directory
+├── advertise.sh # Script for advertisement services
+├── batch_start_all.sh # Script to start all services in batch
+├── build.cmd # Windows build command script
+├── build_all_service.sh # Script to build all services
+├── build_push_k8s_images.sh # Script to build and push images for Kubernetes
+├── check_all.sh # Script to check status of all services
+├── common.sh # Contains common functions used by other scripts
+├── coverage.awk # AWK script for coverage report generation
+├── coverage.sh # Script for generating coverage reports
+├── docker_check_service.sh # Docker specific service check script
+├── docker_start_all.sh # Script to start all services in a docker environment
+├── ensure_tag.sh # Script to ensure proper tagging of docker images
+├── enterprise # Scripts specific to enterprise version
+│ ├── check_all.sh # Check status of all enterprise services
+│ ├── function.sh # Functions specific to enterprise version
+│ └── path_info.cfg # Path information configuration for enterprise version
+├── env_check.sh # Script to check the environment
+├── function.sh # Contains functions used by other scripts
+├── githooks # Git hook scripts
+│ ├── commit-msg # Script to validate commit message
+│ ├── pre-commit # Script to run before each commit
+│ └── pre-push # Script to run before each push
+├── init_pwd.sh # Script to initialize password
+├── install_im_compose.sh # Script to install IM with Docker Compose
+├── install_im_server.sh # Script to install IM server
+├── lib # Library scripts
+│ ├── color.sh # Script for console color manipulation
+│ ├── golang.sh # Script for golang related utility functions
+│ ├── init.sh # Script for initialization tasks
+│ ├── logging.sh # Script for logging related utility functions
+│ ├── release.sh # Script for release related utility functions
+│ ├── util.sh # Script for generic utility functions
+│ └── version.sh # Script for versioning related tasks
+├── make-rules # Makefile rules
+│ ├── common.mk # Common Make rules
+│ ├── copyright.mk # Copyright related Make rules
+│ ├── dependencies.mk # Dependencies related Make rules
+│ ├── gen.mk # Make rules for code generation
+│ ├── golang.mk # Golang specific Make rules
+│ ├── image.mk # Make rules for image building
+│ ├── release.mk # Make rules for release process
+│ ├── swagger.mk # Make rules for swagger documentation
+│ └── tools.mk # Make rules for tools and utilities
+├── mongo-init.sh # Script to initialize MongoDB
+├── msg_gateway_start.sh # Script to start message gateway service
+├── msg_transfer_start.sh # Script to start message transfer service
+├── path_info.sh # Script containing path information
+├── push_start.sh # Script to start push service
+├── release.sh # Script to perform release process
+├── start_all.sh # Script to start all services
+├── start_cron.sh # Script to start cron jobs
+├── start_rpc_service.sh # Script to start RPC service
+├── stop_all.sh # Script to stop all services
+└── style_info.sh # Script containing style related information
+```
+
+The purpose of having a structured scripts directory like this is to make the operations of OpenIM Server clear and easy to manage. Each script has its own responsibility, making it easier to maintain and update. It's also helpful for newcomers who can easily understand what each part of the system is doing by just looking at this directory structure.
+
+Each directory and script in the structure should be understood as a part of a larger whole. All scripts work together to ensure the smooth operation and maintenance of the OpenIM Server.
## Supported platforms
From df710495333b6ce8e6783a551bccba4273269c09 Mon Sep 17 00:00:00 2001
From: WangchuXiao
Date: Thu, 27 Jul 2023 15:04:50 +0800
Subject: [PATCH 06/48] fix bug: delete friend and repeat add friend not effect
(#682)
* new feature: add batch send msg
* new feature: add batch send msg
* new feature: add batch send msg
* new feature: add batch send msg
* new feature: add batch send msg
* new feature: add batch send msg
* fix bug: multiple gateway kick user
* fix bug: multiple gateway kick user
* fix bug: multiple gateway kick user
* fix bug: multiple gateway kick user
* fix bug: multiple gateway kick user
* MsgDestructTime
* fix bug: msg destruct sql
* fix bug: msg destruct
* fix bug: msg destruct
* fix bug: msg destruct sql
* fix bug: msg destruct sql
* fix bug: msg destruct sql
* fix bug: msg destruct sql
* debug: print stack
* debug: print stack
* debug: print stack
* fix bug: msg destruct sql
Signed-off-by: wangchuxiao
* fix bug: msg notification self 2 self push twice
* fix bug: heartbeat get self notification
* fix bug: init grpc conn in one process
* fix bug: grpc conn
Signed-off-by: wangchuxiao
* fix bug: zk client recreate node when reconn
* fix bug: set friend mark args error
* fix bug: rpc client intercepter called twice
Signed-off-by: wangchuxiao
* cicd: robot automated Change
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* test: document msg num set 100
* new feat: sync designated model
* new feat: sync designated model
* new feat: sync designated model
* new feat: sync designated model
* new feat: sync designated model
* new feat: sync designated model
* new feat: sync designated model
* merge code
* merge code
* fix bug: repeat add friend not effect
---------
Signed-off-by: wangchuxiao
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: wangchuxiao-dev
---
pkg/common/db/controller/friend.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pkg/common/db/controller/friend.go b/pkg/common/db/controller/friend.go
index cab838bb4..0f9315c20 100644
--- a/pkg/common/db/controller/friend.go
+++ b/pkg/common/db/controller/friend.go
@@ -24,6 +24,7 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
"github.com/OpenIMSDK/protocol/constant"
"github.com/OpenIMSDK/tools/errs"
+ "github.com/OpenIMSDK/tools/log"
"github.com/OpenIMSDK/tools/mcontext"
"github.com/OpenIMSDK/tools/tx"
"github.com/OpenIMSDK/tools/utils"
@@ -222,6 +223,7 @@ func (f *friendDatabase) AgreeFriendRequest(
friendRequest *relation.FriendRequestModel,
) (err error) {
return f.tx.Transaction(func(tx any) error {
+ defer log.ZDebug(ctx, "return line")
now := time.Now()
fr, err := f.friendRequest.NewTx(tx).Take(ctx, friendRequest.FromUserID, friendRequest.ToUserID)
if err != nil {
@@ -247,7 +249,7 @@ func (f *friendDatabase) AgreeFriendRequest(
if err != nil {
return err
}
- } else if errs.Unwrap(err) != gorm.ErrRecordNotFound {
+ } else if err != nil && errs.Unwrap(err) != gorm.ErrRecordNotFound {
return err
}
From 0b9ac4bd873049ab6cbe73b66dfdef137a13c7f4 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Thu, 27 Jul 2023 16:44:02 +0800
Subject: [PATCH 07/48] Feat/develop test (#687)
* docs: add readme docs
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* Update config.yaml
* Update config.yaml
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
.github/workflows/build-docker-image.yml | 38 +++++--
.github/workflows/deploy.yml | 86 ++++++++--------
.goreleaser.yaml | 120 +++++++++++------------
config/config.yaml | 6 +-
4 files changed, 139 insertions(+), 111 deletions(-)
diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml
index ff58d8d8f..ef2659724 100644
--- a/.github/workflows/build-docker-image.yml
+++ b/.github/workflows/build-docker-image.yml
@@ -29,30 +29,31 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
+# docker.io/openim/openim-server:latest
- name: Log in to Docker Hub
- uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
+ uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
- uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
+ uses: docker/metadata-action@v4.6.0
with:
images: openim/openim-server
tags: latest
- name: Build and push Docker image
- uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
+ uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
-
+# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
- name: Log in to AliYun Docker Hub
- uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
+ uses: docker/login-action@v2
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALIREGISTRY_USERNAME }}
@@ -60,19 +61,42 @@ jobs:
- name: Extract metadata (tags, labels) for Docker
id: meta2
- uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
+ uses: docker/metadata-action@v4.6.0
with:
images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server
tags: latest
- name: Build and push Docker image
- uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
+ uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta2.outputs.tags }}
labels: ${{ steps.meta2.outputs.labels }}
+# ghcr.io/openim/openim-server:latest
+ - name: Log in to GitHub Container Registry
+ uses: docker/login-action@v2
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Extract metadata (tags, labels) for Docker
+ id: meta3
+ uses: docker/metadata-action@v4.6.0
+ with:
+ images: openim/openim-server
+ tags: latest
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v4
+ with:
+ context: .
+ push: true
+ tags: ${{ steps.meta3.outputs.tags }}
+ labels: ${{ steps.meta3.outputs.labels }}
+
# name: OpenIM Build Docker Images
# on:
# push:
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index ef50743a1..2d7798916 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -12,48 +12,52 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-name: deploy for dev
+name: OpenIM Deploy for dev
on:
- push:
- branches:
- - 'devops' # Only for the dev branch
- paths:
- - '.github/workflows/*'
- # - '__test__/**' # dev No immediate testing is required
- - 'src/**'
- - 'Dockerfile'
- - 'docker-compose.yml'
- - 'bin/*'
+ push:
+ branches:
+ - 'devops' # Only for the dev branch
+ paths:
+ - '.github/workflows/*'
+ # - '__test__/**' # dev No immediate testing is required
+ - 'src/**'
+ - 'Dockerfile'
+ - 'docker-compose.yml'
+ - 'bin/*'
-jobs:
- deploy-dev:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- - name: set ssh key # Temporarily set up ssh key
- run: |
- mkdir -p ~/.ssh/
- # secrets.WFP_ID_RSA set in GitHub
- echo "${{secrets.WFP_ID_RSA}}" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan "182.92.xxx.xxx" >> ~/.ssh/known_hosts
- - name: deploy # Deployment
- run: |
- ssh work@182.92.xxx.xxx "
- # 【Attention】Log in with the 'work' account, manually create /home/work/imooc-lego directory
- # Then git clone https://username:password@github.com/imooc-lego/biz-editor-server.git -b dev (private repository, use GitHub username and password)
- # Remember to delete origin to avoid exposing GitHub password
+env:
+ SERVER_PRIVATE_KEY: ${{ secrets.SERVER_PRIVATE_KEY }} # server private key
+ SERVER_HOST: ${{ secrets.SERVER_HOST }} # server ip address
+ USER_NAME: ${{ secrets.USER_NAME }} # server username
+ cache-name: note
- cd /home/work/imooc-lego/biz-editor-server;
- git remote add origin https://openimbot:${{secrets.WFP_PASSWORD}}@github.com/OpenIMSDK/open-im-server.git;
- git checkout dev;
- git pull origin dev; # Download the latest code again
- git remote remove origin; # Remove origin to avoid exposing GitHub password
- # Start docker
- docker-compose build editor-server; # Same as the service name in docker-compose.yml
- docker-compose up -d;
- "
- - name: delete ssh key # Delete ssh key
- run: rm -rf ~/.ssh/id_rsa
+jobs:
+ deploy-dev:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: set ssh key # Temporarily set up ssh key
+ run: |
+ mkdir -p ~/.ssh/
+ # secrets.WFP_ID_RSA set in GitHub
+ echo "${{secrets.WFP_ID_RSA}}" > ~/.ssh/id_rsa
+ chmod 600 ~/.ssh/id_rsa
+ ssh-keyscan "182.92.xxx.xxx" >> ~/.ssh/known_hosts
+ - name: deploy # Deployment
+ run: |
+ ssh work@182.92.xxx.xxx "
+ # 【Attention】Log in with the 'work' account, manually create /home/work/imooc-lego directory
+ # Then git clone https://username:password@github.com/imooc-lego/biz-editor-server.git -b dev (private repository, use GitHub username and password)
+ # Remember to delete origin to avoid exposing GitHub password
+ cd /home/work/imooc-lego/biz-editor-server;
+ git remote add origin https://openimbot:${{secrets.WFP_PASSWORD}}@github.com/OpenIMSDK/open-im-server.git;
+ git checkout dev;
+ git pull origin dev; # Download the latest code again
+ git remote remove origin; # Remove origin to avoid exposing GitHub password
+ # Start docker
+ docker-compose build editor-server; # Same as the service name in docker-compose.yml
+ docker-compose up -d;
+ "
+ - name: delete ssh key # Delete ssh key
+ run: rm -rf ~/.ssh/id_rsa
\ No newline at end of file
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index 996a53745..e9eb44c94 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -335,66 +335,66 @@ changelog:
- title: Other work
order: 9999
-dockers:
- - image_templates:
- - "openimsdk/open-im-server:{{ .Tag }}-amd64"
- - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
- dockerfile: Dockerfile
- use: buildx
- build_flag_templates:
- - "--pull"
- - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md"
- - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png"
- - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]'
- - "--label=io.artifacthub.package.license=Apace-2.0"
- - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system"
- - "--label=org.opencontainers.image.created={{.Date}}"
- - "--label=org.opencontainers.image.name={{.ProjectName}}"
- - "--label=org.opencontainers.image.revision={{.FullCommit}}"
- - "--label=org.opencontainers.image.version={{.Version}}"
- - "--label=org.opencontainers.image.source={{.GitURL}}"
- - "--platform=linux/amd64"
- extra_files:
- - scripts/entrypoint.sh
- - image_templates:
- - "goreleaser/goreleaser:{{ .Tag }}-arm64"
- - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
- dockerfile: Dockerfile
- use: buildx
- build_flag_templates:
- - "--pull"
- - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md"
- - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png"
- - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]'
- - "--label=io.artifacthub.package.license=Apace-2.0"
- - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system"
- - "--label=org.opencontainers.image.created={{.Date}}"
- - "--label=org.opencontainers.image.name={{.ProjectName}}"
- - "--label=org.opencontainers.image.revision={{.FullCommit}}"
- - "--label=org.opencontainers.image.version={{.Version}}"
- - "--label=org.opencontainers.image.source={{.GitURL}}"
- - "--platform=linux/arm64"
- goarch: arm64
- extra_files:
- - scripts/entrypoint.sh
-
-docker_manifests:
- - name_template: "goreleaser/goreleaser:{{ .Tag }}"
- image_templates:
- - "goreleaser/goreleaser:{{ .Tag }}-amd64"
- - "goreleaser/goreleaser:{{ .Tag }}-arm64"
- - name_template: "ghcr.io/goreleaser/goreleaser:{{ .Tag }}"
- image_templates:
- - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
- - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
- - name_template: "goreleaser/goreleaser:latest"
- image_templates:
- - "goreleaser/goreleaser:{{ .Tag }}-amd64"
- - "goreleaser/goreleaser:{{ .Tag }}-arm64"
- - name_template: "ghcr.io/goreleaser/goreleaser:latest"
- image_templates:
- - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
- - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
+# dockers:
+# - image_templates:
+# - "openimsdk/open-im-server:{{ .Tag }}-amd64"
+# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
+# dockerfile: Dockerfile
+# use: buildx
+# build_flag_templates:
+# - "--pull"
+# - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md"
+# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png"
+# - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]'
+# - "--label=io.artifacthub.package.license=Apace-2.0"
+# - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system"
+# - "--label=org.opencontainers.image.created={{.Date}}"
+# - "--label=org.opencontainers.image.name={{.ProjectName}}"
+# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
+# - "--label=org.opencontainers.image.version={{.Version}}"
+# - "--label=org.opencontainers.image.source={{.GitURL}}"
+# - "--platform=linux/amd64"
+# extra_files:
+# - scripts/entrypoint.sh
+# - image_templates:
+# - "goreleaser/goreleaser:{{ .Tag }}-arm64"
+# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
+# dockerfile: Dockerfile
+# use: buildx
+# build_flag_templates:
+# - "--pull"
+# - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md"
+# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png"
+# - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]'
+# - "--label=io.artifacthub.package.license=Apace-2.0"
+# - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system"
+# - "--label=org.opencontainers.image.created={{.Date}}"
+# - "--label=org.opencontainers.image.name={{.ProjectName}}"
+# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
+# - "--label=org.opencontainers.image.version={{.Version}}"
+# - "--label=org.opencontainers.image.source={{.GitURL}}"
+# - "--platform=linux/arm64"
+# goarch: arm64
+# extra_files:
+# - scripts/entrypoint.sh
+
+# docker_manifests:
+# - name_template: "goreleaser/goreleaser:{{ .Tag }}"
+# image_templates:
+# - "goreleaser/goreleaser:{{ .Tag }}-amd64"
+# - "goreleaser/goreleaser:{{ .Tag }}-arm64"
+# - name_template: "ghcr.io/goreleaser/goreleaser:{{ .Tag }}"
+# image_templates:
+# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
+# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
+# - name_template: "goreleaser/goreleaser:latest"
+# image_templates:
+# - "goreleaser/goreleaser:{{ .Tag }}-amd64"
+# - "goreleaser/goreleaser:{{ .Tag }}-arm64"
+# - name_template: "ghcr.io/goreleaser/goreleaser:latest"
+# image_templates:
+# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
+# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
nfpms:
- id: packages
diff --git a/config/config.yaml b/config/config.yaml
index 6bf3cf06e..348aa2e93 100644
--- a/config/config.yaml
+++ b/config/config.yaml
@@ -126,10 +126,10 @@ api:
# Configuration for Aliyun OSS
object:
enable: "minio"
- apiURL: "http://127.0.0.1:10002/object/"
+ apiURL: http://127.0.0.1:10002/object/
minio:
bucket: "openim"
- endpoint: http://127.0.0.1:10005
+ endpoint: http://127.0.0.1:10005
accessKeyID: root
secretAccessKey: openIM123
sessionToken: ""
@@ -371,4 +371,4 @@ prometheus:
conversationPrometheusPort: [ 20230 ]
rtcPrometheusPort: [ 21300 ]
thirdPrometheusPort: [ 21301 ]
- messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ]
\ No newline at end of file
+ messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ]
From 4d816978ec8f03eb7d6652599ebd5a72d35ed06e Mon Sep 17 00:00:00 2001
From: pluto <83957921+plutoyty@users.noreply.github.com>
Date: Thu, 27 Jul 2023 19:46:44 +0800
Subject: [PATCH 08/48] Resolving code conflicts after project directory
changes and Add user subscription to the operation from rpc to db layer
(#684)
* Resolving code conflicts after project directory changes and Add subscribe and unsubscribe mongodb operations
* Organize and update module dependencies
---
go.mod | 2 +-
go.sum | 4 +-
internal/api/route.go | 3 +
internal/api/user.go | 18 +++-
internal/rpc/user/user.go | 33 +++++-
internal/tools/msg.go | 2 +
pkg/common/db/controller/user.go | 89 +++++++++++-----
pkg/common/db/table/unrelation/user.go | 42 ++++++++
pkg/common/db/unrelation/user.go | 141 +++++++++++++++++++++++++
9 files changed, 295 insertions(+), 39 deletions(-)
create mode 100644 pkg/common/db/table/unrelation/user.go
create mode 100644 pkg/common/db/unrelation/user.go
diff --git a/go.mod b/go.mod
index e4bc8edc6..c18eabd08 100644
--- a/go.mod
+++ b/go.mod
@@ -37,7 +37,7 @@ require (
require github.com/google/uuid v1.3.0
require (
- github.com/OpenIMSDK/protocol v0.0.1
+ github.com/OpenIMSDK/protocol v0.0.2
github.com/OpenIMSDK/tools v0.0.5
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
github.com/go-redis/redis v6.15.9+incompatible
diff --git a/go.sum b/go.sum
index 0089e1924..a93a1687a 100644
--- a/go.sum
+++ b/go.sum
@@ -16,8 +16,8 @@ cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5og
firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4=
firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/OpenIMSDK/protocol v0.0.1 h1:Q6J1jCU00dfqmguxw2XI+IGcVfBAkb5Tz8LgvyeNkk0=
-github.com/OpenIMSDK/protocol v0.0.1/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
+github.com/OpenIMSDK/protocol v0.0.2 h1:O53/WiqLCHF9aWPLI32GPF82hn7suM8PkhrtL89Klrw=
+github.com/OpenIMSDK/protocol v0.0.2/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
github.com/OpenIMSDK/tools v0.0.5 h1:yBVHJ3EpIDcp8VFKPjuGr6MQvFa3t4JByZ+vmeC06/Q=
github.com/OpenIMSDK/tools v0.0.5/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
diff --git a/internal/api/route.go b/internal/api/route.go
index 4a4f92cc0..0f46f0f0c 100644
--- a/internal/api/route.go
+++ b/internal/api/route.go
@@ -79,6 +79,9 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
userRouterGroup.POST("/get_users", ParseToken, u.GetUsers)
userRouterGroup.POST("/get_users_online_status", ParseToken, u.GetUsersOnlineStatus)
userRouterGroup.POST("/get_users_online_token_detail", ParseToken, u.GetUsersOnlineTokenDetail)
+ userRouterGroup.POST("/subscribe_users_status", ParseToken, u.UnSubscriberStatus)
+ userRouterGroup.POST("/unsubscribe_users_status", ParseToken, u.UnSubscriberStatus)
+
}
// friend routing group
friendRouterGroup := r.Group("/friend", ParseToken)
diff --git a/internal/api/user.go b/internal/api/user.go
index 8595b3501..108ccac69 100644
--- a/internal/api/user.go
+++ b/internal/api/user.go
@@ -62,6 +62,7 @@ func (u *UserApi) GetUsers(c *gin.Context) {
a2r.Call(user.UserClient.GetPaginationUsers, u.Client, c)
}
+// GetUsersOnlineStatus Get user online status.
func (u *UserApi) GetUsersOnlineStatus(c *gin.Context) {
var req msggateway.GetUsersOnlineStatusReq
if err := c.BindJSON(&req); err != nil {
@@ -95,13 +96,13 @@ func (u *UserApi) GetUsersOnlineStatus(c *gin.Context) {
wsResult = append(wsResult, reply.SuccessResult...)
}
}
- // 遍历 api 请求体中的 userIDs
+ // Traversing the userIDs in the api request body
for _, v1 := range req.UserIDs {
flag = false
res := new(msggateway.GetUsersOnlineStatusResp_SuccessResult)
- // 遍历从各个网关中获取的在线结果
+ // Iterate through the online results fetched from various gateways
for _, v2 := range wsResult {
- // 如果匹配上说明在线,反之
+ // If matches the above description on the line, and vice versa
if v2.UserID == v1 {
flag = true
res.UserID = v1
@@ -123,6 +124,7 @@ func (u *UserApi) UserRegisterCount(c *gin.Context) {
a2r.Call(user.UserClient.UserRegisterCount, u.Client, c)
}
+// GetUsersOnlineTokenDetail Get user online token details.
func (u *UserApi) GetUsersOnlineTokenDetail(c *gin.Context) {
var wsResult []*msggateway.GetUsersOnlineStatusResp_SuccessResult
var respResult []*msggateway.SingleDetail
@@ -182,3 +184,13 @@ func (u *UserApi) GetUsersOnlineTokenDetail(c *gin.Context) {
apiresp.GinSuccess(c, respResult)
}
+
+// SubscriberStatus Presence status of subscribed users.
+func (u *UserApi) SubscriberStatus(c *gin.Context) {
+ a2r.Call(user.UserClient.SubscribeOrCancelUsersStatus, u.Client, c)
+}
+
+// UnSubscriberStatus Unsubscribe a user's presence.
+func (u *UserApi) UnSubscriberStatus(c *gin.Context) {
+ a2r.Call(user.UserClient.SubscribeOrCancelUsersStatus, u.Client, c)
+}
diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go
index fb6518a7e..576492566 100644
--- a/internal/rpc/user/user.go
+++ b/internal/rpc/user/user.go
@@ -17,12 +17,11 @@ package user
import (
"context"
"errors"
- "strings"
- "time"
-
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
-
+ "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
"github.com/OpenIMSDK/tools/log"
+ "strings"
+ "time"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
@@ -60,6 +59,10 @@ func Start(client registry.SvcDiscoveryRegistry, server *grpc.Server) error {
if err != nil {
return err
}
+ mongo, err := unrelation.NewMongo()
+ if err != nil {
+ return err
+ }
if err := db.AutoMigrate(&tablerelation.UserModel{}); err != nil {
return err
}
@@ -72,7 +75,8 @@ func Start(client registry.SvcDiscoveryRegistry, server *grpc.Server) error {
}
userDB := relation.NewUserGorm(db)
cache := cache.NewUserCacheRedis(rdb, userDB, cache.GetDefaultOpt())
- database := controller.NewUserDatabase(userDB, cache, tx.NewGorm(db))
+ userMongoDB := unrelation.NewUserMongoDriver(mongo.GetDatabase())
+ database := controller.NewUserDatabase(userDB, cache, tx.NewGorm(db), userMongoDB)
friendRpcClient := rpcclient.NewFriendRpcClient(client)
msgRpcClient := rpcclient.NewMessageRpcClient(client)
u := &userServer{
@@ -235,6 +239,7 @@ func (s *userServer) GetGlobalRecvMessageOpt(ctx context.Context, req *pbuser.Ge
return &pbuser.GetGlobalRecvMessageOptResp{GlobalRecvMsgOpt: user[0].GlobalRecvMsgOpt}, nil
}
+// GetAllUserID Get user account by page.
func (s *userServer) GetAllUserID(ctx context.Context, req *pbuser.GetAllUserIDReq) (resp *pbuser.GetAllUserIDResp, err error) {
userIDs, err := s.UserDatabase.GetAllUserID(ctx, req.Pagination.PageNumber, req.Pagination.ShowNumber)
if err != nil {
@@ -243,6 +248,24 @@ func (s *userServer) GetAllUserID(ctx context.Context, req *pbuser.GetAllUserIDR
return &pbuser.GetAllUserIDResp{UserIDs: userIDs}, nil
}
+// SubscribeOrCancelUsersStatus Subscribe online or cancel online users.
func (s *userServer) SubscribeOrCancelUsersStatus(ctx context.Context, req *pbuser.SubscribeOrCancelUsersStatusReq) (resp *pbuser.SubscribeOrCancelUsersStatusResp, err error) {
+ err = s.UserDatabase.SubscribeOrCancelUsersStatus(ctx, req.UserID, req.UserIDs, req.Genre)
+ if err != nil {
+ return nil, err
+ }
+ //var status map[string][]string
+ //TODO 获取用户在线列表,返回订阅的用户的在线列表
+
+ return &pbuser.SubscribeOrCancelUsersStatusResp{}, nil
+}
+
+func (s *userServer) GetUserStatus(ctx context.Context, req *pbuser.GetUserStatusReq) (resp *pbuser.GetUserStatusResp, err error) {
+ //TODO implement me
+ panic("implement me")
+}
+
+func (s *userServer) SetUserStatus(ctx context.Context, req *pbuser.SetUserStatusReq) (resp *pbuser.SetUserStatusResp, err error) {
+ //TODO implement me
panic("implement me")
}
diff --git a/internal/tools/msg.go b/internal/tools/msg.go
index 972877516..d13f4597a 100644
--- a/internal/tools/msg.go
+++ b/internal/tools/msg.go
@@ -82,10 +82,12 @@ func InitMsgTool() (*MsgTool, error) {
discov.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials()))
userDB := relation.NewUserGorm(db)
msgDatabase := controller.InitCommonMsgDatabase(rdb, mongo.GetDatabase())
+ userMongoDB := unrelation.NewUserMongoDriver(mongo.GetDatabase())
userDatabase := controller.NewUserDatabase(
userDB,
cache.NewUserCacheRedis(rdb, relation.NewUserGorm(db), cache.GetDefaultOpt()),
tx.NewGorm(db),
+ userMongoDB,
)
groupDatabase := controller.InitGroupDatabase(db, rdb, mongo.GetDatabase())
conversationDatabase := controller.NewConversationDatabase(
diff --git a/pkg/common/db/controller/user.go b/pkg/common/db/controller/user.go
index 4f9383b09..83942ce22 100644
--- a/pkg/common/db/controller/user.go
+++ b/pkg/common/db/controller/user.go
@@ -16,6 +16,8 @@ package controller
import (
"context"
+ unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
+ "github.com/OpenIMSDK/protocol/constant"
"time"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
@@ -26,38 +28,45 @@ import (
)
type UserDatabase interface {
- // 获取指定用户的信息 如有userID未找到 也返回错误
+ // FindWithError Get the information of the specified user. If the userID is not found, it will also return an error
FindWithError(ctx context.Context, userIDs []string) (users []*relation.UserModel, err error)
- // 获取指定用户的信息 如有userID未找到 不返回错误
+ // Find Get the information of the specified user If the userID is not found, no error will be returned
Find(ctx context.Context, userIDs []string) (users []*relation.UserModel, err error)
- // 插入多条 外部保证userID 不重复 且在db中不存在
+ // Create Insert multiple external guarantees that the userID is not repeated and does not exist in the db
Create(ctx context.Context, users []*relation.UserModel) (err error)
- // 更新(非零值) 外部保证userID存在
+ // Update update (non-zero value) external guarantee userID exists
Update(ctx context.Context, user *relation.UserModel) (err error)
- // 更新(零值) 外部保证userID存在
+ // UpdateByMap update (zero value) external guarantee userID exists
UpdateByMap(ctx context.Context, userID string, args map[string]interface{}) (err error)
- // 如果没找到,不返回错误
+ // Page If not found, no error is returned
Page(ctx context.Context, pageNumber, showNumber int32) (users []*relation.UserModel, count int64, err error)
- // 只要有一个存在就为true
+ // IsExist true as long as one exists
IsExist(ctx context.Context, userIDs []string) (exist bool, err error)
- // 获取所有用户ID
+ // GetAllUserID Get all user IDs
GetAllUserID(ctx context.Context, pageNumber, showNumber int32) ([]string, error)
- // 函数内部先查询db中是否存在,存在则什么都不做;不存在则插入
+ // InitOnce Inside the function, first query whether it exists in the db, if it exists, do nothing; if it does not exist, insert it
InitOnce(ctx context.Context, users []*relation.UserModel) (err error)
- // 获取用户总数
+ // CountTotal Get the total number of users
CountTotal(ctx context.Context, before *time.Time) (int64, error)
- // 获取范围内用户增量
+ // CountRangeEverydayTotal Get the user increment in the range
CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error)
+ //SubscribeOrCancelUsersStatus Subscribe or unsubscribe a user's presence status
+ SubscribeOrCancelUsersStatus(ctx context.Context, userID string, userIDs []string, genre int32) error
+ // GetAllSubscribeList Get a list of all subscriptions
+ GetAllSubscribeList(ctx context.Context, userID string) ([]string, error)
+ // GetSubscribedList Get all subscribed lists
+ GetSubscribedList(ctx context.Context, userID string) ([]string, error)
}
type userDatabase struct {
- userDB relation.UserModelInterface
- cache cache.UserCache
- tx tx.Tx
+ userDB relation.UserModelInterface
+ cache cache.UserCache
+ tx tx.Tx
+ mongoDB unRelationTb.UserModelInterface
}
-func NewUserDatabase(userDB relation.UserModelInterface, cache cache.UserCache, tx tx.Tx) UserDatabase {
- return &userDatabase{userDB: userDB, cache: cache, tx: tx}
+func NewUserDatabase(userDB relation.UserModelInterface, cache cache.UserCache, tx tx.Tx, mongoDB unRelationTb.UserModelInterface) UserDatabase {
+ return &userDatabase{userDB: userDB, cache: cache, tx: tx, mongoDB: mongoDB}
}
func (u *userDatabase) InitOnce(ctx context.Context, users []*relation.UserModel) (err error) {
@@ -75,7 +84,7 @@ func (u *userDatabase) InitOnce(ctx context.Context, users []*relation.UserModel
return nil
}
-// 获取指定用户的信息 如有userID未找到 也返回错误.
+// FindWithError Get the information of the specified user and return an error if the userID is not found.
func (u *userDatabase) FindWithError(ctx context.Context, userIDs []string) (users []*relation.UserModel, err error) {
users, err = u.cache.GetUsersInfo(ctx, userIDs)
if err != nil {
@@ -87,13 +96,13 @@ func (u *userDatabase) FindWithError(ctx context.Context, userIDs []string) (use
return
}
-// 获取指定用户的信息 如有userID未找到 不返回错误.
+// Find Get the information of the specified user. If the userID is not found, no error will be returned.
func (u *userDatabase) Find(ctx context.Context, userIDs []string) (users []*relation.UserModel, err error) {
users, err = u.cache.GetUsersInfo(ctx, userIDs)
return
}
-// 插入多条 外部保证userID 不重复 且在db中不存在.
+// Create Insert multiple external guarantees that the userID is not repeated and does not exist in the db.
func (u *userDatabase) Create(ctx context.Context, users []*relation.UserModel) (err error) {
if err := u.tx.Transaction(func(tx any) error {
err = u.userDB.Create(ctx, users)
@@ -111,7 +120,7 @@ func (u *userDatabase) Create(ctx context.Context, users []*relation.UserModel)
return u.cache.DelUsersInfo(userIDs...).ExecDel(ctx)
}
-// 更新(非零值) 外部保证userID存在.
+// Update (non-zero value) externally guarantees that userID exists.
func (u *userDatabase) Update(ctx context.Context, user *relation.UserModel) (err error) {
if err := u.userDB.Update(ctx, user); err != nil {
return err
@@ -119,7 +128,7 @@ func (u *userDatabase) Update(ctx context.Context, user *relation.UserModel) (er
return u.cache.DelUsersInfo(user.UserID).ExecDel(ctx)
}
-// 更新(零值) 外部保证userID存在.
+// UpdateByMap update (zero value) externally guarantees that userID exists.
func (u *userDatabase) UpdateByMap(ctx context.Context, userID string, args map[string]interface{}) (err error) {
if err := u.userDB.UpdateByMap(ctx, userID, args); err != nil {
return err
@@ -127,7 +136,7 @@ func (u *userDatabase) UpdateByMap(ctx context.Context, userID string, args map[
return u.cache.DelUsersInfo(userID).ExecDel(ctx)
}
-// 获取,如果没找到,不返回错误.
+// Page Gets, returns no error if not found.
func (u *userDatabase) Page(
ctx context.Context,
pageNumber, showNumber int32,
@@ -135,7 +144,7 @@ func (u *userDatabase) Page(
return u.userDB.Page(ctx, pageNumber, showNumber)
}
-// userIDs是否存在 只要有一个存在就为true.
+// IsExist Does userIDs exist? As long as there is one, it will be true.
func (u *userDatabase) IsExist(ctx context.Context, userIDs []string) (exist bool, err error) {
users, err := u.userDB.Find(ctx, userIDs)
if err != nil {
@@ -147,18 +156,42 @@ func (u *userDatabase) IsExist(ctx context.Context, userIDs []string) (exist boo
return false, nil
}
+// GetAllUserID Get all user IDs
func (u *userDatabase) GetAllUserID(ctx context.Context, pageNumber, showNumber int32) (userIDs []string, err error) {
return u.userDB.GetAllUserID(ctx, pageNumber, showNumber)
}
+// CountTotal Get the total number of users
func (u *userDatabase) CountTotal(ctx context.Context, before *time.Time) (count int64, err error) {
return u.userDB.CountTotal(ctx, before)
}
-func (u *userDatabase) CountRangeEverydayTotal(
- ctx context.Context,
- start time.Time,
- end time.Time,
-) (map[string]int64, error) {
+// CountRangeEverydayTotal Get the user increment in the range
+func (u *userDatabase) CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) {
return u.userDB.CountRangeEverydayTotal(ctx, start, end)
}
+
+//SubscribeOrCancelUsersStatus Subscribe or unsubscribe a user's presence status
+func (u *userDatabase) SubscribeOrCancelUsersStatus(ctx context.Context, userID string, userIDs []string, genre int32) error {
+ var err error
+ if genre == constant.SubscriberUser {
+ err = u.mongoDB.AddSubscriptionList(ctx, userID, userIDs)
+ } else if genre == constant.Unsubscribe {
+ err = u.mongoDB.UnsubscriptionList(ctx, userID, userIDs)
+ }
+ return err
+}
+
+// GetAllSubscribeList Get a list of all subscriptions.
+func (u *userDatabase) GetAllSubscribeList(ctx context.Context, userID string) ([]string, error) {
+
+ //TODO 获取所有订阅
+ return nil, nil
+}
+
+// GetSubscribedList Get all subscribed lists
+func (u *userDatabase) GetSubscribedList(ctx context.Context, userID string) ([]string, error) {
+
+ //TODO 获取所有被订阅
+ return nil, nil
+}
diff --git a/pkg/common/db/table/unrelation/user.go b/pkg/common/db/table/unrelation/user.go
new file mode 100644
index 000000000..d264da467
--- /dev/null
+++ b/pkg/common/db/table/unrelation/user.go
@@ -0,0 +1,42 @@
+// 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.
+
+package unrelation
+
+import "context"
+
+// SubscribeUser collection constant.
+const (
+ SubscribeUser = "subscribe_user"
+)
+
+// UserModel collection structure.
+type UserModel struct {
+ UserID string `bson:"user_id" json:"userID"`
+ UserIDList []string `bson:"user_id_list" json:"userIDList"`
+}
+
+func (UserModel) TableName() string {
+ return SubscribeUser
+}
+
+// UserModelInterface Operation interface of user mongodb.
+type UserModelInterface interface {
+ // AddSubscriptionList Subscriber's handling of thresholds.
+ AddSubscriptionList(ctx context.Context, userID string, userIDList []string) error
+ // UnsubscriptionList Handling of unsubscribe.
+ UnsubscriptionList(ctx context.Context, userID string, userIDList []string) error
+ // RemoveSubscribedListFromUser Among the unsubscribed users, delete the user from the subscribed list.
+ RemoveSubscribedListFromUser(ctx context.Context, userID string, userIDList []string) error
+}
diff --git a/pkg/common/db/unrelation/user.go b/pkg/common/db/unrelation/user.go
new file mode 100644
index 000000000..feec8aa21
--- /dev/null
+++ b/pkg/common/db/unrelation/user.go
@@ -0,0 +1,141 @@
+// 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.
+
+package unrelation
+
+import (
+ "context"
+ "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
+ "github.com/OpenIMSDK/tools/utils"
+ "go.mongodb.org/mongo-driver/bson"
+ "go.mongodb.org/mongo-driver/mongo"
+ "go.mongodb.org/mongo-driver/mongo/options"
+ "log"
+)
+
+// prefixes and suffixes.
+const (
+ SubscriptionPrefix = "subscription_prefix"
+ SubscribedPrefix = "subscribed_prefix"
+)
+
+// MaximumSubscription Maximum number of subscriptions.
+const (
+ MaximumSubscription = 3000
+)
+
+func NewUserMongoDriver(database *mongo.Database) unrelation.UserModelInterface {
+ return &UserMongoDriver{
+ userCollection: database.Collection(unrelation.SubscribeUser),
+ }
+}
+
+type UserMongoDriver struct {
+ userCollection *mongo.Collection
+}
+
+// AddSubscriptionList Subscriber's handling of thresholds.
+func (u *UserMongoDriver) AddSubscriptionList(ctx context.Context, userID string, userIDList []string) error {
+ // Check the number of lists in the key.
+ filter := bson.M{SubscriptionPrefix + userID: bson.M{"$size": 1}}
+ result, err := u.userCollection.Find(context.Background(), filter)
+ if err != nil {
+ return err
+ }
+ var newUserIDList []string
+ for result.Next(context.Background()) {
+ err := result.Decode(&newUserIDList)
+ if err != nil {
+ log.Fatal(err)
+ }
+ }
+ // If the threshold is exceeded, pop out the previous MaximumSubscription - len(userIDList) and insert it.
+ if len(newUserIDList)+len(userIDList) > MaximumSubscription {
+ newUserIDList = newUserIDList[MaximumSubscription-len(userIDList):]
+ _, err := u.userCollection.UpdateOne(
+ ctx,
+ bson.M{"user_id": SubscriptionPrefix + userID},
+ bson.M{"$set": bson.M{"user_id_list": newUserIDList}},
+ )
+ if err != nil {
+ return err
+ }
+ //for i := 1; i <= MaximumSubscription-len(userIDList); i++ {
+ // _, err := u.userCollection.UpdateOne(
+ // ctx,
+ // bson.M{"user_id": SubscriptionPrefix + userID},
+ // bson.M{SubscriptionPrefix + userID: bson.M{"$pop": -1}},
+ // )
+ // if err != nil {
+ // return err
+ // }
+ //}
+ }
+ upsert := true
+ opts := &options.UpdateOptions{
+ Upsert: &upsert,
+ }
+ _, err = u.userCollection.UpdateOne(
+ ctx,
+ bson.M{"user_id": SubscriptionPrefix + userID},
+ bson.M{"$addToSet": bson.M{"user_id_list": bson.M{"$each": userIDList}}},
+ opts,
+ )
+ if err != nil {
+ return err
+ }
+ for _, user := range userIDList {
+ _, err = u.userCollection.UpdateOne(
+ ctx,
+ bson.M{"user_id": SubscribedPrefix + user},
+ bson.M{"$addToSet": bson.M{"user_id_list": userID}},
+ opts,
+ )
+ if err != nil {
+ return utils.Wrap(err, "transaction failed")
+ }
+ }
+ return nil
+}
+
+// UnsubscriptionList Handling of unsubscribe.
+func (u *UserMongoDriver) UnsubscriptionList(ctx context.Context, userID string, userIDList []string) error {
+ _, err := u.userCollection.UpdateOne(
+ ctx,
+ bson.M{"user_id": SubscriptionPrefix + userID},
+ bson.M{"$pull": bson.M{"user_id_list": bson.M{"$in": userIDList}}},
+ )
+ if err != nil {
+ return err
+ }
+ err = u.RemoveSubscribedListFromUser(ctx, userID, userIDList)
+ if err != nil {
+ return err
+ }
+ return nil
+}
+
+// RemoveSubscribedListFromUser Among the unsubscribed users, delete the user from the subscribed list.
+func (u *UserMongoDriver) RemoveSubscribedListFromUser(ctx context.Context, userID string, userIDList []string) error {
+ var newUserIDList []string
+ for _, value := range userIDList {
+ newUserIDList = append(newUserIDList, SubscribedPrefix+value)
+ }
+ _, err := u.userCollection.UpdateOne(
+ ctx,
+ bson.M{"user_id": bson.M{"$in": newUserIDList}},
+ bson.M{"$pull": bson.M{"user_id_list": userID}},
+ )
+ return utils.Wrap(err, "")
+}
From e7040d3b26b3e77a55ae5121614171eea3e81841 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Fri, 28 Jul 2023 14:37:39 +0800
Subject: [PATCH 11/48] docs: add readme docs (#691)
* docs: add readme docs
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix bug: reject group req bug
* feat: add go relase
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: config env command
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
Co-authored-by: wangchuxiao
---
.github/workflows/build-docker-image.yml | 88 ++++++++----------------
.github/workflows/deploy.yml | 72 ++++++++++---------
.goreleaser.yaml | 3 +
Dockerfile | 3 +-
docs/conversions/images.md | 69 +++++++++++++++++++
docs/conversions/version.md | 6 +-
internal/rpc/group/group.go | 11 +--
7 files changed, 153 insertions(+), 99 deletions(-)
create mode 100644 docs/conversions/images.md
diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml
index ef2659724..3dd64c930 100644
--- a/.github/workflows/build-docker-image.yml
+++ b/.github/workflows/build-docker-image.yml
@@ -18,6 +18,7 @@ on:
push:
branches:
- main
+ - release-*
tags:
- v*
workflow_dispatch:
@@ -29,29 +30,38 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3
-# docker.io/openim/openim-server:latest
- - name: Log in to Docker Hub
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
+ - name: Build OpenIM Server
+ run: |
+ sudo make build
+# docker.io/openim/openim-server:latest
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.6.0
with:
images: openim/openim-server
- tags: latest
+
+ - name: Log in to Docker Hub
+ uses: docker/login-action@v2
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
- push: true
+ push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
+ - name: Extract metadata (tags, labels) for Docker
+ id: meta2
+ uses: docker/metadata-action@v4.6.0
+ with:
+ images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server
+
- name: Log in to AliYun Docker Hub
uses: docker/login-action@v2
with:
@@ -59,22 +69,21 @@ jobs:
username: ${{ secrets.ALIREGISTRY_USERNAME }}
password: ${{ secrets.ALIREGISTRY_TOKEN }}
- - name: Extract metadata (tags, labels) for Docker
- id: meta2
- uses: docker/metadata-action@v4.6.0
- with:
- images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server
- tags: latest
-
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
- push: true
+ push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta2.outputs.tags }}
labels: ${{ steps.meta2.outputs.labels }}
-# ghcr.io/openim/openim-server:latest
+# ghcr.io/openimsdk/openim-server:latest
+ - name: Extract metadata (tags, labels) for Docker
+ id: meta3
+ uses: docker/metadata-action@v4.6.0
+ with:
+ images: ghcr.io/openimsdk/openim-server
+
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
@@ -82,53 +91,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- - name: Extract metadata (tags, labels) for Docker
- id: meta3
- uses: docker/metadata-action@v4.6.0
- with:
- images: openim/openim-server
- tags: latest
-
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
- push: true
+ push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta3.outputs.tags }}
labels: ${{ steps.meta3.outputs.labels }}
-
-# name: OpenIM Build Docker Images
-# on:
-# push:
-# tags:
-# - v*
-# jobs:
-# build:
-# runs-on: ubuntu-latest
-# strategy:
-# matrix:
-# bin:
-# - openim-server
-# steps:
-# - name: Checkout
-# uses: actions/checkout@v3
-# - name: Setup Docker Buildx
-# uses: docker/setup-buildx-action@v2
-# - name: Login to GitHub Container Registry
-# uses: docker/login-action@v2
-# with:
-# registry: ghcr.io
-# username: ${{ github.repository_owner }}
-# password: ${{ secrets.GITHUB_TOKEN }}
-# - name: Docker metadata
-# id: metadata
-# uses: docker/metadata-action@v4
-# with:
-# images: ghcr.io/${{ github.repository_owner }}/openim-${{ matrix.bin }}
-# - name: Build and release Docker images
-# uses: docker/build-push-action@v3
-# with:
-# platforms: linux/386,linux/amd64,linux/arm64/v8
-# target: ${{ matrix.bin }}
-# tags: ${{ steps.metadata.outputs.tags }}
-# push: true
\ No newline at end of file
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 2d7798916..ea28440e9 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -18,6 +18,7 @@ on:
push:
branches:
- 'devops' # Only for the dev branch
+ - 'main'
paths:
- '.github/workflows/*'
# - '__test__/**' # dev No immediate testing is required
@@ -26,38 +27,47 @@ on:
- 'docker-compose.yml'
- 'bin/*'
-env:
- SERVER_PRIVATE_KEY: ${{ secrets.SERVER_PRIVATE_KEY }} # server private key
- SERVER_HOST: ${{ secrets.SERVER_HOST }} # server ip address
- USER_NAME: ${{ secrets.USER_NAME }} # server username
- cache-name: note
-
jobs:
deploy-dev:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - name: set ssh key # Temporarily set up ssh key
- run: |
- mkdir -p ~/.ssh/
- # secrets.WFP_ID_RSA set in GitHub
- echo "${{secrets.WFP_ID_RSA}}" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan "182.92.xxx.xxx" >> ~/.ssh/known_hosts
- - name: deploy # Deployment
- run: |
- ssh work@182.92.xxx.xxx "
- # 【Attention】Log in with the 'work' account, manually create /home/work/imooc-lego directory
- # Then git clone https://username:password@github.com/imooc-lego/biz-editor-server.git -b dev (private repository, use GitHub username and password)
- # Remember to delete origin to avoid exposing GitHub password
- cd /home/work/imooc-lego/biz-editor-server;
- git remote add origin https://openimbot:${{secrets.WFP_PASSWORD}}@github.com/OpenIMSDK/open-im-server.git;
- git checkout dev;
- git pull origin dev; # Download the latest code again
- git remote remove origin; # Remove origin to avoid exposing GitHub password
- # Start docker
- docker-compose build editor-server; # Same as the service name in docker-compose.yml
- docker-compose up -d;
- "
- - name: delete ssh key # Delete ssh key
- run: rm -rf ~/.ssh/id_rsa
\ No newline at end of file
+ - uses: actions/checkout@v3
+ - name: executing remote ssh commands using password
+ uses: appleboy/ssh-action@v1.0.0
+ env:
+ OWNER: ${{ github.repository_owner }}
+ REPO: ${{ github.event.repository.name }}
+ with:
+ host: "${{ secrets.SG_M1_HOST }}, ${{ secrets.SG_N1_HOST }}, ${{ secrets.SG_N2_HOST}}"
+ username: ${{ secrets.SG_USERNAME }}
+ password: ${{ secrets.SG_PASSWORD }}
+ port: ${{ secrets.SG_PORT }}
+ envs: OWNER,REPO
+ script_stop: true
+ script: |
+ mkdir -p /test/openim
+ cd /test/openim
+ pwd;ls -al
+ echo "OWNER: $OWNER"
+ echo "REPO: $REPO"
+ git clone -b develop https://github.com/${OWNER}/${REPO}.git; cd ${REPO}
+ docker compose up -d
+
+
+ # - name: deploy # Deployment
+ # run: |
+ # ssh work@182.92.xxx.xxx "
+ # # 【Attention】Log in with the 'work' account, manually create /home/work/imooc-lego directory
+ # # Then git clone https://username:password@github.com/imooc-lego/biz-editor-server.git -b dev (private repository, use GitHub username and password)
+ # # Remember to delete origin to avoid exposing GitHub password
+ # cd /home/work/imooc-lego/biz-editor-server;
+ # git remote add origin https://openimbot:${{secrets.WFP_PASSWORD}}@github.com/OpenIMSDK/open-im-server.git;
+ # git checkout dev;
+ # git pull origin dev; # Download the latest code again
+ # git remote remove origin; # Remove origin to avoid exposing GitHub password
+ # # Start docker
+ # docker-compose build editor-server; # Same as the service name in docker-compose.yml
+ # docker-compose up -d;
+ # "
+ # - name: delete ssh key # Delete ssh key
+ # run: rm -rf ~/.ssh/id_rsa
\ No newline at end of file
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index e9eb44c94..fc7c0cd01 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -480,6 +480,9 @@ checksum:
release:
footer: |
+
+ ## Welcome to the {{ .Tag }} release of [chat](https://github.com/OpenIMSDK/chat)!🎉🎉!
+
**Full Changelog**: https://github.com/OpenIMSDK/Open-IM-Server/compare/{{ .PreviousTag }}...{{ .Tag }}
## Helping out
diff --git a/Dockerfile b/Dockerfile
index 33c4651c9..290aa02c6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -22,7 +22,8 @@ RUN /bin/sh -c "make build"
# Production Stage
FROM alpine
-RUN apk --no-cache add tzdata
+RUN apk --no-cache add tzdata; \
+ apt --no-cache add ca-certificates
# Set directory to map logs, config files, scripts, and SDK
VOLUME ["/Open-IM-Server/logs", "/Open-IM-Server/config", "/Open-IM-Server/scripts", "/Open-IM-Server/db/sdk"]
diff --git a/docs/conversions/images.md b/docs/conversions/images.md
new file mode 100644
index 000000000..ae85a5bab
--- /dev/null
+++ b/docs/conversions/images.md
@@ -0,0 +1,69 @@
+# OpenIM Image Management Strategy and Pulling Guide
+
+OpenIM is an efficient, stable, and scalable instant messaging framework that provides convenient deployment methods through Docker images. OpenIM manages multiple image sources, hosted respectively on GitHub (ghcr), Alibaba Cloud, and Docker Hub. This document is aimed at detailing the image management strategy of OpenIM and providing the steps for pulling these images.
+
+## Image Management Strategy
+
+OpenIM's versions correspond to GitHub's tag versions. Each time we release a new version and tag it on GitHub, an automated process is triggered that pushes the new Docker image version to the following three platforms:
+
+1. **GitHub (ghcr.io):** We use GitHub Container Registry (ghcr.io) to host OpenIM's Docker images. This allows us to better integrate with the GitHub source code repository, providing better version control and continuous integration/deployment (CI/CD) features. You can view all GitHub images [here](https://github.com/orgs/OpenIMSDK/packages).
+2. **Alibaba Cloud (registry.cn-hangzhou.aliyuncs.com):** For users in Mainland China, we also host OpenIM's Docker images on Alibaba Cloud to provide faster pull speeds. You can view all Alibaba Cloud images on this [page](https://cr.console.aliyun.com/cn-hangzhou/instances/repositories) of Alibaba Cloud Image Service (note that you need to log in to your Alibaba Cloud account first).
+3. **Docker Hub (docker.io):** Docker Hub is the most commonly used Docker image hosting platform, and we also host OpenIM's images there to facilitate developers worldwide. You can view all Docker Hub images on the [OpenIM's Docker Hub page](https://hub.docker.com/r/openim).
+
+## Methods and Steps for Pulling Images
+
+When pulling OpenIM's Docker images, you can choose the most suitable source based on your geographic location and network conditions. Here are the steps to pull OpenIM images from each source:
+
+1. First, make sure Docker is installed on your machine. If not, you can refer to the [Docker official documentation](https://docs.docker.com/get-docker/) for installation.
+
+2. Open the terminal and run the following commands to pull the images:
+
+ For OpenIM Server:
+
+ - Pull from GitHub:
+
+ ```
+ bashCopy code
+ docker pull ghcr.io/openimsdk/openim-server:latest
+ ```
+
+ - Pull from Alibaba Cloud:
+
+ ```
+ bashCopy code
+ docker pull registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
+ ```
+
+ - Pull from Docker Hub:
+
+ ```
+ bashCopy code
+ docker pull docker.io/openim/openim-server:latest
+ ```
+
+ For OpenIM Chat:
+
+ - Pull from GitHub:
+
+ ```
+ bashCopy code
+ docker pull ghcr.io/openimsdk/openim-chat:latest
+ ```
+
+ - Pull from Alibaba Cloud:
+
+ ```
+ bashCopy code
+ docker pull registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat:latest
+ ```
+
+ - Pull from Docker Hub:
+
+ ```
+ bashCopy code
+ docker pull docker.io/openim/openim-chat:latest
+ ```
+
+3. Run the `docker images` command to confirm that the image has been successfully pulled.
+
+This concludes OpenIM's image management strategy and the steps for pulling images. If you have any questions, please feel free to ask.
\ No newline at end of file
diff --git a/docs/conversions/version.md b/docs/conversions/version.md
index a421dd549..bf1062b77 100644
--- a/docs/conversions/version.md
+++ b/docs/conversions/version.md
@@ -54,4 +54,8 @@ git merge release-v3.1
git push origin main
```
-Remember, communication with your team is key throughout this process, keeping everyone up-to-date with the changes being made.
\ No newline at end of file
+Remember, communication with your team is key throughout this process, keeping everyone up-to-date with the changes being made.
+
+
+## Docker images version management
+
diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go
index 4ce3d4216..65beae37e 100644
--- a/internal/rpc/group/group.go
+++ b/internal/rpc/group/group.go
@@ -17,14 +17,15 @@ package group
import (
"context"
"fmt"
- "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
- "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
"math/big"
"math/rand"
"strconv"
"strings"
"time"
+ "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
+ "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
+
pbConversation "github.com/OpenIMSDK/protocol/conversation"
"github.com/OpenIMSDK/protocol/wrapperspb"
@@ -718,11 +719,11 @@ func (s *groupServer) GroupApplicationResponse(ctx context.Context, req *pbGroup
if err := s.GroupDatabase.HandlerGroupRequest(ctx, req.GroupID, req.FromUserID, req.HandledMsg, req.HandleResult, member); err != nil {
return nil, err
}
- if err := s.conversationRpcClient.GroupChatFirstCreateConversation(ctx, req.GroupID, []string{req.FromUserID}); err != nil {
- return nil, err
- }
switch req.HandleResult {
case constant.GroupResponseAgree:
+ if err := s.conversationRpcClient.GroupChatFirstCreateConversation(ctx, req.GroupID, []string{req.FromUserID}); err != nil {
+ return nil, err
+ }
s.Notification.GroupApplicationAcceptedNotification(ctx, req)
case constant.GroupResponseRefuse:
s.Notification.GroupApplicationRejectedNotification(ctx, req)
From 8979b9dce19df9c58cdde4beed461aae7f7e9c73 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Fri, 28 Jul 2023 15:09:04 +0800
Subject: [PATCH 12/48] fix: docker file fix (#692)
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
Dockerfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 290aa02c6..8a230a431 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -22,8 +22,8 @@ RUN /bin/sh -c "make build"
# Production Stage
FROM alpine
-RUN apk --no-cache add tzdata; \
- apt --no-cache add ca-certificates
+RUN echo "https://mirrors.aliyun.com/alpine/v3.4/main" > /etc/apk/repositories && \
+ apk --no-cache add tzdata ca-certificates
# Set directory to map logs, config files, scripts, and SDK
VOLUME ["/Open-IM-Server/logs", "/Open-IM-Server/config", "/Open-IM-Server/scripts", "/Open-IM-Server/db/sdk"]
From e24b0e21149ebd316d3ee5ad9baf1ea5d09e4468 Mon Sep 17 00:00:00 2001
From: pluto <83957921+plutoyty@users.noreply.github.com>
Date: Fri, 28 Jul 2023 17:54:29 +0800
Subject: [PATCH 13/48] Get user online status (#693)
* Resolving code conflicts after project directory changes and Add subscribe and unsubscribe mongodb operations
* Organize and update module dependencies
* Get user online status
* Get user online status
* Get user online status
---
internal/api/route.go | 1 +
internal/api/user.go | 4 ++
internal/rpc/user/user.go | 15 ++++--
pkg/common/db/cache/user.go | 85 ++++++++++++++++++++++++++++++--
pkg/common/db/controller/user.go | 16 ++++++
5 files changed, 114 insertions(+), 7 deletions(-)
diff --git a/internal/api/route.go b/internal/api/route.go
index 0f46f0f0c..1926b55f1 100644
--- a/internal/api/route.go
+++ b/internal/api/route.go
@@ -81,6 +81,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
userRouterGroup.POST("/get_users_online_token_detail", ParseToken, u.GetUsersOnlineTokenDetail)
userRouterGroup.POST("/subscribe_users_status", ParseToken, u.UnSubscriberStatus)
userRouterGroup.POST("/unsubscribe_users_status", ParseToken, u.UnSubscriberStatus)
+ userRouterGroup.POST("/get_users_status", ParseToken, u.GetUserStatus)
}
// friend routing group
diff --git a/internal/api/user.go b/internal/api/user.go
index 108ccac69..3eb136b3d 100644
--- a/internal/api/user.go
+++ b/internal/api/user.go
@@ -194,3 +194,7 @@ func (u *UserApi) SubscriberStatus(c *gin.Context) {
func (u *UserApi) UnSubscriberStatus(c *gin.Context) {
a2r.Call(user.UserClient.SubscribeOrCancelUsersStatus, u.Client, c)
}
+
+func (u *UserApi) GetUserStatus(c *gin.Context) {
+ a2r.Call(user.UserClient.GetUserStatus, u.Client, c)
+}
diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go
index 576492566..53598db0b 100644
--- a/internal/rpc/user/user.go
+++ b/internal/rpc/user/user.go
@@ -261,11 +261,18 @@ func (s *userServer) SubscribeOrCancelUsersStatus(ctx context.Context, req *pbus
}
func (s *userServer) GetUserStatus(ctx context.Context, req *pbuser.GetUserStatusReq) (resp *pbuser.GetUserStatusResp, err error) {
- //TODO implement me
- panic("implement me")
+ //TODO 是否加一个参数校验-判断req.userID的数量,每一个获取加一个限制,一次请求限制500?
+ onlineStatusList, err := s.UserDatabase.GetUserStatus(ctx, req.UserIDs)
+ if err != nil {
+ return nil, err
+ }
+ return &pbuser.GetUserStatusResp{StatusList: onlineStatusList}, nil
}
func (s *userServer) SetUserStatus(ctx context.Context, req *pbuser.SetUserStatusReq) (resp *pbuser.SetUserStatusResp, err error) {
- //TODO implement me
- panic("implement me")
+ err = s.UserDatabase.SetUserStatus(ctx, req.StatusList)
+ if err != nil {
+ return nil, err
+ }
+ return &pbuser.SetUserStatusResp{}, nil
}
diff --git a/pkg/common/db/cache/user.go b/pkg/common/db/cache/user.go
index 455bc9ebe..5c76af22f 100644
--- a/pkg/common/db/cache/user.go
+++ b/pkg/common/db/cache/user.go
@@ -16,6 +16,9 @@ package cache
import (
"context"
+ "encoding/json"
+ "github.com/OpenIMSDK/protocol/user"
+ "strconv"
"time"
"github.com/dtm-labs/rockscache"
@@ -25,9 +28,12 @@ import (
)
const (
- userExpireTime = time.Second * 60 * 60 * 12
- userInfoKey = "USER_INFO:"
- userGlobalRecvMsgOptKey = "USER_GLOBAL_RECV_MSG_OPT_KEY:"
+ userExpireTime = time.Second * 60 * 60 * 12
+ userInfoKey = "USER_INFO:"
+ userGlobalRecvMsgOptKey = "USER_GLOBAL_RECV_MSG_OPT_KEY:"
+ olineStatusKey = "ONLINE_STATUS:"
+ userOlineStatusExpireTime = time.Second * 60 * 60 * 24
+ statusMod = 500
)
type UserCache interface {
@@ -38,10 +44,13 @@ type UserCache interface {
DelUsersInfo(userIDs ...string) UserCache
GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error)
DelUsersGlobalRecvMsgOpt(userIDs ...string) UserCache
+ GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error)
+ SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error
}
type UserCacheRedis struct {
metaCache
+ rdb redis.UniversalClient
userDB relationTb.UserModelInterface
expireTime time.Duration
rcClient *rockscache.Client
@@ -54,6 +63,7 @@ func NewUserCacheRedis(
) UserCache {
rcClient := rockscache.NewClient(rdb, options)
return &UserCacheRedis{
+ rdb: rdb,
metaCache: NewMetaCacheRedis(rcClient),
userDB: userDB,
expireTime: userExpireTime,
@@ -63,6 +73,7 @@ func NewUserCacheRedis(
func (u *UserCacheRedis) NewCache() UserCache {
return &UserCacheRedis{
+ rdb: u.rdb,
metaCache: NewMetaCacheRedis(u.rcClient, u.metaCache.GetPreDelKeys()...),
userDB: u.userDB,
expireTime: u.expireTime,
@@ -145,3 +156,71 @@ func (u *UserCacheRedis) DelUsersGlobalRecvMsgOpt(userIDs ...string) UserCache {
cache.AddKeys(keys...)
return cache
}
+
+func (u *UserCacheRedis) getOnlineStatusKey(userID string) string {
+ return olineStatusKey + userID
+}
+
+// GetUserStatus get user status
+func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) {
+ var res []*user.OnlineStatus
+ for _, userID := range userIDs {
+ UserIDNum, err := strconv.Atoi(userID)
+ if err != nil {
+ return nil, err
+ }
+ var modKey = strconv.Itoa(UserIDNum % statusMod)
+ var onlineStatus user.OnlineStatus
+ key := olineStatusKey + modKey
+ result, err := u.rdb.HGet(ctx, key, userID).Result()
+ if err != nil {
+ if err == redis.Nil {
+ // key or field does not exist
+ res = append(res, &user.OnlineStatus{
+ UserID: userID,
+ Status: 0,
+ PlatformID: -1,
+ })
+ continue
+ } else {
+ return nil, err
+ }
+ }
+ err = json.Unmarshal([]byte(result), &onlineStatus)
+ if err != nil {
+ return nil, err
+ }
+ onlineStatus.UserID = userID
+ res = append(res, &onlineStatus)
+ }
+ return res, nil
+}
+
+// SetUserStatus Set the user status and save it in redis
+func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
+ for _, status := range list {
+ var isNewKey int64
+ UserIDNum, err := strconv.Atoi(status.UserID)
+ if err != nil {
+ return err
+ }
+ var modKey = strconv.Itoa(UserIDNum % statusMod)
+ key := olineStatusKey + modKey
+ jsonData, err := json.Marshal(status)
+ if err != nil {
+ return err
+ }
+ isNewKey, err = u.rdb.Exists(ctx, key).Result()
+ if err != nil {
+ return err
+ }
+ _, err = u.rdb.HSet(ctx, key, status.UserID, string(jsonData)).Result()
+ if err != nil {
+ return err
+ }
+ if isNewKey > 0 {
+ u.rdb.Expire(ctx, key, userOlineStatusExpireTime)
+ }
+ }
+ return nil
+}
diff --git a/pkg/common/db/controller/user.go b/pkg/common/db/controller/user.go
index 83942ce22..5b303ebd7 100644
--- a/pkg/common/db/controller/user.go
+++ b/pkg/common/db/controller/user.go
@@ -18,6 +18,7 @@ import (
"context"
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
"github.com/OpenIMSDK/protocol/constant"
+ "github.com/OpenIMSDK/protocol/user"
"time"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
@@ -56,6 +57,10 @@ type UserDatabase interface {
GetAllSubscribeList(ctx context.Context, userID string) ([]string, error)
// GetSubscribedList Get all subscribed lists
GetSubscribedList(ctx context.Context, userID string) ([]string, error)
+ // GetUserStatus Get the online status of the user
+ GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error)
+ // SetUserStatus Set the user status and store the user status in redis
+ SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error
}
type userDatabase struct {
@@ -195,3 +200,14 @@ func (u *userDatabase) GetSubscribedList(ctx context.Context, userID string) ([]
//TODO 获取所有被订阅
return nil, nil
}
+
+// GetUserStatus get user status
+func (u *userDatabase) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) {
+ onlineStatusList, err := u.cache.GetUserStatus(ctx, userIDs)
+ return onlineStatusList, err
+}
+
+// SetUserStatus Set the user status and save it in redis
+func (u *userDatabase) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
+ return u.cache.SetUserStatus(ctx, list)
+}
From 788b381508fbf65f3fd0bc3342d28b628716abfe Mon Sep 17 00:00:00 2001
From: WangchuXiao
Date: Fri, 28 Jul 2023 21:43:29 +0800
Subject: [PATCH 14/48] fix bug: When the previously applied group has a
disbanded group, applying to add the group again will fail (#698)
* docs: add readme docs
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix bug: reject group req bug
* feat: add go relase
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix bug: join group failed
* fix bug: join group failed
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
Co-authored-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
internal/rpc/group/group.go | 2 +-
pkg/common/db/controller/group.go | 5 +++++
pkg/common/db/relation/group_model.go | 4 ++++
pkg/common/db/table/relation/group.go | 1 +
4 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go
index 65beae37e..a7680dfaa 100644
--- a/internal/rpc/group/group.go
+++ b/internal/rpc/group/group.go
@@ -1040,7 +1040,7 @@ func (s *groupServer) GetUserReqApplicationList(ctx context.Context, req *pbGrou
groupIDs := utils.Distinct(utils.Slice(requests, func(e *relationTb.GroupRequestModel) string {
return e.GroupID
}))
- groups, err := s.GroupDatabase.FindGroup(ctx, groupIDs)
+ groups, err := s.GroupDatabase.FindNotDismissedGroup(ctx, groupIDs)
if err != nil {
return nil, err
}
diff --git a/pkg/common/db/controller/group.go b/pkg/common/db/controller/group.go
index e2b5f90b3..ba4ae18df 100644
--- a/pkg/common/db/controller/group.go
+++ b/pkg/common/db/controller/group.go
@@ -39,6 +39,7 @@ type GroupDatabase interface {
CreateGroup(ctx context.Context, groups []*relationTb.GroupModel, groupMembers []*relationTb.GroupMemberModel) error
TakeGroup(ctx context.Context, groupID string) (group *relationTb.GroupModel, err error)
FindGroup(ctx context.Context, groupIDs []string) (groups []*relationTb.GroupModel, err error)
+ FindNotDismissedGroup(ctx context.Context, groupIDs []string) (groups []*relationTb.GroupModel, err error)
SearchGroup(
ctx context.Context,
keyword string,
@@ -581,3 +582,7 @@ func (g *groupDatabase) CountRangeEverydayTotal(ctx context.Context, start time.
func (g *groupDatabase) FindGroupRequests(ctx context.Context, groupID string, userIDs []string) (int64, []*relationTb.GroupRequestModel, error) {
return g.groupRequestDB.FindGroupRequests(ctx, groupID, userIDs)
}
+
+func (g *groupDatabase) FindNotDismissedGroup(ctx context.Context, groupIDs []string) (groups []*relationTb.GroupModel, err error) {
+ return g.groupDB.FindNotDismissedGroup(ctx, groupIDs)
+}
diff --git a/pkg/common/db/relation/group_model.go b/pkg/common/db/relation/group_model.go
index 697427e04..853f5dccd 100644
--- a/pkg/common/db/relation/group_model.go
+++ b/pkg/common/db/relation/group_model.go
@@ -99,3 +99,7 @@ func (g *GroupGorm) CountRangeEverydayTotal(ctx context.Context, start time.Time
}
return v, nil
}
+
+func (g *GroupGorm) FindNotDismissedGroup(ctx context.Context, groupIDs []string) (groups []*relation.GroupModel, err error) {
+ return groups, utils.Wrap(g.DB.Where("group_id in (?) and status != ?", groupIDs, constant.GroupStatusDismissed).Find(&groups).Error, "")
+}
diff --git a/pkg/common/db/table/relation/group.go b/pkg/common/db/table/relation/group.go
index 2bafb53ec..6759e0d35 100644
--- a/pkg/common/db/table/relation/group.go
+++ b/pkg/common/db/table/relation/group.go
@@ -51,6 +51,7 @@ type GroupModelInterface interface {
UpdateMap(ctx context.Context, groupID string, args map[string]interface{}) (err error)
UpdateStatus(ctx context.Context, groupID string, status int32) (err error)
Find(ctx context.Context, groupIDs []string) (groups []*GroupModel, err error)
+ FindNotDismissedGroup(ctx context.Context, groupIDs []string) (groups []*GroupModel, err error)
Take(ctx context.Context, groupID string) (group *GroupModel, err error)
Search(
ctx context.Context,
From a5eb4dd499181146fbe0509a2a6d3d8887d25d12 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Fri, 28 Jul 2023 22:49:55 +0800
Subject: [PATCH 15/48] fix: docker images (#701)
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
.env | 4 ++--
Dockerfile | 4 ++--
docker-compose.yaml | 4 ++--
scripts/make-rules/golang.mk | 10 +++++-----
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/.env b/.env
index 910d864b8..412b75076 100644
--- a/.env
+++ b/.env
@@ -1,5 +1,5 @@
USER=root
PASSWORD=openIM123
-MINIO_ENDPOINT=http://113.99.98.99:10005
-API_URL=http://113.99.98.99:10002/object/
+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/Dockerfile b/Dockerfile
index 8a230a431..85afdf98b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -23,7 +23,7 @@ RUN /bin/sh -c "make build"
FROM alpine
RUN echo "https://mirrors.aliyun.com/alpine/v3.4/main" > /etc/apk/repositories && \
- apk --no-cache add tzdata ca-certificates
+ apk --no-cache add tzdata ca-certificates bash
# Set directory to map logs, config files, scripts, and SDK
VOLUME ["/Open-IM-Server/logs", "/Open-IM-Server/config", "/Open-IM-Server/scripts", "/Open-IM-Server/db/sdk"]
@@ -34,4 +34,4 @@ COPY --from=builder /Open-IM-Server/_output/bin/platforms/linux/amd64 /Open-IM-S
WORKDIR /Open-IM-Server/scripts
-CMD ["docker_start_all.sh"]
\ No newline at end of file
+CMD ["./docker_start_all.sh"]
\ No newline at end of file
diff --git a/docker-compose.yaml b/docker-compose.yaml
index cd80dbf19..d5565ca52 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -100,7 +100,7 @@ services:
openim_server:
- image: ghcr.io/openimsdk/openim-server:v3.0
+ image: ghcr.io/openimsdk/openim-server:v3.1.0
container_name: openim-server
volumes:
- ./logs:/Open-IM-Server/logs
@@ -124,7 +124,7 @@ services:
max-file: "2"
openim_chat:
- image: ghcr.io/openimsdk/openim-chat:v1.0.0
+ image: ghcr.io/openimsdk/openim-chat:v1.1.0
container_name: openim_chat
restart: always
depends_on:
diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk
index 00e0fee47..aebf70e68 100644
--- a/scripts/make-rules/golang.mk
+++ b/scripts/make-rules/golang.mk
@@ -131,11 +131,11 @@ go.build.%:
$(BIN_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) $(ROOT_DIR)/cmd/$(COMMAND)/main.go; \
fi
-## go.install: Install deployment openim
-.PHONY: go.install
-go.install:
- @echo "===========> Installing deployment openim"
- @$(ROOT_DIR)/scripts/install_im_server.sh
+# ## go.install: Install deployment openim
+# .PHONY: go.install
+# go.install:
+# @echo "===========> Installing deployment openim"
+# @$(ROOT_DIR)/scripts/install_im_server.sh
## go.check: Check OpenIM deployment
.PHONY: go.check
From f894a4546e54562a8bc823d3791b7a5edff10ebe Mon Sep 17 00:00:00 2001
From: Gordon <46924906+FGadvancer@users.noreply.github.com>
Date: Sat, 29 Jul 2023 12:15:12 +0800
Subject: [PATCH 16/48] fix: get userid function call rpc and message gateway
add status change callback (#699)
* fix: to start im or chat, ZooKeeper must be started first.
* fix: msg gateway start output err info
Signed-off-by: Gordon <1432970085@qq.com>
* fix: msg gateway start output err info
Signed-off-by: Gordon <1432970085@qq.com>
* chore: package path changes
Signed-off-by: withchao <993506633@qq.com>
* fix: go mod update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* chore: package path changes
Signed-off-by: withchao <993506633@qq.com>
* chore: package path changes
Signed-off-by: withchao <993506633@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: get all userID
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
* fix: msggateway add online status call
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
---------
Signed-off-by: Gordon <1432970085@qq.com>
Signed-off-by: withchao <993506633@qq.com>
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
Co-authored-by: withchao <993506633@qq.com>
---
go.mod | 2 +-
go.sum | 4 ++--
internal/api/user.go | 2 +-
internal/msggateway/n_ws_server.go | 35 +++++++++++++++++++++++-------
pkg/rpcclient/user.go | 4 ++++
5 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/go.mod b/go.mod
index c18eabd08..c7a2b8309 100644
--- a/go.mod
+++ b/go.mod
@@ -37,7 +37,7 @@ require (
require github.com/google/uuid v1.3.0
require (
- github.com/OpenIMSDK/protocol v0.0.2
+ github.com/OpenIMSDK/protocol v0.0.3
github.com/OpenIMSDK/tools v0.0.5
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
github.com/go-redis/redis v6.15.9+incompatible
diff --git a/go.sum b/go.sum
index a93a1687a..2ad7b17ff 100644
--- a/go.sum
+++ b/go.sum
@@ -16,8 +16,8 @@ cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5og
firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4=
firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/OpenIMSDK/protocol v0.0.2 h1:O53/WiqLCHF9aWPLI32GPF82hn7suM8PkhrtL89Klrw=
-github.com/OpenIMSDK/protocol v0.0.2/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
+github.com/OpenIMSDK/protocol v0.0.3 h1:CFQtmnyW+1dYKVFaVaHcJ6oYuMiMdNfU2gC1xz3K/9I=
+github.com/OpenIMSDK/protocol v0.0.3/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
github.com/OpenIMSDK/tools v0.0.5 h1:yBVHJ3EpIDcp8VFKPjuGr6MQvFa3t4JByZ+vmeC06/Q=
github.com/OpenIMSDK/tools v0.0.5/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
diff --git a/internal/api/user.go b/internal/api/user.go
index 3eb136b3d..41f6fd4c9 100644
--- a/internal/api/user.go
+++ b/internal/api/user.go
@@ -51,7 +51,7 @@ func (u *UserApi) GetUsersPublicInfo(c *gin.Context) {
}
func (u *UserApi) GetAllUsersID(c *gin.Context) {
- a2r.Call(user.UserClient.GetDesignateUsers, u.Client, c)
+ a2r.Call(user.UserClient.GetAllUserID, u.Client, c)
}
func (u *UserApi) AccountCheck(c *gin.Context) {
diff --git a/internal/msggateway/n_ws_server.go b/internal/msggateway/n_ws_server.go
index c324f8a22..67c8132ca 100644
--- a/internal/msggateway/n_ws_server.go
+++ b/internal/msggateway/n_ws_server.go
@@ -18,6 +18,7 @@ import (
"context"
"errors"
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
+ "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
"net/http"
"strconv"
"sync"
@@ -74,6 +75,7 @@ type WsServer struct {
hubServer *Server
validate *validator.Validate
cache cache.MsgModel
+ userClient *rpcclient.UserRpcClient
Compressor
Encoder
MessageHandler
@@ -86,6 +88,28 @@ type kickHandler struct {
func (ws *WsServer) SetDiscoveryRegistry(client discoveryregistry.SvcDiscoveryRegistry) {
ws.MessageHandler = NewGrpcHandler(ws.validate, client)
+ u := rpcclient.NewUserRpcClient(client)
+ ws.userClient = &u
+}
+func (ws *WsServer) SetUserOnlineStatus(ctx context.Context, client *Client, status int32) {
+ err := ws.userClient.SetUserStatus(ctx, client.UserID, status, client.PlatformID)
+ if err != nil {
+ log.ZWarn(ctx, "SetUserStatus err", err)
+ }
+ switch status {
+ case constant.Online:
+ err := CallbackUserOnline(ctx, client.UserID, client.PlatformID, client.IsBackground, client.ctx.GetConnID())
+ if err != nil {
+ log.ZWarn(ctx, "CallbackUserOnline err", err)
+ }
+ case constant.Offline:
+ err := CallbackUserOffline(ctx, client.UserID, client.PlatformID, client.ctx.GetConnID())
+ if err != nil {
+ log.ZWarn(ctx, "CallbackUserOffline err", err)
+ }
+
+ }
+
}
func (ws *WsServer) SetCacheHandler(cache cache.MsgModel) {
@@ -186,6 +210,7 @@ func (ws *WsServer) registerClient(client *Client) {
atomic.AddInt64(&ws.onlineUserConnNum, 1)
}
}
+ ws.SetUserOnlineStatus(client.ctx, client, constant.Online)
log.ZInfo(
client.ctx,
"user online",
@@ -292,14 +317,8 @@ func (ws *WsServer) unregisterClient(client *Client) {
atomic.AddInt64(&ws.onlineUserNum, -1)
}
atomic.AddInt64(&ws.onlineUserConnNum, -1)
- log.ZInfo(
- client.ctx,
- "user offline",
- "close reason",
- client.closedErr,
- "online user Num",
- ws.onlineUserNum,
- "online user conn Num",
+ ws.SetUserOnlineStatus(client.ctx, client, constant.Offline)
+ log.ZInfo(client.ctx, "user offline", "close reason", client.closedErr, "online user Num", ws.onlineUserNum, "online user conn Num",
ws.onlineUserConnNum,
)
}
diff --git a/pkg/rpcclient/user.go b/pkg/rpcclient/user.go
index 1ce4fd53c..6ca60dc75 100644
--- a/pkg/rpcclient/user.go
+++ b/pkg/rpcclient/user.go
@@ -154,3 +154,7 @@ func (u *UserRpcClient) GetAllUserIDs(ctx context.Context, pageNumber, showNumbe
}
return resp.UserIDs, nil
}
+func (u *UserRpcClient) SetUserStatus(ctx context.Context, userID string, status int32, platformID int) error {
+ _, err := u.Client.SetUserStatus(ctx, &user.SetUserStatusReq{StatusList: []*user.OnlineStatus{{UserID: userID, Status: status, PlatformID: int32(platformID)}}})
+ return err
+}
From 1ec33afe3f3549c2ee329f74a7ea147910edf002 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Sat, 29 Jul 2023 14:07:59 +0800
Subject: [PATCH 17/48] Update version.md (#703)
---
docs/conversions/version.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/docs/conversions/version.md b/docs/conversions/version.md
index bf1062b77..8c6caf5ec 100644
--- a/docs/conversions/version.md
+++ b/docs/conversions/version.md
@@ -14,6 +14,10 @@ In the OpenIM repository, the versioning adheres to the `MAJOR.MINOR.PATCH` form
## Milestones and Branching
++ [OpenIM Milestones](https://github.com/OpenIMSDK/Open-IM-Server/milestones)
++ [OpenIM Tags](https://github.com/OpenIMSDK/Open-IM-Server/tags)
++ [OpenIM Branches](https://github.com/OpenIMSDK/Open-IM-Server/branches)
+
When a significant milestone like v3.1.0 is achieved, a new branch `release-v3.1` is created. This branch contains all the code pertaining to this stable release. All bug fixes and features intended for the next version, v3.2.0, are merged into this branch.
The release of `PATCH` versions (Z in `X.Y.Z`) are driven by bug fixes, and these can be rolled out depending on the bug's priority or over a scheduled time. On the other hand, `MINOR` versions (Y in `X.Y.Z`) are released based on the project's roadmap, milestone completion, or on a scheduled timeline. Importantly, the API of minor versions is always backward-compatible.
@@ -59,3 +63,4 @@ Remember, communication with your team is key throughout this process, keeping e
## Docker images version management
++ [OpenIM Docker Images Administration](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md)
From 2166c71c1fdcf2cb8fccf5e547d7d7d92888831b Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Sat, 29 Jul 2023 19:20:09 +0800
Subject: [PATCH 18/48] Update version.md (#704)
---
docs/conversions/version.md | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/docs/conversions/version.md b/docs/conversions/version.md
index 8c6caf5ec..06e34543b 100644
--- a/docs/conversions/version.md
+++ b/docs/conversions/version.md
@@ -2,6 +2,26 @@
Our project, OpenIM, follows the [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/) standards.
+OpenIM, the open source project, employs a comprehensive version management system to ensure the reliability and traceability of our software. Our version management consists of three main components: the `main` branch, the `release` branch, and `tag` management.
+
+## Main Branch
+
+The `main` branch is where all the latest code resides. It's the hub of activity, embodying all the cutting-edge features that are currently being developed or updated. However, since it's subject to frequent changes and updates, it may not always represent the most stable version of the software. Access the `main` branch [here](https://github.com/openimsdk/openim-server/tree/main).
+
+## Release Branch
+
+On the other hand, we have the `release` branch. For instance, in the context of version 3.1, we maintain a `release-v3.1` branch. Unlike the `main` branch, the release branch is designed to be a continuously stable and updated version of the software. This provides a reliable option for users who prefer stability over the latest, but potentially unstable, features. Access the `release-v3.1` branch [here](https://github.com/openimsdk/openim-server/tree/release-v3.1).
+
+## Tag Management
+
+Finally, there's `tag` management. Despite having both `main` and `release` branches, `tag` serves a crucial role. Tags are immutable, i.e., they remain unchanged once created. Therefore, if you need a specific version of the software, you can use the corresponding tag. Check out the available tags [here](https://github.com/openimsdk/openim-server/tags).
+
+Moreover, our Docker image versions are closely tied with these three components. For instance, a tag might correspond to the Docker image `ghcr.io/openimsdk/openim-server:v3.1.0`, a release would be `ghcr.io/openimsdk/openim-server:release-v3.0`, and the main branch might be represented as `ghcr.io/openimsdk/openim-server:main` or `ghcr.io/openimsdk/openim-server:latest`.
+
+To find out more, or to contribute to our project, please visit our GitHub repository at [OpenIM Server](https://github.com/openimsdk/openim-server).
+
+We believe that this approach offers a balanced blend of innovation and stability, enabling us to provide the best possible software to our users.
+
## OpenIM version
OpenIM manages two primary branches: `main` and `release`. The project uses Semantic Versioning 2.0.0 to tag different versions of the software, each indicating a significant milestone in the software's development.
From 80d888f88684da87a6456d530e516e541e917630 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Sat, 29 Jul 2023 21:04:14 +0800
Subject: [PATCH 19/48] docs: update create CODE_OF_CONDUCT.md (#705)
---
CODE_OF_CONDUCT.md | 128 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 128 insertions(+)
create mode 100644 CODE_OF_CONDUCT.md
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..c5e93d7b5
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,128 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, religion, or sexual identity
+and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the
+ overall community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or
+ advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email
+ address, without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement at
+3293172751nss@gmail.com.
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series
+of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or
+permanent ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within
+the community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.0, available at
+https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
+
+Community Impact Guidelines were inspired by [Mozilla's code of conduct
+enforcement ladder](https://github.com/mozilla/diversity).
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see the FAQ at
+https://www.contributor-covenant.org/faq. Translations are available at
+https://www.contributor-covenant.org/translations.
From 6480f9f0b57cfc795ca43457fe0040f04eaa0909 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Sat, 29 Jul 2023 21:26:27 +0800
Subject: [PATCH 20/48] fix: docker images (#706)
* fix: docker images
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: chat scripts config
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
.goreleaser.yaml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index fc7c0cd01..31cdbd085 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -487,10 +487,14 @@ release:
## Helping out
- We release logs are recorded on [✨ CHANGELOG](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CHANGELOG/CHANGELOG.md)
+ We release logs are recorded on [✨ CHANGELOG](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CHANGELOG/CHANGELOG.md)--config_folder_path
+
+ For information on versions of OpenIM and how to maintain branches, read [📚this article](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md)
This release is only possible thanks to **all** the support of some **awesome people**!
+ https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md
+
**Want to be one of them 😘?**
Contributions to this project are welcome! Please see [CONTRIBUTING.md](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CONTRIBUTING.md) for details.
From 6414a0fafd1d32c51d37d843f62eb4ac9fd9b9f5 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Sat, 29 Jul 2023 21:30:47 +0800
Subject: [PATCH 21/48] Update docker-compose.yaml (#707)
---
docker-compose.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docker-compose.yaml b/docker-compose.yaml
index d5565ca52..394232df3 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -100,7 +100,7 @@ services:
openim_server:
- image: ghcr.io/openimsdk/openim-server:v3.1.0
+ image: ghcr.io/openimsdk/openim-server:latest
container_name: openim-server
volumes:
- ./logs:/Open-IM-Server/logs
@@ -124,7 +124,7 @@ services:
max-file: "2"
openim_chat:
- image: ghcr.io/openimsdk/openim-chat:v1.1.0
+ image: ghcr.io/openimsdk/openim-chat:latest
container_name: openim_chat
restart: always
depends_on:
From cf2145cc325ff5aa57d8a20ea524656468c793e6 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Sat, 29 Jul 2023 21:53:00 +0800
Subject: [PATCH 23/48] Create dependabot.yml (#708)
---
.github/dependabot.yml | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 .github/dependabot.yml
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000..f6150ead7
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,11 @@
+# To get started with Dependabot version updates, you'll need to specify which
+# package ecosystems to update and where the package manifests are located.
+# Please see the documentation for all configuration options:
+# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
+
+version: 2
+updates:
+ - package-ecosystem: "gomod"
+ directory: "/"
+ schedule:
+ interval: "daily"
From a74c851295b068e42f9396cedccd2be0e0e4e588 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751@qq.com>
Date: Sat, 29 Jul 2023 22:00:40 +0800
Subject: [PATCH 24/48] Update golang.mk (#710)
---
scripts/make-rules/golang.mk | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk
index aebf70e68..dedcdc9fc 100644
--- a/scripts/make-rules/golang.mk
+++ b/scripts/make-rules/golang.mk
@@ -131,11 +131,11 @@ go.build.%:
$(BIN_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) $(ROOT_DIR)/cmd/$(COMMAND)/main.go; \
fi
-# ## go.install: Install deployment openim
-# .PHONY: go.install
-# go.install:
-# @echo "===========> Installing deployment openim"
-# @$(ROOT_DIR)/scripts/install_im_server.sh
+## go.install: Install deployment openim
+.PHONY: go.install
+go.install:
+ @echo "===========> Installing deployment openim"
+ @$(ROOT_DIR)/scripts/install_im_server.sh
## go.check: Check OpenIM deployment
.PHONY: go.check
@@ -204,4 +204,4 @@ go.clean:
## copyright.help: Show copyright help
.PHONY: go.help
go.help: scripts/make-rules/golang.mk
- $(call smallhelp)
\ No newline at end of file
+ $(call smallhelp)
From f13088262eb46e920a3b7317450c8144f1a9f40a Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 29 Jul 2023 22:02:46 +0800
Subject: [PATCH 25/48] build(deps): bump github.com/minio/minio-go/v7 from
7.0.59 to 7.0.61 (#711)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.59 to 7.0.61.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.59...v7.0.61)
---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 14 +++++++-------
go.sum | 29 ++++++++++++++---------------
2 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/go.mod b/go.mod
index c7a2b8309..33e4b5f3c 100644
--- a/go.mod
+++ b/go.mod
@@ -16,13 +16,13 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/jinzhu/copier v0.3.5
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
- github.com/minio/minio-go/v7 v7.0.59
+ github.com/minio/minio-go/v7 v7.0.61
github.com/mitchellh/mapstructure v1.5.0
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.16.0
github.com/robfig/cron/v3 v3.0.1
- github.com/sirupsen/logrus v1.9.2 // indirect
+ github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/testify v1.8.3
go.mongodb.org/mongo-driver v1.12.0
golang.org/x/image v0.9.0 // indirect
@@ -85,8 +85,8 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/compress v1.16.5 // indirect
- github.com/klauspost/cpuid/v2 v2.2.4 // indirect
+ github.com/klauspost/compress v1.16.7 // indirect
+ github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/lithammer/shortuuid v3.0.0+incompatible // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
@@ -116,10 +116,10 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/arch v0.3.0 // indirect
- golang.org/x/net v0.11.0 // indirect
+ golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.2.0 // indirect
- golang.org/x/sys v0.9.0 // indirect
+ golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.1.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
@@ -136,7 +136,7 @@ require (
github.com/spf13/cobra v1.6.1
github.com/ugorji/go/codec v1.2.11 // indirect
go.uber.org/zap v1.24.0 // indirect
- golang.org/x/crypto v0.10.0 // indirect
+ golang.org/x/crypto v0.11.0 // indirect
google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)
diff --git a/go.sum b/go.sum
index 2ad7b17ff..b81723deb 100644
--- a/go.sum
+++ b/go.sum
@@ -191,12 +191,12 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
-github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI=
-github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
+github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
+github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
-github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
-github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
+github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
+github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -219,8 +219,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
-github.com/minio/minio-go/v7 v7.0.59 h1:lxIXwsTIcQkYoEG25rUJbzpmSB/oWeVDmxFo/uWUUsw=
-github.com/minio/minio-go/v7 v7.0.59/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE=
+github.com/minio/minio-go/v7 v7.0.61 h1:87c+x8J3jxQ5VUGimV9oHdpjsAvy3fhneEBKuoKEVUI=
+github.com/minio/minio-go/v7 v7.0.61/go.mod h1:BTu8FcrEw+HidY0zd/0eny43QnVNkXRPXrLXFuQBHXg=
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
@@ -279,8 +279,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y=
-github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
+github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
+github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
@@ -341,8 +341,8 @@ golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
-golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
+golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
+golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/image v0.9.0 h1:QrzfX26snvCM20hIhBwuHI/ThTg18b/+kcKdXHvnR+g=
golang.org/x/image v0.9.0/go.mod h1:jtrku+n79PfroUbvDdeUWMAI+heR786BofxrbiSF+J0=
@@ -372,8 +372,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
-golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU=
-golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ=
+golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
+golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g=
golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4=
@@ -403,13 +403,12 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
-golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
+golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
From 7b0334ff6d62afb14ab4800ba2ac939d71bd397c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 29 Jul 2023 22:08:17 +0800
Subject: [PATCH 26/48] build(deps): bump github.com/go-sql-driver/mysql from
1.6.0 to 1.7.1 (#713)
Bumps [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) from 1.6.0 to 1.7.1.
- [Release notes](https://github.com/go-sql-driver/mysql/releases)
- [Changelog](https://github.com/go-sql-driver/mysql/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-sql-driver/mysql/compare/v1.6.0...v1.7.1)
---
updated-dependencies:
- dependency-name: github.com/go-sql-driver/mysql
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/go.mod b/go.mod
index 33e4b5f3c..e4c067111 100644
--- a/go.mod
+++ b/go.mod
@@ -41,7 +41,7 @@ require (
github.com/OpenIMSDK/tools v0.0.5
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
github.com/go-redis/redis v6.15.9+incompatible
- github.com/go-sql-driver/mysql v1.6.0
+ github.com/go-sql-driver/mysql v1.7.1
github.com/redis/go-redis/v9 v9.0.5
github.com/tencentyun/cos-go-sdk-v5 v0.7.41
)
diff --git a/go.sum b/go.sum
index b81723deb..3cf065090 100644
--- a/go.sum
+++ b/go.sum
@@ -93,8 +93,9 @@ github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
-github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
+github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg=
github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
From 83eb0da902c3c0ff218fd8cac38df5ec30071806 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 29 Jul 2023 22:25:42 +0800
Subject: [PATCH 27/48] build(deps): bump google.golang.org/api from 0.114.0 to
0.134.0 (#714)
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.114.0 to 0.134.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.114.0...v0.134.0)
---
updated-dependencies:
- dependency-name: google.golang.org/api
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 33 +++++++++++-----------
go.sum | 89 ++++++++++++++++++++++++++++++++++++++--------------------
2 files changed, 75 insertions(+), 47 deletions(-)
diff --git a/go.mod b/go.mod
index e4c067111..e94e4bb52 100644
--- a/go.mod
+++ b/go.mod
@@ -26,7 +26,7 @@ require (
github.com/stretchr/testify v1.8.3
go.mongodb.org/mongo-driver v1.12.0
golang.org/x/image v0.9.0 // indirect
- google.golang.org/api v0.114.0
+ google.golang.org/api v0.134.0
google.golang.org/grpc v1.56.2
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
@@ -47,13 +47,13 @@ require (
)
require (
- cloud.google.com/go v0.110.0 // indirect
- cloud.google.com/go/compute v1.19.1 // indirect
+ cloud.google.com/go v0.110.4 // indirect
+ cloud.google.com/go/compute v1.20.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
- cloud.google.com/go/firestore v1.9.0 // indirect
- cloud.google.com/go/iam v0.13.0 // indirect
- cloud.google.com/go/longrunning v0.4.1 // indirect
- cloud.google.com/go/storage v1.28.1 // indirect
+ cloud.google.com/go/firestore v1.11.0 // indirect
+ cloud.google.com/go/iam v1.1.0 // indirect
+ cloud.google.com/go/longrunning v0.5.1 // indirect
+ cloud.google.com/go/storage v1.30.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
@@ -70,11 +70,12 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-zookeeper/zk v1.0.3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/snappy v0.0.3 // indirect
+ github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-querystring v1.1.0 // indirect
- github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
- github.com/googleapis/gax-go/v2 v2.7.1 // indirect
+ github.com/google/s2a-go v0.1.4 // indirect
+ github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
+ github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
@@ -117,15 +118,15 @@ require (
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/net v0.12.0 // indirect
- golang.org/x/oauth2 v0.7.0 // indirect
- golang.org/x/sync v0.2.0 // indirect
+ golang.org/x/oauth2 v0.10.0 // indirect
+ golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
- golang.org/x/time v0.1.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20230626202813-9b080da550b3 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20230720185612-659f7aaaa771 // indirect
)
require (
@@ -137,6 +138,6 @@ require (
github.com/ugorji/go/codec v1.2.11 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
- google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect
+ google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)
diff --git a/go.sum b/go.sum
index 3cf065090..ae36bd80a 100644
--- a/go.sum
+++ b/go.sum
@@ -1,18 +1,19 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys=
-cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY=
-cloud.google.com/go/compute v1.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY=
-cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE=
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.110.4 h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk=
+cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI=
+cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg=
+cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
-cloud.google.com/go/firestore v1.9.0 h1:IBlRyxgGySXu5VuW0RgGFlTtLukSnNkpDiEOMkQkmpA=
-cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE=
-cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k=
-cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0=
-cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM=
-cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo=
-cloud.google.com/go/storage v1.28.1 h1:F5QDG5ChchaAVQhINh24U99OWHURqrW8OmQcGKXcbgI=
-cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y=
+cloud.google.com/go/firestore v1.11.0 h1:PPgtwcYUOXV2jFe1bV3nda3RCrOa8cvBjTOn2MQVfW8=
+cloud.google.com/go/firestore v1.11.0/go.mod h1:b38dKhgzlmNNGTNZZwe7ZRFEuRab1Hay3/DBsIGKKy4=
+cloud.google.com/go/iam v1.1.0 h1:67gSqaPukx7O8WLLHMa0PNs3EBGd2eE4d+psbO/CO94=
+cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk=
+cloud.google.com/go/longrunning v0.5.1 h1:Fr7TXftcqTudoyRJa113hyaqlGdiBQkp0Gq7tErFDWI=
+cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc=
+cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM=
+cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E=
firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4=
firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -27,6 +28,7 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWso
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible h1:KpbJFXwhVeuxNtBJ74MCGbIoaBok2uZvkD7QXp2+Wis=
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
+github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
@@ -38,6 +40,7 @@ github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1
github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s=
github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
@@ -50,6 +53,11 @@ github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I=
github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
+github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
+github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
+github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -70,6 +78,8 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
+github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
@@ -80,6 +90,7 @@ github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWo
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
@@ -113,6 +124,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
@@ -127,8 +139,9 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
-github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
+github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
@@ -146,20 +159,23 @@ github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc=
+github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k=
-github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k=
-github.com/googleapis/gax-go/v2 v2.7.1 h1:gF4c0zjUP2H/s/hEGyLA3I0fA2ZWjzYiONAD6cvPr8A=
-github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI=
+github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM=
+github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w=
+github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas=
+github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
+github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
@@ -276,6 +292,7 @@ github.com/redis/go-redis/v9 v9.0.5 h1:CuQcn5HIEeK7BgElubPP8CGtE0KakrnbBSTLjathl
github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
+github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
@@ -325,6 +342,7 @@ go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0P
go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
+go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
@@ -341,6 +359,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
@@ -357,6 +376,7 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -365,6 +385,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
@@ -376,8 +397,9 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g=
-golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4=
+golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8=
+golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -386,8 +408,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
-golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
+golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -422,8 +444,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
-golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA=
-golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
+golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
@@ -441,26 +463,30 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
-google.golang.org/api v0.114.0 h1:1xQPji6cO2E2vLiI+C/XiFAnsn1WV3mjaEwGLhi3grE=
-google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg=
+google.golang.org/api v0.134.0 h1:ktL4Goua+UBgoP1eL1/60LwZJqa1sIzkLmvoR3hR6Gw=
+google.golang.org/api v0.134.0/go.mod h1:sjRL3UnjTx5UqNQS9EWr9N8p7xbHpy1k0XGRLCf3Spk=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M=
-google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY=
-google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE=
-google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230626202813-9b080da550b3 h1:QJuqz7YzNTyKDspkp2lrzqtq4lf2AhUSpXTsGP5SbLw=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230626202813-9b080da550b3/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
+google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 h1:Au6te5hbKUV8pIYWHqOUZ1pva5qK/rwbIhoXEUB9Lu8=
+google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y=
+google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130 h1:XVeBY8d/FaK4848myy41HBqnDwvxeV3zMZhwN1TvAMU=
+google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:mPBs5jNgx2GuQGvFwUvVKqtn6HsUw9nP64BedgvqEsQ=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230720185612-659f7aaaa771 h1:Z8qdAF9GFsmcUuWQ5KVYIpP3PCKydn/YKORnghIalu4=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230720185612-659f7aaaa771/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
+google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
+google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI=
google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
@@ -485,6 +511,7 @@ gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
From 9b7ff131c5943c2a04f0a6dfe6de98d15a62570a Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 29 Jul 2023 22:25:53 +0800
Subject: [PATCH 28/48] build(deps): bump gorm.io/driver/mysql from 1.3.5 to
1.5.1 (#712)
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.3.5 to 1.5.1.
- [Commits](https://github.com/go-gorm/mysql/compare/v1.3.5...v1.5.1)
---
updated-dependencies:
- dependency-name: gorm.io/driver/mysql
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/go.mod b/go.mod
index e94e4bb52..81b1209fa 100644
--- a/go.mod
+++ b/go.mod
@@ -30,7 +30,7 @@ require (
google.golang.org/grpc v1.56.2
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
- gorm.io/driver/mysql v1.3.5
+ gorm.io/driver/mysql v1.5.1
gorm.io/gorm v1.25.2
)
diff --git a/go.sum b/go.sum
index ae36bd80a..bba524594 100644
--- a/go.sum
+++ b/go.sum
@@ -104,7 +104,7 @@ github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
-github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
@@ -198,7 +198,6 @@ github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg=
github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
-github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
@@ -520,9 +519,9 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gorm.io/driver/mysql v1.3.5 h1:iWBTVW/8Ij5AG4e0G/zqzaJblYkBI1VIL1LG2HUGsvY=
-gorm.io/driver/mysql v1.3.5/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c=
-gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
+gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw=
+gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o=
+gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho=
gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
From 5143f7f30445ef9b0f2a3141ae1089d03cdce0da Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 29 Jul 2023 22:26:44 +0800
Subject: [PATCH 29/48] build(deps): bump github.com/tencentyun/cos-go-sdk-v5
(#715)
Bumps [github.com/tencentyun/cos-go-sdk-v5](https://github.com/tencentyun/cos-go-sdk-v5) from 0.7.41 to 0.7.42.
- [Release notes](https://github.com/tencentyun/cos-go-sdk-v5/releases)
- [Changelog](https://github.com/tencentyun/cos-go-sdk-v5/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tencentyun/cos-go-sdk-v5/compare/v0.7.41...v0.7.42)
---
updated-dependencies:
- dependency-name: github.com/tencentyun/cos-go-sdk-v5
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/go.mod b/go.mod
index 81b1209fa..e016ff06f 100644
--- a/go.mod
+++ b/go.mod
@@ -43,7 +43,7 @@ require (
github.com/go-redis/redis v6.15.9+incompatible
github.com/go-sql-driver/mysql v1.7.1
github.com/redis/go-redis/v9 v9.0.5
- github.com/tencentyun/cos-go-sdk-v5 v0.7.41
+ github.com/tencentyun/cos-go-sdk-v5 v0.7.42
)
require (
diff --git a/go.sum b/go.sum
index bba524594..067ef5301 100644
--- a/go.sum
+++ b/go.sum
@@ -316,10 +316,10 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
-github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.194/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
-github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.194/go.mod h1:yrBKWhChnDqNz1xuXdSbWXG56XawEq0G5j1lg4VwBD4=
-github.com/tencentyun/cos-go-sdk-v5 v0.7.41 h1:iU0Li/Np78H4SBna0ECQoF3mpgi6ImLXU+doGzPFXGc=
-github.com/tencentyun/cos-go-sdk-v5 v0.7.41/go.mod h1:4dCEtLHGh8QPxHEkgq+nFaky7yZxQuYwgSJM87icDaw=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0=
+github.com/tencentyun/cos-go-sdk-v5 v0.7.42 h1:Up1704BJjI5orycXKjpVpvuOInt9GC5pqY4knyE9Uds=
+github.com/tencentyun/cos-go-sdk-v5 v0.7.42/go.mod h1:LUFnaqRmGk6pEHOaRmdn2dCZR2j0cSsM5xowWFPTPao=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
From 66b64d1b3fad3c02f376f7ec2da6fc9e3f28f7b7 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751NSS@gmail.com>
Date: Mon, 31 Jul 2023 10:08:43 +0800
Subject: [PATCH 30/48] docs: more about docker image install (#718)
docs: more about docker image install
---
docs/conversions/images.md | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/docs/conversions/images.md b/docs/conversions/images.md
index ae85a5bab..f2072dea2 100644
--- a/docs/conversions/images.md
+++ b/docs/conversions/images.md
@@ -2,6 +2,7 @@
OpenIM is an efficient, stable, and scalable instant messaging framework that provides convenient deployment methods through Docker images. OpenIM manages multiple image sources, hosted respectively on GitHub (ghcr), Alibaba Cloud, and Docker Hub. This document is aimed at detailing the image management strategy of OpenIM and providing the steps for pulling these images.
+
## Image Management Strategy
OpenIM's versions correspond to GitHub's tag versions. Each time we release a new version and tag it on GitHub, an automated process is triggered that pushes the new Docker image version to the following three platforms:
@@ -10,10 +11,41 @@ OpenIM's versions correspond to GitHub's tag versions. Each time we release a ne
2. **Alibaba Cloud (registry.cn-hangzhou.aliyuncs.com):** For users in Mainland China, we also host OpenIM's Docker images on Alibaba Cloud to provide faster pull speeds. You can view all Alibaba Cloud images on this [page](https://cr.console.aliyun.com/cn-hangzhou/instances/repositories) of Alibaba Cloud Image Service (note that you need to log in to your Alibaba Cloud account first).
3. **Docker Hub (docker.io):** Docker Hub is the most commonly used Docker image hosting platform, and we also host OpenIM's images there to facilitate developers worldwide. You can view all Docker Hub images on the [OpenIM's Docker Hub page](https://hub.docker.com/r/openim).
+
+## OpenIM Image Design and Usage Guide
+
+OpenIM offers a comprehensive and flexible system of Docker images, available across multiple repositories. We actively maintain these images across different platforms, namely GitHub's ghcr.io, Alibaba Cloud, and Docker Hub. However, we highly recommend ghcr.io for deployment.
+
+### Available Versions
+
+We provide multiple versions of our images to meet different project requirements. Here's a quick overview of what you can expect:
+
+1. `main`: This image corresponds to the latest version of the main branch in OpenIM. It is updated frequently, making it perfect for users who want to stay at the cutting edge of our features.
+2. `release-v3.*`: This is the image that corresponds to the latest version of OpenIM's stable release branch. It's ideal for users who prefer a balance between new features and stability.
+3. `v3.*.*`: These images are specific to each tag in OpenIM. They are preserved in their original state and are never overwritten. These are the go-to images for users who need a specific, unchanging version of OpenIM.
+
+### Multi-Architecture Images
+
+In order to cater to a wider range of needs, some of our images are provided with multiple architectures under `OS / Arch`. These images offer greater compatibility across different operating systems and hardware architectures, ensuring that OpenIM can be deployed virtually anywhere.
+
+**Example:**
+
++ [https://github.com/OpenIMSDK/chat/pkgs/container/openim-chat/113925695?tag=v1.1.0](https://github.com/OpenIMSDK/chat/pkgs/container/openim-chat/113925695?tag=v1.1.0)
+
+
## Methods and Steps for Pulling Images
When pulling OpenIM's Docker images, you can choose the most suitable source based on your geographic location and network conditions. Here are the steps to pull OpenIM images from each source:
+### Select image
+
+1. Choose the image repository platform you prefer. As previously mentioned, we recommend [OpenIM ghcr.io](https://github.com/orgs/OpenIMSDK/packages).
+
+2. Choose the image name and image version that suits your needs. Refer to the description above for more details.
+
+
+### Install image
+
1. First, make sure Docker is installed on your machine. If not, you can refer to the [Docker official documentation](https://docs.docker.com/get-docker/) for installation.
2. Open the terminal and run the following commands to pull the images:
@@ -66,4 +98,4 @@ When pulling OpenIM's Docker images, you can choose the most suitable source bas
3. Run the `docker images` command to confirm that the image has been successfully pulled.
-This concludes OpenIM's image management strategy and the steps for pulling images. If you have any questions, please feel free to ask.
\ No newline at end of file
+This concludes OpenIM's image management strategy and the steps for pulling images. If you have any questions, please feel free to ask.
From be10c57153df39aeb32e1bdea2444224722f937a Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751NSS@gmail.com>
Date: Mon, 31 Jul 2023 10:13:13 +0800
Subject: [PATCH 31/48] Update README.md (#719)
---
docs/conversions/README.md | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/docs/conversions/README.md b/docs/conversions/README.md
index 05fd7dcb1..e8532728c 100644
--- a/docs/conversions/README.md
+++ b/docs/conversions/README.md
@@ -1,9 +1,10 @@
## OpenIM Project Development Standards
-- [Code Standards](https://chat.openai.com/go_code.md)
-- [Directory Standards](https://chat.openai.com/directory.md)
-- [Commit Standards](https://chat.openai.com/commit.md)
-- [Versioning Standards](https://chat.openai.com/version.md)
-- [Interface Standards](https://chat.openai.com/api.md)
-- [Log Standards](https://chat.openai.com/log.md)
-- [Error Code Standards](https://chat.openai.com/error_code.md)
\ No newline at end of file
+- [Code Standards](./go_code.md)
+- [Docker Images Standards](./images.md)
+- [Directory Standards](./directory.md)
+- [Commit Standards](./commit.md)
+- [Versioning Standards](./version.md)
+- [Interface Standards](./api.md)
+- [Log Standards](./log.md)
+- [Error Code Standards](./error_code.md)
From 1ca6c97364e8c109d618e248042dd16ae3186909 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751NSS@gmail.com>
Date: Mon, 31 Jul 2023 11:33:20 +0800
Subject: [PATCH 32/48] Release/v3.1 merge (#724)
* docs: add readme docs
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix bug: reject group req bug
* feat: add go relase
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix bug: join group failed
* fix bug: join group failed
* synchronize the image and tag name of open-im-server
* restore the IP in the env to 127.0.0.1
* synchronize the image and tag name of chat
* fix: docker images (#702)
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: adjust the order: first replace the values in the .env file, then replace the configuration in the config file
* fix: adjust the order: first replace the values in the .env file, then replace the configuration in the config file
* fix: adjust the order: first replace the values in the .env file, then replace the configuration in the config file
* fix: get userid function call rpc and message gateway add status change callback (#699)
* fix: to start im or chat, ZooKeeper must be started first.
* fix: msg gateway start output err info
Signed-off-by: Gordon <1432970085@qq.com>
* fix: msg gateway start output err info
Signed-off-by: Gordon <1432970085@qq.com>
* chore: package path changes
Signed-off-by: withchao <993506633@qq.com>
* fix: go mod update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* chore: package path changes
Signed-off-by: withchao <993506633@qq.com>
* chore: package path changes
Signed-off-by: withchao <993506633@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: token update
Signed-off-by: Gordon <1432970085@qq.com>
* fix: get all userID
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
* fix: msggateway add online status call
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
---------
Signed-off-by: Gordon <1432970085@qq.com>
Signed-off-by: withchao <993506633@qq.com>
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
Co-authored-by: withchao <993506633@qq.com>
* Update version.md (#703)
* Update version.md (#704)
* docs: update create CODE_OF_CONDUCT.md (#705)
* fix: docker images (#706)
* fix: docker images
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: chat scripts config
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* Update docker-compose.yaml (#707)
* fix: docker images (#709)
* fix: docker images
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: chat scripts config
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* Create dependabot.yml (#708)
* Update golang.mk (#710)
* build(deps): bump github.com/minio/minio-go/v7 from 7.0.59 to 7.0.61 (#711)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.59 to 7.0.61.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.59...v7.0.61)
---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump github.com/go-sql-driver/mysql from 1.6.0 to 1.7.1 (#713)
Bumps [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) from 1.6.0 to 1.7.1.
- [Release notes](https://github.com/go-sql-driver/mysql/releases)
- [Changelog](https://github.com/go-sql-driver/mysql/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-sql-driver/mysql/compare/v1.6.0...v1.7.1)
---
updated-dependencies:
- dependency-name: github.com/go-sql-driver/mysql
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump google.golang.org/api from 0.114.0 to 0.134.0 (#714)
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.114.0 to 0.134.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.114.0...v0.134.0)
---
updated-dependencies:
- dependency-name: google.golang.org/api
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump gorm.io/driver/mysql from 1.3.5 to 1.5.1 (#712)
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.3.5 to 1.5.1.
- [Commits](https://github.com/go-gorm/mysql/compare/v1.3.5...v1.5.1)
---
updated-dependencies:
- dependency-name: gorm.io/driver/mysql
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump github.com/tencentyun/cos-go-sdk-v5 (#715)
Bumps [github.com/tencentyun/cos-go-sdk-v5](https://github.com/tencentyun/cos-go-sdk-v5) from 0.7.41 to 0.7.42.
- [Release notes](https://github.com/tencentyun/cos-go-sdk-v5/releases)
- [Changelog](https://github.com/tencentyun/cos-go-sdk-v5/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tencentyun/cos-go-sdk-v5/compare/v0.7.41...v0.7.42)
---
updated-dependencies:
- dependency-name: github.com/tencentyun/cos-go-sdk-v5
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs: more about docker image install (#718)
docs: more about docker image install
* Update README.md (#719)
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
Signed-off-by: Gordon <1432970085@qq.com>
Signed-off-by: withchao <993506633@qq.com>
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
Signed-off-by: dependabot[bot]
Co-authored-by: wangchuxiao
Co-authored-by: skiffer-git <72860476+skiffer-git@users.noreply.github.com>
Co-authored-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
Co-authored-by: withchao <993506633@qq.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
scripts/install_im_server.sh | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/scripts/install_im_server.sh b/scripts/install_im_server.sh
index 33f5f241a..0961193f1 100755
--- a/scripts/install_im_server.sh
+++ b/scripts/install_im_server.sh
@@ -37,12 +37,24 @@ function onCtrlC () {
exit 1
}
+# Load environment variables from .env file
+source ${OPENIM_ROOT}/.env
+
# Get the public internet IP address
internet_ip=$(curl ifconfig.me -s)
echo -e "${PURPLE_PREFIX}=========> Your public internet IP address is ${internet_ip} ${COLOR_SUFFIX} \n"
-# Load environment variables from .env file
-source ${OPENIM_ROOT}/.env
+# Replace local IP address with the public IP address in .env file
+if [ $API_URL == "http://127.0.0.1:10002/object/" ]; then
+ sed -i "s/127.0.0.1/${internet_ip}/" ${OPENIM_ROOT}/.env
+fi
+
+if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
+ sed -i "s/127.0.0.1/${internet_ip}/" ${OPENIM_ROOT}/.env
+fi
+
+
+
echo -e "${PURPLE_PREFIX}=========> Your minio endpoint is ${MINIO_ENDPOINT} ${COLOR_SUFFIX} \n"
@@ -59,15 +71,6 @@ echo -e "${PURPLE_PREFIX}=========> env_check.sh ${COLOR_SUFFIX} \n"
${SCRIPTS_ROOT}/env_check.sh
-# Replace local IP address with the public IP address in .env file
-if [ $API_URL == "http://127.0.0.1:10002/object/" ]; then
- sed -i "s/127.0.0.1/${internet_ip}/" ${OPENIM_ROOT}/.env
-fi
-
-if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
- sed -i "s/127.0.0.1/${internet_ip}/" ${OPENIM_ROOT}/.env
-fi
-
# Go back to the previous directory
cd ${OPENIM_ROOT}
@@ -79,4 +82,4 @@ else
docker compose up -d
fi
-${SCRIPTS_ROOT}/docker_check_service.sh
\ No newline at end of file
+${SCRIPTS_ROOT}/docker_check_service.sh
From 74313d54c2d25d8eeaad630db5e8f2843ee902e6 Mon Sep 17 00:00:00 2001
From: WangchuXiao
Date: Mon, 31 Jul 2023 11:53:53 +0800
Subject: [PATCH 33/48] fix bug: /msg/batch_send_msg isSendAll param not effect
send msg to all user (#725)
* docs: add readme docs
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix bug: reject group req bug
* feat: add go relase
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix bug: join group failed
* fix bug: join group failed
* fix: get userid function call rpc and message gateway add status change callback (#700)
Co-authored-by: withchao <993506633@qq.com>
* fix bug: send all not send msg 2 all user
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
Co-authored-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
Co-authored-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
Co-authored-by: withchao <993506633@qq.com>
---
internal/api/msg.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/internal/api/msg.go b/internal/api/msg.go
index 8480ac7d3..e4a8fda17 100644
--- a/internal/api/msg.go
+++ b/internal/api/msg.go
@@ -262,8 +262,8 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) {
apiresp.GinError(c, err)
return
}
+ recvIDs = append(recvIDs, recvIDsPart...)
if len(recvIDsPart) < showNumber {
- recvIDs = append(recvIDs, recvIDsPart...)
break
}
pageNumber++
From 62141fa1214b56ca7b1d5e95583b0623c8046ded Mon Sep 17 00:00:00 2001
From: Alan <68671759+hanzhixiao@users.noreply.github.com>
Date: Mon, 31 Jul 2023 15:37:46 +0800
Subject: [PATCH 34/48] Docs: Update README.md (#726)
---
README.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3c52475f3..5ed6664db 100644
--- a/README.md
+++ b/README.md
@@ -89,9 +89,12 @@ make check
### Compile from source
Ur need `Go 1.18` or higher version, and `make`.
+
+Version Details: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md
+
```bash
# choose what you need
-BRANCH=release-v3.0
+BRANCH=release-v3.1
git clone -b $BRANCH https://github.com/OpenIMSDK/Open-IM-Server openim && export openim=$(pwd)/openim && cd $openim && make build
```
Read about the [OpenIM Version Policy](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md)
From b131013b3f15d89f141beb50e07bf6b178adfdff Mon Sep 17 00:00:00 2001
From: withchao <48119764+withchao@users.noreply.github.com>
Date: Mon, 31 Jul 2023 17:41:40 +0800
Subject: [PATCH 35/48] feat: add get_group_member_user_id api (#734)
---
internal/api/group.go | 4 ++++
internal/api/route.go | 1 +
2 files changed, 5 insertions(+)
diff --git a/internal/api/group.go b/internal/api/group.go
index ab397a8ac..ad640e74f 100644
--- a/internal/api/group.go
+++ b/internal/api/group.go
@@ -139,3 +139,7 @@ func (o *GroupApi) GroupCreateCount(c *gin.Context) {
func (o *GroupApi) GetGroups(c *gin.Context) {
a2r.Call(group.GroupClient.GetGroups, o.Client, c)
}
+
+func (o *GroupApi) GetGroupMemberUserIDs(c *gin.Context) {
+ a2r.Call(group.GroupClient.GetGroupMemberUserIDs, o.Client, c)
+}
diff --git a/internal/api/route.go b/internal/api/route.go
index 1926b55f1..5dd0c4cc7 100644
--- a/internal/api/route.go
+++ b/internal/api/route.go
@@ -129,6 +129,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
groupRouterGroup.POST("/set_group_member_info", g.SetGroupMemberInfo)
groupRouterGroup.POST("/get_group_abstract_info", g.GetGroupAbstractInfo)
groupRouterGroup.POST("/get_groups", g.GetGroups)
+ groupRouterGroup.POST("/get_group_member_user_id", g.GetGroupMemberUserIDs)
}
superGroupRouterGroup := r.Group("/super_group", ParseToken)
{
From fb021baf526fe6922f56b45a0eb8ecb77c6b37ec Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751NSS@gmail.com>
Date: Mon, 31 Jul 2023 18:39:47 +0800
Subject: [PATCH 36/48] docs: update readme version (#735)
---
docs/conversions/version.md | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/docs/conversions/version.md b/docs/conversions/version.md
index 06e34543b..c8a3dbd1c 100644
--- a/docs/conversions/version.md
+++ b/docs/conversions/version.md
@@ -6,21 +6,36 @@ OpenIM, the open source project, employs a comprehensive version management syst
## Main Branch
-The `main` branch is where all the latest code resides. It's the hub of activity, embodying all the cutting-edge features that are currently being developed or updated. However, since it's subject to frequent changes and updates, it may not always represent the most stable version of the software. Access the `main` branch [here](https://github.com/openimsdk/openim-server/tree/main).
+The `main` branch is where all the latest code resides. It's the hub of activity, embodying all the cutting-edge features that are currently being developed or updated. However, since it's subject to frequent changes and updates, it may not always represent the most stable version of the software. Access the `main` branch [here](https://github.com/OpenIMSDK/Open-IM-Server/tree/main).
## Release Branch
-On the other hand, we have the `release` branch. For instance, in the context of version 3.1, we maintain a `release-v3.1` branch. Unlike the `main` branch, the release branch is designed to be a continuously stable and updated version of the software. This provides a reliable option for users who prefer stability over the latest, but potentially unstable, features. Access the `release-v3.1` branch [here](https://github.com/openimsdk/openim-server/tree/release-v3.1).
+On the other hand, we have the `release` branch. For instance, in the context of version 3.1, we maintain a `release-v3.1` branch. Unlike the `main` branch, the release branch is designed to be a continuously stable and updated version of the software. This provides a reliable option for users who prefer stability over the latest, but potentially unstable, features. Access the `release-v3.1` branch [here](https://github.com/OpenIMSDK/Open-IM-Server/tree/release-v3.1).
## Tag Management
-Finally, there's `tag` management. Despite having both `main` and `release` branches, `tag` serves a crucial role. Tags are immutable, i.e., they remain unchanged once created. Therefore, if you need a specific version of the software, you can use the corresponding tag. Check out the available tags [here](https://github.com/openimsdk/openim-server/tags).
+In addition to the `main` and `release` branches, `tag` also plays a pivotal role in version control. Tags are immutable, meaning once they're created, they remain unchanged. Therefore, if you need a specific version of the software, you can use the corresponding tag. All of our available tags can be viewed [here](https://github.com/OpenIMSDK/Open-IM-Server/tags).
-Moreover, our Docker image versions are closely tied with these three components. For instance, a tag might correspond to the Docker image `ghcr.io/openimsdk/openim-server:v3.1.0`, a release would be `ghcr.io/openimsdk/openim-server:release-v3.0`, and the main branch might be represented as `ghcr.io/openimsdk/openim-server:main` or `ghcr.io/openimsdk/openim-server:latest`.
+Moreover, our Docker image versions are closely tied with these three components. For example, a tag might correspond to the Docker image `ghcr.io/openimsdk/openim-server:v3.1.0`, a release might be represented as `ghcr.io/openimsdk/openim-server:release-v3.0`, and the main branch could be represented as `ghcr.io/openimsdk/openim-server:main` or `ghcr.io/openimsdk/openim-server:latest`.
-To find out more, or to contribute to our project, please visit our GitHub repository at [OpenIM Server](https://github.com/openimsdk/openim-server).
+Here is the specification of our version numbers:
-We believe that this approach offers a balanced blend of innovation and stability, enabling us to provide the best possible software to our users.
+- **Revision version number**: The third digit of the version number, representing bug fixes or code optimizations, usually no new features are added and it is backward compatible with older versions.
+
+- **Build version number**: Usually automatically generated by the system, every code submission will result in an automatic increment by 1.
+
+- Version modifiers
+
+ : These can represent the development stage and stability of the software. Common ones include:
+
+ - `alpha`: An internal testing version with many bugs, generally used for communication among developers.
+ - `beta`: A test version with many bugs, generally used for testing by eager community members, who provide feedback to the developers.
+ - `rc`: Release candidate, to be released as the official version, it's the last test version before the official version.
+ - `ga`: General Availability, the first stable release.
+ - `r/release/or nothing`: The final release version, intended for general users.
+ - `lts`: Long Term Support, the official will specify the maintenance year for this version and will fix all bugs found in this version.
+
+When adding partial functions to the project, the minor version number increases by 1, and the revision version number resets to 0. When there are major changes in the project, the major version number increases by 1. The build number is generally automatically generated by the compiler during the compilation process, only the format needs to be defined, and it does not need to be manually controlled.
## OpenIM version
From 4e7f7e8605fbaf572f64ec3708201bbede33e37e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 31 Jul 2023 18:41:18 +0800
Subject: [PATCH 37/48] build(deps): bump github.com/spf13/cobra from 1.6.1 to
1.7.0 (#727)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.6.1...v1.7.0)
---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 4 ++--
go.sum | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/go.mod b/go.mod
index e016ff06f..0e2045aa8 100644
--- a/go.mod
+++ b/go.mod
@@ -77,7 +77,7 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
- github.com/inconshreveable/mousetrap v1.0.1 // indirect
+ github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
@@ -134,7 +134,7 @@ require (
github.com/goccy/go-json v0.10.2 // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
- github.com/spf13/cobra v1.6.1
+ github.com/spf13/cobra v1.7.0
github.com/ugorji/go/codec v1.2.11 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
diff --git a/go.sum b/go.sum
index 067ef5301..49db92e88 100644
--- a/go.sum
+++ b/go.sum
@@ -180,8 +180,8 @@ github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2I
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
-github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
-github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
+github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
+github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=
@@ -298,8 +298,8 @@ github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
-github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
-github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
+github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
+github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
From f971a148c88d9d4007264fcc8b390b53d6644df7 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 31 Jul 2023 18:41:41 +0800
Subject: [PATCH 38/48] build(deps): bump
github.com/go-playground/validator/v10 (#728)
Bumps [github.com/go-playground/validator/v10](https://github.com/go-playground/validator) from 10.14.0 to 10.14.1.
- [Release notes](https://github.com/go-playground/validator/releases)
- [Commits](https://github.com/go-playground/validator/compare/v10.14.0...v10.14.1)
---
updated-dependencies:
- dependency-name: github.com/go-playground/validator/v10
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 0e2045aa8..d6be16329 100644
--- a/go.mod
+++ b/go.mod
@@ -8,7 +8,7 @@ require (
github.com/bwmarrin/snowflake v0.3.0 // indirect
github.com/dtm-labs/rockscache v0.1.1
github.com/gin-gonic/gin v1.9.1
- github.com/go-playground/validator/v10 v10.14.0
+ github.com/go-playground/validator/v10 v10.14.1
github.com/gogo/protobuf v1.3.2
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/protobuf v1.5.3
diff --git a/go.sum b/go.sum
index 49db92e88..623e24cbf 100644
--- a/go.sum
+++ b/go.sum
@@ -100,8 +100,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
-github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
-github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
+github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k=
+github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
From 37611ab0dd32b97e8999549412a0e5f153016235 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 31 Jul 2023 18:43:25 +0800
Subject: [PATCH 39/48] build(deps): bump google.golang.org/grpc from 1.56.2 to
1.57.0 (#730)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.56.2 to 1.57.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.56.2...v1.57.0)
---
updated-dependencies:
- dependency-name: google.golang.org/grpc
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index d6be16329..002456235 100644
--- a/go.mod
+++ b/go.mod
@@ -27,7 +27,7 @@ require (
go.mongodb.org/mongo-driver v1.12.0
golang.org/x/image v0.9.0 // indirect
google.golang.org/api v0.134.0
- google.golang.org/grpc v1.56.2
+ google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/mysql v1.5.1
diff --git a/go.sum b/go.sum
index 623e24cbf..39d3269cc 100644
--- a/go.sum
+++ b/go.sum
@@ -486,8 +486,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
-google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI=
-google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
+google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
+google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
From a7acc8d9d27a922faa60e41ae9bcf64020c29b55 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 31 Jul 2023 18:43:34 +0800
Subject: [PATCH 40/48] build(deps): bump github.com/stretchr/testify from
1.8.3 to 1.8.4 (#731)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.3 to 1.8.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.3...v1.8.4)
---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/go.mod b/go.mod
index 002456235..3552dc765 100644
--- a/go.mod
+++ b/go.mod
@@ -23,7 +23,7 @@ require (
github.com/prometheus/client_golang v1.16.0
github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.9.3 // indirect
- github.com/stretchr/testify v1.8.3
+ github.com/stretchr/testify v1.8.4
go.mongodb.org/mongo-driver v1.12.0
golang.org/x/image v0.9.0 // indirect
google.golang.org/api v0.134.0
diff --git a/go.sum b/go.sum
index 39d3269cc..d82a9c662 100644
--- a/go.sum
+++ b/go.sum
@@ -314,8 +314,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0=
github.com/tencentyun/cos-go-sdk-v5 v0.7.42 h1:Up1704BJjI5orycXKjpVpvuOInt9GC5pqY4knyE9Uds=
From 0ca097db8f56efa26c5128a153d0736f75d28356 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 31 Jul 2023 18:51:47 +0800
Subject: [PATCH 41/48] build(deps): bump github.com/gorilla/websocket from
1.4.2 to 1.5.0 (#729)
Bumps [github.com/gorilla/websocket](https://github.com/gorilla/websocket) from 1.4.2 to 1.5.0.
- [Release notes](https://github.com/gorilla/websocket/releases)
- [Commits](https://github.com/gorilla/websocket/compare/v1.4.2...v1.5.0)
---
updated-dependencies:
- dependency-name: github.com/gorilla/websocket
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 3552dc765..9180c49f3 100644
--- a/go.mod
+++ b/go.mod
@@ -12,7 +12,7 @@ require (
github.com/gogo/protobuf v1.3.2
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/protobuf v1.5.3
- github.com/gorilla/websocket v1.4.2
+ github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/jinzhu/copier v0.3.5
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
diff --git a/go.sum b/go.sum
index d82a9c662..e804eb461 100644
--- a/go.sum
+++ b/go.sum
@@ -171,8 +171,8 @@ github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
-github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
-github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
+github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
+github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
From 444dc1ae6eba7ff44053a4899bcac3bf2b8f9376 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751NSS@gmail.com>
Date: Tue, 1 Aug 2023 17:16:37 +0800
Subject: [PATCH 42/48] Update images.md (#743)
---
docs/conversions/images.md | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/docs/conversions/images.md b/docs/conversions/images.md
index f2072dea2..70401ec07 100644
--- a/docs/conversions/images.md
+++ b/docs/conversions/images.md
@@ -54,22 +54,19 @@ When pulling OpenIM's Docker images, you can choose the most suitable source bas
- Pull from GitHub:
- ```
- bashCopy code
+ ```bash
docker pull ghcr.io/openimsdk/openim-server:latest
```
- Pull from Alibaba Cloud:
- ```
- bashCopy code
+ ```bash
docker pull registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
```
- Pull from Docker Hub:
- ```
- bashCopy code
+ ```bash
docker pull docker.io/openim/openim-server:latest
```
@@ -77,22 +74,19 @@ When pulling OpenIM's Docker images, you can choose the most suitable source bas
- Pull from GitHub:
- ```
- bashCopy code
+ ```bash
docker pull ghcr.io/openimsdk/openim-chat:latest
```
- Pull from Alibaba Cloud:
- ```
- bashCopy code
+ ```bash
docker pull registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat:latest
```
- Pull from Docker Hub:
- ```
- bashCopy code
+ ```bash
docker pull docker.io/openim/openim-chat:latest
```
From b514bd89341bfafa30109808993432693b4160c7 Mon Sep 17 00:00:00 2001
From: pluto <83957921+plutoyty@users.noreply.github.com>
Date: Tue, 1 Aug 2023 22:10:02 +0800
Subject: [PATCH 43/48] Nginx reverse proxy and TLS configuration (#742)
* Resolving code conflicts after project directory changes and Add subscribe and unsubscribe mongodb operations
* Organize and update module dependencies
* Get user online status
* Get user online status
* Get user online status
* Nginx reverse proxy and TLS configuration
* update "Nginx reverse proxy and TLS configuration"
---
config/open-im-ng-example.conf | 102 ++++++---------------------------
1 file changed, 18 insertions(+), 84 deletions(-)
diff --git a/config/open-im-ng-example.conf b/config/open-im-ng-example.conf
index a817f7357..e5e584ff8 100644
--- a/config/open-im-ng-example.conf
+++ b/config/open-im-ng-example.conf
@@ -4,38 +4,28 @@ upstream im_msg_gateway{
upstream im_api{
server 127.0.0.1:10002; #IM群组用户api服务器地址 根据部署情况可指定多台
}
-upstream im_jssdk_gateway{
- server 127.0.0.1:10003; #IM jssdk服务器地址 根据部署情况可指定多台
- }
upstream storage {
server 127.0.0.1:10005; #MinIO服务器地址 暂时支持1台
}
-upstream im_admin{
- server 127.0.0.1:10006; #IM admin服务器地址 根据部署情况可指定多台
- }
upstream im_grafana{
server 127.0.0.1:10007; #IM 统计服务器地址 docker-compose启动所在机器
}
-upstream im_chat{
+upstream im_chat_api{
server 127.0.0.1:10008; #IM 商业版登录注册服务器地址 根据部署情况可指定多台
}
-upstream im_complete_admin{
+upstream im_admin_api{
server 127.0.0.1:10009; #IM 商业版admin地址 根据部署情况可指定多台
}
-upstream im_organization{
- server 127.0.0.1:10010; #IM 商业版组织架构服务器地址 根据部署情况可指定多台
- }
upstream im_open_rtc{
server 127.0.0.1:7880; #rtc 音视频通话 服务器地址 根据部署情况可指定多台
}
-
server {
listen 443;
- server_name web.rentsoft.cn; #1 web im 端 域名
+ server_name test-web.rentsoft.cn; #1 web im 端 域名
ssl on;
- ssl_certificate /etc/nginx/conf.d/ssl/web.rentsoft.cn.crt; #2 证书
- ssl_certificate_key /etc/nginx/conf.d/ssl/web.rentsoft.cn.key; #3 证书
+ ssl_certificate /etc/nginx/conf.d/ssl/test-web.rentsoft.cn.crt; #2 证书
+ ssl_certificate_key /etc/nginx/conf.d/ssl/test-web.rentsoft.cn.key; #3 证书
ssl_session_timeout 5m;
gzip on;
gzip_min_length 1k;
@@ -72,22 +62,6 @@ server {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://im_api/;
}
- location /jssdk_gateway { #10003 jssdk
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "Upgrade";
- proxy_set_header X-real-ip $remote_addr;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_pass http://im_jssdk_gateway/;
- }
- location ^~/admin/ { #10006 admin
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "Upgrade";
- proxy_set_header X-real-ip $remote_addr;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_pass http://im_admin/;
- }
location ^~/grafana/ { #10007 prometheus
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@@ -96,29 +70,21 @@ server {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://im_grafana/;
}
- location ^~/chat/ { #10008 chat login
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "Upgrade";
- proxy_set_header X-real-ip $remote_addr;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_pass http://im_chat/;
- }
+ location ^~/chat/ { #10008 im_chat_api
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "Upgrade";
+ proxy_set_header X-real-ip $remote_addr;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_pass http://im_chat_api/;
+ }
location ^~/complete_admin/ { #10009 admin
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
- proxy_pass http://im_complete_admin/;
- }
- location ^~/organization/ { #10010 organization
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "Upgrade";
- proxy_set_header X-real-ip $remote_addr;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_pass http://im_organization/;
+ proxy_pass http://im_admin_api/;
}
location ^~/open_rtc/ { #7880 rtc
proxy_http_version 1.1;
@@ -132,17 +98,17 @@ server {
server {
listen 80;
- server_name web.rentsoft.cn ; #1 web im 端 域名
+ server_name test-web.rentsoft.cn ; #1 web im 端 域名
rewrite ^(.*)$ https://${server_name}$1 permanent;
}
server {
ssl_session_timeout 5m;
listen 443;
- server_name storage.rentsoft.cn; #1 MinIO存储域名
+ server_name test-storage.rentsoft.cn; #1 MinIO存储域名
ssl on;
- ssl_certificate /etc/nginx/conf.d/ssl/storage.rentsoft.cn.crt; #证书
- ssl_certificate_key /etc/nginx/conf.d/ssl/storage.rentsoft.cn.key; #证书
+ ssl_certificate /etc/nginx/conf.d/ssl/test-storage.rentsoft.cn.crt; #证书
+ ssl_certificate_key /etc/nginx/conf.d/ssl/test-storage.rentsoft.cn.key; #证书
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
@@ -160,35 +126,3 @@ server {
client_max_body_size 8000M;
}
}
-
-
-server {
- listen 443;
- server_name admin.rentsoft.cn; #后台管理域名
- ssl on;
- ssl_certificate /etc/nginx/conf.d/ssl/admin.rentsoft.cn.crt; # 证书
- ssl_certificate_key /etc/nginx/conf.d/ssl/admin.rentsoft.cn.key; #证书
- ssl_session_timeout 5m;
- gzip on;
- gzip_min_length 1k;
- gzip_buffers 4 16k;
- gzip_comp_level 2;
- gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
- gzip_vary off;
- gzip_disable "MSIE [1-6]\.";
- location / {
- proxy_set_header Host $host;
- proxy_set_header X-Real-Ip $remote_addr;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_set_header X-NginX-Proxy true;
- root /data1/online/Open-IM-Admin/dist/; #管理后台web静态资源存放路径
- index index.html;
- try_files $uri $uri/ /index.html;
- }
-}
-
-server {
- listen 80;
- server_name admin.rentsoft.cn; #管理后台 域名
- rewrite ^(.*)$ https://${server_name}$1 permanent;
-}
From 31cd19af0945c37f6b469b52f463db3e2ebc8127 Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751NSS@gmail.com>
Date: Wed, 2 Aug 2023 10:24:15 +0800
Subject: [PATCH 44/48] Update docker-compose.yaml (#745)
---
docker-compose.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 394232df3..c28c8bc96 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -100,7 +100,7 @@ services:
openim_server:
- image: ghcr.io/openimsdk/openim-server:latest
+ image: ghcr.io/openimsdk/openim-server:main
container_name: openim-server
volumes:
- ./logs:/Open-IM-Server/logs
@@ -124,7 +124,7 @@ services:
max-file: "2"
openim_chat:
- image: ghcr.io/openimsdk/openim-chat:latest
+ image: ghcr.io/openimsdk/openim-chat:main
container_name: openim_chat
restart: always
depends_on:
From d9dbd739ab7b1539af5e81794fba666c39bbeb30 Mon Sep 17 00:00:00 2001
From: withchao <48119764+withchao@users.noreply.github.com>
Date: Wed, 2 Aug 2023 10:41:34 +0800
Subject: [PATCH 45/48] feat: Perfect with rpc but no api (#747)
* feat: add get_group_member_user_id api
* feat: add SendBusinessNotification api
* feat: add GetFriendIDs api
* update pkg
---
go.mod | 2 +-
go.sum | 4 ++--
internal/api/friend.go | 4 ++++
internal/api/msg.go | 47 ++++++++++++++++++++++++++++++++++++++++++
internal/api/route.go | 2 ++
5 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 9180c49f3..cbaca83b8 100644
--- a/go.mod
+++ b/go.mod
@@ -38,7 +38,7 @@ require github.com/google/uuid v1.3.0
require (
github.com/OpenIMSDK/protocol v0.0.3
- github.com/OpenIMSDK/tools v0.0.5
+ github.com/OpenIMSDK/tools v0.0.13
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
github.com/go-redis/redis v6.15.9+incompatible
github.com/go-sql-driver/mysql v1.7.1
diff --git a/go.sum b/go.sum
index e804eb461..0e6352156 100644
--- a/go.sum
+++ b/go.sum
@@ -19,8 +19,8 @@ firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIw
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/OpenIMSDK/protocol v0.0.3 h1:CFQtmnyW+1dYKVFaVaHcJ6oYuMiMdNfU2gC1xz3K/9I=
github.com/OpenIMSDK/protocol v0.0.3/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
-github.com/OpenIMSDK/tools v0.0.5 h1:yBVHJ3EpIDcp8VFKPjuGr6MQvFa3t4JByZ+vmeC06/Q=
-github.com/OpenIMSDK/tools v0.0.5/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
+github.com/OpenIMSDK/tools v0.0.13 h1:rcw4HS8S2DPZR9UOBxD8/ol9UBMzXBypzOVEytDRIMo=
+github.com/OpenIMSDK/tools v0.0.13/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
github.com/Shopify/sarama v1.29.0 h1:ARid8o8oieau9XrHI55f/L3EoRAhm9px6sonbD7yuUE=
github.com/Shopify/sarama v1.29.0/go.mod h1:2QpgD79wpdAESqNQMxNc0KYMkycd4slxGdV3TWSVqrU=
diff --git a/internal/api/friend.go b/internal/api/friend.go
index f64a99ef3..91fc30347 100644
--- a/internal/api/friend.go
+++ b/internal/api/friend.go
@@ -83,3 +83,7 @@ func (o *FriendApi) ImportFriends(c *gin.Context) {
func (o *FriendApi) IsFriend(c *gin.Context) {
a2r.Call(friend.FriendClient.IsFriend, o.Client, c)
}
+
+func (o *FriendApi) GetFriendIDs(c *gin.Context) {
+ a2r.Call(friend.FriendClient.GetFriendIDs, o.Client, c)
+}
diff --git a/internal/api/msg.go b/internal/api/msg.go
index e4a8fda17..e7f06dffa 100644
--- a/internal/api/msg.go
+++ b/internal/api/msg.go
@@ -16,6 +16,8 @@ package api
import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
+ "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
+ "github.com/OpenIMSDK/tools/mcontext"
"github.com/gin-gonic/gin"
"github.com/go-playground/validator/v10"
"github.com/mitchellh/mapstructure"
@@ -234,6 +236,51 @@ func (m *MessageApi) SendMessage(c *gin.Context) {
apiresp.GinSuccess(c, respPb)
}
+func (m *MessageApi) SendBusinessNotification(c *gin.Context) {
+ req := struct {
+ Key string `json:"key"`
+ Data string `json:"data"`
+ SendUserID string `json:"sendUserID"`
+ RecvUserID string `json:"recvUserID"`
+ }{}
+ if err := c.BindJSON(&req); err != nil {
+ apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
+ return
+ }
+ if !authverify.IsAppManagerUid(c) {
+ apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
+ return
+ }
+ sendMsgReq := msg.SendMsgReq{
+ MsgData: &sdkws.MsgData{
+ SendID: req.SendUserID,
+ RecvID: req.RecvUserID,
+ Content: []byte(utils.StructToJsonString(&sdkws.NotificationElem{
+ Detail: utils.StructToJsonString(&struct {
+ Key string `json:"key"`
+ Data string `json:"data"`
+ }{Key: req.Key, Data: req.Data}),
+ })),
+ MsgFrom: constant.SysMsgType,
+ ContentType: constant.BusinessNotification,
+ SessionType: constant.SingleChatType,
+ CreateTime: utils.GetCurrentTimestampByMill(),
+ ClientMsgID: utils.GetMsgID(mcontext.GetOpUserID(c)),
+ Options: config.GetOptionsByNotification(config.NotificationConf{
+ IsSendMsg: false,
+ ReliabilityLevel: 1,
+ UnreadCount: false,
+ }),
+ },
+ }
+ respPb, err := m.Client.SendMsg(c, &sendMsgReq)
+ if err != nil {
+ apiresp.GinError(c, err)
+ return
+ }
+ apiresp.GinSuccess(c, respPb)
+}
+
func (m *MessageApi) BatchSendMsg(c *gin.Context) {
var (
req apistruct.BatchSendMsgReq
diff --git a/internal/api/route.go b/internal/api/route.go
index 5dd0c4cc7..5fd3f115a 100644
--- a/internal/api/route.go
+++ b/internal/api/route.go
@@ -102,6 +102,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
friendRouterGroup.POST("/remove_black", f.RemoveBlack)
friendRouterGroup.POST("/import_friend", f.ImportFriends)
friendRouterGroup.POST("/is_friend", f.IsFriend)
+ friendRouterGroup.POST("/get_friend_id", f.GetFriendIDs)
}
g := NewGroupApi(*groupRpc)
groupRouterGroup := r.Group("/group", ParseToken)
@@ -167,6 +168,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
msgGroup.POST("/newest_seq", m.GetSeq)
msgGroup.POST("/search_msg", m.SearchMsg)
msgGroup.POST("/send_msg", m.SendMessage)
+ msgGroup.POST("/send_business_notification", m.SendBusinessNotification)
msgGroup.POST("/pull_msg_by_seq", m.PullMsgBySeqs)
msgGroup.POST("/revoke_msg", m.RevokeMsg)
msgGroup.POST("/mark_msgs_as_read", m.MarkMsgsAsRead)
From f592a3abd751ca5be42f395f5f61f1a6c2ecb8e8 Mon Sep 17 00:00:00 2001
From: pluto <83957921+plutoyty@users.noreply.github.com>
Date: Thu, 3 Aug 2023 09:44:10 +0800
Subject: [PATCH 46/48] Fix bug 755 (#758)
* Resolving code conflicts after project directory changes and Add subscribe and unsubscribe mongodb operations
* Organize and update module dependencies
* Get user online status
* Get user online status
* Get user online status
* fix-bug-755
* Modify statusmod to a prime number to reduce hash conflicts
---
pkg/common/db/cache/user.go | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/pkg/common/db/cache/user.go b/pkg/common/db/cache/user.go
index 5c76af22f..65afb400d 100644
--- a/pkg/common/db/cache/user.go
+++ b/pkg/common/db/cache/user.go
@@ -18,6 +18,8 @@ import (
"context"
"encoding/json"
"github.com/OpenIMSDK/protocol/user"
+ "github.com/OpenIMSDK/tools/errs"
+ "hash/crc32"
"strconv"
"time"
@@ -33,7 +35,7 @@ const (
userGlobalRecvMsgOptKey = "USER_GLOBAL_RECV_MSG_OPT_KEY:"
olineStatusKey = "ONLINE_STATUS:"
userOlineStatusExpireTime = time.Second * 60 * 60 * 24
- statusMod = 500
+ statusMod = 501
)
type UserCache interface {
@@ -165,11 +167,8 @@ func (u *UserCacheRedis) getOnlineStatusKey(userID string) string {
func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) {
var res []*user.OnlineStatus
for _, userID := range userIDs {
- UserIDNum, err := strconv.Atoi(userID)
- if err != nil {
- return nil, err
- }
- var modKey = strconv.Itoa(UserIDNum % statusMod)
+ UserIDNum := crc32.ChecksumIEEE([]byte(userID))
+ var modKey = strconv.Itoa(int(UserIDNum % statusMod))
var onlineStatus user.OnlineStatus
key := olineStatusKey + modKey
result, err := u.rdb.HGet(ctx, key, userID).Result()
@@ -183,12 +182,12 @@ func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([
})
continue
} else {
- return nil, err
+ return nil, errs.Wrap(err)
}
}
err = json.Unmarshal([]byte(result), &onlineStatus)
if err != nil {
- return nil, err
+ return nil, errs.Wrap(err)
}
onlineStatus.UserID = userID
res = append(res, &onlineStatus)
@@ -200,23 +199,20 @@ func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([
func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
for _, status := range list {
var isNewKey int64
- UserIDNum, err := strconv.Atoi(status.UserID)
- if err != nil {
- return err
- }
- var modKey = strconv.Itoa(UserIDNum % statusMod)
+ UserIDNum := crc32.ChecksumIEEE([]byte(status.UserID))
+ var modKey = strconv.Itoa(int(UserIDNum % statusMod))
key := olineStatusKey + modKey
jsonData, err := json.Marshal(status)
if err != nil {
- return err
+ return errs.Wrap(err)
}
isNewKey, err = u.rdb.Exists(ctx, key).Result()
if err != nil {
- return err
+ return errs.Wrap(err)
}
_, err = u.rdb.HSet(ctx, key, status.UserID, string(jsonData)).Result()
if err != nil {
- return err
+ return errs.Wrap(err)
}
if isNewKey > 0 {
u.rdb.Expire(ctx, key, userOlineStatusExpireTime)
From 4950ccf4ec5c336edfd8dc71e8dbb0aeb9175f36 Mon Sep 17 00:00:00 2001
From: pluto <83957921+plutoyty@users.noreply.github.com>
Date: Thu, 3 Aug 2023 16:04:35 +0800
Subject: [PATCH 47/48] nginx minio configuration picture can not be sent
(#763)
* fix-bug-762
* update
* example
---
config/open-im-ng-example.conf | 112 +++++++++++++++++++++++----------
1 file changed, 78 insertions(+), 34 deletions(-)
diff --git a/config/open-im-ng-example.conf b/config/open-im-ng-example.conf
index e5e584ff8..10a2ecb52 100644
--- a/config/open-im-ng-example.conf
+++ b/config/open-im-ng-example.conf
@@ -1,31 +1,37 @@
upstream im_msg_gateway{
- server 127.0.0.1:10001; #IM消息服务器地址 根据部署情况可指定多台
+ server 127.0.0.1:10001; #IM Message server address Multiple can be specified according to the deployment
}
upstream im_api{
- server 127.0.0.1:10002; #IM群组用户api服务器地址 根据部署情况可指定多台
- }
-upstream storage {
- server 127.0.0.1:10005; #MinIO服务器地址 暂时支持1台
+ server 127.0.0.1:10002; #IM Group user api server address Multiple can be specified according to the deployment
}
upstream im_grafana{
- server 127.0.0.1:10007; #IM 统计服务器地址 docker-compose启动所在机器
+ server 127.0.0.1:10007; #IM Statistical server address The machine where docker-compose starts
}
upstream im_chat_api{
- server 127.0.0.1:10008; #IM 商业版登录注册服务器地址 根据部署情况可指定多台
+ server 127.0.0.1:10008; #IM Business version login registration server address Multiple can be specified according to the deployment
}
upstream im_admin_api{
- server 127.0.0.1:10009; #IM 商业版admin地址 根据部署情况可指定多台
+ server 127.0.0.1:10009; #IM The admin address of the commercial version can specify multiple units according to the deployment situation
}
upstream im_open_rtc{
- server 127.0.0.1:7880; #rtc 音视频通话 服务器地址 根据部署情况可指定多台
+ server 127.0.0.1:7880; #rtc Audio and video call server address Multiple devices can be specified according to the deployment
}
+upstream minio_s3_2 {
+ least_conn;
+ server 127.0.0.1:10005;
+}
+
+upstream minio_console_2 {
+ least_conn;
+ server 127.0.0.1:9090;
+}
server {
listen 443;
- server_name test-web.rentsoft.cn; #1 web im 端 域名
+ server_name your-domain.com; #your-domain.com
ssl on;
- ssl_certificate /etc/nginx/conf.d/ssl/test-web.rentsoft.cn.crt; #2 证书
- ssl_certificate_key /etc/nginx/conf.d/ssl/test-web.rentsoft.cn.key; #3 证书
+ ssl_certificate /etc/nginx/conf.d/ssl/your-domain.com.crt; #2 Certificate
+ ssl_certificate_key /etc/nginx/conf.d/ssl/your-domain.com.key; #3 Certificate
ssl_session_timeout 5m;
gzip on;
gzip_min_length 1k;
@@ -42,7 +48,7 @@ server {
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-NginX-Proxy true;
- root /data1/online/Pc-Web-Demo/build/; # web im静态资源存放路径
+ root /data1/online/Pc-Web-Demo/build/; # web im static resource storage path
index index.html;
try_files $uri $uri/ /index.html;
}
@@ -98,31 +104,69 @@ server {
server {
listen 80;
- server_name test-web.rentsoft.cn ; #1 web im 端 域名
+ server_name test-web.rentsoft.cn ; #1 web im end domain name
rewrite ^(.*)$ https://${server_name}$1 permanent;
}
+
server {
- ssl_session_timeout 5m;
- listen 443;
- server_name test-storage.rentsoft.cn; #1 MinIO存储域名
- ssl on;
- ssl_certificate /etc/nginx/conf.d/ssl/test-storage.rentsoft.cn.crt; #证书
- ssl_certificate_key /etc/nginx/conf.d/ssl/test-storage.rentsoft.cn.key; #证书
- gzip on;
- gzip_min_length 1k;
- gzip_buffers 4 16k;
- gzip_comp_level 2;
- gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
- gzip_vary off;
- gzip_disable "MSIE [1-6]\.";
+ listen 443;
+
+ server_name your-domain.com; #your-domain.com
+ ssl on;
+ ssl_certificate /etc/nginx/conf.d/ssl/your-domain.com.crt; #Certificate
+ ssl_certificate_key /etc/nginx/conf.d/ssl/your-domain.com.key; #Certificate
+ gzip on;
+ gzip_min_length 1k;
+ gzip_buffers 4 16k;
+ gzip_comp_level 2;
+ gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/wasm;
+ gzip_vary off;
+ gzip_disable "MSIE [1-6]\.";
+ # Allow special characters in headers
+ ignore_invalid_headers off;
+ # Allow any size file to be uploaded.
+ # Set to a value such as 1000m; to restrict file size to a specific value
+ client_max_body_size 0;
+ # Disable buffering
+ proxy_buffering off;
+ proxy_request_buffering off;
+
location / {
- proxy_pass http://storage;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_http_version 1.1;
- client_max_body_size 8000M;
+ proxy_set_header Host $http_host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ proxy_connect_timeout 300;
+ # Default is HTTP/1, keepalive is only enabled in HTTP/1.1
+ proxy_http_version 1.1;
+ proxy_set_header Connection "";
+ chunked_transfer_encoding off;
+
+ proxy_pass http://minio_s3_2; # This uses the upstream directive definition to load balance
+ }
+
+ location /minio/ui {
+ rewrite ^/minio/ui/(.*) /$1 break;
+ proxy_set_header Host $http_host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-NginX-Proxy true;
+
+ # This is necessary to pass the correct IP to be hashed
+ real_ip_header X-Real-IP;
+
+ proxy_connect_timeout 300;
+
+ # To support websockets in MinIO versions released after January 2023
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+
+ chunked_transfer_encoding off;
+
+ proxy_pass http://minio_console_2; # This uses the upstream directive definition to load balance
}
}
From 7707375cf50087f70f506cb57db61bca5b9c294a Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 4 Aug 2023 11:15:05 +0800
Subject: [PATCH 48/48] build(deps): bump go.mongodb.org/mongo-driver from
1.12.0 to 1.12.1 (#764)
Bumps [go.mongodb.org/mongo-driver](https://github.com/mongodb/mongo-go-driver) from 1.12.0 to 1.12.1.
- [Release notes](https://github.com/mongodb/mongo-go-driver/releases)
- [Commits](https://github.com/mongodb/mongo-go-driver/compare/v1.12.0...v1.12.1)
---
updated-dependencies:
- dependency-name: go.mongodb.org/mongo-driver
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index cbaca83b8..f813ba5fe 100644
--- a/go.mod
+++ b/go.mod
@@ -24,7 +24,7 @@ require (
github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/testify v1.8.4
- go.mongodb.org/mongo-driver v1.12.0
+ go.mongodb.org/mongo-driver v1.12.1
golang.org/x/image v0.9.0 // indirect
google.golang.org/api v0.134.0
google.golang.org/grpc v1.57.0
diff --git a/go.sum b/go.sum
index 0e6352156..f705f2efd 100644
--- a/go.sum
+++ b/go.sum
@@ -338,8 +338,8 @@ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7Jul
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0PiE=
-go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0=
+go.mongodb.org/mongo-driver v1.12.1 h1:nLkghSU8fQNaK7oUmDhQFsnrtcoNy7Z6LVFKsEecqgE=
+go.mongodb.org/mongo-driver v1.12.1/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=