mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 22:39:18 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 32249a3ccc | |||
| 723245c01f | |||
| 0996193da7 | |||
| f69ea3dfd3 | |||
| 8c93ffc4c6 | |||
| acec7c67f6 | |||
| 0decd3a9b1 | |||
| b1fc0f870a | |||
| 75b15ca458 | |||
| aa08863934 |
@@ -30,7 +30,7 @@ MINIO_ENDPOINT=http://172.28.0.1:10005
|
||||
|
||||
# Base URL for the application programming interface (API).
|
||||
# Default: API_URL=http://172.28.0.1:10002
|
||||
API_URL=http://127.0.0.1:10002
|
||||
API_URL=http://172.28.0.1:10002
|
||||
|
||||
# Directory path for storing data files or related information.
|
||||
# Default: DATA_DIR=./
|
||||
@@ -227,6 +227,7 @@ OPENIM_WEB_PORT=11001
|
||||
# Default: OPENIM_WEB_ADDRESS=172.28.0.1
|
||||
OPENIM_WEB_ADDRESS=172.28.0.8
|
||||
|
||||
|
||||
# ======================================
|
||||
# ========= OpenIM Server ==============
|
||||
# ======================================
|
||||
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Assign the issue
|
||||
run: |
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
# && github.event.pull_request.merged == true
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
if: startsWith(github.event.comment.body, '/create tag')
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Validate version number and get comment
|
||||
id: validate
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the latest code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
|
||||
|
||||
@@ -34,16 +34,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
# docker.io/openim/openim-server:latest
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: openim/openim-server
|
||||
# generate Docker tags based on the following events/attributes
|
||||
@@ -57,13 +57,13 @@ jobs:
|
||||
type=sha
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
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@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
# linux/ppc64le,linux/s390x
|
||||
@@ -76,27 +76,27 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v2
|
||||
# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta2
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
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@v3
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: registry.cn-hangzhou.aliyuncs.com
|
||||
username: ${{ secrets.ALIREGISTRY_USERNAME }}
|
||||
password: ${{ secrets.ALIREGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
# linux/ppc64le,linux/s390x
|
||||
@@ -109,27 +109,27 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v2
|
||||
# ghcr.io/openimsdk/openim-server:latest
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta3
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
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@v3
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
# linux/ppc64le,linux/s390x
|
||||
|
||||
@@ -34,16 +34,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
# docker.io/openim/openim-web:latest
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: openim/openim-web
|
||||
# generate Docker tags based on the following events/attributes
|
||||
@@ -57,13 +57,13 @@ jobs:
|
||||
type=sha
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
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@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-tools/openim-web/Dockerfile
|
||||
@@ -76,27 +76,27 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v2
|
||||
# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-web:latest
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta2
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-web
|
||||
|
||||
- name: Log in to AliYun Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: registry.cn-hangzhou.aliyuncs.com
|
||||
username: ${{ secrets.ALIREGISTRY_USERNAME }}
|
||||
password: ${{ secrets.ALIREGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-tools/openim-web/Dockerfile
|
||||
@@ -109,11 +109,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
install: true
|
||||
- name: Cache Docker layers
|
||||
@@ -125,7 +125,7 @@ jobs:
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -133,12 +133,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-web
|
||||
id: meta1
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-web
|
||||
|
||||
- name: Build and push Docker image for openim-web
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-tools/openim-web/Dockerfile
|
||||
@@ -151,12 +151,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-web
|
||||
id: meta2
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/component
|
||||
|
||||
- name: Build and push Docker image for component
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-tools/component/Dockerfile
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Golang with cache
|
||||
uses: magnetikonline/action-golang-cache@v4
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
steps:
|
||||
- name: "CLA Assistant"
|
||||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
||||
uses: contributor-assistant/github-action@v2.3.1
|
||||
uses: contributor-assistant/github-action@v2.3.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
PERSONAL_ACCESS_TOKEN: ${{ secrets.REDBOT_GITHUB_TOKEN }}
|
||||
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
deploy-dev:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: executing remote ssh commands using password
|
||||
uses: appleboy/ssh-action@v1.0.0
|
||||
env:
|
||||
|
||||
@@ -13,6 +13,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Checkout Repository'
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@v3
|
||||
@@ -29,13 +29,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
install: true
|
||||
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -87,12 +87,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-api
|
||||
id: meta1
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-api
|
||||
|
||||
- name: Build and push Docker image for openim-api
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-api/Dockerfile
|
||||
@@ -105,12 +105,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-cmdutils
|
||||
id: meta2
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-cmdutils
|
||||
|
||||
- name: Build and push Docker image for openim-cmdutils
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-cmdutils/Dockerfile
|
||||
@@ -123,12 +123,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-crontask
|
||||
id: meta3
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-crontask
|
||||
|
||||
- name: Build and push Docker image for openim-crontask
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-crontask/Dockerfile
|
||||
@@ -141,12 +141,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-msggateway
|
||||
id: meta4
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-msggateway
|
||||
|
||||
- name: Build and push Docker image for openim-msggateway
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-msggateway/Dockerfile
|
||||
@@ -159,12 +159,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-msgtransfer
|
||||
id: meta5
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-msgtransfer
|
||||
|
||||
- name: Build and push Docker image for openim-msgtransfer
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-msgtransfer/Dockerfile
|
||||
@@ -177,12 +177,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-push
|
||||
id: meta6
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-push
|
||||
|
||||
- name: Build and push Docker image for openim-push
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-push/Dockerfile
|
||||
@@ -195,12 +195,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-rpc-auth
|
||||
id: meta7
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-auth
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-auth
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-rpc-auth/Dockerfile
|
||||
@@ -213,12 +213,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-rpc-conversation
|
||||
id: meta8
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-conversation
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-conversation
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-rpc-conversation/Dockerfile
|
||||
@@ -231,12 +231,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-rpc-friend
|
||||
id: meta9
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-friend
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-friend
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-rpc-friend/Dockerfile
|
||||
@@ -249,12 +249,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-rpc-group
|
||||
id: meta10
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-group
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-group
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-rpc-group/Dockerfile
|
||||
@@ -267,12 +267,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-rpc-msg
|
||||
id: meta11
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-msg
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-msg
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-rpc-msg/Dockerfile
|
||||
@@ -285,12 +285,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-rpc-third
|
||||
id: meta12
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-third
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-third
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-rpc-third/Dockerfile
|
||||
@@ -303,12 +303,12 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker openim-rpc-user
|
||||
id: meta13
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-user
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-user
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-rpc-user/Dockerfile
|
||||
|
||||
@@ -31,13 +31,13 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.21
|
||||
uses: actions/setup-go@v4
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.21
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Create e2e test
|
||||
run: |
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
name: lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
- name: Run Gosec Security Scanner
|
||||
uses: securego/gosec@master
|
||||
with:
|
||||
|
||||
@@ -25,8 +25,8 @@ jobs:
|
||||
check_for_first_interaction:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/first-interaction@v1.2.0
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/first-interaction@v1.1.1
|
||||
with:
|
||||
repo-token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
pr-message: |
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
linkChecker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Link Checker
|
||||
id: lychee
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: di-sukharev/opencommit@github-action-v1.0.4
|
||||
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Setup
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go_version }}
|
||||
uses: actions/setup-go@v4
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
os: ["ubuntu-latest"]
|
||||
steps:
|
||||
- name: Checkout and Install OpenIM
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
with:
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
os: ["ubuntu-latest"]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go_version }}
|
||||
uses: actions/setup-go@v4
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- run: git fetch --force --tags
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
go-version: stable
|
||||
# More assembly might be required: Docker logins, GPG, etc. It all depends
|
||||
# on your needs.
|
||||
- uses: goreleaser/goreleaser-action@v5
|
||||
- uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
# either 'goreleaser' (default) or 'goreleaser-pro':
|
||||
distribution: goreleaser
|
||||
@@ -63,14 +63,14 @@ jobs:
|
||||
matrix:
|
||||
format: [ deb, rpm, apk ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4 # v3
|
||||
- uses: actions/checkout@v3 # v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
|
||||
with:
|
||||
version: 3.x
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/setup-qemu-action@326560df218a7ea9cf6ab49bbc88b8b306bb437e # v2
|
||||
- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
|
||||
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
||||
with:
|
||||
path: |
|
||||
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Setup
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: In ${{ matrix.os }} Execute the script validation code
|
||||
uses: actions/setup-go@v4
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run GitHub File Sync
|
||||
uses: BetaHuhn/repo-file-sync-action@latest
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run GitHub File Sync
|
||||
uses: BetaHuhn/repo-file-sync-action@latest
|
||||
|
||||
@@ -160,6 +160,7 @@ flycheck_*.el
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
vendor/
|
||||
tools/imctl
|
||||
|
||||
# Go workspace file
|
||||
# go.work
|
||||
|
||||
@@ -361,17 +361,13 @@ linters-settings:
|
||||
- gorm.io/gorm
|
||||
- gorm.io/driver/mysql
|
||||
- k8s.io/klog
|
||||
- github.com/allowed/module
|
||||
- go.mongodb.org/mongo-driver/mongo
|
||||
# - gopkg.in/yaml.v2
|
||||
domains: # List of allowed module domains
|
||||
- google.golang.org
|
||||
- gopkg.in
|
||||
- golang.org
|
||||
- github.com
|
||||
- go.mongodb.org
|
||||
- go.uber.org
|
||||
- openim.io
|
||||
- go.etcd.io
|
||||
blocked:
|
||||
versions:
|
||||
|
||||
@@ -73,11 +73,6 @@ gen:
|
||||
demo:
|
||||
@$(MAKE) go.demo
|
||||
|
||||
## versionchecker: Check version of openim. ✨
|
||||
.PHONY: versionchecker
|
||||
versionchecker:
|
||||
@$(MAKE) go.versionchecker
|
||||
|
||||
## build: Build binaries by default ✨
|
||||
.PHONY: build
|
||||
build:
|
||||
|
||||
+286
-63
@@ -29,106 +29,329 @@
|
||||
|
||||
</p>
|
||||
|
||||
## Ⓜ️ 关于 OpenIM
|
||||
## ✨ 关于 OpenIM
|
||||
|
||||
OpenIM 不仅仅是一个开源的即时消息组件,它是你的应用程序生态系统的一个不可或缺的部分。查看下面的图表,了解 AppServer、AppClient、OpenIMServer 和 OpenIMSDK 是如何交互的。
|
||||
Open-IM-Server 是使用纯 Golang 精心制作的强大的即时消息服务器。其通过 JSON over WebSocket 进行通信的独特方法将每次交互都视为消息。这简化了定制并消除了修改服务器代码的需求。通过利用微服务架构,服务器可以通过集群部署,保证出色的性能和可伸缩性。
|
||||
|
||||

|
||||
Open-IM-Server 不仅仅是一个即时消息服务器;它是将实时网络集成到您的应用程序中的强大工具,定位为您集成的首选选择!🚀
|
||||
|
||||
## 🚀 关于 OpenIMSDK
|
||||
请注意,Open-IM-Server 不作为独立产品运行,也不提供内置的帐户注册或登录服务。为了简化您的实施过程,我们已开源了 [chat repository](https://github.com/OpenIMSDK/chat),其中包括这些功能。与 Open-IM-Server 一起部署此聊天业务服务器可加快全面的聊天产品的设置。👥
|
||||
|
||||
**OpenIMSDK** 无缝集成到您的应用中,提供丰富、实时的消息体验,无需复杂的 UI 集成。它提供:
|
||||
为了进一步增强您的体验,我们还提供了 SDK 客户端,在其中实现了大多数复杂逻辑。可以在 [此链接](https://github.com/OpenIMSDK/openim-sdk-core) 找到 [SDK repository](https://github.com/OpenIMSDK/openim-sdk-core)。[chat repository](https://github.com/OpenIMSDK/chat) 是我们的业务服务器,而 'core' 代表 SDK 的高级封装,它们协同工作以提供卓越的结果。✨
|
||||
|
||||
+ **本地存储**:用于快速数据检索和消息同步。
|
||||
+ **监听器回调**:确保实时消息交互性。
|
||||
+ **API 封装**:简化开发流程。
|
||||
+ **连接管理**:保证可靠的消息传递。
|
||||
## :star2: 为什么选择 OpenIM
|
||||
|
||||
它使用 Golang 构建,并支持跨平台部署,确保在所有平台上提供一致的消息体验。
|
||||
**🔍 功能截图显示**
|
||||
|
||||
👉 **[探索 GO SDK](https://github.com/openimsdk/openim-sdk-core)**
|
||||
<div align="center">
|
||||
|
||||
## 🌐 关于 OpenIMServer
|
||||
| 💻🔄📱 多终端同步 🔄🖥️ | 📅⚡ 高效会议 🚀💼 |
|
||||
| :----------------------------------------------------------: | :----------------------------------------------------------: |
|
||||
|  |  |
|
||||
| 📲🔄 **一对一和群聊** 👥🗣️ | 🎁💻 **特殊功能 - 自定义消息** ✉️🎨 |
|
||||
|  |  |
|
||||
|
||||
精心用 Golang 开发的 **OpenIMServer** 通过多重方式确保了卓越的即时消息服务器能力:
|
||||
</div>
|
||||
|
||||
+ **模块组成**:它由多个模块组成,例如网关和多个 RPC 服务,提供一个多功能的消息环境。
|
||||
+ **微服务架构**:支持集群模式,确保出色的性能和可伸缩性,以有效管理各个实例间的通信。
|
||||
+ **多样的部署选项**:适应你的操作偏好,通过源代码、Kubernetes 或 Docker 提供部署选项。
|
||||
1. **全面的消息类型支持 :speech_balloon:**
|
||||
|
||||
### 增强的业务功能:
|
||||
✅ 支持几乎所有类型的消息,包括文本、图片、表情符号、语音、视频、地理位置、文件、报价、名片、系统通知、自定义消息等
|
||||
|
||||
+ **REST API**:OpenIMServer 为业务系统提供 REST API,旨在通过后端接口为您的操作提供附加功能,如群组创建和消息推送。
|
||||
+ **回调**:为了扩展其在各种业务形式中的实用性,OpenIMServer 提供了回调能力。即,在事件发生之前或之后,它向业务服务器发送请求,比如发送消息,丰富通信过程中的交互和数据交换流。
|
||||
✅ 支持一对一和多人音视频通话
|
||||
|
||||
👉 **[了解更多](https://doc.rentsoft.cn/guides/introduction/product)**
|
||||
✅ 为 iOS、Android、Flutter、uni-app、ReactNative、Electron、Web、H5 等多个平台提供终端支持
|
||||
|
||||
2. **随时随地的高效会议 :earth_americas:**
|
||||
|
||||
✅ 基于具有 100% 可靠强制信令功能的 IM (Instant Messaging),为与聊天应用程序深度集成的 IM 系统铺平了道路
|
||||
|
||||
✅ 支持单次会议中的数百人,订阅人数达到数千,以及服务器端音视频录制
|
||||
|
||||
3. **适用于各种社交场景的一对一和群聊 :busts_in_silhouette:**
|
||||
|
||||
✅ OpenIM 有四种角色:应用程序管理员、群主、群管理员和普通成员
|
||||
|
||||
✅ 强大的群特性,如静音、群公告、群验证、无限群成员和根据需要加载群消息
|
||||
|
||||
4. **独特的功能 :star2:**
|
||||
|
||||
✅ 支持读取并烧毁私人聊天,可自定义时长
|
||||
|
||||
✅ 消息编辑功能扩大了社交场景,使即时通讯变得更加多样化和有趣
|
||||
|
||||
5. **开源 :open_hands:**
|
||||
|
||||
✅ OpenIM 的代码是开源的,数据自控,旨在构建一个全球领先的 IM 开源社区,包括客户端 SDK 和服务器
|
||||
|
||||
✅ 基于开源服务器,已经开发了许多出色的开源项目,例如 [OpenKF](https://github.com/OpenIMSDK/OpenKF) (开源 AI 客户服务系统)
|
||||
|
||||
6. **易于扩展 :wrench:**
|
||||
|
||||
✅ OpenIM 服务器是用 Golang 实现的,引入了创新的 "一切都是消息" 通信模型,简化了自定义消息和扩展功能的实现
|
||||
|
||||
7. **高性能 :racing_car:**
|
||||
|
||||
✅ OpenIM 支持集群中的分层治理架构,经过大量用户的测试,并抽象了在线消息、离线消息和历史消息的存储模型
|
||||
|
||||
8. **全平台支持 :tv:**
|
||||
|
||||
✅ 支持原生 iOS、Android;跨平台 Flutter、uni-app、ReactNative;主要的 Web 前端框架如 React、Vue;小程序和 Electron 支持的 PC 平台
|
||||
|
||||
9. **终极部署体验 🤖**
|
||||
|
||||
✅ 支持 [集群部署](https://github.com/openimsdk/open-im-server/edit/main/deployments/README.md)
|
||||
|
||||
✅ 支持多架构镜像,我们的 Docker 镜像不仅托管在 GitHub 上,而且还在阿里云和 Docker Hub 上支持多个架构。请访问 [我们的 GitHub packages](https://github.com/orgs/OpenIMSDK/packages?repo_name=Open-IM-Server) 并阅读我们的 [版本管理文档](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md) 以获取更多信息。
|
||||
|
||||
10. **开源社区的大生态系统 🤲**
|
||||
|
||||
✅ 我们有数万用户和许多解决方案来解决问题。
|
||||
|
||||
✅ 我们有一个大型的开源社区叫 [OpenIMSDK](https://github.com/OpenIMSDK),它运行核心模块,我们还有一个开源社区叫 [openim-sigs](https://github.com/openim-sigs) 以探索更多基于 IM 的基础设施产品。
|
||||
|
||||
## :rocket: 快速开始
|
||||
|
||||
你只需要一个简单的命令,就可以快速学习 OpenIM 的工程解决方案:
|
||||
<details> <summary>使用 Docker Compose 部署</summary>
|
||||
|
||||
1. 克隆项目
|
||||
|
||||
```
|
||||
bashCopy code
|
||||
$ make demo
|
||||
# 选择您需要的
|
||||
BRANCH=release-v3.1
|
||||
git clone -b $BRANCH https://github.com/openimsdk/open-im-server openim && export openim=$(pwd)/openim && cd $openim && make build
|
||||
```
|
||||
|
||||
🤲 为了方便用户体验,我们提供了多种部署解决方案,您可以根据下面的列表选择自己的部署方法:
|
||||
> **注意** 阅读我们的发布策略:https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md
|
||||
|
||||
+ **[源代码部署指南](https://doc.rentsoft.cn/guides/gettingStarted/imSourceCodeDeployment)**
|
||||
+ **[Docker 部署指南](https://doc.rentsoft.cn/guides/gettingStarted/dockerCompose)**
|
||||
+ **[Kubernetes 部署指南](https://github.com/openimsdk/open-im-server/tree/main/deployments)**
|
||||
1. 修改 `.env`
|
||||
|
||||
```
|
||||
USER=root #无需修改
|
||||
PASSWORD=openIM123 #8位或更多数字和字母的组合,此密码适用于redis、mysql、mongo,以及config/config.yaml中的accessSecret
|
||||
ENDPOINT=http://127.0.0.1:10005 #minio的外部服务IP和端口,或使用域名storage.xx.xx,应用程序必须能够访问此IP和端口或域名,
|
||||
API_URL=http://127.0.0.1:10002/object/ #应用程序必须能够访问此IP和端口或域名,
|
||||
DATA_DIR=./ #指定大磁盘目录
|
||||
```
|
||||
|
||||
1. 部署并启动
|
||||
|
||||
> **注意** 此命令只能执行一次。它会基于 `.env` 中的 `PASSWORD` 变量修改 docker-compose 中的组件密码,并修改 `config/config.yaml` 中的组件密码。如果 `.env` 中的密码发生变化,您需要首先执行 `docker-compose down`;`rm components -rf` 然后执行此命令。
|
||||
|
||||
```
|
||||
|
||||
make install
|
||||
```
|
||||
|
||||
1. 检查服务
|
||||
|
||||
```
|
||||
|
||||
make check
|
||||
```
|
||||
|
||||

|
||||
|
||||
</details> <details> <summary>从源码编译</summary>
|
||||
|
||||
您需要 `Go 1.18` 或更高版本,以及 `make`。
|
||||
|
||||
版本详情:https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md
|
||||
|
||||
```
|
||||
# 选择您需要的
|
||||
BRANCH=release-v3.1
|
||||
git clone -b $BRANCH https://github.com/openimsdk/open-im-server openim && export openim=$(pwd)/openim && cd $openim && make build
|
||||
```
|
||||
|
||||
阅读关于 [OpenIM 版本策略](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md)
|
||||
|
||||
使用 `make help` 来查看 OpenIM 支持的指令。
|
||||
|
||||
如图所示,所有服务已成功构建
|
||||
|
||||

|
||||
|
||||
</details> <details> <summary>组件配置说明</summary>
|
||||
|
||||
config/config.yaml 文件为存储组件提供了详细的配置说明。
|
||||
|
||||
- Zookeeper
|
||||
|
||||
- 用于 RPC 服务发现和注册,支持集群。
|
||||
|
||||
```
|
||||
zookeeper:
|
||||
schema: openim #不建议修改
|
||||
address: [ 127.0.0.1:2181 ] #地址
|
||||
username: #用户名
|
||||
password: #密码
|
||||
```
|
||||
|
||||
- MySQL
|
||||
|
||||
- 用于存储用户、关系和群组,支持主从数据库。
|
||||
|
||||
```
|
||||
mysql:
|
||||
address: [ 127.0.0.1:13306 ] #地址
|
||||
username: root #用户名
|
||||
password: openIM123 #密码
|
||||
database: openIM_v2 #不建议修改
|
||||
maxOpenConn: 1000 #最大连接
|
||||
maxIdleConn: 100 #最大空闲连接
|
||||
maxLifeTime: 60 #连接可重用的最大时间(秒)
|
||||
logLevel: 4 #日志级别 1=静音 2=错误 3=警告 4=信息
|
||||
slowThreshold: 500 #慢语句阈值(毫秒)
|
||||
```
|
||||
|
||||
- Mongo
|
||||
|
||||
- 用于存储离线消息,支持 mongo 分片集群。
|
||||
|
||||
```
|
||||
mongo:
|
||||
uri: #如果不为空,则直接使用此值
|
||||
address: [ 127.0.0.1:37017 ] #地址
|
||||
database: openIM #默认 mongo 数据库
|
||||
username: root #用户名
|
||||
password: openIM123 #密码
|
||||
maxPoolSize: 100 #最大连接数
|
||||
```
|
||||
|
||||
- Redis
|
||||
|
||||
- 用于存储消息序列号、最新消息、用户令牌和 mysql 缓存,支持集群部署。
|
||||
|
||||
```
|
||||
redis:
|
||||
address: [ 127.0.0.1:16379 ] #地址
|
||||
username: #用户名
|
||||
password: openIM123 #密码
|
||||
```
|
||||
|
||||
- Kafka
|
||||
|
||||
- 用于消息队列,用于消息解耦,支持集群部署。
|
||||
|
||||
```
|
||||
kafka:
|
||||
username: #用户名
|
||||
password: #密码
|
||||
addr: [ 127.0.0.1:9092 ] #地址
|
||||
latestMsgToRedis:
|
||||
topic: "latestMsgToRedis"
|
||||
offlineMsgToMongo:
|
||||
topic: "offlineMsgToMongoMysql"
|
||||
msgToPush:
|
||||
topic: "msqToPush"
|
||||
msgToModify:
|
||||
topic: "msgToModify"
|
||||
consumerGroupID:
|
||||
msgToRedis: redis
|
||||
msgToMongo: mongo
|
||||
msgToMySql: mysql
|
||||
msgToPush: push
|
||||
msgToModify: modify
|
||||
```
|
||||
|
||||
</details> <details> <summary>启动和停止服务</summary>
|
||||
|
||||
启动服务
|
||||
|
||||
```
|
||||
|
||||
./scripts/start-all.sh;
|
||||
```
|
||||
|
||||
检查服务
|
||||
|
||||
```
|
||||
|
||||
./scripts/check-all.sh
|
||||
```
|
||||
|
||||
停止服务
|
||||
|
||||
```
|
||||
|
||||
./scripts/stop-all.sh
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details> <summary>开放 IM 端口</summary>
|
||||
|
||||
| TCP 端口 | 描述 | 操作 |
|
||||
| --------- | --------------------------------------------------- | --------------------------------------- |
|
||||
| TCP:10001 | ws 协议,消息端口如消息发送、推送等,用于客户端 SDK | 端口释放或 nginx 反向代理,并关闭防火墙 |
|
||||
| TCP:10002 | api 端口,如用户、朋友、组、消息接口。 | 端口释放或 nginx 反向代理,并关闭防火墙 |
|
||||
| TCP:10005 | 选择 minio 存储时所需 (openIM 默认使用 minio 存储) | 端口释放或 nginx 反向代理,并关闭防火墙 |
|
||||
|
||||
</details> <details> <summary>开放聊天端口</summary>
|
||||
|
||||
- 聊天仓库: https://github.com/OpenIMSDK/chat
|
||||
|
||||
| TCP 端口 | 描述 | 操作 |
|
||||
| --------- | ------------------------ | --------------------------------------- |
|
||||
| TCP:10008 | 业务系统,如注册、登录等 | 端口释放或 nginx 反向代理,并关闭防火墙 |
|
||||
| TCP:10009 | 管理后台,如统计、封禁等 | 端口释放或 nginx 反向代理,并关闭防火墙 |
|
||||
|
||||
</details>
|
||||
|
||||
## :link: APP 和 OpenIM 之间的关系
|
||||
|
||||
OpenIM 不仅仅是一个开源的即时消息组件,它是您的应用程序生态系统的一个不可分割的部分。查看此图表以了解 AppServer、AppClient、Open-IM-Server 和 Open-IM-SDK 如何互动。
|
||||
|
||||

|
||||
|
||||
## :building_construction: 总体架构
|
||||
|
||||
深入了解 Open-IM-Server 的功能与我们的架构图。
|
||||
|
||||

|
||||
|
||||
## :hammer_and_wrench: 开始开发 OpenIM
|
||||
|
||||
OpenIM 我们的目标是建立一个顶级的开源社区。我们有一套标准,在[社区仓库](https://github.com/OpenIMSDK/community)中。
|
||||
OpenIM 我们的目标是建立一个顶级的开源社区。我们有一套标准,在 [Community repository](https://github.com/OpenIMSDK/community) 中。
|
||||
|
||||
如果你想为这个 Open-IM-Server 仓库做贡献,请阅读我们的[贡献者文档](https://github.com/openimsdk/open-im-server/blob/main/CONTRIBUTING.md)。
|
||||
如果您想为这个 Open-IM-Server 仓库做贡献,请阅读我们的 [贡献者文档](https://github.com/openimsdk/open-im-server/blob/main/CONTRIBUTING.md)。
|
||||
|
||||
在开始之前,请确保你的更改是有需求的。最好的方法是创建一个[新的讨论](https://github.com/openimsdk/open-im-server/discussions/new/choose) 或 [Slack 通信](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q),或者如果你发现一个问题,首先[报告它](https://github.com/openimsdk/open-im-server/issues/new/choose)。
|
||||
在您开始之前,请确保您的更改是需要的。最好的方法是创建一个 [新的讨论](https://github.com/openimsdk/open-im-server/discussions/new/choose) 或 [Slack 通讯](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q),或者如果您发现一个问题,首先 [报告它](https://github.com/openimsdk/open-im-server/issues/new/choose)。
|
||||
|
||||
+ [代码标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/go_code.md)
|
||||
- [代码标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/go_code.md)
|
||||
- [Docker 图像标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md)
|
||||
- [目录标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/directory.md)
|
||||
- [提交标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/commit.md)
|
||||
- [版本控制标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md)
|
||||
- [接口标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/api.md)
|
||||
- [日志标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/)
|
||||
- [错误代码标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/error_code.md)
|
||||
|
||||
+ [Docker 镜像标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md)
|
||||
## :busts_in_silhouette: 社区
|
||||
|
||||
+ [目录标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/directory.md)
|
||||
- 📚 [OpenIM 社区](https://github.com/OpenIMSDK/community)
|
||||
- 💕 [OpenIM 兴趣小组](https://github.com/Openim-sigs)
|
||||
- 🚀 [加入我们的 Slack 社区](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)
|
||||
- :eyes: [加入我们的微信群 (微信群)](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg)
|
||||
|
||||
+ [提交标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/commit.md)
|
||||
## :calendar: 社区会议
|
||||
|
||||
+ [版本控制标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md)
|
||||
我们希望任何人都可以参与我们的社区并贡献代码,我们提供礼物和奖励,欢迎您每周四晚上加入我们。
|
||||
|
||||
+ [接口标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/interface.md)
|
||||
我们的会议在 [OpenIM Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q) 🎯,然后您可以搜索 Open-IM-Server 管道加入。
|
||||
|
||||
## :link: 链接
|
||||
我们在 [GitHub 讨论](https://github.com/openimsdk/open-im-server/discussions/categories/meeting) 中记下每次 [双周会议](https://github.com/orgs/OpenIMSDK/discussions/categories/meeting) 的笔记,我们的历史会议记录以及会议回放都可在 [Google Docs :bookmark_tabs:](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing) 中找到。
|
||||
|
||||
+ **[完整文档](https://doc.rentsoft.cn/)**
|
||||
+ **[更新日志](https://github.com/openimsdk/open-im-server/blob/main/CHANGELOG.md)**
|
||||
+ **[FAQ](https://github.com/openimsdk/open-im-server/blob/main/FAQ.md)**
|
||||
+ **[代码示例](https://github.com/openimsdk/open-im-server/blob/main/examples)**
|
||||
## :eyes: 谁在使用 OpenIM
|
||||
|
||||
## :handshake: 社区
|
||||
查看我们的 [用户案例研究](https://github.com/OpenIMSDK/community/blob/main/ADOPTERS.md) 页面以获取项目用户列表。不要犹豫,留下一个 [📝评论](https://github.com/openimsdk/open-im-server/issues/379) 并分享您的使用案例。
|
||||
|
||||
+ **[GitHub Discussions](https://github.com/openimsdk/open-im-server/discussions)**
|
||||
+ **[Slack 通信](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)**
|
||||
+ **[GitHub Issues](https://github.com/openimsdk/open-im-server/issues)**
|
||||
## :page_facing_up: 许可证
|
||||
|
||||
您可以加入这些平台,讨论问题,提出建议,或分享您的成功故事!
|
||||
OpenIM 根据 Apache 2.0 许可证授权。请查看 [LICENSE](https://github.com/openimsdk/open-im-server/tree/main/LICENSE) 以获取完整的许可证文本。
|
||||
|
||||
## :writing_hand: 贡献
|
||||
OpenIM logo,包括其变体和动画版本,在此存储库 [OpenIM](https://github.com/openimsdk/open-im-server) 下的 [assets/logo](./assets/logo) 和 [assets/logo-gif](./assets/logo-gif) 目录中显示,受版权法保护。
|
||||
|
||||
我们欢迎任何形式的贡献!请确保在提交 Pull Request 之前阅读我们的[贡献者文档](https://github.com/openimsdk/open-im-server/blob/main/CONTRIBUTING.md)。
|
||||
## 🔮 感谢我们的贡献者!
|
||||
|
||||
+ **[报告 Bug](https://github.com/openimsdk/open-im-server/issues/new?assignees=&labels=bug&template=bug_report.md&title=)**
|
||||
+ **[提出新特性](https://github.com/openimsdk/open-im-server/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=)**
|
||||
+ **[提交 Pull Request](https://github.com/openimsdk/open-im-server/pulls)**
|
||||
|
||||
感谢您的贡献,我们一起打造一个强大的即时通信解决方案!
|
||||
|
||||
## :closed_book: 许可证
|
||||
|
||||
OpenIMSDK 在 Apache License 2.0 许可下可用。查看[LICENSE 文件](https://github.com/openimsdk/open-im-server/blob/main/LICENSE)了解更多信息。
|
||||
|
||||
## 🔮 Thanks to our contributors!
|
||||
|
||||
<a href="https://github.com/openimsdk/open-im-server/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=openimsdk/open-im-server" />
|
||||
</a>
|
||||
<a href="https://github.com/openimsdk/open-im-server/graphs/contributors"> <img src="https://contrib.rocks/image?repo=openimsdk/open-im-server" /> </a>
|
||||
@@ -24,46 +24,21 @@
|
||||
<p align="center">
|
||||
<a href="./README.md"><b> English </b></a> •
|
||||
<a href="./README-zh_CN.md"><b> 简体中文 </b></a> •
|
||||
<a href="https://www.openim.online/en"><b> Docs </b></a>
|
||||
<a href="https://www.openim.online/en"><b> Docs </b></a>
|
||||
</p>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
## Ⓜ️ About OpenIM
|
||||
## ✨ About OpenIM
|
||||
|
||||
OpenIM isn't just an open-source instant messaging component, it's an integral part of your application ecosystem. Check out this diagram to understand how AppServer, AppClient, OpenIMServer, and OpenIMSDK interact.
|
||||
Open-IM-Server, meticulously developed in pure Golang, is a powerful instant messaging server. Its distinct communication method, employing pb+websocket, views every interaction as a message, streamlining customization without altering server code. Built on a microservice architecture, it offers deployment through clusters for outstanding performance and scalability.
|
||||
|
||||

|
||||
Open-IM-Server is more than an instant messaging server; it's a powerful tool for incorporating real-time networking into your applications, positioning itself as your premier choice for integration! 🚀
|
||||
|
||||
## 🚀 About OpenIMSDK
|
||||
Please be aware that Open-IM-Server does not function as a standalone product and does not offer built-in account registration or login services. To ease your implementation process, we've open-sourced the [chat repository](https://github.com/OpenIMSDK/chat), which comprises these features. Deploying this chat business server in conjunction with Open-IM-Server expedites the setup of a comprehensive chat product. 👥
|
||||
|
||||
**OpenIMSDK** seamlessly integrates into your application, delivering a rich, real-time messaging experience without requiring intricate UI integration. It provides:
|
||||
|
||||
+ **Local Storage**: For quick data retrieval and message synchronization.
|
||||
+ **Listener Callbacks**: Ensuring real-time message interactivity.
|
||||
+ **API Encapsulation**: Streamlining development processes.
|
||||
+ **Connection Management**: Guaranteeing reliable message delivery.
|
||||
|
||||
It's crafted in Golang and supports cross-platform deployment, ensuring a coherent messaging experience across all platforms.
|
||||
|
||||
👉 **[Explore GO SDK](https://github.com/openimsdk/openim-sdk-core)**
|
||||
|
||||
## 🌐 About OpenIMServer
|
||||
|
||||
**OpenIMServer**, meticulously developed in Golang, ensures a stellar instant messaging server capability with a multifold approach:
|
||||
|
||||
+ **Modular Composition**: It's comprised of several modules, such as the gateway and multiple RPC services, offering a versatile messaging environment.
|
||||
+ **Microservices Architecture**: Supporting cluster modes, it assures outstanding performance and scalability to manage communication effectively across various instances.
|
||||
+ **Diverse Deployment Options**: Adapts to your operational preferences, offering deployment via source code, Kubernetes, or Docker.
|
||||
|
||||
### Enhanced Business Functionalities:
|
||||
|
||||
+ **REST API**: OpenIMServer provides REST API for business systems, aiming to empower your operations with additional functionalities like group creation and message push via backend interfaces.
|
||||
+ **Callbacks**: To expand its utility across varied business forms, OpenIMServer offers callback capabilities. That is, it sends a request to the business server before or after an event occurs, such as sending a message, enriching the interaction and data exchange flow in the communication processes.
|
||||
|
||||
👉 **[Learn More](https://doc.rentsoft.cn/guides/introduction/product)**
|
||||
|
||||
<!--
|
||||
Further enhancing your experience, we also provide an SDK client, wherein most complex logics are implemented. The [SDK repository](https://github.com/OpenIMSDK/openim-sdk-core) can be found at [this link](https://github.com/OpenIMSDK/openim-sdk-core). The [chat repository](https://github.com/OpenIMSDK/chat) is our business server while the 'core' represents the high-level encapsulation of the SDK, synergistically working together to deliver superior results. ✨
|
||||
|
||||
## :star2: Why OpenIM
|
||||
|
||||
@@ -79,24 +54,61 @@ It's crafted in Golang and supports cross-platform deployment, ensuring a cohere
|
||||
|
||||
</div>
|
||||
|
||||
**OpenIM** offers a powerful and reliable instant messaging platform, ensuring versatile communication across multiple platforms with the following key features:
|
||||
1. **Comprehensive Message Type Support :speech_balloon:**
|
||||
|
||||
✅ **Versatile Messaging:** Support for text, images, emojis, voice, video, and more, alongside one-on-one and multi-person audio/video calls.
|
||||
✅ Supports almost all types of messages, including text, images, emojis, voice, video, geographical location, files, quotes, business cards, system notifications, custom messages and more
|
||||
|
||||
✅ **Robust Chat Capabilities:** Including roles (application administrator, group owner, etc.) and features like muting, group announcements, and dynamic message loading.
|
||||
✅ Supports one-on-one and multi-person audio and video calls
|
||||
|
||||
✅ **Unique Interaction Features:** Offering read-and-burn private chats and a message editing function to broaden social scenarios.
|
||||
✅ Provides terminal support for multiple platforms such as iOS, Android, Flutter, uni-app, ReactNative, Electron, Web, H5
|
||||
|
||||
✅ **Open Source:** The code of OpenIM is open source and aims to build a leading global IM open source community. [GitHub Repository](https://github.com/OpenIMSDK)
|
||||
2. **Efficient Meetings Anytime, Anywhere :earth_americas:**
|
||||
|
||||
✅ **Extensibility:** Implemented in Golang, OpenIM introduces an "everything is a message" communication model, simplifying custom messages and feature extension.
|
||||
✅ Based on IM (Instant Messaging) with 100% reliable forced signaling capabilities, it paves the way for IM systems, deeply integrated with chat applications
|
||||
|
||||
✅ **High Performance:** Supports a hierarchical governance architecture tested and abstracts the storage model of various message types.
|
||||
✅ Supports hundreds of people in a single meeting, with subscription numbers reaching thousands, and server-side audio and video recording
|
||||
|
||||
✅ **Full Platform Support:** Native support for iOS, Android, Flutter, uni-app, ReactNative, Electron, and Web.
|
||||
3. **One-on-one and Group Chats for Various Social Scenarios :busts_in_silhouette:**
|
||||
|
||||
-->
|
||||
✅ OpenIM has four roles: application administrator, group owner, group administrator, and regular member
|
||||
|
||||
✅ Powerful group features such as muting, group announcements, group validation, unlimited group members, and loading group messages as needed
|
||||
|
||||
4. **Unique Features :star2:**
|
||||
|
||||
✅ Supports read-and-burn private chats, customizable duration
|
||||
|
||||
✅ Message editing function broadens social scenarios, making instant communication more diverse and interesting
|
||||
|
||||
5. **Open Source :open_hands:**
|
||||
|
||||
✅ The code of OpenIM is open source, self-controlled data, aimed at building a globally leading [IM open source community](https://github.com/OpenIMSDK), including [client SDK](https://github.com/openimsdk/openim-sdk-core) and server
|
||||
|
||||
✅ Based on open source Server, many excellent open source projects have been developed, such as [OpenKF](https://github.com/OpenIMSDK/OpenKF) (Open source AI customer service system)
|
||||
|
||||
6. **Easy to Expand :wrench:**
|
||||
|
||||
✅ The OpenIM server is implemented in Golang, introducing an innovative "everything is a message" communication model, simplifying the implementation of custom messages and extended features
|
||||
|
||||
7. **High Performance :racing_car:**
|
||||
|
||||
✅ OpenIM supports a hierarchical governance architecture in the cluster, tested by a large number of users, and abstracts the storage model of online messages, offline messages, and historical messages
|
||||
|
||||
8. **Full Platform Support :tv:**
|
||||
|
||||
✅ Supports native iOS, Android; cross-platform Flutter, uni-app, ReactNative; major web front-end frameworks such as React, Vue; applets; and PC platforms supported by Electron
|
||||
|
||||
9. **The ultimate deployment experience 🤖**
|
||||
|
||||
✅ Supports [cluster deployment](https://github.com/openimsdk/open-im-server/edit/main/deployments/README.md)
|
||||
|
||||
✅ Supports multi-architecture mirroring, our Docker images are hosted not only on GitHub but also on Alibaba Cloud and Docker Hub supporting multiple architectures. Visit [our GitHub packages](https://github.com/orgs/OpenIMSDK/packages?repo_name=Open-IM-Server) and read our [version management document](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md) for more information.
|
||||
|
||||
11. **A large ecosystem of open source communities 🤲**
|
||||
|
||||
✅ We have tens of thousands of users and many solutions to problems.
|
||||
|
||||
✅ We have a large open source community called [OpenIMSDK](https://github.com/OpenIMSDK) that runs the core modules, we have an open source community called [openim-sigs](https://github.com/openim-sigs) to explore more IM-based infrastructure products.
|
||||
|
||||
## :rocket: Quick Start
|
||||
|
||||
@@ -108,7 +120,6 @@ $ make demo
|
||||
|
||||
🤲 In order to facilitate the user experience, we have provided a variety of deployment solutions, you can choose your own deployment method according to the list below:
|
||||
|
||||
<!--
|
||||
<details> <summary>Deploying with Docker Compose</summary>
|
||||
|
||||
It is recommended to use Docker Compose for deployment, which can easily and quickly deploy the entire OpenIM service on a single node
|
||||
@@ -174,27 +185,43 @@ Read: Configuration center document:https://github.com/openimsdk/open-im-serve
|
||||
|
||||
<details> <summary>Deployed with kubernetes</summary>
|
||||
|
||||
+ https://github.com/openimsdk/open-im-server/blob/main/deployments/README.md
|
||||
|
||||
Read: https://github.com/openimsdk/open-im-server/blob/main/deployments/README.md
|
||||
|
||||
</details>
|
||||
-->
|
||||
|
||||
+ **[Source Code Deployment Guide](https://doc.rentsoft.cn/guides/gettingStarted/imSourceCodeDeployment)**
|
||||
+ **[Docker Deployment Guide](https://doc.rentsoft.cn/guides/gettingStarted/dockerCompose)**
|
||||
+ **[Kubernetes Deployment Guide](https://github.com/openimsdk/open-im-server/tree/main/deployments)**
|
||||
<details> <summary>Open IM and Chat Ports</summary>
|
||||
|
||||
<!--
|
||||
## :link: OpenIM and your application
|
||||
+ oepnim-server warehouse: https://github.com/openimsdk/open-im-server
|
||||
|
||||
OpenIM isn't just an open-source instant messaging component, it's an integral part of your application ecosystem. Check out this diagram to understand how AppServer, AppClient, OpenIMServer, and OpenIMSDK interact.
|
||||
| TCP Port | Description | Operation |
|
||||
| --------- | ------------------------------------------------------------ | ----------------------------------------------------- |
|
||||
| TCP:10001 | ws protocol, message port such as message sending, pushing etc, used for client SDK | Port release or nginx reverse proxy, and firewall off |
|
||||
| TCP:10002 | api port, such as user, friend, group, message interfaces. | Port release or nginx reverse proxy, and firewall off |
|
||||
| TCP:10005 | Required when choosing minio storage (openIM uses minio storage by default) | Port release or nginx reverse proxy, and firewall off |
|
||||
|
||||

|
||||
|
||||
+ chat warehouse: https://github.com/OpenIMSDK/chat
|
||||
|
||||
| TCP Port | Description | Operation |
|
||||
| --------- | --------------------------------------------------- | ----------------------------------------------------- |
|
||||
| TCP:10008 | Business system, such as registration, login etc | Port release or nginx reverse proxy, and firewall off |
|
||||
| TCP:10009 | Management backend, such as statistics, banning etc | Port release or nginx reverse proxy, and firewall off |
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
## :link: Relationship Between APP and OpenIM
|
||||
|
||||
OpenIM isn't just an open-source instant messaging component, it's an integral part of your application ecosystem. Check out this diagram to understand how AppServer, AppClient, Open-IM-Server, and Open-IM-SDK interact.
|
||||
|
||||

|
||||
|
||||
## :building_construction: Overall Architecture
|
||||
|
||||
Delve into the heart of Open-IM-Server's functionality with our architecture diagram.
|
||||
|
||||
 -->
|
||||

|
||||
|
||||
## :hammer_and_wrench: To start developing OpenIM
|
||||
|
||||
|
||||
+4
-4
@@ -49,17 +49,17 @@ While it is possible to build OpenIM using a local golang installation, we have
|
||||
|
||||
## Basic Flow
|
||||
|
||||
The scripts directly under [`build/`](.) are used to build and test. They will ensure that the `openim-build` Docker image is built (based on [`build/build-image/Dockerfile`](../Dockerfile) and after base image's `OPENIM_BUILD_IMAGE_CROSS_TAG` from Dockerfile is replaced with one of those actual tags of the base image, like `v1.13.9-2`) and then execute the appropriate command in that container. These scripts will both ensure that the right data is cached from run to run for incremental builds and will copy the results back out of the container. You can specify a different registry/name and version for `openim-cross` by setting `OPENIM_CROSS_IMAGE` and `OPENIM_CROSS_VERSION`, see [`common.sh`](common.sh) for more details.
|
||||
The scripts directly under [`build/`](.) are used to build and test. They will ensure that the `kube-build` Docker image is built (based on [`build/build-image/Dockerfile`](build-image/Dockerfile) and after base image's `KUBE_BUILD_IMAGE_CROSS_TAG` from Dockerfile is replaced with one of those actual tags of the base image, like `v1.13.9-2`) and then execute the appropriate command in that container. These scripts will both ensure that the right data is cached from run to run for incremental builds and will copy the results back out of the container. You can specify a different registry/name and version for `kube-cross` by setting `KUBE_CROSS_IMAGE` and `KUBE_CROSS_VERSION`, see [`common.sh`](common.sh) for more details.
|
||||
|
||||
The `openim-build` container image is built by first creating a "context" directory in `_output/images/build-image`. It is done there instead of at the root of the OpenIM repo to minimize the amount of data we need to package up when building the image.
|
||||
The `kube-build` container image is built by first creating a "context" directory in `_output/images/build-image`. It is done there instead of at the root of the OpenIM repo to minimize the amount of data we need to package up when building the image.
|
||||
|
||||
There are 3 different containers instances that are run from this image. The first is a "data" container to store all data that needs to persist across to support incremental builds. Next there is an "rsync" container that is used to transfer data in and out to the data container. Lastly there is a "build" container that is used for actually doing build actions. The data container persists across runs while the rsync and build containers are deleted after each use.
|
||||
|
||||
`rsync` is used transparently behind the scenes to efficiently move data in and out of the container. This will use an ephemeral port picked by Docker. You can modify this by setting the `OPENIM_RSYNC_PORT` env variable.
|
||||
`rsync` is used transparently behind the scenes to efficiently move data in and out of the container. This will use an ephemeral port picked by Docker. You can modify this by setting the `KUBE_RSYNC_PORT` env variable.
|
||||
|
||||
All Docker names are suffixed with a hash derived from the file path (to allow concurrent usage on things like CI machines) and a version number. When the version number changes all state is cleared and clean build is started. This allows the build infrastructure to be changed and signal to CI systems that old artifacts need to be deleted.
|
||||
|
||||
## Build artifacts
|
||||
The build system output all its products to a top level directory in the source repository named `_output`.
|
||||
These include the binary compiled packages (e.g. imctl, openim-api etc.) and archived Docker images.
|
||||
These include the binary compiled packages (e.g. kubectl, kube-scheduler etc.) and archived Docker images.
|
||||
If you intend to run a component with a docker image you will need to import it from this directory with
|
||||
|
||||
@@ -61,11 +61,11 @@ func run(port int) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err = client.CreateRpcRootNodes(config.Config.GetServiceNames()); err != nil {
|
||||
if err := client.CreateRpcRootNodes(config.Config.GetServiceNames()); err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println("api register public config to discov")
|
||||
if err = client.RegisterConf2Registry(constant.OpenIMCommonConfigKey, config.Config.EncodeConfig()); err != nil {
|
||||
if err := client.RegisterConf2Registry(constant.OpenIMCommonConfigKey, config.Config.EncodeConfig()); err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println("api register public config to discov success")
|
||||
@@ -82,9 +82,7 @@ func run(port int) error {
|
||||
err = router.Run(address)
|
||||
if err != nil {
|
||||
log.ZError(context.Background(), "api run failed ", err, "address", address)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
+13
-19
@@ -132,21 +132,19 @@ api:
|
||||
# minio.signEndpoint is minio public network address
|
||||
object:
|
||||
enable: "minio"
|
||||
apiURL: "http://127.0.0.1:10002"
|
||||
apiURL: "http://172.28.0.1:10002"
|
||||
minio:
|
||||
bucket: "openim"
|
||||
endpoint: "http://172.28.0.1:10005"
|
||||
accessKeyID: "root"
|
||||
secretAccessKey: "openIM123"
|
||||
sessionToken: ''
|
||||
signEndpoint: "http://127.0.0.1:10005"
|
||||
publicRead: false
|
||||
signEndpoint: "http://172.28.0.1:10002"
|
||||
cos:
|
||||
bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com
|
||||
secretID: ''
|
||||
secretKey: ''
|
||||
sessionToken: ''
|
||||
publicRead: false
|
||||
oss:
|
||||
endpoint: "https://oss-cn-chengdu.aliyuncs.com"
|
||||
bucket: "demo-9999999"
|
||||
@@ -154,7 +152,7 @@ object:
|
||||
accessKeyID: ''
|
||||
accessKeySecret: ''
|
||||
sessionToken: ''
|
||||
publicRead: false
|
||||
|
||||
|
||||
###################### RPC Port Configuration ######################
|
||||
# RPC service ports
|
||||
@@ -196,7 +194,7 @@ rpcRegisterName:
|
||||
# Whether to output in json format
|
||||
# Whether to include stack trace in logs
|
||||
log:
|
||||
storageLocation: ../../logs/
|
||||
storageLocation: /root/workspaces/openim/openim-server/logs/
|
||||
rotationTime: 24
|
||||
remainRotationCount: 2
|
||||
remainLogLevel: 6
|
||||
@@ -228,18 +226,18 @@ push:
|
||||
enable: getui
|
||||
geTui:
|
||||
pushUrl: "https://restapi.getui.com/v2/$appId"
|
||||
masterSecret: ''
|
||||
appKey: ''
|
||||
intent: ''
|
||||
channelID: ''
|
||||
channelName: ''
|
||||
masterSecret: ""
|
||||
appKey: ""
|
||||
intent: ""
|
||||
channelID: ""
|
||||
channelName: ""
|
||||
fcm:
|
||||
serviceAccount: "x.json"
|
||||
jpns:
|
||||
appKey: ''
|
||||
masterSecret: ''
|
||||
pushUrl: ''
|
||||
pushIntent: ''
|
||||
appKey:
|
||||
masterSecret:
|
||||
pushUrl:
|
||||
pushIntent:
|
||||
|
||||
# App manager configuration
|
||||
#
|
||||
@@ -353,10 +351,6 @@ callback:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeUpdateUserInfo:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeCreateGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
|
||||
@@ -36,13 +36,6 @@ API_URL=${API_URL}
|
||||
# Default: DATA_DIR=./
|
||||
DATA_DIR=${DATA_DIR}
|
||||
|
||||
# Choose the appropriate image address, the default is GITHUB image,
|
||||
# you can choose docker hub, for Chinese users can choose Ali Cloud
|
||||
# export IMAGE_REGISTRY="ghcr.io/openimsdk"
|
||||
# export IMAGE_REGISTRY="openim"
|
||||
# export IMAGE_REGISTRY="registry.cn-hangzhou.aliyuncs.com/openimsdk"
|
||||
IMAGE_REGISTRY=${IMAGE_REGISTRY}
|
||||
|
||||
# ======================================
|
||||
# ========= Network Configuration ======
|
||||
# ======================================
|
||||
@@ -234,6 +227,7 @@ OPENIM_WEB_PORT=${OPENIM_WEB_PORT}
|
||||
# Default: OPENIM_WEB_ADDRESS=172.28.0.1
|
||||
OPENIM_WEB_ADDRESS=${OPENIM_WEB_NETWORK_ADDRESS}
|
||||
|
||||
|
||||
# ======================================
|
||||
# ========= OpenIM Server ==============
|
||||
# ======================================
|
||||
|
||||
@@ -140,13 +140,11 @@ object:
|
||||
secretAccessKey: "${MINIO_SECRET_KEY}"
|
||||
sessionToken: ${MINIO_SESSION_TOKEN}
|
||||
signEndpoint: "${MINIO_SIGN_ENDPOINT}"
|
||||
publicRead: ${MINIO_PUBLIC_READ}
|
||||
cos:
|
||||
bucketURL: ${COS_BUCKET_URL}
|
||||
secretID: ${COS_SECRET_ID}
|
||||
secretKey: ${COS_SECRET_KEY}
|
||||
sessionToken: ${COS_SESSION_TOKEN}
|
||||
publicRead: ${COS_PUBLIC_READ}
|
||||
oss:
|
||||
endpoint: "${OSS_ENDPOINT}"
|
||||
bucket: "${OSS_BUCKET}"
|
||||
@@ -154,7 +152,7 @@ object:
|
||||
accessKeyID: ${OSS_ACCESS_KEY_ID}
|
||||
accessKeySecret: ${OSS_ACCESS_KEY_SECRET}
|
||||
sessionToken: ${OSS_SESSION_TOKEN}
|
||||
publicRead: ${OSS_PUBLIC_READ}
|
||||
|
||||
|
||||
###################### RPC Port Configuration ######################
|
||||
# RPC service ports
|
||||
@@ -228,18 +226,18 @@ push:
|
||||
enable: ${PUSH_ENABLE}
|
||||
geTui:
|
||||
pushUrl: "${GETUI_PUSH_URL}"
|
||||
masterSecret: ${GETUI_MASTER_SECRET}
|
||||
appKey: ${GETUI_APP_KEY}
|
||||
intent: ${GETUI_INTENT}
|
||||
channelID: ${GETUI_CHANNEL_ID}
|
||||
channelName: ${GETUI_CHANNEL_NAME}
|
||||
masterSecret: ""
|
||||
appKey: ""
|
||||
intent: ""
|
||||
channelID: ""
|
||||
channelName: ""
|
||||
fcm:
|
||||
serviceAccount: "${FCM_SERVICE_ACCOUNT}"
|
||||
jpns:
|
||||
appKey: ${JPNS_APP_KEY}
|
||||
masterSecret: ${JPNS_MASTER_SECRET}
|
||||
pushUrl: ${JPNS_PUSH_URL}
|
||||
pushIntent: ${JPNS_PUSH_INTENT}
|
||||
appKey:
|
||||
masterSecret:
|
||||
pushUrl:
|
||||
pushIntent:
|
||||
|
||||
# App manager configuration
|
||||
#
|
||||
@@ -353,10 +351,6 @@ callback:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeUpdateUserInfo:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeCreateGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
|
||||
+2
-4
@@ -128,9 +128,8 @@ services:
|
||||
|
||||
openim-web:
|
||||
# image: ghcr.io/openimsdk/openim-web:latest
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-web:latest
|
||||
image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-web:latest
|
||||
# image: openim/openim-web:latest
|
||||
image: ${IMAGE_REGISTRY}/openim-web:latest
|
||||
container_name: openim-web
|
||||
environment:
|
||||
- OPENIM_WEB_DIST_PATH=${OPENIM_WEB_DIST_PATH}
|
||||
@@ -143,10 +142,9 @@ services:
|
||||
ipv4_address: ${OPENIM_WEB_NETWORK_ADDRESS}
|
||||
|
||||
# openim-server:
|
||||
# # image: ghcr.io/openimsdk/openim-server:main
|
||||
# image: ghcr.io/openimsdk/openim-server:main
|
||||
# # image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:main
|
||||
# # image: openim/openim-server:main
|
||||
# image: ${IMAGE_REGISTRY}/openim-server:main
|
||||
# # build: .
|
||||
# container_name: openim-server
|
||||
# ports:
|
||||
|
||||
+140
-429
@@ -1,504 +1,215 @@
|
||||
# OpenIM enviroment
|
||||
|
||||
<!-- vscode-markdown-toc -->
|
||||
|
||||
* 1. [OpenIM Deployment Guide](#OpenIMDeploymentGuide)
|
||||
* 1.1. [Deployment Strategies](#DeploymentStrategies)
|
||||
* 1.2. [Source Code Deployment](#SourceCodeDeployment)
|
||||
* 1.3. [Docker Compose Deployment](#DockerComposeDeployment)
|
||||
* 1.4. [Environment Variable Configuration](#EnvironmentVariableConfiguration)
|
||||
* 1.4.1. [[1. Recommended using environment variables:](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#1-recommended-using-environment-variables)](#1.Recommendedusingenvironmentvariables:https:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.md1-recommended-using-environment-variables)
|
||||
* 1.4.2. [[Additional Configuration](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#additional-configuration)](#AdditionalConfigurationhttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdadditional-configuration)
|
||||
* 1.4.3. [[Security Considerations](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#security-considerations)](#SecurityConsiderationshttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdsecurity-considerations)
|
||||
* 1.4.4. [[Data Management](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#data-management)](#DataManagementhttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mddata-management)
|
||||
* 1.4.5. [[Monitoring and Logging](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#monitoring-and-logging)](#MonitoringandLogginghttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdmonitoring-and-logging)
|
||||
* 1.4.6. [[Troubleshooting](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#troubleshooting)](#Troubleshootinghttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdtroubleshooting)
|
||||
* 1.4.7. [[Conclusion](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#conclusion)](#Conclusionhttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdconclusion)
|
||||
* 1.4.8. [[Additional Resources](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#additional-resources)](#AdditionalResourceshttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdadditional-resources)
|
||||
* 2. [Further Configuration](#FurtherConfiguration)
|
||||
* 2.1. [Image Registry Configuration](#ImageRegistryConfiguration)
|
||||
* 2.2. [OpenIM Docker Network Configuration](#OpenIMDockerNetworkConfiguration)
|
||||
* 2.3. [OpenIM Configuration](#OpenIMConfiguration)
|
||||
* 2.4. [OpenIM Chat Configuration](#OpenIMChatConfiguration)
|
||||
* 2.5. [Zookeeper Configuration](#ZookeeperConfiguration)
|
||||
* 2.6. [MySQL Configuration](#MySQLConfiguration)
|
||||
* 2.7. [MongoDB Configuration](#MongoDBConfiguration)
|
||||
* 2.8. [Tencent Cloud COS Configuration](#TencentCloudCOSConfiguration)
|
||||
* 2.9. [Alibaba Cloud OSS Configuration](#AlibabaCloudOSSConfiguration)
|
||||
* 2.10. [Redis Configuration](#RedisConfiguration)
|
||||
* 2.11. [Kafka Configuration](#KafkaConfiguration)
|
||||
* 2.12. [OpenIM Web Configuration](#OpenIMWebConfiguration)
|
||||
* 2.13. [RPC Configuration](#RPCConfiguration)
|
||||
* 2.14. [Prometheus Configuration](#PrometheusConfiguration)
|
||||
* 2.15. [Grafana Configuration](#GrafanaConfiguration)
|
||||
* 2.16. [RPC Port Configuration Variables](#RPCPortConfigurationVariables)
|
||||
* 2.17. [RPC Register Name Configuration](#RPCRegisterNameConfiguration)
|
||||
* 2.18. [Log Configuration](#LogConfiguration)
|
||||
* 2.19. [Additional Configuration Variables](#AdditionalConfigurationVariables)
|
||||
* 2.20. [Prometheus Configuration](#PrometheusConfiguration-1)
|
||||
* 2.20.1. [General Configuration](#GeneralConfiguration)
|
||||
* 2.20.2. [Service-Specific Prometheus Ports](#Service-SpecificPrometheusPorts)
|
||||
|
||||
<!-- vscode-markdown-toc-config
|
||||
numbering=true
|
||||
autoSave=true
|
||||
/vscode-markdown-toc-config -->
|
||||
<!-- /vscode-markdown-toc -->
|
||||
## How to change the configuration
|
||||
|
||||
|
||||
## 1. <a name='OpenIMDeploymentGuide'></a>OpenIM Deployment Guide
|
||||
**Modify the configuration files:**
|
||||
|
||||
Welcome to the OpenIM Deployment Guide! OpenIM offers a versatile and robust instant messaging server, and deploying it can be achieved through various methods. This guide will walk you through the primary deployment strategies, ensuring you can set up OpenIM in a way that best suits your needs.
|
||||
Three ways to modify the configuration:
|
||||
|
||||
### 1.1. <a name='DeploymentStrategies'></a>Deployment Strategies
|
||||
|
||||
OpenIM provides multiple deployment methods, each tailored to different use cases and technical preferences:
|
||||
|
||||
1. **[Source Code Deployment Guide](https://doc.rentsoft.cn/guides/gettingStarted/imSourceCodeDeployment)**
|
||||
2. **[Docker Deployment Guide](https://doc.rentsoft.cn/guides/gettingStarted/dockerCompose)**
|
||||
3. **[Kubernetes Deployment Guide](https://github.com/openimsdk/open-im-server/tree/main/deployments)**
|
||||
|
||||
While the first two methods will be our main focus, it's worth noting that the third method, Kubernetes deployment, is also viable and can be rendered via the `environment.sh` script variables.
|
||||
|
||||
### 1.2. <a name='SourceCodeDeployment'></a>Source Code Deployment
|
||||
|
||||
In the source code deployment method, the configuration generation process involves executing `make init`, which fundamentally runs the script `./scripts/init-config.sh`. This script utilizes variables defined in the [`environment.sh`](https://github.com/openimsdk/open-im-server/blob/main/scripts/install/environment.sh) script to render the [`openim.yaml`](https://github.com/openimsdk/open-im-server/blob/main/deployments/templates/openim.yaml) template file, subsequently generating the [`config.yaml`](https://github.com/openimsdk/open-im-server/blob/main/config/config.yaml) configuration file.
|
||||
|
||||
### 1.3. <a name='DockerComposeDeployment'></a>Docker Compose Deployment
|
||||
|
||||
Docker deployment offers a slightly more intricate template. Within the [openim-server](https://github.com/openimsdk/openim-docker/tree/main/openim-server) directory, multiple subdirectories correspond to various versions, each aligning with `openim-chat` as illustrated below:
|
||||
|
||||
| openim-server | openim-chat |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| [main](https://github.com/openimsdk/openim-docker/tree/main/openim-server/main) | [main](https://github.com/openimsdk/openim-docker/tree/main/openim-chat/main) |
|
||||
| [release-v3.2](https://github.com/openimsdk/openim-docker/tree/main/openim-server/release-v3.3) | [release-v3.2](https://github.com/openimsdk/openim-docker/tree/main/openim-chat/release-v1.3) |
|
||||
| [release-v3.2](https://github.com/openimsdk/openim-docker/tree/main/openim-server/release-v3.2) | [release-v3.2](https://github.com/openimsdk/openim-docker/tree/main/openim-chat/release-v1.2) |
|
||||
|
||||
Configuration file modifications can be made by specifying corresponding environment variables, for instance:
|
||||
#### **1. Recommended using environment variables:**
|
||||
|
||||
```bash
|
||||
export CHAT_BRANCH="main"
|
||||
export SERVER_BRANCH="main"
|
||||
export PASSWORD="openIM123" # Set password
|
||||
export USER="root" # Set username
|
||||
# Choose chat version and server version https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md, eg: main, release-v*.*
|
||||
export CHAT_BRANCH="main"
|
||||
export SERVER_BRANCH="main"
|
||||
#... Other environment variables
|
||||
# MONGO_USERNAME: This sets the MongoDB username
|
||||
# MONGO_PASSWORD: Set the MongoDB password
|
||||
# MONGO_DATABASE: Sets the MongoDB database name
|
||||
# MINIO_ENDPOINT: set the MinIO service address
|
||||
# API_URL: under network environment, set OpenIM Server API address
|
||||
export API_URL="http://127.0.0.1:10002"
|
||||
```
|
||||
|
||||
These variables are stored within the [`environment.sh`](https://github.com/OpenIMSDK/openim-docker/blob/main/scripts/install/environment.sh) configuration:
|
||||
Next, update the configuration using `make init`:
|
||||
|
||||
```bash
|
||||
readonly CHAT_BRANCH=${CHAT_BRANCH:-'main'}
|
||||
readonly SERVER_BRANCH=${SERVER_BRANCH:-'main'}
|
||||
make init
|
||||
```
|
||||
|
||||
Setting a variable, e.g., `export CHAT_BRANCH="release-v1.3"`, will prioritize `CHAT_BRANCH="release-v1.3"` as the variable value. Ultimately, the chosen image version is determined, and rendering is achieved through `make init` (or `./scripts/init-config.sh`).
|
||||
|
||||
> Note: Direct modifications to the `config.yaml` file are also permissible without utilizing `make init`.
|
||||
|
||||
### 1.4. <a name='EnvironmentVariableConfiguration'></a>Environment Variable Configuration
|
||||
|
||||
For convenience, configuration through modifying environment variables is recommended:
|
||||
|
||||
#### 1.4.1. <a name='1.Recommendedusingenvironmentvariables:https:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.md1-recommended-using-environment-variables'></a>[1. Recommended using environment variables:](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#1-recommended-using-environment-variables)
|
||||
|
||||
+ PASSWORD
|
||||
|
||||
+ **Description**: Password for mysql, mongodb, redis, and minio.
|
||||
+ **Default**: `openIM123`
|
||||
+ Notes:
|
||||
+ Minimum password length: 8 characters.
|
||||
+ Special characters are not allowed.
|
||||
|
||||
```bash
|
||||
export PASSWORD="openIM123"
|
||||
```
|
||||
|
||||
+ USER
|
||||
|
||||
+ **Description**: Username for mysql, mongodb, redis, and minio.
|
||||
+ **Default**: `root`
|
||||
|
||||
```bash
|
||||
export USER="root"
|
||||
```
|
||||
|
||||
+ API_URL
|
||||
|
||||
+ **Description**: API address.
|
||||
+ **Note**: If the server has an external IP, it will be automatically obtained. For internal networks, set this variable to the IP serving internally.
|
||||
|
||||
```
|
||||
export API_URL="http://ip:10002"
|
||||
```
|
||||
|
||||
+ DATA_DIR
|
||||
|
||||
+ **Description**: Data mount directory for components.
|
||||
+ **Default**: `/data/openim`
|
||||
|
||||
```bash
|
||||
export DATA_DIR="/data/openim"
|
||||
```
|
||||
|
||||
#### 1.4.2. <a name='AdditionalConfigurationhttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdadditional-configuration'></a>[Additional Configuration](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#additional-configuration)
|
||||
|
||||
##### [MinIO Access and Secret Key](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#minio-access-and-secret-key)
|
||||
|
||||
To secure your MinIO server, you should set up an access key and secret key. These credentials are used to authenticate requests to your MinIO server.
|
||||
#### **2. Modify the automation script:**
|
||||
|
||||
```bash
|
||||
export MINIO_ACCESS_KEY="YourAccessKey"
|
||||
export MINIO_SECRET_KEY="YourSecretKey"
|
||||
scripts/install/environment.sh
|
||||
```
|
||||
|
||||
##### [MinIO Browser](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#minio-browser)
|
||||
|
||||
MinIO comes with an embedded web-based object browser. You can control the availability of the MinIO browser by setting the `MINIO_BROWSER` environment variable.
|
||||
Next, update the configuration using `make init`:
|
||||
|
||||
```bash
|
||||
export MINIO_BROWSER="on"
|
||||
make init
|
||||
```
|
||||
|
||||
#### 1.4.3. <a name='SecurityConsiderationshttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdsecurity-considerations'></a>[Security Considerations](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#security-considerations)
|
||||
#### 3. Modify `config.yaml` and `.env` files (but will be overwritten when using `make init` again).
|
||||
|
||||
##### [TLS/SSL Configuration](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#tls-ssl-configuration)
|
||||
The `config/config.yaml` file has detailed configuration instructions for the storage components.
|
||||
|
||||
For secure communication, it's recommended to enable TLS/SSL for your MinIO server. You can do this by providing the path to the SSL certificate and key files.
|
||||
|
||||
The config file is available via [environment.sh](https://github.com/openimsdk/open-im-server/blob/main/scripts/install/environment.sh) configuration [openim.yaml](https://github.com/openimsdk/open-im-server/blob/main/deployments/templates/openim.yaml) template, and then through the `make init` to automatically generate a new configuration.
|
||||
|
||||
|
||||
## Environment variable
|
||||
|
||||
By setting the environment variable below, You can then refresh the configuration using `make init` or `./scripts/init-config.sh`
|
||||
|
||||
##### MINIO
|
||||
|
||||
+ [MINIO DOCS](https://min.io/docs/minio/kubernetes/upstream/index.html)
|
||||
|
||||
apiURL is the address of the api, the access address of the app, use s3 must be configured
|
||||
|
||||
#### Overview
|
||||
|
||||
MinIO is an object storage server that is API compatible with Amazon S3. It's best suited for storing unstructured data such as photos, videos, log files, backups, and container/VM images. In this guide, we'll walk through the process of configuring MinIO with custom settings.
|
||||
|
||||
#### Default Configuration
|
||||
|
||||
Configuration can be achieved by modifying the default variables in the `./scripts/install/environment.sh` file. However, for more flexibility and dynamic adjustments, setting environment variables is recommended.
|
||||
|
||||
#### Setting Up the Environment Variables
|
||||
|
||||
##### IP Configuration
|
||||
|
||||
By default, the system generates the public IP of the machine. To manually set a public or local IP address, use:
|
||||
|
||||
```bash
|
||||
export MINIO_CERTS_DIR="/path/to/certs/directory"
|
||||
export IP=127.0.0.1
|
||||
```
|
||||
|
||||
#### 1.4.4. <a name='DataManagementhttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mddata-management'></a>[Data Management](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#data-management)
|
||||
##### API URL
|
||||
|
||||
##### [Data Retention Policy](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#data-retention-policy)
|
||||
|
||||
You may want to set up a data retention policy to automatically delete objects after a specified period.
|
||||
This is the address your application uses to communicate with MinIO. By default, it uses the public IP. However, you can adjust it to a public domain or another IP.
|
||||
|
||||
```bash
|
||||
export MINIO_RETENTION_DAYS="30"
|
||||
export API_URL=127.0.0.1:10002
|
||||
```
|
||||
|
||||
#### 1.4.5. <a name='MonitoringandLogginghttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdmonitoring-and-logging'></a>[Monitoring and Logging](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#monitoring-and-logging)
|
||||
##### MinIO Endpoint Configuration
|
||||
|
||||
##### [Audit Logging](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#audit-logging)
|
||||
|
||||
Enable audit logging to keep track of access and changes to your data.
|
||||
This is the primary address MinIO uses for communications:
|
||||
|
||||
```bash
|
||||
export MINIO_AUDIT="on"
|
||||
export MINIO_ENDPOINT="127.0.0.1"
|
||||
```
|
||||
|
||||
#### 1.4.6. <a name='Troubleshootinghttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdtroubleshooting'></a>[Troubleshooting](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#troubleshooting)
|
||||
##### MinIO Sign Endpoint
|
||||
|
||||
##### [Debug Mode](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#debug-mode)
|
||||
|
||||
In case of issues, you may enable debug mode to get more detailed logs to assist in troubleshooting.
|
||||
For direct external access to stored content:
|
||||
|
||||
```bash
|
||||
export MINIO_DEBUG="on"
|
||||
export MINIO_SIGN_ENDPOINT=127.0.0.1:10005
|
||||
```
|
||||
|
||||
#### 1.4.7. <a name='Conclusionhttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdconclusion'></a>[Conclusion](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#conclusion)
|
||||
##### Modifying MinIO's Port
|
||||
|
||||
With the environment variables configured as per your requirements, your MinIO server should be ready to securely store and manage your object data. Ensure to verify the setup and monitor the logs for any unusual activities or errors. Regularly update the MinIO server and review your configuration to adapt to any changes or improvements in the MinIO system.
|
||||
If you need to adjust MinIO's port from the default:
|
||||
|
||||
#### 1.4.8. <a name='AdditionalResourceshttps:github.comopenimsdkopen-im-serverblobmaindocscontribenvironment.mdadditional-resources'></a>[Additional Resources](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md#additional-resources)
|
||||
```bash
|
||||
export MINIO_PORT="10005"
|
||||
```
|
||||
|
||||
+ [MinIO Client Quickstart Guide](https://docs.min.io/docs/minio-client-quickstart-guide)
|
||||
+ [MinIO Admin Complete Guide](https://docs.min.io/docs/minio-admin-complete-guide)
|
||||
+ [MinIO Docker Quickstart Guide](https://docs.min.io/docs/minio-docker-quickstart-guide)
|
||||
#### Applying the Configuration
|
||||
|
||||
Feel free to explore the MinIO documentation for more advanced configurations and usage scenarios.
|
||||
After setting your desired environment variables, restart the MinIO server to apply the changes.
|
||||
|
||||
#### Verification
|
||||
|
||||
It's crucial to verify the configurations by checking the connectivity between your application and MinIO using the set API URL and ensuring that the data can be directly accessed using the `signEndpoint`.
|
||||
|
||||
## 2. <a name='FurtherConfiguration'></a>Further Configuration
|
||||
|
||||
### 2.1. <a name='ImageRegistryConfiguration'></a>Image Registry Configuration
|
||||
## Configuration Details
|
||||
|
||||
**Description**: The image registry configuration allows users to select an image address for use. The default is set to use GITHUB images, but users can opt for Docker Hub or Ali Cloud, especially beneficial for Chinese users due to its local proximity.
|
||||
###### Zookeeper
|
||||
|
||||
| Parameter | Default Value | Description |
|
||||
| ---------------- | --------------------- | ------------------------------------------------------------ |
|
||||
| `IMAGE_REGISTRY` | `"ghcr.io/openimsdk"` | The registry from which Docker images will be pulled. Other options include `"openim"` and `"registry.cn-hangzhou.aliyuncs.com/openimsdk"`. |
|
||||
- **Purpose**: Used for RPC service discovery and registration, cluster support.
|
||||
|
||||
```bash
|
||||
zookeeper:
|
||||
schema: openim # Not recommended to modify
|
||||
address: [ 127.0.0.1:2181 ] # Address
|
||||
username: # Username
|
||||
password: # Password
|
||||
```
|
||||
|
||||
### 2.2. <a name='OpenIMDockerNetworkConfiguration'></a>OpenIM Docker Network Configuration
|
||||
###### MySQL
|
||||
|
||||
**Description**: This section configures the Docker network subnet and generates IP addresses for various services within the defined subnet.
|
||||
- **Purpose**: Used for storing users, relationships, and groups. Supports master-slave database.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| --------------------------- | ----------------- | ------------------------------------------------------------ |
|
||||
| `DOCKER_BRIDGE_SUBNET` | `'172.28.0.0/16'` | The subnet for the Docker network. |
|
||||
| `DOCKER_BRIDGE_GATEWAY` | Generated IP | The gateway IP address within the Docker subnet. |
|
||||
| `[SERVICE]_NETWORK_ADDRESS` | Generated IP | The network IP address for a specific service (e.g., MYSQL, MONGO, REDIS, etc.) within the Docker subnet. |
|
||||
```bash
|
||||
mysql:
|
||||
address: [ 127.0.0.1:13306 ] # Address
|
||||
username: root # Username
|
||||
password: openIM123 # Password
|
||||
database: openIM_v2 # Not recommended to modify
|
||||
maxOpenConn: 1000 # Maximum connection
|
||||
maxIdleConn: 100 # Maximum idle connection
|
||||
maxLifeTime: 60 # Max time a connection can be reused (seconds)
|
||||
logLevel: 4 # Log level (1=silent, 2=error, 3=warn, 4=info)
|
||||
slowThreshold: 500 # Slow statement threshold (milliseconds)
|
||||
```
|
||||
|
||||
### 2.3. <a name='OpenIMConfiguration'></a>OpenIM Configuration
|
||||
###### Mongo
|
||||
|
||||
**Description**: OpenIM configuration involves setting up directories for data, installation, configuration, and logs. It also involves configuring the OpenIM server address and ports for WebSocket and API.
|
||||
- **Purpose**: Used for storing offline messages. Supports mongo sharded clusters.
|
||||
|
||||
| Parameter | Default Value | Description |
|
||||
| ----------------------- | ------------------------ | ----------------------------------------- |
|
||||
| `OPENIM_DATA_DIR` | `"/data/openim"` | Directory for OpenIM data. |
|
||||
| `OPENIM_INSTALL_DIR` | `"/opt/openim"` | Directory where OpenIM is installed. |
|
||||
| `OPENIM_CONFIG_DIR` | `"/etc/openim"` | Directory for OpenIM configuration files. |
|
||||
| `OPENIM_LOG_DIR` | `"/var/log/openim"` | Directory for OpenIM logs. |
|
||||
| `OPENIM_SERVER_ADDRESS` | Docker Bridge Gateway IP | OpenIM server address. |
|
||||
| `OPENIM_WS_PORT` | `'10001'` | Port for OpenIM WebSocket. |
|
||||
| `API_OPENIM_PORT` | `'10002'` | Port for OpenIM API. |
|
||||
```bash
|
||||
mongo:
|
||||
uri: # Use this value directly if not empty
|
||||
address: [ 127.0.0.1:37017 ] # Address
|
||||
database: openIM # Default mongo db
|
||||
username: root # Username
|
||||
password: openIM123 # Password
|
||||
maxPoolSize: 100 # Maximum connections
|
||||
```
|
||||
|
||||
### 2.4. <a name='OpenIMChatConfiguration'></a>OpenIM Chat Configuration
|
||||
###### Redis
|
||||
|
||||
**Description**: Configuration for OpenIM chat, including data directory, server address, and ports for API and chat functionalities.
|
||||
- **Purpose**: Used for storing message sequence numbers, latest messages, user tokens, and MySQL cache. Supports cluster deployment.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| ----------------------- | -------------------------- | ------------------------------- |
|
||||
| `OPENIM_CHAT_DATA_DIR` | `"./openim-chat/[BRANCH]"` | Directory for OpenIM chat data. |
|
||||
| `OPENIM_CHAT_ADDRESS` | Docker Bridge Gateway IP | OpenIM chat service address. |
|
||||
| `OPENIM_CHAT_API_PORT` | `"10008"` | Port for OpenIM chat API. |
|
||||
| `OPENIM_ADMIN_API_PORT` | `"10009"` | Port for OpenIM Admin API. |
|
||||
| `OPENIM_ADMIN_PORT` | `"30200"` | Port for OpenIM chat Admin. |
|
||||
| `OPENIM_CHAT_PORT` | `"30300"` | Port for OpenIM chat. |
|
||||
```bash
|
||||
redis:
|
||||
address: [ 127.0.0.1:16379 ] # Address
|
||||
username: # Username
|
||||
password: openIM123 # Password
|
||||
```
|
||||
|
||||
### 2.5. <a name='ZookeeperConfiguration'></a>Zookeeper Configuration
|
||||
###### Kafka
|
||||
|
||||
**Description**: Configuration for Zookeeper, including schema, port, address, and credentials.
|
||||
- **Purpose**: Used for message queues for decoupling. Supports cluster deployment.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| -------------------- | ------------------------ | ----------------------- |
|
||||
| `ZOOKEEPER_SCHEMA` | `"openim"` | Schema for Zookeeper. |
|
||||
| `ZOOKEEPER_PORT` | `"12181"` | Port for Zookeeper. |
|
||||
| `ZOOKEEPER_ADDRESS` | Docker Bridge Gateway IP | Address for Zookeeper. |
|
||||
| `ZOOKEEPER_USERNAME` | `""` | Username for Zookeeper. |
|
||||
| `ZOOKEEPER_PASSWORD` | `""` | Password for Zookeeper. |
|
||||
```bash
|
||||
kafka:
|
||||
username: # Username
|
||||
password: # Password
|
||||
addr: [ 127.0.0.1:9092 ] # Address
|
||||
topics:
|
||||
latestMsgToRedis: "latestMsgToRedis"
|
||||
offlineMsgToMongo: "offlineMsgToMongoMysql"
|
||||
msgToPush: "msgToPush"
|
||||
msgToModify: "msgToModify"
|
||||
consumerGroupID:
|
||||
msgToRedis: redis
|
||||
msgToMongo: mongo
|
||||
msgToMySql: mysql
|
||||
msgToPush: push
|
||||
msgToModify: modify
|
||||
```
|
||||
|
||||
### 2.6. <a name='MySQLConfiguration'></a>MySQL Configuration
|
||||
|
||||
**Description**: Configuration for MySQL, including port, address, and credentials.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| ---------------- | ------------------------ | ------------------- |
|
||||
| `MYSQL_PORT` | `"13306"` | Port for MySQL. |
|
||||
| `MYSQL_ADDRESS` | Docker Bridge Gateway IP | Address for MySQL. |
|
||||
| `MYSQL_USERNAME` | User-defined | Username for MySQL. |
|
||||
| `MYSQL_PASSWORD` | User-defined | Password for MySQL. |
|
||||
|
||||
Note: The configurations for other services (e.g., MONGO, REDIS, KAFKA, etc.) follow a similar pattern to MySQL and can be documented in a similar manner.
|
||||
|
||||
### 2.7. <a name='MongoDBConfiguration'></a>MongoDB Configuration
|
||||
## Config options
|
||||
|
||||
This section involves setting up MongoDB, including its port, address, and credentials.
|
||||
...
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| -------------- | -------------- | ----------------------- |
|
||||
| MONGO_PORT | "27017" | Port used by MongoDB. |
|
||||
| MONGO_ADDRESS | [Generated IP] | IP address for MongoDB. |
|
||||
| MONGO_USERNAME | [User Defined] | Username for MongoDB. |
|
||||
| MONGO_PASSWORD | [User Defined] | Password for MongoDB. |
|
||||
## Use the default values
|
||||
|
||||
### 2.8. <a name='TencentCloudCOSConfiguration'></a>Tencent Cloud COS Configuration
|
||||
A method to revert to the default value:
|
||||
|
||||
This section involves setting up Tencent Cloud COS, including its bucket URL and credentials.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| ----------------- | ------------------------------------------------------------ | ------------------------------------ |
|
||||
| COS_BUCKET_URL | "[https://temp-1252357374.cos.ap-chengdu.myqcloud.com](https://temp-1252357374.cos.ap-chengdu.myqcloud.com/)" | Tencent Cloud COS bucket URL. |
|
||||
| COS_SECRET_ID | [User Defined] | Secret ID for Tencent Cloud COS. |
|
||||
| COS_SECRET_KEY | [User Defined] | Secret key for Tencent Cloud COS. |
|
||||
| COS_SESSION_TOKEN | [User Defined] | Session token for Tencent Cloud COS. |
|
||||
| COS_PUBLIC_READ | "false" | Public read access. |
|
||||
|
||||
### 2.9. <a name='AlibabaCloudOSSConfiguration'></a>Alibaba Cloud OSS Configuration
|
||||
|
||||
This section involves setting up Alibaba Cloud OSS, including its endpoint, bucket name, and credentials.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| --------------------- | ------------------------------------------------------------ | ---------------------------------------- |
|
||||
| OSS_ENDPOINT | "[https://oss-cn-chengdu.aliyuncs.com](https://oss-cn-chengdu.aliyuncs.com/)" | Endpoint URL for Alibaba Cloud OSS. |
|
||||
| OSS_BUCKET | "demo-9999999" | Bucket name for Alibaba Cloud OSS. |
|
||||
| OSS_BUCKET_URL | "[https://demo-9999999.oss-cn-chengdu.aliyuncs.com](https://demo-9999999.oss-cn-chengdu.aliyuncs.com/)" | Bucket URL for Alibaba Cloud OSS. |
|
||||
| OSS_ACCESS_KEY_ID | [User Defined] | Access key ID for Alibaba Cloud OSS. |
|
||||
| OSS_ACCESS_KEY_SECRET | [User Defined] | Access key secret for Alibaba Cloud OSS. |
|
||||
| OSS_SESSION_TOKEN | [User Defined] | Session token for Alibaba Cloud OSS. |
|
||||
| OSS_PUBLIC_READ | "false" | Public read access. |
|
||||
|
||||
### 2.10. <a name='RedisConfiguration'></a>Redis Configuration
|
||||
|
||||
This section involves setting up Redis, including its port, address, and credentials.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| -------------- | -------------------------- | --------------------- |
|
||||
| REDIS_PORT | "16379" | Port used by Redis. |
|
||||
| REDIS_ADDRESS | "${DOCKER_BRIDGE_GATEWAY}" | IP address for Redis. |
|
||||
| REDIS_USERNAME | [User Defined] | Username for Redis. |
|
||||
| REDIS_PASSWORD | "${PASSWORD}" | Password for Redis. |
|
||||
|
||||
### 2.11. <a name='KafkaConfiguration'></a>Kafka Configuration
|
||||
|
||||
This section involves setting up Kafka, including its port, address, credentials, and topics.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| ---------------------------- | -------------------------- | ----------------------------------- |
|
||||
| KAFKA_USERNAME | [User Defined] | Username for Kafka. |
|
||||
| KAFKA_PASSWORD | [User Defined] | Password for Kafka. |
|
||||
| KAFKA_PORT | "19094" | Port used by Kafka. |
|
||||
| KAFKA_ADDRESS | "${DOCKER_BRIDGE_GATEWAY}" | IP address for Kafka. |
|
||||
| KAFKA_LATESTMSG_REDIS_TOPIC | "latestMsgToRedis" | Topic for latest message to Redis. |
|
||||
| KAFKA_OFFLINEMSG_MONGO_TOPIC | "offlineMsgToMongoMysql" | Topic for offline message to Mongo. |
|
||||
| KAFKA_MSG_PUSH_TOPIC | "msgToPush" | Topic for message to push. |
|
||||
| KAFKA_CONSUMERGROUPID_REDIS | "redis" | Consumer group ID to Redis. |
|
||||
| KAFKA_CONSUMERGROUPID_MONGO | "mongo" | Consumer group ID to Mongo. |
|
||||
| KAFKA_CONSUMERGROUPID_MYSQL | "mysql" | Consumer group ID to MySQL. |
|
||||
| KAFKA_CONSUMERGROUPID_PUSH | "push" | Consumer group ID to push. |
|
||||
|
||||
Note: Ensure to replace placeholder values (like [User Defined], `${DOCKER_BRIDGE_GATEWAY}`, and `${PASSWORD}`) with actual values before deploying the configuration.
|
||||
|
||||
|
||||
|
||||
### 2.12. <a name='OpenIMWebConfiguration'></a>OpenIM Web Configuration
|
||||
|
||||
This section involves setting up OpenIM Web, including its port, address, and dist path.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| -------------------- | -------------------------- | ------------------------- |
|
||||
| OPENIM_WEB_PORT | "11001" | Port used by OpenIM Web. |
|
||||
| OPENIM_WEB_ADDRESS | "${DOCKER_BRIDGE_GATEWAY}" | Address for OpenIM Web. |
|
||||
| OPENIM_WEB_DIST_PATH | "/app/dist" | Dist path for OpenIM Web. |
|
||||
|
||||
### 2.13. <a name='RPCConfiguration'></a>RPC Configuration
|
||||
|
||||
Configuration for RPC, including the register and listen IP.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| --------------- | -------------- | -------------------- |
|
||||
| RPC_REGISTER_IP | [User Defined] | Register IP for RPC. |
|
||||
| RPC_LISTEN_IP | "0.0.0.0" | Listen IP for RPC. |
|
||||
|
||||
### 2.14. <a name='PrometheusConfiguration'></a>Prometheus Configuration
|
||||
|
||||
Setting up Prometheus, including its port and address.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| ------------------ | -------------------------- | ------------------------ |
|
||||
| PROMETHEUS_PORT | "19090" | Port used by Prometheus. |
|
||||
| PROMETHEUS_ADDRESS | "${DOCKER_BRIDGE_GATEWAY}" | Address for Prometheus. |
|
||||
|
||||
### 2.15. <a name='GrafanaConfiguration'></a>Grafana Configuration
|
||||
|
||||
Configuration for Grafana, including its port and address.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| --------------- | -------------------------- | --------------------- |
|
||||
| GRAFANA_PORT | "3000" | Port used by Grafana. |
|
||||
| GRAFANA_ADDRESS | "${DOCKER_BRIDGE_GATEWAY}" | Address for Grafana. |
|
||||
|
||||
### 2.16. <a name='RPCPortConfigurationVariables'></a>RPC Port Configuration Variables
|
||||
|
||||
Configuration for various RPC ports. Note: For launching multiple programs, just fill in multiple ports separated by commas. Try not to have spaces.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| --------------------------- | ------------- | ----------------------------------- |
|
||||
| OPENIM_USER_PORT | '10110' | OpenIM User Service Port. |
|
||||
| OPENIM_FRIEND_PORT | '10120' | OpenIM Friend Service Port. |
|
||||
| OPENIM_MESSAGE_PORT | '10130' | OpenIM Message Service Port. |
|
||||
| OPENIM_MESSAGE_GATEWAY_PORT | '10140' | OpenIM Message Gateway Service Port |
|
||||
| OPENIM_GROUP_PORT | '10150' | OpenIM Group Service Port. |
|
||||
| OPENIM_AUTH_PORT | '10160' | OpenIM Authorization Service Port. |
|
||||
| OPENIM_PUSH_PORT | '10170' | OpenIM Push Service Port. |
|
||||
| OPENIM_CONVERSATION_PORT | '10180' | OpenIM Conversation Service Port. |
|
||||
| OPENIM_THIRD_PORT | '10190' | OpenIM Third-Party Service Port. |
|
||||
|
||||
### 2.17. <a name='RPCRegisterNameConfiguration'></a>RPC Register Name Configuration
|
||||
|
||||
This section involves setting up the RPC Register Names for various OpenIM services.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| --------------------------- | ---------------- | ----------------------------------- |
|
||||
| OPENIM_USER_NAME | "User" | OpenIM User Service Name |
|
||||
| OPENIM_FRIEND_NAME | "Friend" | OpenIM Friend Service Name |
|
||||
| OPENIM_MSG_NAME | "Msg" | OpenIM Message Service Name |
|
||||
| OPENIM_PUSH_NAME | "Push" | OpenIM Push Service Name |
|
||||
| OPENIM_MESSAGE_GATEWAY_NAME | "MessageGateway" | OpenIM Message Gateway Service Name |
|
||||
| OPENIM_GROUP_NAME | "Group" | OpenIM Group Service Name |
|
||||
| OPENIM_AUTH_NAME | "Auth" | OpenIM Authorization Service Name |
|
||||
| OPENIM_CONVERSATION_NAME | "Conversation" | OpenIM Conversation Service Name |
|
||||
| OPENIM_THIRD_NAME | "Third" | OpenIM Third-Party Service Name |
|
||||
|
||||
### 2.18. <a name='LogConfiguration'></a>Log Configuration
|
||||
|
||||
This section involves configuring the log settings, including storage location, rotation time, and log level.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| ------------------------- | ------------------------ | --------------------------------- |
|
||||
| LOG_STORAGE_LOCATION | ""${OPENIM_ROOT}"/logs/" | Location for storing logs |
|
||||
| LOG_ROTATION_TIME | "24" | Log rotation time (in hours) |
|
||||
| LOG_REMAIN_ROTATION_COUNT | "2" | Number of log rotations to retain |
|
||||
| LOG_REMAIN_LOG_LEVEL | "6" | Log level to retain |
|
||||
| LOG_IS_STDOUT | "false" | Output log to standard output |
|
||||
| LOG_IS_JSON | "false" | Log in JSON format |
|
||||
| LOG_WITH_STACK | "false" | Include stack info in logs |
|
||||
|
||||
### 2.19. <a name='AdditionalConfigurationVariables'></a>Additional Configuration Variables
|
||||
|
||||
This section involves setting up additional configuration variables for Websocket, Push Notifications, and Chat.
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| ----------------------- | ----------------- | ---------------------------------- |
|
||||
| WEBSOCKET_MAX_CONN_NUM | "100000" | Maximum Websocket connections |
|
||||
| WEBSOCKET_MAX_MSG_LEN | "4096" | Maximum Websocket message length |
|
||||
| WEBSOCKET_TIMEOUT | "10" | Websocket timeout |
|
||||
| PUSH_ENABLE | "getui" | Push notification enable status |
|
||||
| GETUI_PUSH_URL | [Generated URL] | GeTui Push Notification URL |
|
||||
| GETUI_MASTER_SECRET | [User Defined] | GeTui Master Secret |
|
||||
| GETUI_APP_KEY | [User Defined] | GeTui Application Key |
|
||||
| GETUI_INTENT | [User Defined] | GeTui Push Intent |
|
||||
| GETUI_CHANNEL_ID | [User Defined] | GeTui Channel ID |
|
||||
| GETUI_CHANNEL_NAME | [User Defined] | GeTui Channel Name |
|
||||
| FCM_SERVICE_ACCOUNT | "x.json" | FCM Service Account |
|
||||
| JPNS_APP_KEY | [User Defined] | JPNS Application Key |
|
||||
| JPNS_MASTER_SECRET | [User Defined] | JPNS Master Secret |
|
||||
| JPNS_PUSH_URL | [User Defined] | JPNS Push Notification URL |
|
||||
| JPNS_PUSH_INTENT | [User Defined] | JPNS Push Intent |
|
||||
| MANAGER_USERID_1 | "openIM123456" | Administrator ID 1 |
|
||||
| MANAGER_USERID_2 | "openIM654321" | Administrator ID 2 |
|
||||
| MANAGER_USERID_3 | "openIMAdmin" | Administrator ID 3 |
|
||||
| NICKNAME_1 | "system1" | Nickname 1 |
|
||||
| NICKNAME_2 | "system2" | Nickname 2 |
|
||||
| NICKNAME_3 | "system3" | Nickname 3 |
|
||||
| MULTILOGIN_POLICY | "1" | Multi-login Policy |
|
||||
| CHAT_PERSISTENCE_MYSQL | "true" | Chat Persistence in MySQL |
|
||||
| MSG_CACHE_TIMEOUT | "86400" | Message Cache Timeout |
|
||||
| GROUP_MSG_READ_RECEIPT | "true" | Group Message Read Receipt Enable |
|
||||
| SINGLE_MSG_READ_RECEIPT | "true" | Single Message Read Receipt Enable |
|
||||
| RETAIN_CHAT_RECORDS | "365" | Retain Chat Records (in days) |
|
||||
| CHAT_RECORDS_CLEAR_TIME | [Cron Expression] | Chat Records Clear Time |
|
||||
| MSG_DESTRUCT_TIME | [Cron Expression] | Message Destruct Time |
|
||||
| SECRET | "${PASSWORD}" | Secret Key |
|
||||
| TOKEN_EXPIRE | "90" | Token Expiry Time |
|
||||
| FRIEND_VERIFY | "false" | Friend Verification Enable |
|
||||
| IOS_PUSH_SOUND | "xxx" | iOS |
|
||||
|
||||
|
||||
|
||||
### 2.20. <a name='PrometheusConfiguration-1'></a>Prometheus Configuration
|
||||
|
||||
This section involves configuring Prometheus, including enabling/disabling it and setting up ports for various services.
|
||||
|
||||
#### 2.20.1. <a name='GeneralConfiguration'></a>General Configuration
|
||||
|
||||
| Parameter | Example Value | Description |
|
||||
| ------------------- | ------------- | ----------------------------- |
|
||||
| `PROMETHEUS_ENABLE` | "false" | Whether to enable Prometheus. |
|
||||
|
||||
#### 2.20.2. <a name='Service-SpecificPrometheusPorts'></a>Service-Specific Prometheus Ports
|
||||
|
||||
| Service | Parameter | Default Port Value | Description |
|
||||
| ------------------------ | ------------------------ | ---------------------------- | -------------------------------------------------- |
|
||||
| User Service | `USER_PROM_PORT` | '20110' | Prometheus port for the User service. |
|
||||
| Friend Service | `FRIEND_PROM_PORT` | '20120' | Prometheus port for the Friend service. |
|
||||
| Message Service | `MESSAGE_PROM_PORT` | '20130' | Prometheus port for the Message service. |
|
||||
| Message Gateway | `MSG_GATEWAY_PROM_PORT` | '20140' | Prometheus port for the Message Gateway. |
|
||||
| Group Service | `GROUP_PROM_PORT` | '20150' | Prometheus port for the Group service. |
|
||||
| Auth Service | `AUTH_PROM_PORT` | '20160' | Prometheus port for the Auth service. |
|
||||
| Push Service | `PUSH_PROM_PORT` | '20170' | Prometheus port for the Push service. |
|
||||
| Conversation Service | `CONVERSATION_PROM_PORT` | '20230' | Prometheus port for the Conversation service. |
|
||||
| RTC Service | `RTC_PROM_PORT` | '21300' | Prometheus port for the RTC service. |
|
||||
| Third Service | `THIRD_PROM_PORT` | '21301' | Prometheus port for the Third service. |
|
||||
| Message Transfer Service | `MSG_TRANSFER_PROM_PORT` | '21400, 21401, 21402, 21403' | Prometheus ports for the Message Transfer service. |
|
||||
```bash
|
||||
export IP=127.0.0.1
|
||||
```
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
<!-- vscode-markdown-toc -->
|
||||
|
||||
<!-- vscode-markdown-toc-config
|
||||
numbering=true
|
||||
autoSave=true
|
||||
/vscode-markdown-toc-config -->
|
||||
<!-- /vscode-markdown-toc -->
|
||||
# Install Docker
|
||||
|
||||
|
||||
The installation command is as follows:
|
||||
|
||||
```bash
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 65 KiB |
@@ -7,7 +7,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.15.5
|
||||
github.com/go-playground/validator/v10 v10.15.3
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||
github.com/golang/protobuf v1.5.3
|
||||
@@ -19,38 +19,38 @@ require (
|
||||
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.17.0
|
||||
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.4
|
||||
go.mongodb.org/mongo-driver v1.12.1
|
||||
golang.org/x/image v0.12.0
|
||||
google.golang.org/api v0.143.0
|
||||
google.golang.org/grpc v1.58.2
|
||||
google.golang.org/api v0.138.0
|
||||
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
|
||||
gorm.io/gorm v1.25.5
|
||||
gorm.io/gorm v1.25.4
|
||||
)
|
||||
|
||||
require github.com/google/uuid v1.3.1
|
||||
|
||||
require (
|
||||
github.com/IBM/sarama v1.41.2
|
||||
github.com/OpenIMSDK/protocol v0.0.25
|
||||
github.com/IBM/sarama v1.41.1
|
||||
github.com/OpenIMSDK/protocol v0.0.21
|
||||
github.com/OpenIMSDK/tools v0.0.14
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible
|
||||
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.2.1
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.44
|
||||
github.com/redis/go-redis/v9 v9.1.0
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.42
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.110.7 // indirect
|
||||
cloud.google.com/go v0.110.6 // indirect
|
||||
cloud.google.com/go/compute v1.23.0 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||
cloud.google.com/go/firestore v1.12.0 // indirect
|
||||
cloud.google.com/go/firestore v1.11.0 // indirect
|
||||
cloud.google.com/go/iam v1.1.1 // indirect
|
||||
cloud.google.com/go/longrunning v0.5.1 // indirect
|
||||
cloud.google.com/go/storage v1.30.1 // indirect
|
||||
@@ -73,8 +73,8 @@ require (
|
||||
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/google/s2a-go v0.1.7 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect
|
||||
github.com/google/s2a-go v0.1.5 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
@@ -104,9 +104,9 @@ require (
|
||||
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.18 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
|
||||
github.com/prometheus/common v0.44.0 // indirect
|
||||
github.com/prometheus/procfs v0.11.1 // indirect
|
||||
github.com/prometheus/client_model v0.3.0 // indirect
|
||||
github.com/prometheus/common v0.42.0 // indirect
|
||||
github.com/prometheus/procfs v0.10.1 // indirect
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/rs/xid v1.5.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
@@ -119,17 +119,17 @@ 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.17.0 // indirect
|
||||
golang.org/x/oauth2 v0.12.0 // indirect
|
||||
golang.org/x/net v0.14.0 // indirect
|
||||
golang.org/x/oauth2 v0.11.0 // indirect
|
||||
golang.org/x/sync v0.3.0 // indirect
|
||||
golang.org/x/sys v0.13.0 // indirect
|
||||
golang.org/x/sys v0.11.0 // indirect
|
||||
golang.org/x/text v0.13.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 v0.0.0-20230913181813-007df8e322eb // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -140,6 +140,6 @@ require (
|
||||
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.14.0 // indirect
|
||||
golang.org/x/crypto v0.12.0 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
)
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o=
|
||||
cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.110.6 h1:8uYAkj3YHTP/1iwReuHPxLSbdcyc+dSBbzFMrVwDR6Q=
|
||||
cloud.google.com/go v0.110.6/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI=
|
||||
cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY=
|
||||
cloud.google.com/go/compute v1.23.0/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.12.0 h1:aeEA/N7DW7+l2u5jtkO8I0qv0D95YwjggD8kUHrTHO4=
|
||||
cloud.google.com/go/firestore v1.12.0/go.mod h1:b38dKhgzlmNNGTNZZwe7ZRFEuRab1Hay3/DBsIGKKy4=
|
||||
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.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y=
|
||||
cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU=
|
||||
cloud.google.com/go/longrunning v0.5.1 h1:Fr7TXftcqTudoyRJa113hyaqlGdiBQkp0Gq7tErFDWI=
|
||||
@@ -16,26 +17,28 @@ cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7Biccwk
|
||||
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/IBM/sarama v1.41.2 h1:ZDBZfGPHAD4uuAtSv4U22fRZBgst0eEwGFzLj0fb85c=
|
||||
github.com/IBM/sarama v1.41.2/go.mod h1:xdpu7sd6OE1uxNdjYTSKUfY8FaKkJES9/+EyjSgiGQk=
|
||||
github.com/OpenIMSDK/protocol v0.0.25 h1:AtB0Ia5LO26oqPoPJDIS4UMH3Wb2li96fMgfzI2cr4I=
|
||||
github.com/OpenIMSDK/protocol v0.0.25/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
|
||||
github.com/IBM/sarama v1.41.1 h1:B4/TdHce/8Ipza+qrLIeNJ9D1AOxZVp/3uDv6H/dp2M=
|
||||
github.com/IBM/sarama v1.41.1/go.mod h1:JFCPURVskaipJdKRFkiE/OZqQHw7jqliaJmRwXCmSSw=
|
||||
github.com/OpenIMSDK/protocol v0.0.21 h1:5H6H+hJ9d/VgRqttvxD/zfK9Asd+4M8Eknk5swSbUVY=
|
||||
github.com/OpenIMSDK/protocol v0.0.21/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
|
||||
github.com/OpenIMSDK/tools v0.0.14 h1:WLof/+WxyPyRST+QkoTKubYCiV73uCLiL8pgnpH/yKQ=
|
||||
github.com/OpenIMSDK/tools v0.0.14/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
|
||||
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible h1:Sg/2xHwDrioHpxTN6WMiwbXTpUEinBpHsN7mG21Rc2k=
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.9+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=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
|
||||
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
|
||||
github.com/bsm/ginkgo/v2 v2.9.5 h1:rtVBYPs3+TC5iLUVOis1B9tjLTup7Cj5IfzosKtvTJ0=
|
||||
github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y=
|
||||
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
|
||||
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
|
||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||
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=
|
||||
@@ -48,6 +51,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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
@@ -67,6 +75,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/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
@@ -74,6 +84,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=
|
||||
@@ -83,8 +94,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.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24=
|
||||
github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
|
||||
github.com/go-playground/validator/v10 v10.15.3 h1:S+sSpunYjNPDuXkWbK+x+bA7iXiW296KG4dL3X7xUZo=
|
||||
github.com/go-playground/validator/v10 v10.15.3/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=
|
||||
@@ -107,6 +118,8 @@ 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=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
@@ -138,14 +151,14 @@ 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.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
|
||||
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
|
||||
github.com/google/s2a-go v0.1.5 h1:8IYp3w9nysqv3JH+NJgXJzGbDHzLOTj43BmSkp+O7qg=
|
||||
github.com/google/s2a-go v0.1.5/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.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
|
||||
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.1 h1:SBWmZhjUDRorQxrN0nwzf+AHBxnbFjViHQS4P0yVpmQ=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.1/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
|
||||
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=
|
||||
@@ -154,6 +167,7 @@ github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWm
|
||||
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=
|
||||
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
@@ -254,21 +268,22 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
|
||||
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
|
||||
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
|
||||
github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
|
||||
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
|
||||
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
|
||||
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
|
||||
github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI=
|
||||
github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
|
||||
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
|
||||
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
|
||||
github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
|
||||
github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
|
||||
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
|
||||
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/redis/go-redis/v9 v9.2.1 h1:WlYJg71ODF0dVspZZCpYmoF1+U1Jjk9Rwd7pq6QmlCg=
|
||||
github.com/redis/go-redis/v9 v9.2.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
|
||||
github.com/redis/go-redis/v9 v9.1.0 h1:137FnGdk+EQdCbye1FW+qOEcY5S+SpY9T0NiuqvtfMY=
|
||||
github.com/redis/go-redis/v9 v9.1.0/go.mod h1:urWj3He21Dj5k4TK1y59xH8Uj6ATueP8AH1cY3lZl4c=
|
||||
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=
|
||||
@@ -295,8 +310,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
||||
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.44 h1:Vvz28KVdmSUrwTH2MWgAMlhzUAh+lQBSSAW1J7qJDW8=
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.44/go.mod h1:LUFnaqRmGk6pEHOaRmdn2dCZR2j0cSsM5xowWFPTPao=
|
||||
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=
|
||||
@@ -316,6 +331,7 @@ go.mongodb.org/mongo-driver v1.12.1 h1:nLkghSU8fQNaK7oUmDhQFsnrtcoNy7Z6LVFKsEecq
|
||||
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=
|
||||
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=
|
||||
@@ -330,10 +346,11 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
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.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
|
||||
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
|
||||
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/image v0.12.0 h1:w13vZbU4o5rKOFFR8y7M+c4A5jXDC0uXTdHYRP8X2DQ=
|
||||
golang.org/x/image v0.12.0/go.mod h1:Lu90jvHG7GfemOIcldsh9A2hS01ocl6oNO7ype5mEnk=
|
||||
@@ -347,6 +364,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=
|
||||
@@ -355,6 +373,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=
|
||||
@@ -363,11 +382,12 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx
|
||||
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.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
|
||||
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
|
||||
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU=
|
||||
golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk=
|
||||
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=
|
||||
@@ -398,8 +418,8 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
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.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
|
||||
golang.org/x/sys v0.11.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=
|
||||
@@ -431,28 +451,32 @@ 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.143.0 h1:o8cekTkqhywkbZT6p1UHJPZ9+9uuCAJs/KYomxZB8fA=
|
||||
google.golang.org/api v0.143.0/go.mod h1:FoX9DO9hT7DLNn97OuoZAGSDuNAXdJRuGK98rSUgurk=
|
||||
google.golang.org/api v0.138.0 h1:K/tVp05MxNVbHShRw9m7e9VJGdagNeTdMzqPH7AUqr0=
|
||||
google.golang.org/api v0.138.0/go.mod h1:4xyob8CxC+0GChNBvEUAk8VBKNvYOTWM9T3v3UfRxuY=
|
||||
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-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA=
|
||||
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 h1:N3bU/SQDCDyD6R528GJ/PwW9KjYcJA3dgyH+MovAkIM=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA=
|
||||
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g=
|
||||
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5 h1:nIgk/EEq3/YlnmVVXVnm14rC2oxgs1o0ong4sD/rd44=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5/go.mod h1:5DZzOUPCLYL3mNkQ0ms0F3EuUNZ7py1Bqeq6sxzI7/Q=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 h1:wukfNtZmZUurLN/atp2hiIeTKn7QJWIQdHzqmsOnAOk=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
|
||||
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.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I=
|
||||
google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
|
||||
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.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=
|
||||
@@ -474,6 +498,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=
|
||||
@@ -484,8 +509,8 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
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.5 h1:zR9lOiiYf09VNh5Q1gphfyia1JpiClIWG9hQaxB/mls=
|
||||
gorm.io/gorm v1.25.5/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
|
||||
gorm.io/gorm v1.25.4 h1:iyNd8fNAe8W9dvtlgeRI5zSVZPsq3OpcTu37cYcpCmw=
|
||||
gorm.io/gorm v1.25.4/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||
|
||||
@@ -4,7 +4,7 @@ use (
|
||||
.
|
||||
./test/typecheck
|
||||
./tools/changelog
|
||||
//./tools/imctl
|
||||
./tools/imctl
|
||||
./tools/infra
|
||||
./tools/ncpu
|
||||
./tools/openim-web
|
||||
@@ -12,5 +12,4 @@ use (
|
||||
./tools/yamlfmt
|
||||
./tools/component
|
||||
./tools/url2im
|
||||
./tools/data-conversion
|
||||
)
|
||||
|
||||
+2
-3
@@ -58,7 +58,7 @@ func (m MessageApi) newUserSendMsgReq(c *gin.Context, params *apistruct.SendMsg)
|
||||
options := make(map[string]bool, 5)
|
||||
switch params.ContentType {
|
||||
case constant.Text:
|
||||
fallthrough
|
||||
newContent = params.Content["text"].(string)
|
||||
case constant.Picture:
|
||||
fallthrough
|
||||
case constant.Custom:
|
||||
@@ -100,7 +100,6 @@ func (m MessageApi) newUserSendMsgReq(c *gin.Context, params *apistruct.SendMsg)
|
||||
ContentType: params.ContentType,
|
||||
Content: []byte(newContent),
|
||||
CreateTime: utils.GetCurrentTimestampByMill(),
|
||||
SendTime: params.SendTime,
|
||||
Options: options,
|
||||
OfflinePushInfo: params.OfflinePushInfo,
|
||||
},
|
||||
@@ -208,6 +207,7 @@ func (m *MessageApi) SendMessage(c *gin.Context) {
|
||||
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
|
||||
return
|
||||
}
|
||||
log.ZInfo(c, "SendMessage", "req", req)
|
||||
if !authverify.IsAppManagerUid(c) {
|
||||
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
||||
return
|
||||
@@ -224,7 +224,6 @@ func (m *MessageApi) SendMessage(c *gin.Context) {
|
||||
respPb, err := m.Client.SendMsg(c, sendMsgReq)
|
||||
if err != nil {
|
||||
status = constant.MsgSendFailed
|
||||
log.ZError(c, "send message err", err)
|
||||
apiresp.GinError(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -156,11 +156,6 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
|
||||
thirdGroup.POST("/fcm_update_token", t.FcmUpdateToken)
|
||||
thirdGroup.POST("/set_app_badge", t.SetAppBadge)
|
||||
|
||||
logs := thirdGroup.Group("/logs")
|
||||
logs.POST("/upload", t.UploadLogs)
|
||||
logs.POST("/delete", t.DeleteLogs)
|
||||
logs.POST("/search", t.SearchLogs)
|
||||
|
||||
objectGroup := r.Group("/object", ParseToken)
|
||||
|
||||
objectGroup.POST("/part_limit", t.PartLimit)
|
||||
|
||||
@@ -105,16 +105,3 @@ func (o *ThirdApi) ObjectRedirect(c *gin.Context) {
|
||||
}
|
||||
c.Redirect(http.StatusFound, resp.Url)
|
||||
}
|
||||
|
||||
// #################### logs ####################.
|
||||
func (o *ThirdApi) UploadLogs(c *gin.Context) {
|
||||
a2r.Call(third.ThirdClient.UploadLogs, o.Client, c)
|
||||
}
|
||||
|
||||
func (o *ThirdApi) DeleteLogs(c *gin.Context) {
|
||||
a2r.Call(third.ThirdClient.DeleteLogs, o.Client, c)
|
||||
}
|
||||
|
||||
func (o *ThirdApi) SearchLogs(c *gin.Context) {
|
||||
a2r.Call(third.ThirdClient.SearchLogs, o.Client, c)
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ const (
|
||||
PongMessage = 10
|
||||
)
|
||||
|
||||
type PingPongHandler func(string) error
|
||||
type PongHandler func(string) error
|
||||
|
||||
type Client struct {
|
||||
w *sync.Mutex
|
||||
@@ -107,12 +107,8 @@ func (c *Client) ResetClient(
|
||||
c.token = token
|
||||
}
|
||||
|
||||
func (c *Client) pingHandler(_ string) error {
|
||||
func (c *Client) pongHandler(_ string) error {
|
||||
c.conn.SetReadDeadline(pongWait)
|
||||
err := c.writePongMsg()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -126,11 +122,10 @@ func (c *Client) readMessage() {
|
||||
}()
|
||||
c.conn.SetReadLimit(maxMessageSize)
|
||||
_ = c.conn.SetReadDeadline(pongWait)
|
||||
c.conn.SetPingHandler(c.pingHandler)
|
||||
c.conn.SetPongHandler(c.pongHandler)
|
||||
for {
|
||||
messageType, message, returnErr := c.conn.ReadMessage()
|
||||
if returnErr != nil {
|
||||
log.ZWarn(c.ctx, "readMessage", returnErr, "messageType", messageType)
|
||||
c.closedErr = returnErr
|
||||
return
|
||||
}
|
||||
@@ -207,8 +202,8 @@ func (c *Client) handleMessage(message []byte) error {
|
||||
binaryReq.ReqIdentifier,
|
||||
)
|
||||
}
|
||||
|
||||
return c.replyMessage(ctx, &binaryReq, messageErr, resp)
|
||||
c.replyMessage(ctx, &binaryReq, messageErr, resp)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Client) setAppBackgroundStatus(ctx context.Context, req Req) ([]byte, error) {
|
||||
@@ -229,7 +224,7 @@ func (c *Client) close() {
|
||||
c.longConnServer.UnRegister(c)
|
||||
}
|
||||
|
||||
func (c *Client) replyMessage(ctx context.Context, binaryReq *Req, err error, resp []byte) error {
|
||||
func (c *Client) replyMessage(ctx context.Context, binaryReq *Req, err error, resp []byte) {
|
||||
errResp := apiresp.ParseError(err)
|
||||
mReply := Resp{
|
||||
ReqIdentifier: binaryReq.ReqIdentifier,
|
||||
@@ -244,10 +239,6 @@ func (c *Client) replyMessage(ctx context.Context, binaryReq *Req, err error, re
|
||||
if err != nil {
|
||||
log.ZWarn(ctx, "wireBinaryMsg replyMessage", err, "resp", mReply.String())
|
||||
}
|
||||
if binaryReq.ReqIdentifier == WsLogoutMsg {
|
||||
return errors.New("user logout")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Client) PushMessage(ctx context.Context, msgData *sdkws.MsgData) error {
|
||||
|
||||
@@ -41,8 +41,7 @@ type LongConn interface {
|
||||
SetConnNil()
|
||||
// SetReadLimit sets the maximum size for a message read from the peer.bytes
|
||||
SetReadLimit(limit int64)
|
||||
SetPongHandler(handler PingPongHandler)
|
||||
SetPingHandler(handler PingPongHandler)
|
||||
SetPongHandler(handler PongHandler)
|
||||
// GenerateLongConn Check the connection of the current and when it was sent are the same
|
||||
GenerateLongConn(w http.ResponseWriter, r *http.Request) error
|
||||
}
|
||||
@@ -117,14 +116,10 @@ func (d *GWebSocket) SetReadLimit(limit int64) {
|
||||
d.conn.SetReadLimit(limit)
|
||||
}
|
||||
|
||||
func (d *GWebSocket) SetPongHandler(handler PingPongHandler) {
|
||||
func (d *GWebSocket) SetPongHandler(handler PongHandler) {
|
||||
d.conn.SetPongHandler(handler)
|
||||
}
|
||||
|
||||
func (d *GWebSocket) SetPingHandler(handler PingPongHandler) {
|
||||
d.conn.SetPingHandler(handler)
|
||||
}
|
||||
|
||||
//func (d *GWebSocket) CheckSendConnDiffNow() bool {
|
||||
// return d.conn == d.sendConn
|
||||
//}
|
||||
|
||||
@@ -204,8 +204,10 @@ func (c *conversationServer) SetConversations(ctx context.Context, req *pbconver
|
||||
if err := c.conversationDatabase.SyncPeerUserPrivateConversationTx(ctx, conversations); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, userID := range req.UserIDs {
|
||||
c.conversationNotificationSender.ConversationSetPrivateNotification(ctx, userID, req.Conversation.UserID, req.Conversation.IsPrivateChat.Value, req.Conversation.ConversationID)
|
||||
if len(req.UserIDs) != 1 || unequal > 0 {
|
||||
for _, userID := range req.UserIDs {
|
||||
c.conversationNotificationSender.ConversationSetPrivateNotification(ctx, userID, req.Conversation.UserID, req.Conversation.IsPrivateChat.Value, req.Conversation.ConversationID)
|
||||
}
|
||||
}
|
||||
}
|
||||
if req.Conversation.BurnDuration != nil {
|
||||
@@ -217,7 +219,7 @@ func (c *conversationServer) SetConversations(ctx context.Context, req *pbconver
|
||||
if err := c.conversationDatabase.SetUsersConversationFiledTx(ctx, req.UserIDs, &conversation, m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if unequal > 0 {
|
||||
if len(req.UserIDs) != 1 || unequal > 0 {
|
||||
for _, v := range req.UserIDs {
|
||||
c.conversationNotificationSender.ConversationChangeNotification(ctx, v, []string{req.Conversation.ConversationID})
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func CallbackBeforeCreateGroup(ctx context.Context, req *group.CreateGroupReq) (
|
||||
RoleLevel: constant.GroupAdmin,
|
||||
})
|
||||
}
|
||||
for _, userID := range req.MemberUserIDs {
|
||||
for _, userID := range req.AdminUserIDs {
|
||||
cbReq.InitMemberList = append(cbReq.InitMemberList, &apistruct.GroupAddMemberInfo{
|
||||
UserID: userID,
|
||||
RoleLevel: constant.GroupOrdinaryUsers,
|
||||
|
||||
+26
-35
@@ -225,16 +225,15 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbgroup.CreateGroupR
|
||||
return nil, err
|
||||
}
|
||||
joinGroup := func(userID string, roleLevel int32) error {
|
||||
groupMember := &relationtb.GroupMemberModel{
|
||||
GroupID: group.GroupID,
|
||||
UserID: userID,
|
||||
RoleLevel: roleLevel,
|
||||
OperatorUserID: opUserID,
|
||||
JoinSource: constant.JoinByInvitation,
|
||||
InviterUserID: opUserID,
|
||||
JoinTime: time.Now(),
|
||||
MuteEndTime: time.UnixMilli(0),
|
||||
}
|
||||
groupMember := convert.Pb2DbGroupMember(userMap[userID])
|
||||
groupMember.Nickname = ""
|
||||
groupMember.GroupID = group.GroupID
|
||||
groupMember.RoleLevel = roleLevel
|
||||
groupMember.OperatorUserID = mcontext.GetOpUserID(ctx)
|
||||
groupMember.JoinSource = constant.JoinByInvitation
|
||||
groupMember.InviterUserID = mcontext.GetOpUserID(ctx)
|
||||
groupMember.JoinTime = time.Now()
|
||||
groupMember.MuteEndTime = time.Unix(0, 0)
|
||||
if err := CallbackBeforeMemberJoinGroup(ctx, groupMember, group.Ex); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -360,9 +359,6 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbgroup.Invite
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(userMap) != len(req.InvitedUserIDs) {
|
||||
return nil, errs.ErrRecordNotFound.Wrap("user not found")
|
||||
}
|
||||
var groupMember *relationtb.GroupMemberModel
|
||||
var opUserID string
|
||||
if !authverify.IsAppManagerUid(ctx) {
|
||||
@@ -420,16 +416,15 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbgroup.Invite
|
||||
opUserID := mcontext.GetOpUserID(ctx)
|
||||
var groupMembers []*relationtb.GroupMemberModel
|
||||
for _, userID := range req.InvitedUserIDs {
|
||||
member := &relationtb.GroupMemberModel{
|
||||
GroupID: req.GroupID,
|
||||
UserID: userID,
|
||||
RoleLevel: constant.GroupOrdinaryUsers,
|
||||
OperatorUserID: opUserID,
|
||||
InviterUserID: opUserID,
|
||||
JoinSource: constant.JoinByInvitation,
|
||||
JoinTime: time.Now(),
|
||||
MuteEndTime: time.UnixMilli(0),
|
||||
}
|
||||
member := convert.Pb2DbGroupMember(userMap[userID])
|
||||
member.Nickname = ""
|
||||
member.GroupID = req.GroupID
|
||||
member.RoleLevel = constant.GroupOrdinaryUsers
|
||||
member.OperatorUserID = opUserID
|
||||
member.InviterUserID = opUserID
|
||||
member.JoinSource = constant.JoinByInvitation
|
||||
member.JoinTime = time.Now()
|
||||
member.MuteEndTime = time.Unix(0, 0)
|
||||
if err := CallbackBeforeMemberJoinGroup(ctx, member, group.Ex); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -805,15 +800,14 @@ func (s *groupServer) JoinGroup(ctx context.Context, req *pbgroup.JoinGroupReq)
|
||||
if group.GroupType == constant.SuperGroup {
|
||||
return nil, errs.ErrGroupTypeNotSupport.Wrap()
|
||||
}
|
||||
groupMember := &relationtb.GroupMemberModel{
|
||||
GroupID: group.GroupID,
|
||||
UserID: user.UserID,
|
||||
RoleLevel: constant.GroupOrdinaryUsers,
|
||||
OperatorUserID: mcontext.GetOpUserID(ctx),
|
||||
InviterUserID: req.InviterUserID,
|
||||
JoinTime: time.Now(),
|
||||
MuteEndTime: time.UnixMilli(0),
|
||||
}
|
||||
groupMember := convert.Pb2DbGroupMember(user)
|
||||
groupMember.GroupID = group.GroupID
|
||||
groupMember.RoleLevel = constant.GroupOrdinaryUsers
|
||||
groupMember.OperatorUserID = mcontext.GetOpUserID(ctx)
|
||||
groupMember.JoinSource = constant.JoinByInvitation
|
||||
groupMember.InviterUserID = req.InviterUserID
|
||||
groupMember.JoinTime = time.Now()
|
||||
groupMember.MuteEndTime = time.Unix(0, 0)
|
||||
if err := CallbackBeforeMemberJoinGroup(ctx, groupMember, group.Ex); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1278,9 +1272,6 @@ func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbgroup.SetGr
|
||||
if len(req.Members) == 0 {
|
||||
return nil, errs.ErrArgs.Wrap("members empty")
|
||||
}
|
||||
for i := range req.Members {
|
||||
req.Members[i].FaceURL = nil
|
||||
}
|
||||
duplicateMap := make(map[[2]string]struct{})
|
||||
userIDMap := make(map[string]struct{})
|
||||
groupIDMap := make(map[string]struct{})
|
||||
|
||||
+26
-48
@@ -81,8 +81,7 @@ func (m *msgServer) SetConversationHasReadSeq(
|
||||
if err := m.MsgDatabase.SetHasReadSeq(ctx, req.UserID, req.ConversationID, req.HasReadSeq); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err = m.sendMarkAsReadNotification(ctx, req.ConversationID, constant.SingleChatType, req.UserID,
|
||||
req.UserID, nil, req.HasReadSeq); err != nil {
|
||||
if err = m.sendMarkAsReadNotification(ctx, req.ConversationID, constant.SingleChatType, req.UserID, req.UserID, nil, req.HasReadSeq); err != nil {
|
||||
return
|
||||
}
|
||||
return &msg.SetConversationHasReadSeqResp{}, nil
|
||||
@@ -120,8 +119,7 @@ func (m *msgServer) MarkMsgsAsRead(
|
||||
return
|
||||
}
|
||||
}
|
||||
if err = m.sendMarkAsReadNotification(ctx, req.ConversationID, conversation.ConversationType, req.UserID,
|
||||
m.conversationAndGetRecvID(conversation, req.UserID), req.Seqs, hasReadSeq); err != nil {
|
||||
if err = m.sendMarkAsReadNotification(ctx, req.ConversationID, conversation.ConversationType, req.UserID, m.conversationAndGetRecvID(conversation, req.UserID), req.Seqs, hasReadSeq); err != nil {
|
||||
return
|
||||
}
|
||||
return &msg.MarkMsgsAsReadResp{}, nil
|
||||
@@ -133,61 +131,44 @@ func (m *msgServer) MarkConversationAsRead(
|
||||
) (resp *msg.MarkConversationAsReadResp, err error) {
|
||||
conversation, err := m.Conversation.GetConversation(ctx, req.UserID, req.ConversationID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return
|
||||
}
|
||||
hasReadSeq, err := m.MsgDatabase.GetHasReadSeq(ctx, req.UserID, req.ConversationID)
|
||||
if err != nil && errs.Unwrap(err) != redis.Nil {
|
||||
return nil, err
|
||||
return
|
||||
}
|
||||
log.ZDebug(ctx, "MarkConversationAsRead", "hasReadSeq", hasReadSeq, "req.HasReadSeq", req.HasReadSeq)
|
||||
var seqs []int64
|
||||
|
||||
log.ZDebug(ctx, "MarkConversationAsRead", "hasReadSeq", hasReadSeq,
|
||||
"req.HasReadSeq", req.HasReadSeq)
|
||||
if conversation.ConversationType == constant.SingleChatType {
|
||||
if len(req.Seqs) == 0 {
|
||||
for i := hasReadSeq + 1; i <= req.HasReadSeq; i++ {
|
||||
seqs = append(seqs, i)
|
||||
}
|
||||
|
||||
if len(seqs) > 0 {
|
||||
log.ZDebug(ctx, "MarkConversationAsRead", "seqs", seqs, "conversationID", req.ConversationID)
|
||||
if err = m.MsgDatabase.MarkSingleChatMsgsAsRead(ctx, req.UserID, req.ConversationID, seqs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if req.HasReadSeq > hasReadSeq {
|
||||
err = m.MsgDatabase.SetHasReadSeq(ctx, req.UserID, req.ConversationID, req.HasReadSeq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
hasReadSeq = req.HasReadSeq
|
||||
}
|
||||
if err = m.sendMarkAsReadNotification(ctx, req.ConversationID, conversation.ConversationType, req.UserID,
|
||||
m.conversationAndGetRecvID(conversation, req.UserID), seqs, hasReadSeq); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
} else if conversation.ConversationType == constant.SuperGroupChatType {
|
||||
if req.HasReadSeq > hasReadSeq {
|
||||
err = m.MsgDatabase.SetHasReadSeq(ctx, req.UserID, req.ConversationID, req.HasReadSeq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
hasReadSeq = req.HasReadSeq
|
||||
}
|
||||
if err = m.sendMarkAsReadNotification(ctx, req.ConversationID, constant.SingleChatType, req.UserID,
|
||||
req.UserID, seqs, hasReadSeq); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
} else {
|
||||
seqs = req.Seqs
|
||||
}
|
||||
if len(seqs) > 0 {
|
||||
log.ZDebug(ctx, "MarkConversationAsRead", "seqs", seqs, "conversationID", req.ConversationID)
|
||||
if err = m.MsgDatabase.MarkSingleChatMsgsAsRead(ctx, req.UserID, req.ConversationID, seqs); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
if req.HasReadSeq > hasReadSeq {
|
||||
err = m.MsgDatabase.SetHasReadSeq(ctx, req.UserID, req.ConversationID, req.HasReadSeq)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
hasReadSeq = req.HasReadSeq
|
||||
}
|
||||
if err = m.sendMarkAsReadNotification(ctx, req.ConversationID, conversation.ConversationType, req.UserID, m.conversationAndGetRecvID(conversation, req.UserID), seqs, hasReadSeq); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
return &msg.MarkConversationAsReadResp{}, nil
|
||||
}
|
||||
|
||||
func (m *msgServer) sendMarkAsReadNotification(
|
||||
ctx context.Context,
|
||||
conversationID string,
|
||||
sessionType int32,
|
||||
sesstionType int32,
|
||||
sendID, recvID string,
|
||||
seqs []int64,
|
||||
hasReadSeq int64,
|
||||
@@ -198,9 +179,6 @@ func (m *msgServer) sendMarkAsReadNotification(
|
||||
Seqs: seqs,
|
||||
HasReadSeq: hasReadSeq,
|
||||
}
|
||||
err := m.notificationSender.NotificationWithSesstionType(ctx, sendID, recvID, constant.HasReadReceipt, sessionType, tips)
|
||||
if err != nil {
|
||||
log.ZWarn(ctx, "send has read Receipt err", err)
|
||||
}
|
||||
m.notificationSender.NotificationWithSesstionType(ctx, sendID, recvID, constant.HasReadReceipt, sesstionType, tips)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
package third
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/OpenIMSDK/protocol/constant"
|
||||
"github.com/OpenIMSDK/protocol/third"
|
||||
"github.com/OpenIMSDK/tools/errs"
|
||||
"github.com/OpenIMSDK/tools/utils"
|
||||
utils2 "github.com/OpenIMSDK/tools/utils"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/authverify"
|
||||
relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation"
|
||||
)
|
||||
|
||||
func genLogID() string {
|
||||
const dataLen = 10
|
||||
data := make([]byte, dataLen)
|
||||
rand.Read(data)
|
||||
chars := []byte("0123456789")
|
||||
for i := 0; i < len(data); i++ {
|
||||
if i == 0 {
|
||||
data[i] = chars[1:][data[i]%9]
|
||||
} else {
|
||||
data[i] = chars[data[i]%10]
|
||||
}
|
||||
}
|
||||
return string(data)
|
||||
}
|
||||
|
||||
func (t *thirdServer) UploadLogs(ctx context.Context, req *third.UploadLogsReq) (*third.UploadLogsResp, error) {
|
||||
var DBlogs []*relationtb.Log
|
||||
userID := ctx.Value(constant.OpUserID).(string)
|
||||
platform := constant.PlatformID2Name[int(req.Platform)]
|
||||
for _, fileURL := range req.FileURLs {
|
||||
log := relationtb.Log{
|
||||
Version: req.Version,
|
||||
SystemType: req.SystemType,
|
||||
Platform: platform,
|
||||
UserID: userID,
|
||||
CreateTime: time.Now(),
|
||||
Url: fileURL.URL,
|
||||
FileName: fileURL.Filename,
|
||||
}
|
||||
for i := 0; i < 20; i++ {
|
||||
id := genLogID()
|
||||
logs, err := t.thirdDatabase.GetLogs(ctx, []string{id}, "")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(logs) == 0 {
|
||||
log.LogID = id
|
||||
break
|
||||
}
|
||||
}
|
||||
if log.LogID == "" {
|
||||
return nil, errs.ErrData.Wrap("Log id gen error")
|
||||
}
|
||||
DBlogs = append(DBlogs, &log)
|
||||
}
|
||||
err := t.thirdDatabase.UploadLogs(ctx, DBlogs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &third.UploadLogsResp{}, nil
|
||||
}
|
||||
|
||||
func (t *thirdServer) DeleteLogs(ctx context.Context, req *third.DeleteLogsReq) (*third.DeleteLogsResp, error) {
|
||||
if err := authverify.CheckAdmin(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
userID := ""
|
||||
logs, err := t.thirdDatabase.GetLogs(ctx, req.LogIDs, userID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var logIDs []string
|
||||
for _, log := range logs {
|
||||
logIDs = append(logIDs, log.LogID)
|
||||
}
|
||||
if ids := utils2.Single(req.LogIDs, logIDs); len(ids) > 0 {
|
||||
return nil, errs.ErrRecordNotFound.Wrap(fmt.Sprintf("logIDs not found%#v", ids))
|
||||
}
|
||||
err = t.thirdDatabase.DeleteLogs(ctx, req.LogIDs, userID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &third.DeleteLogsResp{}, nil
|
||||
}
|
||||
|
||||
func dbToPbLogInfos(logs []*relationtb.Log) []*third.LogInfo {
|
||||
db2pbForLogInfo := func(log *relationtb.Log) *third.LogInfo {
|
||||
return &third.LogInfo{
|
||||
Filename: log.FileName,
|
||||
UserID: log.UserID,
|
||||
Platform: utils.StringToInt32(log.Platform),
|
||||
Url: log.Url,
|
||||
CreateTime: log.CreateTime.UnixMilli(),
|
||||
LogID: log.LogID,
|
||||
SystemType: log.SystemType,
|
||||
Version: log.Version,
|
||||
Ex: log.Ex,
|
||||
}
|
||||
}
|
||||
return utils.Slice(logs, db2pbForLogInfo)
|
||||
}
|
||||
|
||||
func (t *thirdServer) SearchLogs(ctx context.Context, req *third.SearchLogsReq) (*third.SearchLogsResp, error) {
|
||||
if err := authverify.CheckAdmin(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var (
|
||||
resp third.SearchLogsResp
|
||||
userIDs []string
|
||||
)
|
||||
if req.StartTime > req.EndTime {
|
||||
return nil, errs.ErrArgs.Wrap("startTime>endTime")
|
||||
}
|
||||
total, logs, err := t.thirdDatabase.SearchLogs(ctx, req.Keyword, time.UnixMilli(req.StartTime), time.UnixMilli(req.EndTime), req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pbLogs := dbToPbLogInfos(logs)
|
||||
for _, log := range logs {
|
||||
userIDs = append(userIDs, log.UserID)
|
||||
}
|
||||
users, err := t.thirdDatabase.FindUsers(ctx, userIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
IDtoName := make(map[string]string)
|
||||
for _, user := range users {
|
||||
IDtoName[user.UserID] = user.Nickname
|
||||
}
|
||||
for _, pbLog := range pbLogs {
|
||||
pbLog.Nickname = IDtoName[pbLog.UserID]
|
||||
}
|
||||
resp.LogsInfos = pbLogs
|
||||
resp.Total = total
|
||||
return &resp, nil
|
||||
}
|
||||
@@ -35,7 +35,6 @@ import (
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/db/controller"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/db/relation"
|
||||
relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
|
||||
)
|
||||
|
||||
@@ -80,7 +79,7 @@ func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) e
|
||||
}
|
||||
third.RegisterThirdServer(server, &thirdServer{
|
||||
apiURL: apiURL,
|
||||
thirdDatabase: controller.NewThirdDatabase(cache.NewMsgCacheModel(rdb), db),
|
||||
thirdDatabase: controller.NewThirdDatabase(cache.NewMsgCacheModel(rdb)),
|
||||
userRpcClient: rpcclient.NewUserRpcClient(client),
|
||||
s3dataBase: controller.NewS3Database(o, relation.NewObjectInfo(db)),
|
||||
defaultExpire: time.Hour * 24 * 7,
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
// 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 user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/OpenIMSDK/protocol/constant"
|
||||
pbuser "github.com/OpenIMSDK/protocol/user"
|
||||
"github.com/OpenIMSDK/tools/errs"
|
||||
"github.com/OpenIMSDK/tools/mcontext"
|
||||
"github.com/OpenIMSDK/tools/utils"
|
||||
|
||||
cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/http"
|
||||
)
|
||||
|
||||
func CallbackBeforeUpdateUserInfo(ctx context.Context, req *pbuser.UpdateUserInfoReq) error {
|
||||
if !config.Config.Callback.CallbackBeforeUpdateUserInfo.Enable {
|
||||
return nil
|
||||
}
|
||||
cbReq := &cbapi.CallbackBeforeUpdateUserInfoReq{
|
||||
CallbackCommand: constant.CallbackBeforeUpdateUserInfoCommand,
|
||||
OperationID: mcontext.GetOperationID(ctx),
|
||||
UserID: req.UserInfo.UserID,
|
||||
FaceURL: &req.UserInfo.FaceURL,
|
||||
Nickname: &req.UserInfo.Nickname,
|
||||
}
|
||||
resp := &cbapi.CallbackBeforeUpdateUserInfoResp{}
|
||||
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, cbReq, resp, config.Config.Callback.CallbackBeforeUpdateUserInfo); err != nil {
|
||||
if err == errs.ErrCallbackContinue {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
utils.NotNilReplace(&req.UserInfo.FaceURL, resp.FaceURL)
|
||||
utils.NotNilReplace(&req.UserInfo.Ex, resp.Ex)
|
||||
utils.NotNilReplace(&req.UserInfo.Nickname, resp.Nickname)
|
||||
return nil
|
||||
}
|
||||
+17
-25
@@ -115,9 +115,6 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbuser.UpdateUserI
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := CallbackBeforeUpdateUserInfo(ctx, req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
user := convert.UserPb2DB(req.UserInfo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -139,9 +136,6 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbuser.UpdateUserI
|
||||
for _, friendID := range friends {
|
||||
s.friendNotificationSender.FriendInfoUpdatedNotification(ctx, req.UserInfo.UserID, friendID)
|
||||
}
|
||||
if err := s.groupRpcClient.NotificationUserInfoUpdate(ctx, req.UserInfo.UserID); err != nil {
|
||||
log.ZError(ctx, "NotificationUserInfoUpdate", err, "userID", req.UserInfo.UserID)
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -289,8 +283,7 @@ func (s *userServer) SubscribeOrCancelUsersStatus(ctx context.Context, req *pbus
|
||||
}
|
||||
|
||||
// GetUserStatus Get the online status of the user.
|
||||
func (s *userServer) GetUserStatus(ctx context.Context, req *pbuser.GetUserStatusReq) (resp *pbuser.GetUserStatusResp,
|
||||
err error) {
|
||||
func (s *userServer) GetUserStatus(ctx context.Context, req *pbuser.GetUserStatusReq) (resp *pbuser.GetUserStatusResp, err error) {
|
||||
onlineStatusList, err := s.UserDatabase.GetUserStatus(ctx, req.UserIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -299,32 +292,31 @@ func (s *userServer) GetUserStatus(ctx context.Context, req *pbuser.GetUserStatu
|
||||
}
|
||||
|
||||
// SetUserStatus Synchronize user's online status.
|
||||
func (s *userServer) SetUserStatus(ctx context.Context, req *pbuser.SetUserStatusReq) (resp *pbuser.SetUserStatusResp,
|
||||
err error) {
|
||||
err = s.UserDatabase.SetUserStatus(ctx, req.UserID, req.Status, req.PlatformID)
|
||||
func (s *userServer) SetUserStatus(ctx context.Context, req *pbuser.SetUserStatusReq) (resp *pbuser.SetUserStatusResp, err error) {
|
||||
err = s.UserDatabase.SetUserStatus(ctx, req.StatusList)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list, err := s.UserDatabase.GetSubscribedList(ctx, req.UserID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, userID := range list {
|
||||
tips := &sdkws.UserStatusChangeTips{
|
||||
FromUserID: req.UserID,
|
||||
ToUserID: userID,
|
||||
Status: req.Status,
|
||||
PlatformID: req.PlatformID,
|
||||
for _, value := range req.StatusList {
|
||||
list, err := s.UserDatabase.GetSubscribedList(ctx, value.UserID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, userID := range list {
|
||||
tips := &sdkws.UserStatusChangeTips{
|
||||
FromUserID: value.UserID,
|
||||
ToUserID: userID,
|
||||
Status: value.Status,
|
||||
PlatformID: value.PlatformIDs[0],
|
||||
}
|
||||
s.userNotificationSender.UserStatusChangeNotification(ctx, tips)
|
||||
}
|
||||
s.userNotificationSender.UserStatusChangeNotification(ctx, tips)
|
||||
}
|
||||
|
||||
return &pbuser.SetUserStatusResp{}, nil
|
||||
}
|
||||
|
||||
// GetSubscribeUsersStatus Get the online status of subscribers.
|
||||
func (s *userServer) GetSubscribeUsersStatus(ctx context.Context,
|
||||
req *pbuser.GetSubscribeUsersStatusReq) (*pbuser.GetSubscribeUsersStatusResp, error) {
|
||||
func (s *userServer) GetSubscribeUsersStatus(ctx context.Context, req *pbuser.GetSubscribeUsersStatusReq) (*pbuser.GetSubscribeUsersStatusResp, error) {
|
||||
userList, err := s.UserDatabase.GetAllSubscribeList(ctx, req.UserID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -29,7 +29,6 @@ type SendMsg struct {
|
||||
SessionType int32 `json:"sessionType" binding:"required"`
|
||||
IsOnlineOnly bool `json:"isOnlineOnly"`
|
||||
NotOfflinePush bool `json:"notOfflinePush"`
|
||||
SendTime int64 `json:"sendTime"`
|
||||
OfflinePushInfo *sdkws.OfflinePushInfo `json:"offlinePushInfo"`
|
||||
}
|
||||
|
||||
|
||||
@@ -75,10 +75,9 @@ type configStruct struct {
|
||||
} `yaml:"mongo"`
|
||||
|
||||
Redis struct {
|
||||
ClusterMode bool `yaml:"clusterMode"`
|
||||
Address []string `yaml:"address"`
|
||||
Username string `yaml:"username"`
|
||||
Password string `yaml:"password"`
|
||||
Address []string `yaml:"address"`
|
||||
Username string `yaml:"username"`
|
||||
Password string `yaml:"password"`
|
||||
} `yaml:"redis"`
|
||||
|
||||
Kafka struct {
|
||||
@@ -129,14 +128,12 @@ type configStruct struct {
|
||||
SecretAccessKey string `yaml:"secretAccessKey"`
|
||||
SessionToken string `yaml:"sessionToken"`
|
||||
SignEndpoint string `yaml:"signEndpoint"`
|
||||
PublicRead bool `yaml:"publicRead"`
|
||||
} `yaml:"minio"`
|
||||
Cos struct {
|
||||
BucketURL string `yaml:"bucketURL"`
|
||||
SecretID string `yaml:"secretID"`
|
||||
SecretKey string `yaml:"secretKey"`
|
||||
SessionToken string `yaml:"sessionToken"`
|
||||
PublicRead bool `yaml:"publicRead"`
|
||||
} `yaml:"cos"`
|
||||
Oss struct {
|
||||
Endpoint string `yaml:"endpoint"`
|
||||
@@ -145,7 +142,6 @@ type configStruct struct {
|
||||
AccessKeyID string `yaml:"accessKeyID"`
|
||||
AccessKeySecret string `yaml:"accessKeySecret"`
|
||||
SessionToken string `yaml:"sessionToken"`
|
||||
PublicRead bool `yaml:"publicRead"`
|
||||
} `yaml:"oss"`
|
||||
} `yaml:"object"`
|
||||
|
||||
@@ -251,7 +247,6 @@ type configStruct struct {
|
||||
CallbackOnlinePush CallBackConfig `yaml:"onlinePush"`
|
||||
CallbackBeforeSuperGroupOnlinePush CallBackConfig `yaml:"superGroupOnlinePush"`
|
||||
CallbackBeforeAddFriend CallBackConfig `yaml:"beforeAddFriend"`
|
||||
CallbackBeforeUpdateUserInfo CallBackConfig `yaml:"beforeUpdateUserInfo"`
|
||||
CallbackBeforeCreateGroup CallBackConfig `yaml:"beforeCreateGroup"`
|
||||
CallbackBeforeMemberJoinGroup CallBackConfig `yaml:"beforeMemberJoinGroup"`
|
||||
CallbackBeforeSetGroupMemberInfo CallBackConfig `yaml:"beforeSetGroupMemberInfo"`
|
||||
|
||||
@@ -138,11 +138,11 @@ func Pb2DBGroupInfo(m *sdkws.GroupInfo) *relation.GroupModel {
|
||||
}
|
||||
}
|
||||
|
||||
//func Pb2DbGroupMember(m *sdkws.UserInfo) *relation.GroupMemberModel {
|
||||
// return &relation.GroupMemberModel{
|
||||
// UserID: m.UserID,
|
||||
// Nickname: m.Nickname,
|
||||
// FaceURL: m.FaceURL,
|
||||
// Ex: m.Ex,
|
||||
// }
|
||||
//}
|
||||
func Pb2DbGroupMember(m *sdkws.UserInfo) *relation.GroupMemberModel {
|
||||
return &relation.GroupMemberModel{
|
||||
UserID: m.UserID,
|
||||
Nickname: m.Nickname,
|
||||
FaceURL: m.FaceURL,
|
||||
Ex: m.Ex,
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+11
-5
@@ -59,8 +59,11 @@ type ConversationCache interface {
|
||||
DelConversations(ownerUserID string, conversationIDs ...string) ConversationCache
|
||||
DelUsersConversation(conversationID string, ownerUserIDs ...string) ConversationCache
|
||||
// get one conversation from msgCache
|
||||
GetConversations(ctx context.Context, ownerUserID string,
|
||||
conversationIDs []string) ([]*relationtb.ConversationModel, error)
|
||||
GetConversations(
|
||||
ctx context.Context,
|
||||
ownerUserID string,
|
||||
conversationIDs []string,
|
||||
) ([]*relationtb.ConversationModel, error)
|
||||
// get one user's all conversations from msgCache
|
||||
GetUserAllConversations(ctx context.Context, ownerUserID string) ([]*relationtb.ConversationModel, error)
|
||||
// get user conversation recv msg from msgCache
|
||||
@@ -76,8 +79,10 @@ type ConversationCache interface {
|
||||
GetUserAllHasReadSeqs(ctx context.Context, ownerUserID string) (map[string]int64, error)
|
||||
DelUserAllHasReadSeqs(ownerUserID string, conversationIDs ...string) ConversationCache
|
||||
|
||||
GetConversationsByConversationID(ctx context.Context,
|
||||
conversationIDs []string) ([]*relationtb.ConversationModel, error)
|
||||
GetConversationsByConversationID(
|
||||
ctx context.Context,
|
||||
conversationIDs []string,
|
||||
) ([]*relationtb.ConversationModel, error)
|
||||
DelConversationByConversationID(conversationIDs ...string) ConversationCache
|
||||
GetConversationNotReceiveMessageUserIDs(ctx context.Context, conversationID string) ([]string, error)
|
||||
DelConversationNotReceiveMessageUserIDs(conversationIDs ...string) ConversationCache
|
||||
@@ -413,7 +418,8 @@ func (c *ConversationRedisCache) GetUserAllHasReadSeqs(
|
||||
)
|
||||
}
|
||||
|
||||
func (c *ConversationRedisCache) DelUserAllHasReadSeqs(ownerUserID string,
|
||||
func (c *ConversationRedisCache) DelUserAllHasReadSeqs(
|
||||
ownerUserID string,
|
||||
conversationIDs ...string,
|
||||
) ConversationCache {
|
||||
cache := c.NewCache()
|
||||
|
||||
Vendored
+2
-3
@@ -39,7 +39,7 @@ func NewRedis() (redis.UniversalClient, error) {
|
||||
}
|
||||
specialerror.AddReplace(redis.Nil, errs.ErrRecordNotFound)
|
||||
var rdb redis.UniversalClient
|
||||
if len(config.Config.Redis.Address) > 1 || config.Config.Redis.ClusterMode {
|
||||
if len(config.Config.Redis.Address) > 1 {
|
||||
rdb = redis.NewClusterClient(&redis.ClusterOptions{
|
||||
Addrs: config.Config.Redis.Address,
|
||||
Username: config.Config.Redis.Username,
|
||||
@@ -58,13 +58,12 @@ func NewRedis() (redis.UniversalClient, error) {
|
||||
})
|
||||
}
|
||||
|
||||
var err error
|
||||
var err error = nil
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
|
||||
defer cancel()
|
||||
err = rdb.Ping(ctx).Err()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("redis ping %w", err)
|
||||
}
|
||||
|
||||
return rdb, err
|
||||
}
|
||||
|
||||
Vendored
+71
-85
@@ -21,8 +21,6 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/OpenIMSDK/tools/log"
|
||||
|
||||
"github.com/OpenIMSDK/protocol/constant"
|
||||
|
||||
"github.com/OpenIMSDK/protocol/user"
|
||||
@@ -53,7 +51,7 @@ type UserCache interface {
|
||||
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, userID string, status, platformID int32) error
|
||||
SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error
|
||||
}
|
||||
|
||||
type UserCacheRedis struct {
|
||||
@@ -200,107 +198,95 @@ func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([
|
||||
return nil, errs.Wrap(err)
|
||||
}
|
||||
onlineStatus.UserID = userID
|
||||
onlineStatus.Status = constant.Online
|
||||
res = append(res, &onlineStatus)
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// SetUserStatus Set the user status and save it in redis.
|
||||
func (u *UserCacheRedis) SetUserStatus(ctx context.Context, userID string, status, platformID int32) error {
|
||||
UserIDNum := crc32.ChecksumIEEE([]byte(userID))
|
||||
modKey := strconv.Itoa(int(UserIDNum % statusMod))
|
||||
key := olineStatusKey + modKey
|
||||
log.ZDebug(ctx, "SetUserStatus args", "userID", userID, "status", status,
|
||||
"platformID", platformID, "modKey", modKey, "key", key)
|
||||
isNewKey, err := u.rdb.Exists(ctx, key).Result()
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
if isNewKey == 0 {
|
||||
if status == constant.Online {
|
||||
onlineStatus := user.OnlineStatus{
|
||||
UserID: userID,
|
||||
Status: constant.Online,
|
||||
PlatformIDs: []int32{platformID},
|
||||
}
|
||||
jsonData, err := json.Marshal(onlineStatus)
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
_, err = u.rdb.HSet(ctx, key, userID, string(jsonData)).Result()
|
||||
func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
|
||||
for _, status := range list {
|
||||
var isNewKey int64
|
||||
UserIDNum := crc32.ChecksumIEEE([]byte(status.UserID))
|
||||
modKey := strconv.Itoa(int(UserIDNum % statusMod))
|
||||
key := olineStatusKey + modKey
|
||||
jsonData, err := json.Marshal(status)
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
isNewKey, err = u.rdb.Exists(ctx, key).Result()
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
if isNewKey == 0 {
|
||||
_, err = u.rdb.HSet(ctx, key, status.UserID, string(jsonData)).Result()
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
u.rdb.Expire(ctx, key, userOlineStatusExpireTime)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
isNil := false
|
||||
result, err := u.rdb.HGet(ctx, key, userID).Result()
|
||||
if err != nil {
|
||||
if err == redis.Nil {
|
||||
isNil = true
|
||||
} else {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
}
|
||||
|
||||
if status == constant.Offline {
|
||||
if isNil {
|
||||
log.ZWarn(ctx, "this user not online,maybe trigger order not right",
|
||||
err, "userStatus", status)
|
||||
return nil
|
||||
}
|
||||
var onlineStatus user.OnlineStatus
|
||||
err = json.Unmarshal([]byte(result), &onlineStatus)
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
var newPlatformIDs []int32
|
||||
for _, val := range onlineStatus.PlatformIDs {
|
||||
if val != platformID {
|
||||
newPlatformIDs = append(newPlatformIDs, val)
|
||||
}
|
||||
}
|
||||
if newPlatformIDs == nil {
|
||||
_, err = u.rdb.HDel(ctx, key, userID).Result()
|
||||
result, err := u.rdb.HGet(ctx, key, status.UserID).Result()
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
} else {
|
||||
onlineStatus.PlatformIDs = newPlatformIDs
|
||||
newjsonData, err := json.Marshal(&onlineStatus)
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
_, err = u.rdb.HSet(ctx, key, userID, string(newjsonData)).Result()
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var onlineStatus user.OnlineStatus
|
||||
if !isNil {
|
||||
var onlineStatus user.OnlineStatus
|
||||
err = json.Unmarshal([]byte(result), &onlineStatus)
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
onlineStatus.UserID = status.UserID
|
||||
if status.Status == constant.Offline {
|
||||
var newPlatformIDs []int32
|
||||
for _, val := range onlineStatus.PlatformIDs {
|
||||
if val != status.PlatformIDs[0] {
|
||||
newPlatformIDs = append(newPlatformIDs, val)
|
||||
}
|
||||
}
|
||||
if newPlatformIDs == nil {
|
||||
onlineStatus.Status = constant.Offline
|
||||
onlineStatus.PlatformIDs = []int32{}
|
||||
newjsonData, err := json.Marshal(&onlineStatus)
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
_, err = u.rdb.HSet(ctx, key, status.UserID, string(newjsonData)).Result()
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
} else {
|
||||
onlineStatus.PlatformIDs = newPlatformIDs
|
||||
newjsonData, err := json.Marshal(&onlineStatus)
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
_, err = u.rdb.HSet(ctx, key, status.UserID, string(newjsonData)).Result()
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
onlineStatus.Status = constant.Online
|
||||
// Judging whether to be kicked out.
|
||||
flag := false
|
||||
for _, val := range onlineStatus.PlatformIDs {
|
||||
if val == status.PlatformIDs[0] {
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !flag {
|
||||
onlineStatus.PlatformIDs = append(onlineStatus.PlatformIDs, status.PlatformIDs[0])
|
||||
}
|
||||
newjsonData, err := json.Marshal(&onlineStatus)
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
_, err = u.rdb.HSet(ctx, key, status.UserID, string(newjsonData)).Result()
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
onlineStatus.Status = constant.Online
|
||||
onlineStatus.UserID = userID
|
||||
onlineStatus.PlatformIDs = append(onlineStatus.PlatformIDs, platformID)
|
||||
newjsonData, err := json.Marshal(&onlineStatus)
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
_, err = u.rdb.HSet(ctx, key, userID, string(newjsonData)).Result()
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -16,59 +16,21 @@ package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/db/cache"
|
||||
dbimpl "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation"
|
||||
)
|
||||
|
||||
type ThirdDatabase interface {
|
||||
FcmUpdateToken(ctx context.Context, account string, platformID int, fcmToken string, expireTime int64) error
|
||||
SetAppBadge(ctx context.Context, userID string, value int) error
|
||||
// about log for debug
|
||||
UploadLogs(ctx context.Context, logs []*relation.Log) error
|
||||
DeleteLogs(ctx context.Context, logID []string, userID string) error
|
||||
SearchLogs(ctx context.Context, keyword string, start time.Time, end time.Time, pageNumber int32, showNumber int32) (uint32, []*relation.Log, error)
|
||||
GetLogs(ctx context.Context, LogIDs []string, userID string) ([]*relation.Log, error)
|
||||
FindUsers(ctx context.Context, userIDs []string) ([]*relation.UserModel, error)
|
||||
}
|
||||
|
||||
type thirdDatabase struct {
|
||||
cache cache.MsgModel
|
||||
logdb relation.LogInterface
|
||||
userdb relation.UserModelInterface
|
||||
cache cache.MsgModel
|
||||
}
|
||||
|
||||
// FindUsers implements ThirdDatabase.
|
||||
func (t *thirdDatabase) FindUsers(ctx context.Context, userIDs []string) ([]*relation.UserModel, error) {
|
||||
return t.userdb.Find(ctx, userIDs)
|
||||
}
|
||||
|
||||
// DeleteLogs implements ThirdDatabase.
|
||||
func (t *thirdDatabase) DeleteLogs(ctx context.Context, logID []string, userID string) error {
|
||||
return t.logdb.Delete(ctx, logID, userID)
|
||||
}
|
||||
|
||||
// GetLogs implements ThirdDatabase.
|
||||
func (t *thirdDatabase) GetLogs(ctx context.Context, LogIDs []string, userID string) ([]*relation.Log, error) {
|
||||
return t.logdb.Get(ctx, LogIDs, userID)
|
||||
}
|
||||
|
||||
// SearchLogs implements ThirdDatabase.
|
||||
func (t *thirdDatabase) SearchLogs(ctx context.Context, keyword string, start time.Time, end time.Time, pageNumber int32, showNumber int32) (uint32, []*relation.Log, error) {
|
||||
return t.logdb.Search(ctx, keyword, start, end, pageNumber, showNumber)
|
||||
}
|
||||
|
||||
// UploadLogs implements ThirdDatabase.
|
||||
func (t *thirdDatabase) UploadLogs(ctx context.Context, logs []*relation.Log) error {
|
||||
return t.logdb.Create(ctx, logs)
|
||||
}
|
||||
|
||||
func NewThirdDatabase(cache cache.MsgModel, db *gorm.DB) ThirdDatabase {
|
||||
return &thirdDatabase{cache: cache, logdb: dbimpl.NewLogGorm(db), userdb: dbimpl.NewUserGorm(db)}
|
||||
func NewThirdDatabase(cache cache.MsgModel) ThirdDatabase {
|
||||
return &thirdDatabase{cache: cache}
|
||||
}
|
||||
|
||||
func (t *thirdDatabase) FcmUpdateToken(
|
||||
|
||||
@@ -64,7 +64,7 @@ type UserDatabase interface {
|
||||
// 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, userID string, status, platformID int32) error
|
||||
SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error
|
||||
}
|
||||
|
||||
type userDatabase struct {
|
||||
@@ -217,6 +217,6 @@ func (u *userDatabase) GetUserStatus(ctx context.Context, userIDs []string) ([]*
|
||||
}
|
||||
|
||||
// SetUserStatus Set the user status and save it in redis.
|
||||
func (u *userDatabase) SetUserStatus(ctx context.Context, userID string, status, platformID int32) error {
|
||||
return u.cache.SetUserStatus(ctx, userID, status, platformID)
|
||||
func (u *userDatabase) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
|
||||
return u.cache.SetUserStatus(ctx, list)
|
||||
}
|
||||
|
||||
@@ -52,24 +52,18 @@ func (g *GroupLocalCache) GetGroupMemberIDs(ctx context.Context, groupID string)
|
||||
if len(resp.GroupAbstractInfos) < 1 {
|
||||
return nil, errs.ErrGroupIDNotFound
|
||||
}
|
||||
|
||||
g.lock.Lock()
|
||||
defer g.lock.Unlock()
|
||||
localHashInfo, ok := g.cache[groupID]
|
||||
if ok && localHashInfo.memberListHash == resp.GroupAbstractInfos[0].GroupMemberListHash {
|
||||
g.lock.Unlock()
|
||||
return localHashInfo.userIDs, nil
|
||||
}
|
||||
g.lock.Unlock()
|
||||
|
||||
groupMembersResp, err := g.client.Client.GetGroupMemberUserIDs(ctx, &group.GetGroupMemberUserIDsReq{
|
||||
GroupID: groupID,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
g.lock.Lock()
|
||||
defer g.lock.Unlock()
|
||||
g.cache[groupID] = GroupMemberIDsHash{
|
||||
memberListHash: resp.GroupAbstractInfos[0].GroupMemberListHash,
|
||||
userIDs: groupMembersResp.UserIDs,
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package relation
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/OpenIMSDK/tools/errs"
|
||||
"github.com/OpenIMSDK/tools/ormutil"
|
||||
"gorm.io/gorm"
|
||||
|
||||
relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation"
|
||||
)
|
||||
|
||||
type LogGorm struct {
|
||||
db *gorm.DB
|
||||
}
|
||||
|
||||
func (l *LogGorm) Create(ctx context.Context, log []*relationtb.Log) error {
|
||||
return errs.Wrap(l.db.WithContext(ctx).Create(log).Error)
|
||||
}
|
||||
|
||||
func (l *LogGorm) Search(ctx context.Context, keyword string, start time.Time, end time.Time, pageNumber int32, showNumber int32) (uint32, []*relationtb.Log, error) {
|
||||
db := l.db.WithContext(ctx).Where("create_time >= ?", start)
|
||||
if end.UnixMilli() != 0 {
|
||||
db = l.db.WithContext(ctx).Where("create_time <= ?", end)
|
||||
}
|
||||
return ormutil.GormSearch[relationtb.Log](db, []string{"user_id"}, keyword, pageNumber, showNumber)
|
||||
}
|
||||
|
||||
func (l *LogGorm) Delete(ctx context.Context, logIDs []string, userID string) error {
|
||||
if userID == "" {
|
||||
return errs.Wrap(l.db.WithContext(ctx).Where("log_id in ?", logIDs).Delete(&relationtb.Log{}).Error)
|
||||
}
|
||||
return errs.Wrap(l.db.WithContext(ctx).Where("log_id in ? and user_id=?", logIDs, userID).Delete(&relationtb.Log{}).Error)
|
||||
}
|
||||
|
||||
func (l *LogGorm) Get(ctx context.Context, logIDs []string, userID string) ([]*relationtb.Log, error) {
|
||||
var logs []*relationtb.Log
|
||||
if userID == "" {
|
||||
return logs, errs.Wrap(l.db.WithContext(ctx).Where("log_id in ?", logIDs).Find(&logs).Error)
|
||||
}
|
||||
return logs, errs.Wrap(l.db.WithContext(ctx).Where("log_id in ? and user_id=?", logIDs, userID).Find(&logs).Error)
|
||||
}
|
||||
|
||||
func NewLogGorm(db *gorm.DB) relationtb.LogInterface {
|
||||
db.AutoMigrate(&relationtb.Log{})
|
||||
return &LogGorm{db: db}
|
||||
}
|
||||
@@ -288,7 +288,7 @@ func (c *Cos) AccessURL(ctx context.Context, name string, expire time.Duration,
|
||||
style = append(style, "format/"+opt.Image.Format)
|
||||
}
|
||||
if len(style) > 0 {
|
||||
imageMogr = "imageMogr2/thumbnail/" + strings.Join(style, "/") + "/ignore-error/1"
|
||||
imageMogr = "&imageMogr2/thumbnail/" + strings.Join(style, "/") + "/ignore-error/1"
|
||||
}
|
||||
}
|
||||
if opt.ContentType != "" {
|
||||
@@ -306,23 +306,13 @@ func (c *Cos) AccessURL(ctx context.Context, name string, expire time.Duration,
|
||||
} else if expire < time.Second {
|
||||
expire = time.Second
|
||||
}
|
||||
rawURL, err := c.getPresignedURL(ctx, name, expire, &option)
|
||||
rawURL, err := c.client.Object.GetPresignedURL(ctx, http.MethodGet, name, c.credential.SecretID, c.credential.SecretKey, expire, &option)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
urlStr := rawURL.String()
|
||||
if imageMogr != "" {
|
||||
if rawURL.RawQuery == "" {
|
||||
rawURL.RawQuery = imageMogr
|
||||
} else {
|
||||
rawURL.RawQuery = rawURL.RawQuery + "&" + imageMogr
|
||||
}
|
||||
urlStr += imageMogr
|
||||
}
|
||||
return rawURL.String(), nil
|
||||
}
|
||||
|
||||
func (c *Cos) getPresignedURL(ctx context.Context, name string, expire time.Duration, opt *cos.PresignedURLOptions) (*url.URL, error) {
|
||||
if !config.Config.Object.Cos.PublicRead {
|
||||
return c.client.Object.GetPresignedURL(ctx, http.MethodGet, name, c.credential.SecretID, c.credential.SecretKey, expire, opt)
|
||||
}
|
||||
return c.client.Object.GetObjectURL(name), nil
|
||||
return urlStr, nil
|
||||
}
|
||||
|
||||
+2
-16
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2023 OpenIM open source community. All rights reserved.
|
||||
// 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.
|
||||
@@ -12,18 +12,4 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package admin
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// RegisterAddFriend 注册时默认好友.
|
||||
type RegisterAddFriend struct {
|
||||
UserID string `gorm:"column:user_id;primary_key;type:char(64)"`
|
||||
CreateTime time.Time `gorm:"column:create_time"`
|
||||
}
|
||||
|
||||
func (RegisterAddFriend) TableName() string {
|
||||
return "register_add_friends"
|
||||
}
|
||||
package cos // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cos"
|
||||
@@ -1,13 +0,0 @@
|
||||
package cos
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/url"
|
||||
_ "unsafe"
|
||||
|
||||
"github.com/tencentyun/cos-go-sdk-v5"
|
||||
)
|
||||
|
||||
//go:linkname newRequest github.com/tencentyun/cos-go-sdk-v5.(*Client).newRequest
|
||||
func newRequest(c *cos.Client, ctx context.Context, baseURL *url.URL, uri, method string, body interface{}, optQuery interface{}, optHeader interface{}) (req *http.Request, err error)
|
||||
@@ -0,0 +1,15 @@
|
||||
// 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 minio // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/minio"
|
||||
@@ -1,11 +0,0 @@
|
||||
package minio
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
_ "unsafe"
|
||||
|
||||
"github.com/minio/minio-go/v7"
|
||||
)
|
||||
|
||||
//go:linkname makeTargetURL github.com/minio/minio-go/v7.(*Client).makeTargetURL
|
||||
func makeTargetURL(client *minio.Client, bucketName, objectName, bucketLocation string, isVirtualHostStyle bool, queryValues url.Values) (*url.URL, error)
|
||||
@@ -139,15 +139,6 @@ func (m *Minio) initMinio(ctx context.Context) error {
|
||||
return fmt.Errorf("make bucket error: %w", err)
|
||||
}
|
||||
}
|
||||
if conf.PublicRead {
|
||||
policy := fmt.Sprintf(
|
||||
`{"Version": "2012-10-17","Statement": [{"Action": ["s3:GetObject","s3:PutObject"],"Effect": "Allow","Principal": {"AWS": ["*"]},"Resource": ["arn:aws:s3:::%s/*"],"Sid": ""}]}`,
|
||||
conf.Bucket,
|
||||
)
|
||||
if err := m.core.Client.SetBucketPolicy(ctx, conf.Bucket, policy); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
m.location, err = m.core.Client.GetBucketLocation(ctx, conf.Bucket)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -384,15 +375,7 @@ func (m *Minio) presignedGetObject(ctx context.Context, name string, expire time
|
||||
} else if expire < time.Second {
|
||||
expire = time.Second
|
||||
}
|
||||
var (
|
||||
rawURL *url.URL
|
||||
err error
|
||||
)
|
||||
if config.Config.Object.Minio.PublicRead {
|
||||
rawURL, err = makeTargetURL(m.sign, m.bucket, name, m.location, false, query)
|
||||
} else {
|
||||
rawURL, err = m.sign.PresignedGetObject(ctx, m.bucket, name, expire, query)
|
||||
}
|
||||
rawURL, err := m.sign.PresignedGetObject(ctx, m.bucket, name, expire, query)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// 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 oss // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/oss"
|
||||
@@ -1,39 +0,0 @@
|
||||
// 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 oss
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
_ "unsafe"
|
||||
|
||||
"github.com/aliyun/aliyun-oss-go-sdk/oss"
|
||||
)
|
||||
|
||||
//go:linkname signHeader github.com/aliyun/aliyun-oss-go-sdk/oss.Conn.signHeader
|
||||
func signHeader(c oss.Conn, req *http.Request, canonicalizedResource string)
|
||||
|
||||
//go:linkname getURLParams github.com/aliyun/aliyun-oss-go-sdk/oss.Conn.getURLParams
|
||||
func getURLParams(c oss.Conn, params map[string]interface{}) string
|
||||
|
||||
//go:linkname getURL github.com/aliyun/aliyun-oss-go-sdk/oss.urlMaker.getURL
|
||||
func getURL(um urlMaker, bucket, object, params string) *url.URL
|
||||
|
||||
type urlMaker struct {
|
||||
Scheme string
|
||||
NetLoc string
|
||||
Type int
|
||||
IsProxy bool
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -70,7 +69,6 @@ func NewOSS() (s3.Interface, error) {
|
||||
bucketURL: conf.BucketURL,
|
||||
bucket: bucket,
|
||||
credentials: client.Config.GetCredentials(),
|
||||
um: *(*urlMaker)(reflect.ValueOf(bucket.Client.Conn).Elem().FieldByName("url").UnsafePointer()),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -78,7 +76,6 @@ type OSS struct {
|
||||
bucketURL string
|
||||
bucket *oss.Bucket
|
||||
credentials oss.Credentials
|
||||
um urlMaker
|
||||
}
|
||||
|
||||
func (o *OSS) Engine() string {
|
||||
@@ -166,7 +163,7 @@ func (o *OSS) AuthSign(ctx context.Context, uploadID string, name string, expire
|
||||
request.Header.Set(oss.HTTPHeaderHost, request.Host)
|
||||
request.Header.Set(oss.HTTPHeaderDate, now)
|
||||
request.Header.Set(oss.HttpHeaderOssDate, now)
|
||||
signHeader(*o.bucket.Client.Conn, request, fmt.Sprintf(`/%s/%s?partNumber=%d&uploadId=%s`, o.bucket.BucketName, name, partNumber, uploadID))
|
||||
ossSignHeader(o.bucket.Client.Conn, request, fmt.Sprintf(`/%s/%s?partNumber=%d&uploadId=%s`, o.bucket.BucketName, name, partNumber, uploadID))
|
||||
delete(request.Header, oss.HTTPHeaderDate)
|
||||
result.Parts[i] = s3.SignPart{
|
||||
PartNumber: partNumber,
|
||||
@@ -275,7 +272,6 @@ func (o *OSS) ListUploadedParts(ctx context.Context, uploadID string, name strin
|
||||
}
|
||||
|
||||
func (o *OSS) AccessURL(ctx context.Context, name string, expire time.Duration, opt *s3.AccessURLOption) (string, error) {
|
||||
publicRead := config.Config.Object.Oss.PublicRead
|
||||
var opts []oss.Option
|
||||
if opt != nil {
|
||||
if opt.Image != nil {
|
||||
@@ -303,13 +299,11 @@ func (o *OSS) AccessURL(ctx context.Context, name string, expire time.Duration,
|
||||
process += ",format," + format
|
||||
opts = append(opts, oss.Process(process))
|
||||
}
|
||||
if !publicRead {
|
||||
if opt.ContentType != "" {
|
||||
opts = append(opts, oss.ResponseContentType(opt.ContentType))
|
||||
}
|
||||
if opt.Filename != "" {
|
||||
opts = append(opts, oss.ResponseContentDisposition(`attachment; filename=`+strconv.Quote(opt.Filename)))
|
||||
}
|
||||
if opt.ContentType != "" {
|
||||
opts = append(opts, oss.ResponseContentType(opt.ContentType))
|
||||
}
|
||||
if opt.Filename != "" {
|
||||
opts = append(opts, oss.ResponseContentDisposition(`attachment; filename=`+strconv.Quote(opt.Filename)))
|
||||
}
|
||||
}
|
||||
if expire <= 0 {
|
||||
@@ -317,13 +311,5 @@ func (o *OSS) AccessURL(ctx context.Context, name string, expire time.Duration,
|
||||
} else if expire < time.Second {
|
||||
expire = time.Second
|
||||
}
|
||||
if !publicRead {
|
||||
return o.bucket.SignURL(name, http.MethodGet, int64(expire/time.Second), opts...)
|
||||
}
|
||||
rawParams, err := oss.GetRawParams(opts)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
params := getURLParams(*o.bucket.Client.Conn, rawParams)
|
||||
return getURL(o.um, o.bucket.BucketName, name, params).String(), nil
|
||||
return o.bucket.SignURL(name, http.MethodGet, int64(expire/time.Second), opts...)
|
||||
}
|
||||
|
||||
+8
-12
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2023 OpenIM open source community. All rights reserved.
|
||||
// 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.
|
||||
@@ -12,18 +12,14 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package admin
|
||||
package oss
|
||||
|
||||
import (
|
||||
"time"
|
||||
"net/http"
|
||||
_ "unsafe"
|
||||
|
||||
"github.com/aliyun/aliyun-oss-go-sdk/oss"
|
||||
)
|
||||
|
||||
// RegisterAddGroup 注册时默认群组.
|
||||
type RegisterAddGroup struct {
|
||||
GroupID string `gorm:"column:group_id;primary_key;type:char(64)"`
|
||||
CreateTime time.Time `gorm:"column:create_time"`
|
||||
}
|
||||
|
||||
func (RegisterAddGroup) TableName() string {
|
||||
return "register_add_groups"
|
||||
}
|
||||
//go:linkname ossSignHeader github.com/aliyun/aliyun-oss-go-sdk/oss.(*Conn).signHeader
|
||||
func ossSignHeader(c *oss.Conn, req *http.Request, canonicalizedResource string)
|
||||
@@ -1,25 +0,0 @@
|
||||
package relation
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Log struct {
|
||||
LogID string `gorm:"column:log_id;primary_key;type:char(64)"`
|
||||
Platform string `gorm:"column:platform;type:varchar(32)"`
|
||||
UserID string `gorm:"column:user_id;type:char(64)"`
|
||||
CreateTime time.Time `gorm:"index:,sort:desc"`
|
||||
Url string `gorm:"column:url;type varchar(255)"`
|
||||
FileName string `gorm:"column:filename;type varchar(255)"`
|
||||
SystemType string `gorm:"column:system_type;type varchar(255)"`
|
||||
Version string `gorm:"column:version;type varchar(255)"`
|
||||
Ex string `gorm:"column:ex;type varchar(255)"`
|
||||
}
|
||||
|
||||
type LogInterface interface {
|
||||
Create(ctx context.Context, log []*Log) error
|
||||
Search(ctx context.Context, keyword string, start time.Time, end time.Time, pageNumber int32, showNumber int32) (uint32, []*Log, error)
|
||||
Delete(ctx context.Context, logID []string, userID string) error
|
||||
Get(ctx context.Context, logIDs []string, userID string) ([]*Log, error)
|
||||
}
|
||||
@@ -163,11 +163,7 @@ func (u *UserMongoDriver) GetAllSubscribeList(ctx context.Context, userID string
|
||||
bson.M{"user_id": SubscriptionPrefix + userID})
|
||||
err = cursor.Decode(&user)
|
||||
if err != nil {
|
||||
if err == mongo.ErrNoDocuments {
|
||||
return []string{}, nil
|
||||
} else {
|
||||
return nil, errs.Wrap(err)
|
||||
}
|
||||
return nil, errs.Wrap(err)
|
||||
}
|
||||
return user.UserIDList, nil
|
||||
}
|
||||
@@ -180,11 +176,7 @@ func (u *UserMongoDriver) GetSubscribedList(ctx context.Context, userID string)
|
||||
bson.M{"user_id": SubscribedPrefix + userID})
|
||||
err = cursor.Decode(&user)
|
||||
if err != nil {
|
||||
if err == mongo.ErrNoDocuments {
|
||||
return []string{}, nil
|
||||
} else {
|
||||
return nil, errs.Wrap(err)
|
||||
}
|
||||
return nil, errs.Wrap(err)
|
||||
}
|
||||
return user.UserIDList, nil
|
||||
}
|
||||
|
||||
@@ -173,9 +173,6 @@ func (u *UserRpcClient) GetAllUserIDs(ctx context.Context, pageNumber, showNumbe
|
||||
|
||||
// SetUserStatus sets the status for a user based on the provided user ID, status, and platform ID.
|
||||
func (u *UserRpcClient) SetUserStatus(ctx context.Context, userID string, status int32, platformID int) error {
|
||||
_, err := u.Client.SetUserStatus(ctx, &user.SetUserStatusReq{
|
||||
UserID: userID,
|
||||
Status: status, PlatformID: int32(platformID),
|
||||
})
|
||||
_, err := u.Client.SetUserStatus(ctx, &user.SetUserStatusReq{StatusList: []*user.OnlineStatus{{UserID: userID, Status: status, PlatformIDs: []int32{int32(platformID)}}}})
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ echo "+++ The port being checked: ${OPENIM_DEPENDENCY_PORT_LISTARIES[@]}"
|
||||
|
||||
set +e
|
||||
|
||||
# Later, after discarding Docker, the Docker keyword is unreliable, and Kubepods is used
|
||||
if grep -qE 'docker|kubepods' /proc/1/cgroup || [ -f /.dockerenv ]; then
|
||||
openim::color::echo ${COLOR_BLUE} "Environment in the interior of the container"
|
||||
else
|
||||
|
||||
@@ -69,15 +69,6 @@ def "ENV_FILE" ""${OPENIM_ROOT}"/scripts/install/environment.sh"
|
||||
def "CHAT_BRANCH" "main"
|
||||
def "SERVER_BRANCH" "main"
|
||||
|
||||
# Choose the appropriate image address, the default is GITHUB image,
|
||||
# you can choose docker hub, for Chinese users can choose Ali Cloud
|
||||
# export IMAGE_REGISTRY="ghcr.io/openimsdk"
|
||||
# export IMAGE_REGISTRY="openim"
|
||||
# export IMAGE_REGISTRY="registry.cn-hangzhou.aliyuncs.com/openimsdk"
|
||||
def "IMAGE_REGISTRY" "ghcr.io/openimsdk"
|
||||
# def "IMAGE_REGISTRY" "openim"
|
||||
# def "IMAGE_REGISTRY" "registry.cn-hangzhou.aliyuncs.com/openimsdk"
|
||||
|
||||
###################### OpenIM Docker Network ######################
|
||||
# 设置 Docker 网络的网段
|
||||
readonly DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET:-'172.28.0.0/16'}
|
||||
@@ -195,21 +186,17 @@ def "MINIO_ACCESS_KEY" "${USER}"
|
||||
def "MINIO_SECRET_KEY" "${PASSWORD}" # MinIO的密钥
|
||||
def "MINIO_SESSION_TOKEN" # MinIO的会话令牌
|
||||
readonly MINIO_SIGN_ENDPOINT=${MINIO_SIGN_ENDPOINT:-"http://${IP}:${MINIO_PORT}"} # signEndpoint为minio公网地址
|
||||
def "MINIO_PUBLIC_READ" "false" # 公有读
|
||||
|
||||
# 腾讯云COS的存储桶URL
|
||||
def "COS_BUCKET_URL" "https://temp-1252357374.cos.ap-chengdu.myqcloud.com"
|
||||
def "COS_SECRET_ID" # 腾讯云COS的密钥ID
|
||||
def "COS_SECRET_KEY" # 腾讯云COS的密钥
|
||||
def "COS_SESSION_TOKEN" # 腾讯云COS的会话令牌
|
||||
def "COS_PUBLIC_READ" "false" # 公有读
|
||||
def "OSS_ENDPOINT" "https://oss-cn-chengdu.aliyuncs.com" # 阿里云OSS的端点URL
|
||||
def "OSS_BUCKET" "demo-9999999" # 阿里云OSS的存储桶名称
|
||||
def "OSS_BUCKET_URL" "https://demo-9999999.oss-cn-chengdu.aliyuncs.com" # 阿里云OSS的存储桶URL
|
||||
def "OSS_ACCESS_KEY_ID" # 阿里云OSS的访问密钥ID
|
||||
def "OSS_ACCESS_KEY_SECRET" # 阿里云OSS的密钥
|
||||
def "OSS_SESSION_TOKEN" # 阿里云OSS的会话令牌
|
||||
def "OSS_PUBLIC_READ" "false" # 公有读
|
||||
|
||||
###################### Redis 配置信息 ######################
|
||||
def "REDIS_PORT" "16379" # Redis的端口
|
||||
@@ -298,16 +285,11 @@ def "WEBSOCKET_TIMEOUT" "10" # Websocket超时
|
||||
def "PUSH_ENABLE" "getui" # 推送是否启用
|
||||
# GeTui推送URL
|
||||
readonly GETUI_PUSH_URL=${GETUI_PUSH_URL:-'https://restapi.getui.com/v2/$appId'}
|
||||
def "GETUI_MASTER_SECRET" "" # GeTui主密钥
|
||||
def "GETUI_APP_KEY" "" # GeTui应用密钥
|
||||
def "GETUI_INTENT" "" # GeTui推送意图
|
||||
def "GETUI_CHANNEL_ID" "" # GeTui渠道ID
|
||||
def "GETUI_CHANNEL_NAME" "" # GeTui渠道名称
|
||||
def "FCM_SERVICE_ACCOUNT" "x.json" # FCM服务账户
|
||||
def "JPNS_APP_KEY" "" # JPNS应用密钥
|
||||
def "JPNS_MASTER_SECRET" "" # JPNS主密钥
|
||||
def "JPNS_PUSH_URL" "" # JPNS推送URL
|
||||
def "JPNS_PUSH_INTENT" "" # JPNS推送意图
|
||||
def "JPNS_APP_KEY" # JPNS应用密钥
|
||||
def "JPNS_MASTER_SECRET" # JPNS主密钥
|
||||
def "JPNS_PUSH_URL" # JPNS推送URL
|
||||
def "JPNS_PUSH_INTENT" # JPNS推送意图
|
||||
def "MANAGER_USERID_1" "openIM123456" # 管理员ID 1
|
||||
def "MANAGER_USERID_2" "openIM654321" # 管理员ID 2
|
||||
def "MANAGER_USERID_3" "openIMAdmin" # 管理员ID 3
|
||||
|
||||
@@ -48,7 +48,7 @@ function openim::crontask::start()
|
||||
openim::log::info "Start OpenIM Cron, binary root: ${SERVER_NAME}"
|
||||
openim::log::status "Start OpenIM Cron, path: ${OPENIM_CRONTASK_BINARY}"
|
||||
|
||||
openim::util::stop_services_with_name ${OPENIM_CRONTASK_BINARY}
|
||||
openim::util::stop_services_with_name ${SERVER_NAME}
|
||||
|
||||
openim::log::status "start cron_task process, path: ${OPENIM_CRONTASK_BINARY}"
|
||||
nohup ${OPENIM_CRONTASK_BINARY} >> ${LOG_FILE} 2>&1 &
|
||||
|
||||
@@ -18,11 +18,11 @@ set -o errexit
|
||||
set +o nounset
|
||||
set -o pipefail
|
||||
|
||||
ulimit -n 200000
|
||||
|
||||
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P)
|
||||
[[ -z ${COMMON_SOURCED} ]] && source "${OPENIM_ROOT}"/scripts/install/common.sh
|
||||
|
||||
openim::util::set_max_fd 200000
|
||||
|
||||
SERVER_NAME="openim-msggateway"
|
||||
|
||||
function openim::msggateway::start()
|
||||
|
||||
@@ -18,11 +18,11 @@ set -o errexit
|
||||
set +o nounset
|
||||
set -o pipefail
|
||||
|
||||
ulimit -n 200000
|
||||
|
||||
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P)
|
||||
[[ -z ${COMMON_SOURCED} ]] && source "${OPENIM_ROOT}"/scripts/install/common.sh
|
||||
|
||||
openim::util::set_max_fd 200000
|
||||
|
||||
SERVER_NAME="openim-msgtransfer"
|
||||
|
||||
function openim::msgtransfer::start()
|
||||
|
||||
@@ -54,14 +54,14 @@ function openim::push::start()
|
||||
openim::log::status "Start OpenIM Push, binary root: ${SERVER_NAME}"
|
||||
openim::log::info "Start OpenIM Push, path: ${OPENIM_PUSH_BINARY}"
|
||||
|
||||
openim::util::stop_services_with_name ${SERVER_NAME}
|
||||
|
||||
openim::log::status "prepare start push process, path: ${OPENIM_PUSH_BINARY}"
|
||||
openim::log::status "prepare start push process, port: ${OPENIM_PUSH_PORT}, prometheus port: ${PUSH_PROM_PORT}"
|
||||
|
||||
OPENIM_PUSH_PORTS_ARRAY=$(openim::util::list-to-string ${OPENIM_PUSH_PORT} )
|
||||
PUSH_PROM_PORTS_ARRAY=$(openim::util::list-to-string ${PUSH_PROM_PORT} )
|
||||
|
||||
openim::util::stop_services_with_name ${SERVER_NAME}
|
||||
|
||||
openim::log::status "push port list: ${OPENIM_PUSH_PORTS_ARRAY[@]}"
|
||||
openim::log::status "prometheus port list: ${PUSH_PROM_PORTS_ARRAY[@]}"
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ function openim::tools::post-start() {
|
||||
openim::log::info "Post-start actions for OpenIM Tools..."
|
||||
for tool in "${OPENIM_TOOLS_POST_START_NAME_LISTARIES[@]}"; do
|
||||
openim::log::info "Starting ${tool}..."
|
||||
openim::tools::start_service ${tool}
|
||||
# openim::tools::start_service ${tool}
|
||||
sleep 0.2
|
||||
done
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
################################################################################
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
if [ -z "${COLOR_OPEN+x}" ]; then
|
||||
if [[ ! -v COLOR_OPEN ]]; then
|
||||
COLOR_OPEN=1
|
||||
fi
|
||||
|
||||
|
||||
@@ -1250,38 +1250,6 @@ function openim::util::gencpu() {
|
||||
echo $cpu_count
|
||||
}
|
||||
|
||||
function openim::util::set_max_fd() {
|
||||
local desired_fd=$1
|
||||
local max_fd_limit
|
||||
|
||||
# Check if we're not on cygwin or darwin.
|
||||
if [ "$(uname -s | tr '[:upper:]' '[:lower:]')" != "cygwin" ] && [ "$(uname -s | tr '[:upper:]' '[:lower:]')" != "darwin" ]; then
|
||||
# Try to get the hard limit.
|
||||
max_fd_limit=$(ulimit -H -n)
|
||||
if [ $? -eq 0 ]; then
|
||||
# If desired_fd is 'maximum' or 'max', set it to the hard limit.
|
||||
if [ "$desired_fd" = "maximum" ] || [ "$desired_fd" = "max" ]; then
|
||||
desired_fd="$max_fd_limit"
|
||||
fi
|
||||
|
||||
# Check if desired_fd is less than or equal to max_fd_limit.
|
||||
if [ "$desired_fd" -le "$max_fd_limit" ]; then
|
||||
ulimit -n "$desired_fd"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Warning: Could not set maximum file descriptor limit to $desired_fd"
|
||||
fi
|
||||
else
|
||||
echo "Warning: Desired file descriptor limit ($desired_fd) is greater than the hard limit ($max_fd_limit)"
|
||||
fi
|
||||
else
|
||||
echo "Warning: Could not query the maximum file descriptor hard limit."
|
||||
fi
|
||||
else
|
||||
echo "Warning: Not attempting to modify file descriptor limit on Cygwin or Darwin."
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function openim::util::gen_os_arch() {
|
||||
# Get the current operating system and architecture
|
||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#
|
||||
|
||||
GO := go
|
||||
GO_SUPPORTED_VERSIONS ?= 1.18|1.19|1.20|1.21|1.22
|
||||
GO_SUPPORTED_VERSIONS ?= 1.18|1.19|1.20|1.21
|
||||
|
||||
GO_LDFLAGS += -X $(VERSION_PACKAGE).gitVersion=$(GIT_TAG) \
|
||||
-X $(VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) \
|
||||
@@ -125,10 +125,6 @@ go.check-component:
|
||||
@echo "===========> Checking openim component"
|
||||
@$(ROOT_DIR)/scripts/install/openim-tools.sh openim::tools::pre-start
|
||||
|
||||
## go.versionchecker: Design, detect some environment variables and versions
|
||||
go.versionchecker:
|
||||
@$(ROOT_DIR)/scripts/install/openim-tools.sh openim::tools::post-start
|
||||
|
||||
## go.build.verify: Verify that a suitable version of Go exists
|
||||
.PHONY: go.build.verify
|
||||
go.build.verify:
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#
|
||||
|
||||
DOCKER := docker
|
||||
DOCKER_SUPPORTED_API_VERSION ?= 1.32|1.40|1.41|1.42
|
||||
DOCKER_SUPPORTED_API_VERSION ?= 1.32|1.40|1.41
|
||||
|
||||
# read: https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md
|
||||
REGISTRY_PREFIX ?= ghcr.io/openimsdk
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
// 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 data_conversion
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/IBM/sarama"
|
||||
)
|
||||
|
||||
var (
|
||||
topic = "latestMsgToRedis"
|
||||
addr = "127.0.0.1:9092"
|
||||
)
|
||||
|
||||
var (
|
||||
consumer sarama.Consumer
|
||||
producer sarama.SyncProducer
|
||||
)
|
||||
|
||||
func init() {
|
||||
// Producer
|
||||
config := sarama.NewConfig() // Instantiate a sarama Config
|
||||
config.Producer.Return.Successes = true // Whether to enable the successes channel to be notified after the message is sent successfully
|
||||
config.Producer.Return.Errors = true
|
||||
config.Producer.RequiredAcks = sarama.WaitForAll // Set producer Message Reply level 0 1 all
|
||||
config.Producer.Partitioner = sarama.NewHashPartitioner // Set the hash-key automatic hash partition. When sending a message, you must specify the key value of the message. If there is no key, the partition will be selected randomly
|
||||
|
||||
client, err := sarama.NewSyncProducer([]string{addr}, config)
|
||||
if err != nil {
|
||||
fmt.Println("producer closed, err:", err)
|
||||
}
|
||||
producer = client
|
||||
|
||||
// Consumer
|
||||
consumerT, err := sarama.NewConsumer([]string{addr}, sarama.NewConfig())
|
||||
if err != nil {
|
||||
fmt.Printf("fail to start consumer, err:%v\n", err)
|
||||
}
|
||||
consumer = consumerT
|
||||
}
|
||||
|
||||
func SendMessage() {
|
||||
// construct a message
|
||||
msg := &sarama.ProducerMessage{}
|
||||
msg.Topic = topic
|
||||
msg.Value = sarama.StringEncoder("this is a test log")
|
||||
|
||||
// Send a message
|
||||
pid, offset, err := producer.SendMessage(msg)
|
||||
if err != nil {
|
||||
fmt.Println("send msg failed, err:", err)
|
||||
}
|
||||
fmt.Printf("pid:%v offset:%v\n", pid, offset)
|
||||
}
|
||||
|
||||
func GetMessage() {
|
||||
partitionList, err := consumer.Partitions(topic) // Get all partitions according to topic
|
||||
if err != nil {
|
||||
fmt.Printf("fail to get list of partition:err%v\n", err)
|
||||
}
|
||||
fmt.Println(partitionList)
|
||||
for partition := range partitionList { // iterate over all partitions
|
||||
// Create a corresponding partition consumer for each partition
|
||||
pc, err := consumer.ConsumePartition(topic, int32(partition), sarama.OffsetNewest)
|
||||
if err != nil {
|
||||
fmt.Printf("failed to start consumer for partition %d,err:%v\n", partition, err)
|
||||
}
|
||||
// Asynchronously consume information from each partition
|
||||
go func(sarama.PartitionConsumer) {
|
||||
for msg := range pc.Messages() {
|
||||
fmt.Printf("Partition:%d Offset:%d Key:%v Value:%v", msg.Partition, msg.Offset, msg.Key, msg.Value)
|
||||
}
|
||||
}(pc)
|
||||
}
|
||||
}
|
||||
+6
-10
@@ -12,18 +12,14 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package common
|
||||
package data_conversion
|
||||
|
||||
import "fmt"
|
||||
import "testing"
|
||||
|
||||
func ErrorPrint(s string) {
|
||||
fmt.Printf("\x1b[%dm%v\x1b[0m\n", 31, s)
|
||||
func TestGetMessage(t *testing.T) {
|
||||
GetMessage()
|
||||
}
|
||||
|
||||
func SuccessPrint(s string) {
|
||||
fmt.Printf("\x1b[%dm%v\x1b[0m\n", 32, s)
|
||||
}
|
||||
|
||||
func WarningPrint(s string) {
|
||||
fmt.Printf("\x1b[%dmWarning: But %v\x1b[0m\n", 33, s)
|
||||
func TestSendMessage(t *testing.T) {
|
||||
SendMessage()
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// 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 data_conversion
|
||||
@@ -0,0 +1,228 @@
|
||||
// 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 data_conversion
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/OpenIMSDK/tools/log"
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation"
|
||||
)
|
||||
|
||||
var (
|
||||
MysqlDb_v2 *gorm.DB
|
||||
MysqlDb_v3 *gorm.DB
|
||||
)
|
||||
|
||||
const (
|
||||
username_v2 = "root"
|
||||
password_v2 = "123456"
|
||||
ip_v2 = "127.0.0.1:3306"
|
||||
database_v2 = "openim_v2"
|
||||
)
|
||||
|
||||
const (
|
||||
username_v3 = "root"
|
||||
password_v3 = "123456"
|
||||
ip_v3 = "127.0.0.1:3306"
|
||||
database_v3 = "openim_v3"
|
||||
)
|
||||
|
||||
func init() {
|
||||
dsn := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||
username_v2,
|
||||
password_v2,
|
||||
ip_v2,
|
||||
database_v2,
|
||||
)
|
||||
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
||||
MysqlDb_v2 = db
|
||||
if err != nil {
|
||||
log.ZDebug(context.Background(), "err", err)
|
||||
}
|
||||
|
||||
dsn_v3 := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||
username_v3,
|
||||
password_v3,
|
||||
ip_v3,
|
||||
database_v3,
|
||||
)
|
||||
db_v3, err := gorm.Open(mysql.Open(dsn_v3), &gorm.Config{})
|
||||
MysqlDb_v3 = db_v3
|
||||
if err != nil {
|
||||
log.ZDebug(context.Background(), "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
func UserConversion() {
|
||||
var count int64
|
||||
var user relation.UserModel
|
||||
MysqlDb_v2.Model(&user).Count(&count)
|
||||
batchSize := 100
|
||||
offset := 0
|
||||
|
||||
for int64(offset) < count {
|
||||
var results []relation.UserModel
|
||||
MysqlDb_v2.Limit(batchSize).Offset(offset).Find(&results)
|
||||
// Process query results
|
||||
fmt.Println("============================batch data===================", offset, batchSize)
|
||||
fmt.Println(results)
|
||||
MysqlDb_v3.Create(results)
|
||||
fmt.Println("======================================================")
|
||||
offset += batchSize
|
||||
}
|
||||
}
|
||||
|
||||
func FriendConversion() {
|
||||
var count int64
|
||||
var friend relation.FriendModel
|
||||
MysqlDb_v2.Model(&friend).Count(&count)
|
||||
batchSize := 100
|
||||
offset := 0
|
||||
|
||||
for int64(offset) < count {
|
||||
var results []relation.FriendModel
|
||||
MysqlDb_v2.Limit(batchSize).Offset(offset).Find(&results)
|
||||
// Process query results
|
||||
fmt.Println("============================batch data===================", offset, batchSize)
|
||||
fmt.Println(results)
|
||||
MysqlDb_v3.Create(results)
|
||||
fmt.Println("======================================================")
|
||||
offset += batchSize
|
||||
}
|
||||
}
|
||||
|
||||
func RequestConversion() {
|
||||
var count int64
|
||||
var friendRequest relation.FriendRequestModel
|
||||
MysqlDb_v2.Model(&friendRequest).Count(&count)
|
||||
batchSize := 100
|
||||
offset := 0
|
||||
|
||||
for int64(offset) < count {
|
||||
var results []relation.FriendRequestModel
|
||||
MysqlDb_v2.Limit(batchSize).Offset(offset).Find(&results)
|
||||
// Process query results
|
||||
fmt.Println("============================batch data===================", offset, batchSize)
|
||||
fmt.Println(results)
|
||||
MysqlDb_v3.Create(results)
|
||||
fmt.Println("======================================================")
|
||||
offset += batchSize
|
||||
}
|
||||
|
||||
var groupRequest relation.GroupRequestModel
|
||||
MysqlDb_v2.Model(&groupRequest).Count(&count)
|
||||
batchSize = 100
|
||||
offset = 0
|
||||
|
||||
for int64(offset) < count {
|
||||
var results []relation.GroupRequestModel
|
||||
MysqlDb_v2.Limit(batchSize).Offset(offset).Find(&results)
|
||||
// Process query results
|
||||
fmt.Println("============================batch data===================", offset, batchSize)
|
||||
fmt.Println(results)
|
||||
MysqlDb_v3.Create(results)
|
||||
fmt.Println("======================================================")
|
||||
offset += batchSize
|
||||
}
|
||||
}
|
||||
|
||||
func GroupConversion() {
|
||||
var count int64
|
||||
var group relation.GroupModel
|
||||
MysqlDb_v2.Model(&group).Count(&count)
|
||||
batchSize := 100
|
||||
offset := 0
|
||||
|
||||
for int64(offset) < count {
|
||||
var results []relation.GroupModel
|
||||
MysqlDb_v2.Limit(batchSize).Offset(offset).Find(&results)
|
||||
for i, val := range results {
|
||||
temp := time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC)
|
||||
if val.NotificationUpdateTime.Equal(temp) {
|
||||
results[i].NotificationUpdateTime = time.Now()
|
||||
// fmt.Println(val.NotificationUpdateTime)
|
||||
}
|
||||
}
|
||||
// Process query results
|
||||
fmt.Println("============================batch data===================", offset, batchSize)
|
||||
fmt.Println(results)
|
||||
MysqlDb_v3.Create(results)
|
||||
fmt.Println("======================================================")
|
||||
offset += batchSize
|
||||
}
|
||||
}
|
||||
|
||||
func GroupMemberConversion() {
|
||||
var count int64
|
||||
var groupMember relation.GroupMemberModel
|
||||
MysqlDb_v2.Model(&groupMember).Count(&count)
|
||||
batchSize := 100
|
||||
offset := 0
|
||||
|
||||
for int64(offset) < count {
|
||||
var results []relation.GroupMemberModel
|
||||
MysqlDb_v2.Limit(batchSize).Offset(offset).Find(&results)
|
||||
// Process query results
|
||||
fmt.Println("============================batch data===================", offset, batchSize)
|
||||
fmt.Println(results)
|
||||
MysqlDb_v3.Create(results)
|
||||
fmt.Println("======================================================")
|
||||
offset += batchSize
|
||||
}
|
||||
}
|
||||
|
||||
func BlacksConversion() {
|
||||
var count int64
|
||||
var black relation.BlackModel
|
||||
MysqlDb_v2.Model(&black).Count(&count)
|
||||
batchSize := 100
|
||||
offset := 0
|
||||
|
||||
for int64(offset) < count {
|
||||
var results []relation.BlackModel
|
||||
MysqlDb_v2.Limit(batchSize).Offset(offset).Find(&results)
|
||||
// Process query results
|
||||
fmt.Println("============================batch data===================", offset, batchSize)
|
||||
fmt.Println(results)
|
||||
MysqlDb_v3.Create(results)
|
||||
fmt.Println("======================================================")
|
||||
offset += batchSize
|
||||
}
|
||||
}
|
||||
|
||||
func ChatLogsConversion() {
|
||||
var count int64
|
||||
var chat relation.ChatLogModel
|
||||
MysqlDb_v2.Model(&chat).Count(&count)
|
||||
batchSize := 100
|
||||
offset := 0
|
||||
|
||||
for int64(offset) < count {
|
||||
var results []relation.ChatLogModel
|
||||
MysqlDb_v2.Limit(batchSize).Offset(offset).Find(&results)
|
||||
// Process query results
|
||||
fmt.Println("============================batch data===================", offset, batchSize)
|
||||
// fmt.Println(results)
|
||||
MysqlDb_v3.Create(results)
|
||||
fmt.Println("======================================================")
|
||||
offset += batchSize
|
||||
}
|
||||
}
|
||||
@@ -12,19 +12,38 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package callbackstruct
|
||||
package data_conversion
|
||||
|
||||
type CallbackBeforeUpdateUserInfoReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OperationID string `json:"operationID"`
|
||||
UserID string `json:"userID"`
|
||||
Nickname *string `json:"nickName"`
|
||||
FaceURL *string `json:"faceURL"`
|
||||
Ex *string `json:"ex"`
|
||||
import "testing"
|
||||
|
||||
// pass
|
||||
func TestUserConversion(t *testing.T) {
|
||||
UserConversion()
|
||||
}
|
||||
type CallbackBeforeUpdateUserInfoResp struct {
|
||||
CommonCallbackResp
|
||||
Nickname *string `json:"nickName"`
|
||||
FaceURL *string `json:"faceURL"`
|
||||
Ex *string `json:"ex"`
|
||||
|
||||
// pass
|
||||
func TestFriendConversion(t *testing.T) {
|
||||
FriendConversion()
|
||||
}
|
||||
|
||||
// pass
|
||||
func TestGroupConversion(t *testing.T) {
|
||||
GroupConversion()
|
||||
GroupMemberConversion()
|
||||
}
|
||||
|
||||
// pass
|
||||
func TestBlacksConversion(t *testing.T) {
|
||||
BlacksConversion()
|
||||
}
|
||||
|
||||
// pass
|
||||
func TestRequestConversion(t *testing.T) {
|
||||
RequestConversion()
|
||||
}
|
||||
|
||||
// pass
|
||||
func TestChatLogsConversion(t *testing.T) {
|
||||
// If the printed result is too long, the console will not display it, but it can run normally
|
||||
ChatLogsConversion()
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// 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 data_conversion
|
||||
@@ -46,7 +46,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// defaultCfgPath is the default path of the configuration file.
|
||||
// defaultCfgPath is the default path of the configuration file
|
||||
defaultCfgPath = "../../../../../config/config.yaml"
|
||||
minioHealthCheckDuration = 1
|
||||
maxRetry = 100
|
||||
@@ -66,7 +66,6 @@ func initCfg() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return yaml.Unmarshal(data, &config.Config)
|
||||
}
|
||||
|
||||
@@ -80,7 +79,6 @@ func main() {
|
||||
|
||||
if err := initCfg(); err != nil {
|
||||
fmt.Printf("Read config failed: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -113,7 +111,6 @@ func main() {
|
||||
|
||||
if allSuccess {
|
||||
successPrint("All components started successfully!")
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -129,7 +126,6 @@ func exactIP(urll string) string {
|
||||
if strings.HasSuffix(host, ":") {
|
||||
host = host[0 : len(host)-1]
|
||||
}
|
||||
|
||||
return host
|
||||
}
|
||||
|
||||
@@ -152,7 +148,6 @@ func checkMysql() error {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -182,7 +177,6 @@ func checkMongo() error {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -215,7 +209,6 @@ func checkMinio() error {
|
||||
return ErrConfig.Wrap("apiURL or Minio SignEndpoint endpoint contain 127.0.0.1")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -243,7 +236,6 @@ func checkRedis() error {
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -268,7 +260,6 @@ func checkZookeeper() error {
|
||||
return errs.Wrap(err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -304,7 +295,6 @@ func checkKafka() error {
|
||||
return ErrComponentStart.Wrap(fmt.Sprintf("kafka doesn't contain topic:%v", config.Config.Kafka.LatestMsgToRedis.Topic))
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/logger"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/tools/data-conversion/chat/conversion"
|
||||
"github.com/openimsdk/open-im-server/v3/tools/data-conversion/utils"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var (
|
||||
usernameV2 = "root" // v2版本mysql用户名
|
||||
passwordV2 = "openIM" // v2版本mysql密码
|
||||
addrV2 = "127.0.0.1:13306" // v2版本mysql地址
|
||||
databaseV2 = "admin_chat" // v2版本mysql数据库名字
|
||||
)
|
||||
|
||||
var (
|
||||
usernameV3 = "root" // v3版本mysql用户名
|
||||
passwordV3 = "openIM123" // v3版本mysql密码
|
||||
addrV3 = "127.0.0.1:13306" // v3版本mysql地址
|
||||
databaseV3 = "openim_enterprise" // v3版本mysql数据库名字
|
||||
)
|
||||
|
||||
var concurrency = 1 // 并发数量
|
||||
|
||||
log.SetFlags(log.LstdFlags | log.Llongfile)
|
||||
dsnV2 := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", usernameV2, passwordV2, addrV2, databaseV2)
|
||||
dsnV3 := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", usernameV3, passwordV3, addrV3, databaseV3)
|
||||
dbV2, err := gorm.Open(mysql.Open(dsnV2), &gorm.Config{Logger: logger.Discard})
|
||||
if err != nil {
|
||||
log.Println("open v2 db failed", err)
|
||||
return
|
||||
}
|
||||
dbV3, err := gorm.Open(mysql.Open(dsnV3), &gorm.Config{Logger: logger.Discard})
|
||||
if err != nil {
|
||||
log.Println("open v3 db failed", err)
|
||||
return
|
||||
}
|
||||
|
||||
var tasks utils.TakeList
|
||||
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.Account) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.Attribute) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.Register) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.UserLoginRecord) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.Admin) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.Applet) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.ForbiddenAccount) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.InvitationRegister) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.IPForbidden) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.LimitUserLoginIP) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.RegisterAddFriend) })
|
||||
tasks.Append(func() (string, error) { return utils.FindAndInsert(dbV2, dbV3, conversion.RegisterAddGroup) })
|
||||
|
||||
utils.RunTask(concurrency, tasks)
|
||||
|
||||
}
|
||||
@@ -1,153 +0,0 @@
|
||||
package conversion
|
||||
|
||||
import (
|
||||
v2 "github.com/openimsdk/open-im-server/v3/tools/data-conversion/chat/v2"
|
||||
"github.com/openimsdk/open-im-server/v3/tools/data-conversion/chat/v3/admin"
|
||||
"github.com/openimsdk/open-im-server/v3/tools/data-conversion/chat/v3/chat"
|
||||
"github.com/openimsdk/open-im-server/v3/tools/data-conversion/utils"
|
||||
)
|
||||
|
||||
// ########## chat ##########
|
||||
|
||||
func Account(v v2.Account) (chat.Account, bool) {
|
||||
utils.InitTime(&v.CreateTime, &v.ChangeTime)
|
||||
return chat.Account{
|
||||
UserID: v.UserID,
|
||||
Password: v.Password,
|
||||
CreateTime: v.CreateTime,
|
||||
ChangeTime: v.ChangeTime,
|
||||
OperatorUserID: v.OperatorUserID,
|
||||
}, true
|
||||
}
|
||||
|
||||
func Attribute(v v2.Attribute) (chat.Attribute, bool) {
|
||||
utils.InitTime(&v.CreateTime, &v.ChangeTime, &v.BirthTime)
|
||||
return chat.Attribute{
|
||||
UserID: v.UserID,
|
||||
Account: v.Account,
|
||||
PhoneNumber: v.PhoneNumber,
|
||||
AreaCode: v.AreaCode,
|
||||
Email: v.Email,
|
||||
Nickname: v.Nickname,
|
||||
FaceURL: v.FaceURL,
|
||||
Gender: v.Gender,
|
||||
CreateTime: v.CreateTime,
|
||||
ChangeTime: v.ChangeTime,
|
||||
BirthTime: v.BirthTime,
|
||||
Level: v.Level,
|
||||
AllowVibration: v.AllowVibration,
|
||||
AllowBeep: v.AllowBeep,
|
||||
AllowAddFriend: v.AllowAddFriend,
|
||||
GlobalRecvMsgOpt: 0,
|
||||
}, true
|
||||
}
|
||||
|
||||
func Register(v v2.Register) (chat.Register, bool) {
|
||||
utils.InitTime(&v.CreateTime)
|
||||
return chat.Register{
|
||||
UserID: v.UserID,
|
||||
DeviceID: v.DeviceID,
|
||||
IP: v.IP,
|
||||
Platform: v.Platform,
|
||||
AccountType: v.AccountType,
|
||||
Mode: v.Mode,
|
||||
CreateTime: v.CreateTime,
|
||||
}, true
|
||||
}
|
||||
|
||||
func UserLoginRecord(v v2.UserLoginRecord) (chat.UserLoginRecord, bool) {
|
||||
utils.InitTime(&v.LoginTime)
|
||||
return chat.UserLoginRecord{
|
||||
UserID: v.UserID,
|
||||
LoginTime: v.LoginTime,
|
||||
IP: v.IP,
|
||||
DeviceID: v.DeviceID,
|
||||
Platform: v.Platform,
|
||||
}, true
|
||||
}
|
||||
|
||||
// ########## admin ##########
|
||||
|
||||
func Admin(v v2.Admin) (admin.Admin, bool) {
|
||||
utils.InitTime(&v.CreateTime)
|
||||
return admin.Admin{
|
||||
Account: v.Account,
|
||||
Password: v.Password,
|
||||
FaceURL: v.FaceURL,
|
||||
Nickname: v.Nickname,
|
||||
UserID: v.UserID,
|
||||
Level: v.Level,
|
||||
CreateTime: v.CreateTime,
|
||||
}, true
|
||||
}
|
||||
|
||||
func Applet(v v2.Applet) (admin.Applet, bool) {
|
||||
utils.InitTime(&v.CreateTime)
|
||||
return admin.Applet{
|
||||
ID: v.ID,
|
||||
Name: v.Name,
|
||||
AppID: v.AppID,
|
||||
Icon: v.Icon,
|
||||
URL: v.URL,
|
||||
MD5: v.MD5,
|
||||
Size: v.Size,
|
||||
Version: v.Version,
|
||||
Priority: v.Priority,
|
||||
Status: v.Status,
|
||||
CreateTime: v.CreateTime,
|
||||
}, true
|
||||
}
|
||||
|
||||
func ForbiddenAccount(v v2.ForbiddenAccount) (admin.ForbiddenAccount, bool) {
|
||||
utils.InitTime(&v.CreateTime)
|
||||
return admin.ForbiddenAccount{
|
||||
UserID: v.UserID,
|
||||
Reason: v.Reason,
|
||||
OperatorUserID: v.OperatorUserID,
|
||||
CreateTime: v.CreateTime,
|
||||
}, true
|
||||
}
|
||||
|
||||
func InvitationRegister(v v2.InvitationRegister) (admin.InvitationRegister, bool) {
|
||||
utils.InitTime(&v.CreateTime)
|
||||
return admin.InvitationRegister{
|
||||
InvitationCode: v.InvitationCode,
|
||||
UsedByUserID: v.UsedByUserID,
|
||||
CreateTime: v.CreateTime,
|
||||
}, true
|
||||
}
|
||||
|
||||
func IPForbidden(v v2.IPForbidden) (admin.IPForbidden, bool) {
|
||||
utils.InitTime(&v.CreateTime)
|
||||
return admin.IPForbidden{
|
||||
IP: v.IP,
|
||||
LimitRegister: v.LimitRegister > 0,
|
||||
LimitLogin: v.LimitLogin > 0,
|
||||
CreateTime: v.CreateTime,
|
||||
}, true
|
||||
}
|
||||
|
||||
func LimitUserLoginIP(v v2.LimitUserLoginIP) (admin.LimitUserLoginIP, bool) {
|
||||
utils.InitTime(&v.CreateTime)
|
||||
return admin.LimitUserLoginIP{
|
||||
UserID: v.UserID,
|
||||
IP: v.IP,
|
||||
CreateTime: v.CreateTime,
|
||||
}, true
|
||||
}
|
||||
|
||||
func RegisterAddFriend(v v2.RegisterAddFriend) (admin.RegisterAddFriend, bool) {
|
||||
utils.InitTime(&v.CreateTime)
|
||||
return admin.RegisterAddFriend{
|
||||
UserID: v.UserID,
|
||||
CreateTime: v.CreateTime,
|
||||
}, true
|
||||
}
|
||||
|
||||
func RegisterAddGroup(v v2.RegisterAddGroup) (admin.RegisterAddGroup, bool) {
|
||||
utils.InitTime(&v.CreateTime)
|
||||
return admin.RegisterAddGroup{
|
||||
GroupID: v.GroupID,
|
||||
CreateTime: v.CreateTime,
|
||||
}, true
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package v2
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// AppVersion pc端版本管理
|
||||
type AppVersion struct {
|
||||
Version string `gorm:"column:version;size:64" json:"version"`
|
||||
Type int `gorm:"column:type;primary_key" json:"type"`
|
||||
UpdateTime int `gorm:"column:update_time" json:"update_time"`
|
||||
ForceUpdate bool `gorm:"column:force_update" json:"force_update"`
|
||||
FileName string `gorm:"column:file_name" json:"file_name"`
|
||||
YamlName string `gorm:"column:yaml_name" json:"yaml_name"`
|
||||
UpdateLog string `gorm:"column:update_log" json:"update_log"`
|
||||
}
|
||||
|
||||
// Admin 后台管理员
|
||||
type Admin struct {
|
||||
Account string `gorm:"column:account;primary_key;type:char(64)" json:"account"`
|
||||
Password string `gorm:"column:Password;type:char(64)" json:"password"`
|
||||
FaceURL string `gorm:"column:FaceURL;type:char(64)" json:"faceURL"`
|
||||
Nickname string `gorm:"column:Nickname;type:char(64)" json:"nickname"`
|
||||
UserID string `gorm:"column:UserID;type:char(64)" json:"userID"` //openIM userID
|
||||
Level int32 `gorm:"column:level;default:1" json:"level"`
|
||||
CreateTime time.Time `gorm:"column:create_time" json:"createTime"`
|
||||
}
|
||||
|
||||
// RegisterAddFriend 注册时默认好友
|
||||
type RegisterAddFriend struct {
|
||||
UserID string `gorm:"column:user_id;primary_key;type:char(64)" json:"userID"`
|
||||
CreateTime time.Time `gorm:"column:create_time" json:"createTime"`
|
||||
}
|
||||
|
||||
// RegisterAddGroup 注册时默认群组
|
||||
type RegisterAddGroup struct {
|
||||
GroupID string `gorm:"column:group_id;primary_key;type:char(64)" json:"userID"`
|
||||
CreateTime time.Time `gorm:"column:create_time" json:"createTime"`
|
||||
}
|
||||
|
||||
// ClientInitConfig 系统相关配置项
|
||||
type ClientInitConfig struct {
|
||||
DiscoverPageURL string `gorm:"column:discover_page_url;size:128" json:"discoverPageURL"`
|
||||
OrdinaryUserAddFriend int32 `gorm:"column:ordinary_user_add_friend; default:1" json:"ordinaryUserAddFriend"`
|
||||
BossUserID string `gorm:"column:boss_user_id;type:char(64)" json:"bossUserID"`
|
||||
AdminURL string `gorm:"column:admin_url;type:char(128)" json:"adminURL"`
|
||||
AllowSendMsgNotFriend int32 `gorm:"column:allow_send_msg_not_friend;default:1" json:"allowSendMsgNotFriend"`
|
||||
NeedInvitationCodeRegister int32 `gorm:"column:need_invitation_code_register;default:0" json:"needInvitationCodeRegister"`
|
||||
}
|
||||
|
||||
type Applet struct {
|
||||
ID string `gorm:"column:id;primary_key;size:64"`
|
||||
Name string `gorm:"column:name;uniqueIndex;size:64"`
|
||||
AppID string `gorm:"column:app_id;uniqueIndex;size:255"`
|
||||
Icon string `gorm:"column:icon;size:255"`
|
||||
URL string `gorm:"column:url;size:255"`
|
||||
MD5 string `gorm:"column:md5;size:255"`
|
||||
Size int64 `gorm:"column:size"`
|
||||
Version string `gorm:"column:version;size:64"`
|
||||
Priority uint32 `gorm:"column:priority;size:64"`
|
||||
Status uint8 `gorm:"column:status"`
|
||||
CreateTime time.Time `gorm:"column:create_time;autoCreateTime;size:64"`
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user