Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c343a3f62 | |||
| 60800a5ced | |||
| c52dbee98a | |||
| 4147cf53b7 | |||
| 8c55ad1f02 | |||
| 22c8cd7fdb | |||
| cdd3dbc51c | |||
| 257443e675 | |||
| 2cd01a5fa6 | |||
| 095bfa790e | |||
| e41747c662 | |||
| 73c2c44fdb | |||
| 59e3eeb0a3 | |||
| f9f604b4b9 | |||
| c60288d163 | |||
| 809c2bd55c | |||
| 60b40b3ded | |||
| 8d773a5360 | |||
| b77c5f6ac3 | |||
| 6d06ae5894 | |||
| 62f599317a | |||
| 07d01d5cc6 | |||
| 4950ccf4ec | |||
| f592a3abd7 | |||
| d9dbd739ab | |||
| 31cd19af09 | |||
| b514bd8934 | |||
| 444dc1ae6e | |||
| 0ca097db8f | |||
| a7acc8d9d2 | |||
| 37611ab0dd | |||
| f971a148c8 | |||
| 4e7f7e8605 | |||
| fb021baf52 | |||
| b131013b3f | |||
| 62141fa121 |
@@ -9,3 +9,37 @@ updates:
|
|||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
|
time: "08:00"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
|
commit-message:
|
||||||
|
prefix: "feat"
|
||||||
|
include: "scope"
|
||||||
|
groups:
|
||||||
|
gomod-deps:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
time: "08:00"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
|
commit-message:
|
||||||
|
prefix: "chore"
|
||||||
|
include: "scope"
|
||||||
|
groups:
|
||||||
|
github-actions:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
- package-ecosystem: "docker"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
time: "08:00"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
|
commit-message:
|
||||||
|
prefix: "feat"
|
||||||
|
include: "scope"
|
||||||
@@ -18,30 +18,21 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
# types:
|
# types:
|
||||||
# - closed
|
# - closed
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
pull_request_review_comment:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-pr:
|
create-pr:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event.pull_request.base.ref == 'main'
|
if: github.event.pull_request.base.ref == 'main' && github.event.pull_request.merged == true
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup GitHub CLI
|
|
||||||
run: |
|
|
||||||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
|
|
||||||
sudo apt-add-repository https://cli.github.com/packages
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install gh
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
# - name: Configure GitHub CLI
|
|
||||||
# run: |
|
|
||||||
# git config --global user.email "3293172751ysy@gmail.com"
|
|
||||||
# git config --global user.name "kubbot"
|
|
||||||
# echo "${{ secrets.BOT_GITHUB_TOKEN }}" | gh auth login --with-token
|
|
||||||
- name: Create PR to release branch
|
- name: Create PR to release branch
|
||||||
run: |
|
run: |
|
||||||
ISSUEID=$(gh pr view ${{ github.event.pull_request.number }} --repo $OWNER/$REPO | grep -oP 'Fixes #\K\d+')
|
ISSUEID=$(gh pr view ${{ github.event.pull_request.number }} --repo $OWNER/$REPO | grep -oP 'Fixes #\K\d+')
|
||||||
@@ -56,10 +47,9 @@ jobs:
|
|||||||
|
|
||||||
gh pr edit ${{ github.event.pull_request.number }} --repo $OWNER/$REPO --add-label "$LABELS" --add-assignee "$ASSIGNEES" --milestone "$MILESTONE"
|
gh pr edit ${{ github.event.pull_request.number }} --repo $OWNER/$REPO --add-label "$LABELS" --add-assignee "$ASSIGNEES" --milestone "$MILESTONE"
|
||||||
|
|
||||||
git checkout -b bot/merge-to-release-$ISSUEID
|
# git checkout -b bot/merge-to-release-$ISSUEID
|
||||||
git push origin bot/merge-to-release-$ISSUEID
|
# git push origin bot/merge-to-release-$ISSUEID
|
||||||
gh pr create --base release --head bot/merge-to-release-$ISSUEID --title "Merge main to release" --body ""
|
# gh pr create --base release --head bot/merge-to-release-$ISSUEID --title "Merge main to release" --body ""
|
||||||
|
|
||||||
# gh pr create --base main --head feat/auto-release-pr-624 --title "The bug is fixed" --body "$x" --repo OpenIMSDK/Open-IM-Server --reviewer "cubxxw"
|
# gh pr create --base main --head feat/auto-release-pr-624 --title "The bug is fixed" --body "$x" --repo OpenIMSDK/Open-IM-Server --reviewer "cubxxw"
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
@@ -67,4 +57,4 @@ jobs:
|
|||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
ISSUE: ${{ github.event.issue.html_url }}
|
ISSUE: ${{ github.event.issue.html_url }}
|
||||||
OWNER: ${{ github.repository_owner }}
|
OWNER: ${{ github.repository_owner }}
|
||||||
REPO: ${{ github.event.repository.name }}
|
REPO: ${{ github.event.repository.name }}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
name: Create Tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
pull_request_review_comment:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create_tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.event.comment.body, '/create tag')
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Validate version number and get comment
|
||||||
|
id: validate
|
||||||
|
run: |
|
||||||
|
COMMENT="${{ github.event.comment.body }}"
|
||||||
|
VERSION=$(echo $COMMENT | cut -d ' ' -f 3)
|
||||||
|
TAG_COMMENT=$(echo $COMMENT | cut -d '"' -f 2)
|
||||||
|
if [[ $VERSION =~ ^v([0-9]+\.){2}[0-9]+$ ]]; then
|
||||||
|
echo "version=$VERSION" >> $GITHUB_STATE
|
||||||
|
echo "tag_comment=$TAG_COMMENT" >> $GITHUB_STATE
|
||||||
|
else
|
||||||
|
echo "Invalid version number."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Create a new tag
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
source $GITHUB_STATE
|
||||||
|
git tag -a $VERSION -m "$tag_comment"
|
||||||
|
git push origin $VERSION
|
||||||
|
echo "tag_created=$VERSION" >> $GITHUB_OUTPUT
|
||||||
@@ -23,16 +23,20 @@ on:
|
|||||||
- v*
|
- v*
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Common versions
|
||||||
|
GO_VERSION: "1.20"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-dockerhub:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out the repo
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up QEMU
|
||||||
- name: Build OpenIM Server
|
uses: docker/setup-qemu-action@v2
|
||||||
run: |
|
- name: Set up Docker Buildx
|
||||||
sudo make build
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
# docker.io/openim/openim-server:latest
|
# docker.io/openim/openim-server:latest
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
@@ -40,6 +44,15 @@ jobs:
|
|||||||
uses: docker/metadata-action@v4.6.0
|
uses: docker/metadata-action@v4.6.0
|
||||||
with:
|
with:
|
||||||
images: openim/openim-server
|
images: openim/openim-server
|
||||||
|
# generate Docker tags based on the following events/attributes
|
||||||
|
tags: |
|
||||||
|
type=schedule
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=sha
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
@@ -51,10 +64,21 @@ jobs:
|
|||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
# linux/ppc64le,linux/s390x
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
build-aliyun:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
|
# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
id: meta2
|
id: meta2
|
||||||
@@ -73,10 +97,21 @@ jobs:
|
|||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
# linux/ppc64le,linux/s390x
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta2.outputs.tags }}
|
tags: ${{ steps.meta2.outputs.tags }}
|
||||||
labels: ${{ steps.meta2.outputs.labels }}
|
labels: ${{ steps.meta2.outputs.labels }}
|
||||||
|
|
||||||
|
build-ghcr:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
# ghcr.io/openimsdk/openim-server:latest
|
# ghcr.io/openimsdk/openim-server:latest
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
id: meta3
|
id: meta3
|
||||||
@@ -88,13 +123,15 @@ jobs:
|
|||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
# linux/ppc64le,linux/s390x
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta3.outputs.tags }}
|
tags: ${{ steps.meta3.outputs.tags }}
|
||||||
labels: ${{ steps.meta3.outputs.labels }}
|
labels: ${{ steps.meta3.outputs.labels }}
|
||||||
|
|||||||
@@ -0,0 +1,320 @@
|
|||||||
|
# Copyright © 2023 OpenIM open source community. 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.
|
||||||
|
|
||||||
|
name: Docker Buildx Images CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '30 1 * * *'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- release-*
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-ghcr:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
|
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
|
- name: Log in to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
################################################
|
||||||
|
# build/
|
||||||
|
# └── docker
|
||||||
|
# ├── openim-api
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-cmdutils
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-crontask
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-msggateway
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-msgtransfer
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-push
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-rpc-auth
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-rpc-conversation
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-rpc-friend
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-rpc-group
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-rpc-msg
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# ├── openim-rpc-third
|
||||||
|
# │ └── Dockerfile
|
||||||
|
# └── openim-rpc-user
|
||||||
|
# └── Dockerfile
|
||||||
|
#############################################
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-api
|
||||||
|
id: meta1
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-api/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta1.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta1.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-cmdutils
|
||||||
|
id: meta2
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-cmdutils/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta2.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta2.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-crontask
|
||||||
|
id: meta3
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-crontask/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta3.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta3.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-msggateway
|
||||||
|
id: meta4
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-msggateway/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta4.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta4.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-msgtransfer
|
||||||
|
id: meta5
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-msgtransfer/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta5.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta5.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-push
|
||||||
|
id: meta6
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-push/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta6.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta6.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-rpc-auth
|
||||||
|
id: meta7
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-rpc-auth/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta7.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta7.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-rpc-conversation
|
||||||
|
id: meta8
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-rpc-conversation/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta8.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta8.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-rpc-friend
|
||||||
|
id: meta9
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-rpc-friend/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta9.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta9.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-rpc-group
|
||||||
|
id: meta10
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-rpc-group/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta10.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta10.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-rpc-msg
|
||||||
|
id: meta11
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-rpc-msg/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta11.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta11.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-rpc-third
|
||||||
|
id: meta12
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-rpc-third/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta12.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta12.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker openim-rpc-user
|
||||||
|
id: meta13
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./build/docker/openim-rpc-user/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta13.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta13.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
# Copyright © 2023 OpenIM open source community. 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.
|
|
||||||
|
|
||||||
name: Build Image
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- "**.go"
|
|
||||||
- "!**_test.go"
|
|
||||||
- "build/**"
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
components: [core, swagger]
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 20
|
|
||||||
- uses: dorny/paths-filter@v2
|
|
||||||
if: ${{ !startsWith(github.ref_name, 'v') }}
|
|
||||||
id: changes
|
|
||||||
with:
|
|
||||||
filters: |
|
|
||||||
go:
|
|
||||||
- '**.go'
|
|
||||||
- 'build/core/Dockerfile'
|
|
||||||
api:
|
|
||||||
- 'openapi/**'
|
|
||||||
- 'build/swagger/build.sh'
|
|
||||||
- 'build/swagger/Dockerfile'
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
flavor: |
|
|
||||||
latest=false
|
|
||||||
images: |
|
|
||||||
${{ secrets.DOCKERHUB_USERNAME }}/openimsdk-${{ matrix.components }}
|
|
||||||
registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALIREGISTRY_NAMESPACE }}/openimsdk-${{ matrix.components }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=sha,prefix={{branch}}-,enable=${{ github.ref_type == 'branch' }}
|
|
||||||
type=ref,event=tag
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Login to Ali Container Registry
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: registry.cn-hangzhou.aliyuncs.com
|
|
||||||
username: ${{ secrets.ALIREGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.ALIREGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
- name: Condition
|
|
||||||
id: condition
|
|
||||||
run: |
|
|
||||||
echo "run=${{ startsWith(github.ref_name, 'v') || ((steps.changes.outputs.go == 'true' && (matrix.components == 'core' || matrix.components == 'job')) || (steps.changes.outputs.api == 'true' && matrix.components == 'swagger')) }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
if: ${{ steps.condition.outputs.run == 'true' }}
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
if: ${{ steps.condition.outputs.run == 'true' }}
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
- name: Build and push
|
|
||||||
if: ${{ steps.condition.outputs.run == 'true' }}
|
|
||||||
uses: docker/build-push-action@v3
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./build/${{ matrix.components }}/Dockerfile
|
|
||||||
platforms: linux/amd64
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# shamelessly copied from https://github.com/sigstore/cosign/blob/main/.github/workflows/milestone.yaml
|
||||||
|
|
||||||
|
name: milestone
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [closed]
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
milestone:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
actions: none
|
||||||
|
checks: none
|
||||||
|
contents: read
|
||||||
|
deployments: none
|
||||||
|
issues: write
|
||||||
|
packages: none
|
||||||
|
pull-requests: write
|
||||||
|
repository-projects: none
|
||||||
|
security-events: none
|
||||||
|
statuses: none
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
if (!context.payload.pull_request.merged) {
|
||||||
|
console.log('PR was not merged, skipping.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!!context.payload.pull_request.milestone) {
|
||||||
|
console.log('PR has existing milestone, skipping.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
milestones = await github.rest.issues.listMilestones({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
state: 'open',
|
||||||
|
sort: 'due_on',
|
||||||
|
direction: 'asc'
|
||||||
|
})
|
||||||
|
if (milestones.data.length === 0) {
|
||||||
|
console.log('There are no milestones, skipping.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await github.rest.issues.update({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.payload.pull_request.number,
|
||||||
|
milestone: milestones.data[0].number
|
||||||
|
});
|
||||||
@@ -90,19 +90,11 @@ jobs:
|
|||||||
echo "Run unit test and get test coverage successfully"
|
echo "Run unit test and get test coverage successfully"
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v2
|
|
||||||
with:
|
|
||||||
languages: go
|
|
||||||
|
|
||||||
- name: Build source code for host platform
|
- name: Build source code for host platform
|
||||||
run: |
|
run: |
|
||||||
sudo make build
|
sudo make build
|
||||||
echo "Build source code for host platform successfully"
|
echo "Build source code for host platform successfully"
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v2
|
|
||||||
|
|
||||||
- name: OpenIM verify copyright
|
- name: OpenIM verify copyright
|
||||||
run: |
|
run: |
|
||||||
sudo make verify-copyright
|
sudo make verify-copyright
|
||||||
|
|||||||
@@ -33,4 +33,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
project: OpenIM-V3.1
|
project: OpenIM-V3.1
|
||||||
column: In Progress
|
column: In Progress
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||||
+1
-1
@@ -114,7 +114,7 @@ linters-settings:
|
|||||||
max-blank-identifiers: 2
|
max-blank-identifiers: 2
|
||||||
dupl:
|
dupl:
|
||||||
# tokens count to trigger issue, 150 by default
|
# tokens count to trigger issue, 150 by default
|
||||||
threshold: 100
|
threshold: 200
|
||||||
errcheck:
|
errcheck:
|
||||||
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
|
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
|
||||||
# default is false: such cases aren't reported by default.
|
# default is false: such cases aren't reported by default.
|
||||||
|
|||||||
+13
-9
@@ -447,8 +447,8 @@ milestones:
|
|||||||
# Repository for the milestone
|
# Repository for the milestone
|
||||||
# Default is extracted from the origin remote URL
|
# Default is extracted from the origin remote URL
|
||||||
repo:
|
repo:
|
||||||
owner: user
|
owner: OpenIMSDK
|
||||||
name: repo
|
name: Open-IM-Server
|
||||||
|
|
||||||
# Whether to close the milestone
|
# Whether to close the milestone
|
||||||
close: true
|
close: true
|
||||||
@@ -479,6 +479,9 @@ checksum:
|
|||||||
algorithm: sha256
|
algorithm: sha256
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
|
||||||
|
prerelease: auto
|
||||||
|
|
||||||
footer: |
|
footer: |
|
||||||
|
|
||||||
## Welcome to the {{ .Tag }} release of [chat](https://github.com/OpenIMSDK/chat)!🎉🎉!
|
## Welcome to the {{ .Tag }} release of [chat](https://github.com/OpenIMSDK/chat)!🎉🎉!
|
||||||
@@ -487,18 +490,14 @@ release:
|
|||||||
|
|
||||||
## Helping out
|
## Helping out
|
||||||
|
|
||||||
We release logs are recorded on [✨ CHANGELOG](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CHANGELOG/CHANGELOG.md)--config_folder_path
|
+ We release logs are recorded on [✨CHANGELOG](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CHANGELOG/CHANGELOG.md)
|
||||||
|
|
||||||
For information on versions of OpenIM and how to maintain branches, read [📚this article](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md)
|
+ For information on versions of OpenIM and how to maintain branches, read [📚this article](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md)
|
||||||
|
|
||||||
This release is only possible thanks to **all** the support of some **awesome people**!
|
+ If you wish to use mirroring, read OpenIM's [image management policy](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md)
|
||||||
|
|
||||||
https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md
|
|
||||||
|
|
||||||
**Want to be one of them 😘?**
|
**Want to be one of them 😘?**
|
||||||
|
|
||||||
Contributions to this project are welcome! Please see [CONTRIBUTING.md](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CONTRIBUTING.md) for details.
|
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/kubbot" style="float: left; margin-right: 10px;">
|
<a href="https://github.com/kubbot" style="float: left; margin-right: 10px;">
|
||||||
<img src="https://github.com/openimbot/openimbot/blob/main/assets/icon/blue%E9%80%8F%E6%98%8E.png" width="50" height="50" />
|
<img src="https://github.com/openimbot/openimbot/blob/main/assets/icon/blue%E9%80%8F%E6%98%8E.png" width="50" height="50" />
|
||||||
@@ -511,6 +510,11 @@ release:
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
> @openimbot and @kubbot have made great contributions to the community as community 🤖robots(@openimsdk/bot), respectively.
|
||||||
|
> Thanks to the @openimsdk/openim team for all their hard work on this release.
|
||||||
|
> Thank you to all the [💕developers and contributors](https://github.com/OpenIMSDK/Open-IM-Server/graphs/contributors), people from all over the world, OpenIM brings us together
|
||||||
|
> Contributions to this project are welcome! Please see [CONTRIBUTING.md](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CONTRIBUTING.md) for details.
|
||||||
|
|
||||||
## Get Involved with OpenIM!
|
## Get Involved with OpenIM!
|
||||||
|
|
||||||
|
|||||||
+12
-16
@@ -1,10 +1,6 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM golang:1.20 AS builder
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
LABEL org.opencontainers.image.source=https://github.com/OpenIMSDK/Open-IM-Server
|
|
||||||
LABEL org.opencontainers.image.description="OpenIM Server image"
|
|
||||||
LABEL org.opencontainers.image.licenses="Apache 2.0"
|
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
ARG GO111MODULE=on
|
ARG GO111MODULE=on
|
||||||
ARG GOPROXY=https://goproxy.cn,direct
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
@@ -12,26 +8,26 @@ ENV GO111MODULE=$GO111MODULE
|
|||||||
ENV GOPROXY=$GOPROXY
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
# Set up the working directory
|
# Set up the working directory
|
||||||
WORKDIR /Open-IM-Server
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
# Copy all files to the container
|
# Copy all files to the container
|
||||||
ADD . .
|
ADD . .
|
||||||
|
|
||||||
|
RUN /bin/sh -c "make clean"
|
||||||
RUN /bin/sh -c "make build"
|
RUN /bin/sh -c "make build"
|
||||||
|
|
||||||
# Production Stage
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
FROM alpine
|
|
||||||
|
|
||||||
RUN echo "https://mirrors.aliyun.com/alpine/v3.4/main" > /etc/apk/repositories && \
|
WORKDIR ${SERVER_WORKDIR}
|
||||||
apk --no-cache add tzdata ca-certificates bash
|
|
||||||
|
|
||||||
# Set directory to map logs, config files, scripts, and SDK
|
|
||||||
VOLUME ["/Open-IM-Server/logs", "/Open-IM-Server/config", "/Open-IM-Server/scripts", "/Open-IM-Server/db/sdk"]
|
|
||||||
|
|
||||||
# Copy scripts and binary files to the production image
|
# Copy scripts and binary files to the production image
|
||||||
COPY --from=builder /Open-IM-Server/scripts /Open-IM-Server/scripts
|
COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts
|
||||||
COPY --from=builder /Open-IM-Server/_output/bin/platforms/linux/amd64 /Open-IM-Server/_output/bin/platforms/linux/amd64
|
COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config
|
||||||
|
COPY --from=builder ${SERVER_WORKDIR}/_output/bin/platforms /openim/openim-server/_output/bin/platforms
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/scripts
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config","/openim/openim-server/scripts"]
|
||||||
|
|
||||||
CMD ["./docker_start_all.sh"]
|
CMD ["bash","-c","${OPENIM_SERVER_CMDDIR}/docker_start_all.sh"]
|
||||||
@@ -89,9 +89,12 @@ make check
|
|||||||
### Compile from source
|
### Compile from source
|
||||||
|
|
||||||
Ur need `Go 1.18` or higher version, and `make`.
|
Ur need `Go 1.18` or higher version, and `make`.
|
||||||
|
|
||||||
|
Version Details: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# choose what you need
|
# choose what you need
|
||||||
BRANCH=release-v3.0
|
BRANCH=release-v3.1
|
||||||
git clone -b $BRANCH https://github.com/OpenIMSDK/Open-IM-Server openim && export openim=$(pwd)/openim && cd $openim && make build
|
git clone -b $BRANCH https://github.com/OpenIMSDK/Open-IM-Server openim && export openim=$(pwd)/openim && cd $openim && make build
|
||||||
```
|
```
|
||||||
Read about the [OpenIM Version Policy](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md)
|
Read about the [OpenIM Version Policy](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md)
|
||||||
|
|||||||
@@ -1,12 +1,32 @@
|
|||||||
FROM golang:1.20.0 as build
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
WORKDIR /openim
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
FROM golang:1.20 AS builder
|
||||||
echo "Asia/Shanghai" > /etc/timezone && \
|
|
||||||
mkdir -p /var/log/miniblog
|
|
||||||
|
|
||||||
COPY miniblog /openim
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
EXPOSE 10002
|
WORKDIR /openim/openim-server
|
||||||
CMD ["./bin/openim-api","--port", "10002"]
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
RUN make build BINS=openim-api
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
EXPOSE ${10002}
|
||||||
|
|
||||||
|
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-api --port 10002 -c ${SERVER_WORKDIR}/config"]
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN go mod download
|
||||||
|
RUN make clean
|
||||||
|
RUN make build BINS=openim-cmdutils
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
COPY --from=builder ${SERVER_WORKDIR}/_output/bin/platforms /openim/openim-server/_output/bin/platforms
|
||||||
|
COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config
|
||||||
|
|
||||||
|
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-cmdutils"]
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
RUN make build BINS=openim-crontask
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-crontask"]
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
RUN make build BINS=openim-msggateway
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
ENV OS ${OS}
|
||||||
|
ENV ARCH ${ARCH}
|
||||||
|
|
||||||
|
EXPOSE 10140
|
||||||
|
EXPOSE 10001
|
||||||
|
|
||||||
|
CMD ${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-msggateway --port 10140 --ws_port 10001
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
RUN make build BINS=openim-msgtransfer
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
ENV OS ${OS}
|
||||||
|
ENV ARCH ${ARCH}
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
CMD ${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-msgtransfer
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
RUN make build BINS=openim-push
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV OS ${OS}
|
||||||
|
ENV ARCH ${ARCH}
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
EXPOSE 10170
|
||||||
|
|
||||||
|
CMD ${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-push --port 10170
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
|
||||||
|
# RUN make build BINS=openim-rpc
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth ./cmd/openim-rpc/openim-rpc-auth
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV OS ${OS}
|
||||||
|
ENV ARCH ${ARCH}
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms/
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
EXPOSE 10160
|
||||||
|
|
||||||
|
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-rpc-auth --port 10160 -c ${SERVER_WORKDIR}/config"]
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
|
||||||
|
RUN make build BINS=openim-rpc
|
||||||
|
# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation ./cmd/openim-rpc/openim-rpc-conversation
|
||||||
|
|
||||||
|
RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV OS ${OS}
|
||||||
|
ENV ARCH ${ARCH}
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms/
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
EXPOSE 10230
|
||||||
|
EXPOSE 20230
|
||||||
|
|
||||||
|
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-rpc-conversation --port 10230 --prometheus_port 20230 -c ${SERVER_WORKDIR}/config"]
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
|
||||||
|
RUN make build BINS=openim-rpc
|
||||||
|
# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend ./cmd/openim-rpc/openim-rpc-friend
|
||||||
|
|
||||||
|
RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV OS ${OS}
|
||||||
|
ENV ARCH ${ARCH}
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms/
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
EXPOSE 10120
|
||||||
|
EXPOSE 20120
|
||||||
|
|
||||||
|
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-rpc-friend --port 10120 --prometheus_port 20120 -c ${SERVER_WORKDIR}/config"]
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
|
||||||
|
RUN make build BINS=openim-rpc
|
||||||
|
# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group ./cmd/openim-rpc/openim-rpc-group
|
||||||
|
|
||||||
|
RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV OS ${OS}
|
||||||
|
ENV ARCH ${ARCH}
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms/
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
EXPOSE 10150
|
||||||
|
EXPOSE 20150
|
||||||
|
|
||||||
|
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-rpc-group --port 10150 --prometheus_port 20150 -c ${SERVER_WORKDIR}/config"]
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
|
||||||
|
RUN make build BINS=openim-rpc
|
||||||
|
# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg ./cmd/openim-rpc/openim-rpc-msg
|
||||||
|
|
||||||
|
RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV OS ${OS}
|
||||||
|
ENV ARCH ${ARCH}
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms/
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
EXPOSE 10130
|
||||||
|
EXPOSE 20130
|
||||||
|
|
||||||
|
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-rpc-msg --port 10130 --prometheus_port 20130 -c ${SERVER_WORKDIR}/config"]
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
|
||||||
|
RUN make build BINS=openim-rpc
|
||||||
|
# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third ./cmd/openim-rpc/openim-rpc-third
|
||||||
|
|
||||||
|
RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV OS ${OS}
|
||||||
|
ENV ARCH ${ARCH}
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms/
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
EXPOSE 10200
|
||||||
|
|
||||||
|
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-rpc-third --port 10200 -c ${SERVER_WORKDIR}/config"]
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
|
# Set go mod installation source and proxy
|
||||||
|
|
||||||
|
FROM golang:1.20 AS builder
|
||||||
|
|
||||||
|
ARG GO111MODULE=on
|
||||||
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV GO111MODULE=$GO111MODULE
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN make clean
|
||||||
|
|
||||||
|
RUN make build BINS=openim-rpc
|
||||||
|
# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user ./cmd/openim-rpc/openim-rpc-user
|
||||||
|
|
||||||
|
RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation && \
|
||||||
|
rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth
|
||||||
|
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
ENV OS ${OS}
|
||||||
|
ENV ARCH ${ARCH}
|
||||||
|
|
||||||
|
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms/
|
||||||
|
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
|
||||||
|
|
||||||
|
EXPOSE 10110
|
||||||
|
|
||||||
|
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-rpc-user --port 10110 -c ${SERVER_WORKDIR}/config"]
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-api
|
|
||||||
BIN_DIR=../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-api ./
|
COPY ./openim-api ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-api","--port", "10002"]
|
CMD ["./openim-api","--port", "10002"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-cmdutils
|
|
||||||
BIN_DIR=../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-crontask
|
|
||||||
BIN_DIR=../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-crontask ./
|
COPY ./openim-crontask ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-crontask"]
|
CMD ["./openim-crontask"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-rpc-msg_gateway
|
|
||||||
BIN_DIR=../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-rpc-msg_gateway ./
|
COPY ./openim-rpc-msg_gateway ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-rpc-msg_gateway","--port", "10140" "--ws_port", "10001", "--prometheus_port", "20240"]
|
CMD ["./openim-rpc-msg_gateway","--port", "10140" "--ws_port", "10001", "--prometheus_port", "20240"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-msgtransfer
|
|
||||||
BIN_DIR=../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-msgtransfer ./
|
COPY ./openim-msgtransfer ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-msgtransfer","--prometheus_port", "21400"]
|
CMD ["./openim-msgtransfer","--prometheus_port", "21400"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-push
|
|
||||||
BIN_DIR=../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-push ./
|
COPY ./openim-push ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-push", "--port", "10170", "--prometheus_port", "20170"]
|
CMD ["./openim-push", "--port", "10170", "--prometheus_port", "20170"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-rpc-auth
|
|
||||||
BIN_DIR=../../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-rpc-auth ./
|
COPY ./openim-rpc-auth ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-rpc-auth", "--port", "10160"]
|
CMD ["./openim-rpc-auth", "--port", "10160"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-rpc-conversation
|
|
||||||
BIN_DIR=../../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-rpc-conversation ./
|
COPY ./openim-rpc-conversation ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-rpc-conversation", "--port", "10230", "--prometheus_port","20230"]
|
CMD ["./openim-rpc-conversation", "--port", "10230", "--prometheus_port","20230"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-rpc-friend
|
|
||||||
BIN_DIR=../../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-rpc-friend ./
|
COPY ./openim-rpc-friend ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-rpc-friend", "--port", "10120", "--prometheus_port","20120"]
|
CMD ["./openim-rpc-friend", "--port", "10120", "--prometheus_port","20120"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-rpc-group
|
|
||||||
BIN_DIR=../../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-rpc-group ./
|
COPY ./openim-rpc-group ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-rpc-group", "--port", "10150", "--prometheus_port","20150"]
|
CMD ["./openim-rpc-group", "--port", "10150", "--prometheus_port","20150"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-rpc-msg
|
|
||||||
BIN_DIR=../../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-rpc-msg ./
|
COPY ./openim-rpc-msg ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-rpc-msg", "--port", "10130", "--prometheus_port","20130"]
|
CMD ["./openim-rpc-msg", "--port", "10130", "--prometheus_port","20130"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-rpc-third
|
|
||||||
BIN_DIR=../../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-rpc-third ./
|
COPY ./openim-rpc-third ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-rpc-third", "--port", "10200"]
|
CMD ["./openim-rpc-third", "--port", "10200"]
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
.PHONY: all build run gotool install clean help
|
|
||||||
|
|
||||||
NAME=openim-rpc-user
|
|
||||||
BIN_DIR=../../../bin/
|
|
||||||
|
|
||||||
OS:= $(or $(os),linux)
|
|
||||||
ARCH:=$(or $(arch),amd64)
|
|
||||||
all: gotool build
|
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}.exe
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BINARY_NAME=${NAME}
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run ./
|
|
||||||
|
|
||||||
gotool:
|
|
||||||
go fmt ./
|
|
||||||
go vet ./
|
|
||||||
|
|
||||||
install:build
|
|
||||||
mv ${BINARY_NAME} ${BIN_DIR}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/bin
|
WORKDIR /openim/openim-server/bin
|
||||||
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
&&apt-get install net-tools
|
&&apt-get install net-tools
|
||||||
@@ -27,6 +27,6 @@ RUN apt-get -qq update \
|
|||||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||||
COPY ./openim-rpc-user ./
|
COPY ./openim-rpc-user ./
|
||||||
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
VOLUME ["/openim/openim-server/logs","/openim/openim-server/config"]
|
||||||
|
|
||||||
CMD ["./openim-rpc-user", "--port", "10110"]
|
CMD ["./openim-rpc-user", "--port", "10110"]
|
||||||
|
|||||||
+88
-110
@@ -1,41 +1,37 @@
|
|||||||
upstream im_msg_gateway{
|
upstream im_msg_gateway{
|
||||||
server 127.0.0.1:10001; #IM消息服务器地址 根据部署情况可指定多台
|
server 127.0.0.1:10001; #IM Message server address Multiple can be specified according to the deployment
|
||||||
}
|
}
|
||||||
upstream im_api{
|
upstream im_api{
|
||||||
server 127.0.0.1:10002; #IM群组用户api服务器地址 根据部署情况可指定多台
|
server 127.0.0.1:10002; #IM Group user api server address Multiple can be specified according to the deployment
|
||||||
}
|
|
||||||
upstream im_jssdk_gateway{
|
|
||||||
server 127.0.0.1:10003; #IM jssdk服务器地址 根据部署情况可指定多台
|
|
||||||
}
|
|
||||||
upstream storage {
|
|
||||||
server 127.0.0.1:10005; #MinIO服务器地址 暂时支持1台
|
|
||||||
}
|
|
||||||
upstream im_admin{
|
|
||||||
server 127.0.0.1:10006; #IM admin服务器地址 根据部署情况可指定多台
|
|
||||||
}
|
}
|
||||||
upstream im_grafana{
|
upstream im_grafana{
|
||||||
server 127.0.0.1:10007; #IM 统计服务器地址 docker-compose启动所在机器
|
server 127.0.0.1:10007; #IM Statistical server address The machine where docker-compose starts
|
||||||
}
|
}
|
||||||
upstream im_chat{
|
upstream im_chat_api{
|
||||||
server 127.0.0.1:10008; #IM 商业版登录注册服务器地址 根据部署情况可指定多台
|
server 127.0.0.1:10008; #IM Business version login registration server address Multiple can be specified according to the deployment
|
||||||
}
|
}
|
||||||
upstream im_complete_admin{
|
upstream im_admin_api{
|
||||||
server 127.0.0.1:10009; #IM 商业版admin地址 根据部署情况可指定多台
|
server 127.0.0.1:10009; #IM The admin address of the commercial version can specify multiple units according to the deployment situation
|
||||||
}
|
|
||||||
upstream im_organization{
|
|
||||||
server 127.0.0.1:10010; #IM 商业版组织架构服务器地址 根据部署情况可指定多台
|
|
||||||
}
|
}
|
||||||
upstream im_open_rtc{
|
upstream im_open_rtc{
|
||||||
server 127.0.0.1:7880; #rtc 音视频通话 服务器地址 根据部署情况可指定多台
|
server 127.0.0.1:7880; #rtc Audio and video call server address Multiple devices can be specified according to the deployment
|
||||||
}
|
}
|
||||||
|
upstream minio_s3_2 {
|
||||||
|
least_conn;
|
||||||
|
server 127.0.0.1:10005;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream minio_console_2 {
|
||||||
|
least_conn;
|
||||||
|
server 127.0.0.1:9090;
|
||||||
|
}
|
||||||
server {
|
server {
|
||||||
listen 443;
|
listen 443;
|
||||||
server_name web.rentsoft.cn; #1 web im 端 域名
|
server_name your-domain.com; #your-domain.com
|
||||||
|
|
||||||
ssl on;
|
ssl on;
|
||||||
ssl_certificate /etc/nginx/conf.d/ssl/web.rentsoft.cn.crt; #2 证书
|
ssl_certificate /etc/nginx/conf.d/ssl/your-domain.com.crt; #2 Certificate
|
||||||
ssl_certificate_key /etc/nginx/conf.d/ssl/web.rentsoft.cn.key; #3 证书
|
ssl_certificate_key /etc/nginx/conf.d/ssl/your-domain.com.key; #3 Certificate
|
||||||
ssl_session_timeout 5m;
|
ssl_session_timeout 5m;
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_min_length 1k;
|
gzip_min_length 1k;
|
||||||
@@ -52,7 +48,7 @@ server {
|
|||||||
proxy_set_header X-Real-Ip $remote_addr;
|
proxy_set_header X-Real-Ip $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header X-NginX-Proxy true;
|
proxy_set_header X-NginX-Proxy true;
|
||||||
root /data1/online/Pc-Web-Demo/build/; # web im静态资源存放路径
|
root /data1/online/Pc-Web-Demo/build/; # web im static resource storage path
|
||||||
index index.html;
|
index index.html;
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
@@ -72,22 +68,6 @@ server {
|
|||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_pass http://im_api/;
|
proxy_pass http://im_api/;
|
||||||
}
|
}
|
||||||
location /jssdk_gateway { #10003 jssdk
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "Upgrade";
|
|
||||||
proxy_set_header X-real-ip $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_pass http://im_jssdk_gateway/;
|
|
||||||
}
|
|
||||||
location ^~/admin/ { #10006 admin
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "Upgrade";
|
|
||||||
proxy_set_header X-real-ip $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_pass http://im_admin/;
|
|
||||||
}
|
|
||||||
location ^~/grafana/ { #10007 prometheus
|
location ^~/grafana/ { #10007 prometheus
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
@@ -96,29 +76,21 @@ server {
|
|||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_pass http://im_grafana/;
|
proxy_pass http://im_grafana/;
|
||||||
}
|
}
|
||||||
location ^~/chat/ { #10008 chat login
|
location ^~/chat/ { #10008 im_chat_api
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "Upgrade";
|
proxy_set_header Connection "Upgrade";
|
||||||
proxy_set_header X-real-ip $remote_addr;
|
proxy_set_header X-real-ip $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_pass http://im_chat/;
|
proxy_pass http://im_chat_api/;
|
||||||
}
|
}
|
||||||
location ^~/complete_admin/ { #10009 admin
|
location ^~/complete_admin/ { #10009 admin
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "Upgrade";
|
proxy_set_header Connection "Upgrade";
|
||||||
proxy_set_header X-real-ip $remote_addr;
|
proxy_set_header X-real-ip $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_pass http://im_complete_admin/;
|
proxy_pass http://im_admin_api/;
|
||||||
}
|
|
||||||
location ^~/organization/ { #10010 organization
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "Upgrade";
|
|
||||||
proxy_set_header X-real-ip $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_pass http://im_organization/;
|
|
||||||
}
|
}
|
||||||
location ^~/open_rtc/ { #7880 rtc
|
location ^~/open_rtc/ { #7880 rtc
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
@@ -132,63 +104,69 @@ server {
|
|||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name web.rentsoft.cn ; #1 web im 端 域名
|
server_name test-web.rentsoft.cn ; #1 web im end domain name
|
||||||
rewrite ^(.*)$ https://${server_name}$1 permanent;
|
rewrite ^(.*)$ https://${server_name}$1 permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
ssl_session_timeout 5m;
|
listen 443;
|
||||||
listen 443;
|
|
||||||
server_name storage.rentsoft.cn; #1 MinIO存储域名
|
server_name your-domain.com; #your-domain.com
|
||||||
ssl on;
|
ssl on;
|
||||||
ssl_certificate /etc/nginx/conf.d/ssl/storage.rentsoft.cn.crt; #证书
|
ssl_certificate /etc/nginx/conf.d/ssl/your-domain.com.crt; #Certificate
|
||||||
ssl_certificate_key /etc/nginx/conf.d/ssl/storage.rentsoft.cn.key; #证书
|
ssl_certificate_key /etc/nginx/conf.d/ssl/your-domain.com.key; #Certificate
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_min_length 1k;
|
gzip_min_length 1k;
|
||||||
gzip_buffers 4 16k;
|
gzip_buffers 4 16k;
|
||||||
gzip_comp_level 2;
|
gzip_comp_level 2;
|
||||||
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
|
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/wasm;
|
||||||
gzip_vary off;
|
gzip_vary off;
|
||||||
gzip_disable "MSIE [1-6]\.";
|
gzip_disable "MSIE [1-6]\.";
|
||||||
|
# Allow special characters in headers
|
||||||
|
ignore_invalid_headers off;
|
||||||
|
# Allow any size file to be uploaded.
|
||||||
|
# Set to a value such as 1000m; to restrict file size to a specific value
|
||||||
|
client_max_body_size 0;
|
||||||
|
# Disable buffering
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_request_buffering off;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://storage;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_http_version 1.1;
|
proxy_connect_timeout 300;
|
||||||
client_max_body_size 8000M;
|
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Connection "";
|
||||||
|
chunked_transfer_encoding off;
|
||||||
|
|
||||||
|
proxy_pass http://minio_s3_2; # This uses the upstream directive definition to load balance
|
||||||
|
}
|
||||||
|
|
||||||
|
location /minio/ui {
|
||||||
|
rewrite ^/minio/ui/(.*) /$1 break;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-NginX-Proxy true;
|
||||||
|
|
||||||
|
# This is necessary to pass the correct IP to be hashed
|
||||||
|
real_ip_header X-Real-IP;
|
||||||
|
|
||||||
|
proxy_connect_timeout 300;
|
||||||
|
|
||||||
|
# To support websockets in MinIO versions released after January 2023
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
|
chunked_transfer_encoding off;
|
||||||
|
|
||||||
|
proxy_pass http://minio_console_2; # This uses the upstream directive definition to load balance
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443;
|
|
||||||
server_name admin.rentsoft.cn; #后台管理域名
|
|
||||||
ssl on;
|
|
||||||
ssl_certificate /etc/nginx/conf.d/ssl/admin.rentsoft.cn.crt; # 证书
|
|
||||||
ssl_certificate_key /etc/nginx/conf.d/ssl/admin.rentsoft.cn.key; #证书
|
|
||||||
ssl_session_timeout 5m;
|
|
||||||
gzip on;
|
|
||||||
gzip_min_length 1k;
|
|
||||||
gzip_buffers 4 16k;
|
|
||||||
gzip_comp_level 2;
|
|
||||||
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
|
|
||||||
gzip_vary off;
|
|
||||||
gzip_disable "MSIE [1-6]\.";
|
|
||||||
location / {
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-Ip $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header X-NginX-Proxy true;
|
|
||||||
root /data1/online/Open-IM-Admin/dist/; #管理后台web静态资源存放路径
|
|
||||||
index index.html;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name admin.rentsoft.cn; #管理后台 域名
|
|
||||||
rewrite ^(.*)$ https://${server_name}$1 permanent;
|
|
||||||
}
|
|
||||||
|
|||||||
+11
-9
@@ -100,14 +100,12 @@ services:
|
|||||||
|
|
||||||
|
|
||||||
openim_server:
|
openim_server:
|
||||||
image: ghcr.io/openimsdk/openim-server:latest
|
image: ghcr.io/openim-sigs/openim-server:v1.0.0-debug.11 #ghcr.io/openimsdk/openim-server:main
|
||||||
container_name: openim-server
|
container_name: openim-server
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs:/Open-IM-Server/logs
|
- ./_output/openim/openim-server/logs:/openim/openim-server/logs
|
||||||
- ./config/config.yaml:/Open-IM-Server/config/config.yaml
|
- ./_output/openim/openim-server/config:/openim/openim-server/config
|
||||||
- ./config/notification.yaml:/Open-IM-Server/config/notification.yaml
|
- ./_output/openim/openim-server/scripts:/openim/openim-server/scripts
|
||||||
- ${DATA_DIR}/db/sdk:/Open-IM-Server/db/sdk
|
|
||||||
- ./scripts:/Open-IM-Server/scripts
|
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
- zookeeper
|
- zookeeper
|
||||||
@@ -123,9 +121,13 @@ services:
|
|||||||
max-size: "1g"
|
max-size: "1g"
|
||||||
max-file: "2"
|
max-file: "2"
|
||||||
|
|
||||||
openim_chat:
|
openim-chat:
|
||||||
image: ghcr.io/openimsdk/openim-chat:latest
|
image: ghcr.io/openim-sigs/openim-chat:v1.0.0-debug.11 # ghcr.io/openimsdk/openim-chat:main
|
||||||
container_name: openim_chat
|
container_name: openim-chat
|
||||||
|
volumes:
|
||||||
|
- ./_output/openim/openim-chat/logs:/openim/openim-chat/logs
|
||||||
|
- ./_output/openim/openim-chat/config:/openim/openim-chat/config
|
||||||
|
- ./_output/openim/openim-chat/scripts:/openim/openim-chat/scripts
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
|||||||
@@ -54,22 +54,19 @@ When pulling OpenIM's Docker images, you can choose the most suitable source bas
|
|||||||
|
|
||||||
- Pull from GitHub:
|
- Pull from GitHub:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
bashCopy code
|
|
||||||
docker pull ghcr.io/openimsdk/openim-server:latest
|
docker pull ghcr.io/openimsdk/openim-server:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
- Pull from Alibaba Cloud:
|
- Pull from Alibaba Cloud:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
bashCopy code
|
|
||||||
docker pull registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
|
docker pull registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
- Pull from Docker Hub:
|
- Pull from Docker Hub:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
bashCopy code
|
|
||||||
docker pull docker.io/openim/openim-server:latest
|
docker pull docker.io/openim/openim-server:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -77,22 +74,19 @@ When pulling OpenIM's Docker images, you can choose the most suitable source bas
|
|||||||
|
|
||||||
- Pull from GitHub:
|
- Pull from GitHub:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
bashCopy code
|
|
||||||
docker pull ghcr.io/openimsdk/openim-chat:latest
|
docker pull ghcr.io/openimsdk/openim-chat:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
- Pull from Alibaba Cloud:
|
- Pull from Alibaba Cloud:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
bashCopy code
|
|
||||||
docker pull registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat:latest
|
docker pull registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
- Pull from Docker Hub:
|
- Pull from Docker Hub:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
bashCopy code
|
|
||||||
docker pull docker.io/openim/openim-chat:latest
|
docker pull docker.io/openim/openim-chat:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -6,21 +6,36 @@ OpenIM, the open source project, employs a comprehensive version management syst
|
|||||||
|
|
||||||
## Main Branch
|
## Main Branch
|
||||||
|
|
||||||
The `main` branch is where all the latest code resides. It's the hub of activity, embodying all the cutting-edge features that are currently being developed or updated. However, since it's subject to frequent changes and updates, it may not always represent the most stable version of the software. Access the `main` branch [here](https://github.com/openimsdk/openim-server/tree/main).
|
The `main` branch is where all the latest code resides. It's the hub of activity, embodying all the cutting-edge features that are currently being developed or updated. However, since it's subject to frequent changes and updates, it may not always represent the most stable version of the software. Access the `main` branch [here](https://github.com/OpenIMSDK/Open-IM-Server/tree/main).
|
||||||
|
|
||||||
## Release Branch
|
## Release Branch
|
||||||
|
|
||||||
On the other hand, we have the `release` branch. For instance, in the context of version 3.1, we maintain a `release-v3.1` branch. Unlike the `main` branch, the release branch is designed to be a continuously stable and updated version of the software. This provides a reliable option for users who prefer stability over the latest, but potentially unstable, features. Access the `release-v3.1` branch [here](https://github.com/openimsdk/openim-server/tree/release-v3.1).
|
On the other hand, we have the `release` branch. For instance, in the context of version 3.1, we maintain a `release-v3.1` branch. Unlike the `main` branch, the release branch is designed to be a continuously stable and updated version of the software. This provides a reliable option for users who prefer stability over the latest, but potentially unstable, features. Access the `release-v3.1` branch [here](https://github.com/OpenIMSDK/Open-IM-Server/tree/release-v3.1).
|
||||||
|
|
||||||
## Tag Management
|
## Tag Management
|
||||||
|
|
||||||
Finally, there's `tag` management. Despite having both `main` and `release` branches, `tag` serves a crucial role. Tags are immutable, i.e., they remain unchanged once created. Therefore, if you need a specific version of the software, you can use the corresponding tag. Check out the available tags [here](https://github.com/openimsdk/openim-server/tags).
|
In addition to the `main` and `release` branches, `tag` also plays a pivotal role in version control. Tags are immutable, meaning once they're created, they remain unchanged. Therefore, if you need a specific version of the software, you can use the corresponding tag. All of our available tags can be viewed [here](https://github.com/OpenIMSDK/Open-IM-Server/tags).
|
||||||
|
|
||||||
Moreover, our Docker image versions are closely tied with these three components. For instance, a tag might correspond to the Docker image `ghcr.io/openimsdk/openim-server:v3.1.0`, a release would be `ghcr.io/openimsdk/openim-server:release-v3.0`, and the main branch might be represented as `ghcr.io/openimsdk/openim-server:main` or `ghcr.io/openimsdk/openim-server:latest`.
|
Moreover, our Docker image versions are closely tied with these three components. For example, a tag might correspond to the Docker image `ghcr.io/openimsdk/openim-server:v3.1.0`, a release might be represented as `ghcr.io/openimsdk/openim-server:release-v3.0`, and the main branch could be represented as `ghcr.io/openimsdk/openim-server:main` or `ghcr.io/openimsdk/openim-server:latest`.
|
||||||
|
|
||||||
To find out more, or to contribute to our project, please visit our GitHub repository at [OpenIM Server](https://github.com/openimsdk/openim-server).
|
Here is the specification of our version numbers:
|
||||||
|
|
||||||
We believe that this approach offers a balanced blend of innovation and stability, enabling us to provide the best possible software to our users.
|
- **Revision version number**: The third digit of the version number, representing bug fixes or code optimizations, usually no new features are added and it is backward compatible with older versions.
|
||||||
|
|
||||||
|
- **Build version number**: Usually automatically generated by the system, every code submission will result in an automatic increment by 1.
|
||||||
|
|
||||||
|
- Version modifiers
|
||||||
|
|
||||||
|
: These can represent the development stage and stability of the software. Common ones include:
|
||||||
|
|
||||||
|
- `alpha`: An internal testing version with many bugs, generally used for communication among developers.
|
||||||
|
- `beta`: A test version with many bugs, generally used for testing by eager community members, who provide feedback to the developers.
|
||||||
|
- `rc`: Release candidate, to be released as the official version, it's the last test version before the official version.
|
||||||
|
- `ga`: General Availability, the first stable release.
|
||||||
|
- `r/release/or nothing`: The final release version, intended for general users.
|
||||||
|
- `lts`: Long Term Support, the official will specify the maintenance year for this version and will fix all bugs found in this version.
|
||||||
|
|
||||||
|
When adding partial functions to the project, the minor version number increases by 1, and the revision version number resets to 0. When there are major changes in the project, the major version number increases by 1. The build number is generally automatically generated by the compiler during the compilation process, only the format needs to be defined, and it does not need to be manually controlled.
|
||||||
|
|
||||||
## OpenIM version
|
## OpenIM version
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ require (
|
|||||||
github.com/bwmarrin/snowflake v0.3.0 // indirect
|
github.com/bwmarrin/snowflake v0.3.0 // indirect
|
||||||
github.com/dtm-labs/rockscache v0.1.1
|
github.com/dtm-labs/rockscache v0.1.1
|
||||||
github.com/gin-gonic/gin v1.9.1
|
github.com/gin-gonic/gin v1.9.1
|
||||||
github.com/go-playground/validator/v10 v10.14.0
|
github.com/go-playground/validator/v10 v10.14.1
|
||||||
github.com/gogo/protobuf v1.3.2
|
github.com/gogo/protobuf v1.3.2
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.0
|
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||||
github.com/golang/protobuf v1.5.3
|
github.com/golang/protobuf v1.5.3
|
||||||
github.com/gorilla/websocket v1.4.2
|
github.com/gorilla/websocket v1.5.0
|
||||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
|
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
|
||||||
github.com/jinzhu/copier v0.3.5
|
github.com/jinzhu/copier v0.3.5
|
||||||
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
|
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
|
||||||
@@ -23,11 +23,11 @@ require (
|
|||||||
github.com/prometheus/client_golang v1.16.0
|
github.com/prometheus/client_golang v1.16.0
|
||||||
github.com/robfig/cron/v3 v3.0.1
|
github.com/robfig/cron/v3 v3.0.1
|
||||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||||
github.com/stretchr/testify v1.8.3
|
github.com/stretchr/testify v1.8.4
|
||||||
go.mongodb.org/mongo-driver v1.12.0
|
go.mongodb.org/mongo-driver v1.12.0
|
||||||
golang.org/x/image v0.9.0 // indirect
|
golang.org/x/image v0.9.0 // indirect
|
||||||
google.golang.org/api v0.134.0
|
google.golang.org/api v0.134.0
|
||||||
google.golang.org/grpc v1.56.2
|
google.golang.org/grpc v1.57.0
|
||||||
google.golang.org/protobuf v1.31.0
|
google.golang.org/protobuf v1.31.0
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
gorm.io/driver/mysql v1.5.1
|
gorm.io/driver/mysql v1.5.1
|
||||||
@@ -38,7 +38,7 @@ require github.com/google/uuid v1.3.0
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/OpenIMSDK/protocol v0.0.3
|
github.com/OpenIMSDK/protocol v0.0.3
|
||||||
github.com/OpenIMSDK/tools v0.0.5
|
github.com/OpenIMSDK/tools v0.0.13
|
||||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
|
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
|
||||||
github.com/go-redis/redis v6.15.9+incompatible
|
github.com/go-redis/redis v6.15.9+incompatible
|
||||||
github.com/go-sql-driver/mysql v1.7.1
|
github.com/go-sql-driver/mysql v1.7.1
|
||||||
@@ -77,7 +77,7 @@ require (
|
|||||||
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
|
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
|
||||||
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
|
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
|
||||||
github.com/hashicorp/go-uuid v1.0.2 // indirect
|
github.com/hashicorp/go-uuid v1.0.2 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
||||||
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
||||||
github.com/jcmturner/gofork v1.0.0 // indirect
|
github.com/jcmturner/gofork v1.0.0 // indirect
|
||||||
@@ -134,7 +134,7 @@ require (
|
|||||||
github.com/goccy/go-json v0.10.2 // indirect
|
github.com/goccy/go-json v0.10.2 // indirect
|
||||||
github.com/lestrrat-go/strftime v1.0.6 // indirect
|
github.com/lestrrat-go/strftime v1.0.6 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||||
github.com/spf13/cobra v1.6.1
|
github.com/spf13/cobra v1.7.0
|
||||||
github.com/ugorji/go/codec v1.2.11 // indirect
|
github.com/ugorji/go/codec v1.2.11 // indirect
|
||||||
go.uber.org/zap v1.24.0 // indirect
|
go.uber.org/zap v1.24.0 // indirect
|
||||||
golang.org/x/crypto v0.11.0 // indirect
|
golang.org/x/crypto v0.11.0 // indirect
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIw
|
|||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/OpenIMSDK/protocol v0.0.3 h1:CFQtmnyW+1dYKVFaVaHcJ6oYuMiMdNfU2gC1xz3K/9I=
|
github.com/OpenIMSDK/protocol v0.0.3 h1:CFQtmnyW+1dYKVFaVaHcJ6oYuMiMdNfU2gC1xz3K/9I=
|
||||||
github.com/OpenIMSDK/protocol v0.0.3/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
|
github.com/OpenIMSDK/protocol v0.0.3/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
|
||||||
github.com/OpenIMSDK/tools v0.0.5 h1:yBVHJ3EpIDcp8VFKPjuGr6MQvFa3t4JByZ+vmeC06/Q=
|
github.com/OpenIMSDK/tools v0.0.13 h1:rcw4HS8S2DPZR9UOBxD8/ol9UBMzXBypzOVEytDRIMo=
|
||||||
github.com/OpenIMSDK/tools v0.0.5/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
|
github.com/OpenIMSDK/tools v0.0.13/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
|
||||||
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
|
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
|
||||||
github.com/Shopify/sarama v1.29.0 h1:ARid8o8oieau9XrHI55f/L3EoRAhm9px6sonbD7yuUE=
|
github.com/Shopify/sarama v1.29.0 h1:ARid8o8oieau9XrHI55f/L3EoRAhm9px6sonbD7yuUE=
|
||||||
github.com/Shopify/sarama v1.29.0/go.mod h1:2QpgD79wpdAESqNQMxNc0KYMkycd4slxGdV3TWSVqrU=
|
github.com/Shopify/sarama v1.29.0/go.mod h1:2QpgD79wpdAESqNQMxNc0KYMkycd4slxGdV3TWSVqrU=
|
||||||
@@ -100,8 +100,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
|
|||||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
github.com/go-playground/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 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||||
github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
|
github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k=
|
||||||
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
|
github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
|
||||||
github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
|
github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
|
||||||
github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
|
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=
|
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||||
@@ -171,8 +171,8 @@ github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56
|
|||||||
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
|
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
|
||||||
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
||||||
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
|
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
|
||||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
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 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
|
||||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
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/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||||
@@ -180,8 +180,8 @@ github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2I
|
|||||||
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
|
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
|
||||||
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
|
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
|
||||||
github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=
|
github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=
|
||||||
@@ -298,8 +298,8 @@ github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
|||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||||
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
|
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
|
||||||
github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
|
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
@@ -314,8 +314,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
|||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
|
|
||||||
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
|
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||||
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
|
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/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/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0=
|
||||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.42 h1:Up1704BJjI5orycXKjpVpvuOInt9GC5pqY4knyE9Uds=
|
github.com/tencentyun/cos-go-sdk-v5 v0.7.42 h1:Up1704BJjI5orycXKjpVpvuOInt9GC5pqY4knyE9Uds=
|
||||||
@@ -486,8 +487,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp
|
|||||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
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.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
|
||||||
google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI=
|
google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
|
||||||
google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
|
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-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-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
mark=''
|
|
||||||
for ((ratio=0;${ratio}<=100;ratio+=5))
|
|
||||||
do
|
|
||||||
sleep 0.2
|
|
||||||
printf "progress:[%-40s]%d%%\r" "${mark}" "${ratio}"
|
|
||||||
mark="##${mark}"
|
|
||||||
done
|
|
||||||
echo
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Change directory to the 'scripts' folder
|
|
||||||
cd scripts
|
|
||||||
|
|
||||||
# Grant execute permissions to all shell scripts in the 'scripts' folder
|
|
||||||
chmod +x *.sh
|
|
||||||
|
|
||||||
# Run the 'env_check.sh' script for environment checks
|
|
||||||
./env_check.sh
|
|
||||||
|
|
||||||
# Move back to the parent directory
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# Check if Docker is installed
|
|
||||||
if ! command -v docker >/dev/null 2>&1; then
|
|
||||||
echo "Error: Docker is not installed. Please install Docker before running this script."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Start Docker services using docker-compose
|
|
||||||
if command -v docker-compose &> /dev/null
|
|
||||||
then
|
|
||||||
docker-compose up -d
|
|
||||||
else
|
|
||||||
docker compose up -d
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Move back to the 'scripts' folder
|
|
||||||
cd scripts
|
|
||||||
|
|
||||||
# Run the 'docker_check_service.sh' script for Docker service checks
|
|
||||||
./docker_check_service.sh
|
|
||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# Copyright © 2023 OpenIM. All rights reserved.
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -20,7 +20,7 @@ set -e
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
|
||||||
############### OpenIM Github ###############
|
############################## OpenIM Github ##############################
|
||||||
# ... rest of the script ...
|
# ... rest of the script ...
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
@@ -78,7 +78,7 @@ GITHUB_TOKEN=
|
|||||||
# Default data directory. If you want to specify a different directory, uncomment and replace "./".
|
# Default data directory. If you want to specify a different directory, uncomment and replace "./".
|
||||||
# DATA_DIR=./
|
# DATA_DIR=./
|
||||||
|
|
||||||
############### OpenIM Functions ###############
|
############################## OpenIM Functions ##############################
|
||||||
# Install horizon of the script
|
# Install horizon of the script
|
||||||
#
|
#
|
||||||
# Pre-requisites:
|
# Pre-requisites:
|
||||||
@@ -290,7 +290,7 @@ function install_openim() {
|
|||||||
success "OpenIM installation completed successfully. Happy chatting!"
|
success "OpenIM installation completed successfully. Happy chatting!"
|
||||||
}
|
}
|
||||||
|
|
||||||
############### OpenIM Help ###############
|
############################## OpenIM Help ##############################
|
||||||
|
|
||||||
# Function to display help message
|
# Function to display help message
|
||||||
function cmd_help() {
|
function cmd_help() {
|
||||||
@@ -406,7 +406,7 @@ function parseinput() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
############### OpenIM LOGO ###############
|
############################## OpenIM LOG ##############################
|
||||||
# Set text color to cyan for header and URL
|
# Set text color to cyan for header and URL
|
||||||
print_with_delay() {
|
print_with_delay() {
|
||||||
text="$1"
|
text="$1"
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
echo "Welcome to the Open-IM-Server installation scripts."
|
echo "Welcome to the Open-IM-Server installation scripts."
|
||||||
echo "Please select an deploy option:"
|
echo "Please select an deploy option:"
|
||||||
|
|||||||
@@ -83,3 +83,7 @@ func (o *FriendApi) ImportFriends(c *gin.Context) {
|
|||||||
func (o *FriendApi) IsFriend(c *gin.Context) {
|
func (o *FriendApi) IsFriend(c *gin.Context) {
|
||||||
a2r.Call(friend.FriendClient.IsFriend, o.Client, c)
|
a2r.Call(friend.FriendClient.IsFriend, o.Client, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o *FriendApi) GetFriendIDs(c *gin.Context) {
|
||||||
|
a2r.Call(friend.FriendClient.GetFriendIDs, o.Client, c)
|
||||||
|
}
|
||||||
|
|||||||
@@ -139,3 +139,7 @@ func (o *GroupApi) GroupCreateCount(c *gin.Context) {
|
|||||||
func (o *GroupApi) GetGroups(c *gin.Context) {
|
func (o *GroupApi) GetGroups(c *gin.Context) {
|
||||||
a2r.Call(group.GroupClient.GetGroups, o.Client, c)
|
a2r.Call(group.GroupClient.GetGroups, o.Client, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o *GroupApi) GetGroupMemberUserIDs(c *gin.Context) {
|
||||||
|
a2r.Call(group.GroupClient.GetGroupMemberUserIDs, o.Client, c)
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
@@ -234,6 +236,51 @@ func (m *MessageApi) SendMessage(c *gin.Context) {
|
|||||||
apiresp.GinSuccess(c, respPb)
|
apiresp.GinSuccess(c, respPb)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *MessageApi) SendBusinessNotification(c *gin.Context) {
|
||||||
|
req := struct {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Data string `json:"data"`
|
||||||
|
SendUserID string `json:"sendUserID"`
|
||||||
|
RecvUserID string `json:"recvUserID"`
|
||||||
|
}{}
|
||||||
|
if err := c.BindJSON(&req); err != nil {
|
||||||
|
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !authverify.IsAppManagerUid(c) {
|
||||||
|
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
sendMsgReq := msg.SendMsgReq{
|
||||||
|
MsgData: &sdkws.MsgData{
|
||||||
|
SendID: req.SendUserID,
|
||||||
|
RecvID: req.RecvUserID,
|
||||||
|
Content: []byte(utils.StructToJsonString(&sdkws.NotificationElem{
|
||||||
|
Detail: utils.StructToJsonString(&struct {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Data string `json:"data"`
|
||||||
|
}{Key: req.Key, Data: req.Data}),
|
||||||
|
})),
|
||||||
|
MsgFrom: constant.SysMsgType,
|
||||||
|
ContentType: constant.BusinessNotification,
|
||||||
|
SessionType: constant.SingleChatType,
|
||||||
|
CreateTime: utils.GetCurrentTimestampByMill(),
|
||||||
|
ClientMsgID: utils.GetMsgID(mcontext.GetOpUserID(c)),
|
||||||
|
Options: config.GetOptionsByNotification(config.NotificationConf{
|
||||||
|
IsSendMsg: false,
|
||||||
|
ReliabilityLevel: 1,
|
||||||
|
UnreadCount: false,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
respPb, err := m.Client.SendMsg(c, &sendMsgReq)
|
||||||
|
if err != nil {
|
||||||
|
apiresp.GinError(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
apiresp.GinSuccess(c, respPb)
|
||||||
|
}
|
||||||
|
|
||||||
func (m *MessageApi) BatchSendMsg(c *gin.Context) {
|
func (m *MessageApi) BatchSendMsg(c *gin.Context) {
|
||||||
var (
|
var (
|
||||||
req apistruct.BatchSendMsgReq
|
req apistruct.BatchSendMsgReq
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
|
|||||||
friendRouterGroup.POST("/remove_black", f.RemoveBlack)
|
friendRouterGroup.POST("/remove_black", f.RemoveBlack)
|
||||||
friendRouterGroup.POST("/import_friend", f.ImportFriends)
|
friendRouterGroup.POST("/import_friend", f.ImportFriends)
|
||||||
friendRouterGroup.POST("/is_friend", f.IsFriend)
|
friendRouterGroup.POST("/is_friend", f.IsFriend)
|
||||||
|
friendRouterGroup.POST("/get_friend_id", f.GetFriendIDs)
|
||||||
}
|
}
|
||||||
g := NewGroupApi(*groupRpc)
|
g := NewGroupApi(*groupRpc)
|
||||||
groupRouterGroup := r.Group("/group", ParseToken)
|
groupRouterGroup := r.Group("/group", ParseToken)
|
||||||
@@ -129,6 +130,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
|
|||||||
groupRouterGroup.POST("/set_group_member_info", g.SetGroupMemberInfo)
|
groupRouterGroup.POST("/set_group_member_info", g.SetGroupMemberInfo)
|
||||||
groupRouterGroup.POST("/get_group_abstract_info", g.GetGroupAbstractInfo)
|
groupRouterGroup.POST("/get_group_abstract_info", g.GetGroupAbstractInfo)
|
||||||
groupRouterGroup.POST("/get_groups", g.GetGroups)
|
groupRouterGroup.POST("/get_groups", g.GetGroups)
|
||||||
|
groupRouterGroup.POST("/get_group_member_user_id", g.GetGroupMemberUserIDs)
|
||||||
}
|
}
|
||||||
superGroupRouterGroup := r.Group("/super_group", ParseToken)
|
superGroupRouterGroup := r.Group("/super_group", ParseToken)
|
||||||
{
|
{
|
||||||
@@ -166,6 +168,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
|
|||||||
msgGroup.POST("/newest_seq", m.GetSeq)
|
msgGroup.POST("/newest_seq", m.GetSeq)
|
||||||
msgGroup.POST("/search_msg", m.SearchMsg)
|
msgGroup.POST("/search_msg", m.SearchMsg)
|
||||||
msgGroup.POST("/send_msg", m.SendMessage)
|
msgGroup.POST("/send_msg", m.SendMessage)
|
||||||
|
msgGroup.POST("/send_business_notification", m.SendBusinessNotification)
|
||||||
msgGroup.POST("/pull_msg_by_seq", m.PullMsgBySeqs)
|
msgGroup.POST("/pull_msg_by_seq", m.PullMsgBySeqs)
|
||||||
msgGroup.POST("/revoke_msg", m.RevokeMsg)
|
msgGroup.POST("/revoke_msg", m.RevokeMsg)
|
||||||
msgGroup.POST("/mark_msgs_as_read", m.MarkMsgsAsRead)
|
msgGroup.POST("/mark_msgs_as_read", m.MarkMsgsAsRead)
|
||||||
|
|||||||
Vendored
+12
-16
@@ -18,6 +18,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/OpenIMSDK/protocol/user"
|
"github.com/OpenIMSDK/protocol/user"
|
||||||
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
|
"hash/crc32"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -33,7 +35,7 @@ const (
|
|||||||
userGlobalRecvMsgOptKey = "USER_GLOBAL_RECV_MSG_OPT_KEY:"
|
userGlobalRecvMsgOptKey = "USER_GLOBAL_RECV_MSG_OPT_KEY:"
|
||||||
olineStatusKey = "ONLINE_STATUS:"
|
olineStatusKey = "ONLINE_STATUS:"
|
||||||
userOlineStatusExpireTime = time.Second * 60 * 60 * 24
|
userOlineStatusExpireTime = time.Second * 60 * 60 * 24
|
||||||
statusMod = 500
|
statusMod = 501
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserCache interface {
|
type UserCache interface {
|
||||||
@@ -165,11 +167,8 @@ func (u *UserCacheRedis) getOnlineStatusKey(userID string) string {
|
|||||||
func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) {
|
func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) {
|
||||||
var res []*user.OnlineStatus
|
var res []*user.OnlineStatus
|
||||||
for _, userID := range userIDs {
|
for _, userID := range userIDs {
|
||||||
UserIDNum, err := strconv.Atoi(userID)
|
UserIDNum := crc32.ChecksumIEEE([]byte(userID))
|
||||||
if err != nil {
|
var modKey = strconv.Itoa(int(UserIDNum % statusMod))
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var modKey = strconv.Itoa(UserIDNum % statusMod)
|
|
||||||
var onlineStatus user.OnlineStatus
|
var onlineStatus user.OnlineStatus
|
||||||
key := olineStatusKey + modKey
|
key := olineStatusKey + modKey
|
||||||
result, err := u.rdb.HGet(ctx, key, userID).Result()
|
result, err := u.rdb.HGet(ctx, key, userID).Result()
|
||||||
@@ -183,12 +182,12 @@ func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([
|
|||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
return nil, err
|
return nil, errs.Wrap(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = json.Unmarshal([]byte(result), &onlineStatus)
|
err = json.Unmarshal([]byte(result), &onlineStatus)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, errs.Wrap(err)
|
||||||
}
|
}
|
||||||
onlineStatus.UserID = userID
|
onlineStatus.UserID = userID
|
||||||
res = append(res, &onlineStatus)
|
res = append(res, &onlineStatus)
|
||||||
@@ -200,23 +199,20 @@ func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([
|
|||||||
func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
|
func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
|
||||||
for _, status := range list {
|
for _, status := range list {
|
||||||
var isNewKey int64
|
var isNewKey int64
|
||||||
UserIDNum, err := strconv.Atoi(status.UserID)
|
UserIDNum := crc32.ChecksumIEEE([]byte(status.UserID))
|
||||||
if err != nil {
|
var modKey = strconv.Itoa(int(UserIDNum % statusMod))
|
||||||
return err
|
|
||||||
}
|
|
||||||
var modKey = strconv.Itoa(UserIDNum % statusMod)
|
|
||||||
key := olineStatusKey + modKey
|
key := olineStatusKey + modKey
|
||||||
jsonData, err := json.Marshal(status)
|
jsonData, err := json.Marshal(status)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return errs.Wrap(err)
|
||||||
}
|
}
|
||||||
isNewKey, err = u.rdb.Exists(ctx, key).Result()
|
isNewKey, err = u.rdb.Exists(ctx, key).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return errs.Wrap(err)
|
||||||
}
|
}
|
||||||
_, err = u.rdb.HSet(ctx, key, status.UserID, string(jsonData)).Result()
|
_, err = u.rdb.HSet(ctx, key, status.UserID, string(jsonData)).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return errs.Wrap(err)
|
||||||
}
|
}
|
||||||
if isNewKey > 0 {
|
if isNewKey > 0 {
|
||||||
u.rdb.Expire(ctx, key, userOlineStatusExpireTime)
|
u.rdb.Expire(ctx, key, userOlineStatusExpireTime)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|||||||
+12
-11
@@ -1,12 +1,13 @@
|
|||||||
|
@echo off
|
||||||
set output_dir=%~dp0..\_output\bin\platforms\windows
|
set output_dir=%~dp0..\_output\bin\platforms\windows
|
||||||
go build -o %output_dir%\api.exe ../cmd/openim-api/main.go
|
|
||||||
go build -o %output_dir%\auth.exe ../cmd/openim-rpc/openim-rpc-auth/main.go
|
set "rpc_apps=auth conversation friend group msg third user"
|
||||||
go build -o %output_dir%\conversation.exe ../cmd/openim-rpc/openim-rpc-conversation/main.go
|
set "other_apps=api push msgtransfer msggateway"
|
||||||
go build -o %output_dir%\friend.exe ../cmd/openim-rpc/openim-rpc-friend/main.go
|
|
||||||
go build -o %output_dir%\group.exe ../cmd/openim-rpc/openim-rpc-group/main.go
|
for %%a in (%rpc_apps%) do (
|
||||||
go build -o %output_dir%\msg.exe ../cmd/openim-rpc/openim-rpc-msg/main.go
|
go build -o %output_dir%\%%a.exe ../cmd/openim-rpc/openim-rpc-%%a/main.go
|
||||||
go build -o %output_dir%\third.exe ../cmd/openim-rpc/openim-rpc-third/main.go
|
)
|
||||||
go build -o %output_dir%\user.exe ../cmd/openim-rpc/openim-rpc-user/main.go
|
|
||||||
go build -o %output_dir%\push.exe ../cmd/openim-push/main.go
|
for %%a in (%other_apps%) do (
|
||||||
go build -o %output_dir%\msgtransfer.exe ../cmd/openim-msgtransfer/main.go
|
go build -o %output_dir%\%%a.exe ../cmd/openim-%%a/main.go
|
||||||
go build -o %output_dir%\msggateway.exe ../cmd/openim-msggateway/main.go
|
)
|
||||||
|
|||||||
@@ -104,9 +104,7 @@ openim::build::get_docker_wrapped_binaries() {
|
|||||||
"openim-rpc-msg,${OPENIM_BASE_IMAGE_REGISTRY}/debian-base-${arch}:${debian_base_version}"
|
"openim-rpc-msg,${OPENIM_BASE_IMAGE_REGISTRY}/debian-base-${arch}:${debian_base_version}"
|
||||||
"openim-rpc-third,${OPENIM_BASE_IMAGE_REGISTRY}/debian-base-${arch}:${debian_base_version}"
|
"openim-rpc-third,${OPENIM_BASE_IMAGE_REGISTRY}/debian-base-${arch}:${debian_base_version}"
|
||||||
"openim-rpc-user,${OPENIM_BASE_IMAGE_REGISTRY}/debian-base-${arch}:${debian_base_version}"
|
"openim-rpc-user,${OPENIM_BASE_IMAGE_REGISTRY}/debian-base-${arch}:${debian_base_version}"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
echo "${targets[@]}"
|
echo "${targets[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
|||||||
|
|
||||||
#fixme Put the shell scripts name here
|
#fixme Put the shell scripts name here
|
||||||
need_to_start_server_shell=(
|
need_to_start_server_shell=(
|
||||||
start_rpc_service.sh
|
${SCRIPTS_ROOT}/start_rpc_service.sh
|
||||||
msg_gateway_start.sh
|
${SCRIPTS_ROOT}/msg_gateway_start.sh
|
||||||
push_start.sh
|
${SCRIPTS_ROOT}/push_start.sh
|
||||||
msg_transfer_start.sh
|
${SCRIPTS_ROOT}/msg_transfer_start.sh
|
||||||
start_cron.sh
|
${SCRIPTS_ROOT}/start_cron.sh
|
||||||
)
|
)
|
||||||
|
|
||||||
#fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started
|
#fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started
|
||||||
@@ -41,8 +41,7 @@ echo "==========================================================">>$OPENIM_ROOT/
|
|||||||
echo "==========================================================">>$OPENIM_ROOT/logs/openIM.log 2>&1 &
|
echo "==========================================================">>$OPENIM_ROOT/logs/openIM.log 2>&1 &
|
||||||
echo "==========================================================">>$OPENIM_ROOT/logs/openIM.log 2>&1 &
|
echo "==========================================================">>$OPENIM_ROOT/logs/openIM.log 2>&1 &
|
||||||
for i in ${need_to_start_server_shell[*]}; do
|
for i in ${need_to_start_server_shell[*]}; do
|
||||||
chmod +x $i
|
$i
|
||||||
./$i
|
|
||||||
done
|
done
|
||||||
|
|
||||||
sleep 15
|
sleep 15
|
||||||
|
|||||||
@@ -16,12 +16,12 @@
|
|||||||
#input:[10023,2323,3434]
|
#input:[10023,2323,3434]
|
||||||
#output:10023 2323 3434
|
#output:10023 2323 3434
|
||||||
list_to_string(){
|
list_to_string(){
|
||||||
ports_list=$*
|
ports_list=$*
|
||||||
sub_s1=`echo $ports_list | sed 's/ //g'`
|
sub_s1=`echo $ports_list | sed 's/ //g'`
|
||||||
sub_s2=${sub_s1//,/ }
|
sub_s2=${sub_s1//,/ }
|
||||||
sub_s3=${sub_s2#*[}
|
sub_s3=${sub_s2#*[}
|
||||||
sub_s4=${sub_s3%]*}
|
sub_s4=${sub_s3%]*}
|
||||||
ports_array=$sub_s4
|
ports_array=$sub_s4
|
||||||
}
|
}
|
||||||
remove_space(){
|
remove_space(){
|
||||||
value=$*
|
value=$*
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
#Don't put the space between "="
|
#Don't put the space between "="
|
||||||
|
|
||||||
|
demo_server_name="chat-api"
|
||||||
demo_server_name="openim_chat_api"
|
|
||||||
demo_server_binary_root="$BIN_DIR/"
|
demo_server_binary_root="$BIN_DIR/"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Global configuration file default dir
|
#Global configuration file default dir
|
||||||
config_path="../.docker-compose_cfg/config.yaml"
|
config_path="../.docker-compose_cfg/config.yaml"
|
||||||
|
|
||||||
@@ -15,15 +12,14 @@ service_source_root=(
|
|||||||
../cmd/api/chat/
|
../cmd/api/chat/
|
||||||
../cmd/api/admin/
|
../cmd/api/admin/
|
||||||
#rpc service file
|
#rpc service file
|
||||||
../cmd/openim-rpc/admin/
|
../cmd/rpc/admin/
|
||||||
../cmd/openim-rpc/chat/
|
../cmd/rpc/chat/
|
||||||
)
|
)
|
||||||
|
|
||||||
#service filename
|
#service filename
|
||||||
service_names=(
|
service_names=(
|
||||||
#api service filename
|
chat-api
|
||||||
openim_chat_api
|
admin-api
|
||||||
openim_admin_api
|
admin-rpc
|
||||||
#rpc service filename
|
chat-rpc
|
||||||
openim_admin
|
|
||||||
openim_chat
|
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Copyright © 2023 OpenIM. All rights reserved.
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ openim::golang::server_targets() {
|
|||||||
local targets=(
|
local targets=(
|
||||||
openim-api
|
openim-api
|
||||||
openim-cmdutils
|
openim-cmdutils
|
||||||
openim-cmdutils
|
|
||||||
openim-crontask
|
openim-crontask
|
||||||
openim-msggateway
|
openim-msggateway
|
||||||
openim-msgtransfer
|
openim-msgtransfer
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ go.build.%:
|
|||||||
@echo "===========> Building binary $(COMMAND) $(VERSION) for $(OS)_$(ARCH)"
|
@echo "===========> Building binary $(COMMAND) $(VERSION) for $(OS)_$(ARCH)"
|
||||||
@mkdir -p $(BIN_DIR)/platforms/$(OS)/$(ARCH)
|
@mkdir -p $(BIN_DIR)/platforms/$(OS)/$(ARCH)
|
||||||
@if [ "$(COMMAND)" == "openim-sdk-core" ]; then \
|
@if [ "$(COMMAND)" == "openim-sdk-core" ]; then \
|
||||||
echo "===========> DEBUG: Compilation is not yet supported $(COMMAND)"; \
|
echo "===========> DEBUG: OpenIM-SDK-Core It is no longer supported for openim-server $(COMMAND)"; \
|
||||||
elif [ "$(COMMAND)" == "openim-rpc" ]; then \
|
elif [ "$(COMMAND)" == "openim-rpc" ]; then \
|
||||||
for d in $(wildcard $(ROOT_DIR)/cmd/openim-rpc/*); do \
|
for d in $(wildcard $(ROOT_DIR)/cmd/openim-rpc/*); do \
|
||||||
cd $${d} && CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o \
|
cd $${d} && CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o \
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ prome_ports=($ports_array)
|
|||||||
|
|
||||||
#Check if the service exists
|
#Check if the service exists
|
||||||
#If it is exists,kill this process
|
#If it is exists,kill this process
|
||||||
check=`ps aux | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
|
check=`ps | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
|
||||||
if [ $check -ge 1 ]
|
if [ $check -ge 1 ]
|
||||||
then
|
then
|
||||||
oldPid=`ps aux | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
|
oldPid=`ps | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
|
||||||
kill -9 $oldPid
|
kill -9 $oldPid
|
||||||
fi
|
fi
|
||||||
#Waiting port recycling
|
#Waiting port recycling
|
||||||
@@ -59,10 +59,10 @@ for ((i = 0; i < ${msg_transfer_service_num}; i++)); do
|
|||||||
done
|
done
|
||||||
|
|
||||||
#Check launched service process
|
#Check launched service process
|
||||||
check=`ps aux | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
|
check=`ps | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
|
||||||
if [ $check -ge 1 ]
|
if [ $check -ge 1 ]
|
||||||
then
|
then
|
||||||
newPid=`ps aux | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
|
newPid=`ps | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
|
||||||
allPorts=""
|
allPorts=""
|
||||||
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX}
|
||||||
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${BACKGROUND_GREEN}${openim_msgtransfer}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${BACKGROUND_GREEN}${openim_msgtransfer}${COLOR_SUFFIX}
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ prome_ports=($ports_array)
|
|||||||
|
|
||||||
#Check if the service exists
|
#Check if the service exists
|
||||||
#If it is exists,kill this process
|
#If it is exists,kill this process
|
||||||
check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l)
|
check=$(ps | grep -w ./${push_name} | grep -v grep | wc -l)
|
||||||
if [ $check -ge 1 ]; then
|
if [ $check -ge 1 ]; then
|
||||||
oldPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
|
oldPid=$(ps | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
|
||||||
kill -9 $oldPid
|
kill -9 $oldPid
|
||||||
fi
|
fi
|
||||||
#Waiting port recycling
|
#Waiting port recycling
|
||||||
@@ -61,9 +61,9 @@ done
|
|||||||
|
|
||||||
sleep 3
|
sleep 3
|
||||||
#Check launched service process
|
#Check launched service process
|
||||||
check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l)
|
check=$(ps | grep -w ./${push_name} | grep -v grep | wc -l)
|
||||||
if [ $check -ge 1 ]; then
|
if [ $check -ge 1 ]; then
|
||||||
newPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
|
newPid=$(ps | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
|
||||||
ports=$(netstat -netulp | grep -w ${newPid} | awk '{print $4}' | awk -F '[:]' '{print $NF}')
|
ports=$(netstat -netulp | grep -w ${newPid} | awk '{print $4}' | awk -F '[:]' '{print $NF}')
|
||||||
allPorts=""
|
allPorts=""
|
||||||
|
|
||||||
|
|||||||
@@ -27,15 +27,15 @@ source $SCRIPTS_ROOT/function.sh
|
|||||||
|
|
||||||
cd $SCRIPTS_ROOT
|
cd $SCRIPTS_ROOT
|
||||||
|
|
||||||
|
echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
|
||||||
|
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
|
||||||
|
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"
|
||||||
|
|
||||||
if [ ! -d "${OPENIM_ROOT}/_output/bin/platforms" ]; then
|
if [ ! -d "${OPENIM_ROOT}/_output/bin/platforms" ]; then
|
||||||
# exec build_all_service.sh
|
# exec build_all_service.sh
|
||||||
"${SCRIPTS_ROOT}/build_all_service.sh"
|
"${SCRIPTS_ROOT}/build_all_service.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
|
|
||||||
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
|
|
||||||
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"
|
|
||||||
|
|
||||||
bin_dir="$OPENIM_ROOT/_output/bin"
|
bin_dir="$OPENIM_ROOT/_output/bin"
|
||||||
logs_dir="$OPENIM_ROOT/logs"
|
logs_dir="$OPENIM_ROOT/logs"
|
||||||
sdk_db_dir="$OPENIM_ROOT/sdk/db/"
|
sdk_db_dir="$OPENIM_ROOT/sdk/db/"
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ sdk_db_dir="$OPENIM_ROOT/sdk/db/"
|
|||||||
|
|
||||||
#Check if the service exists
|
#Check if the service exists
|
||||||
#If it is exists,kill this process
|
#If it is exists,kill this process
|
||||||
check=`ps aux | grep -w ./${cron_task_name} | grep -v grep| wc -l`
|
check=`ps | grep -w ./${cron_task_name} | grep -v grep| wc -l`
|
||||||
if [ $check -ge 1 ]
|
if [ $check -ge 1 ]
|
||||||
then
|
then
|
||||||
oldPid=`ps aux | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'`
|
oldPid=`ps | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'`
|
||||||
kill -9 $oldPid
|
kill -9 $oldPid
|
||||||
fi
|
fi
|
||||||
#Waiting port recycling
|
#Waiting port recycling
|
||||||
@@ -50,10 +50,10 @@ nohup ./${cron_task_name} >>$OPENIM_ROOT/logs/openIM.log 2>&1 &
|
|||||||
#done
|
#done
|
||||||
|
|
||||||
#Check launched service process
|
#Check launched service process
|
||||||
check=`ps aux | grep -w ./${cron_task_name} | grep -v grep| wc -l`
|
check=`ps | grep -w ./${cron_task_name} | grep -v grep| wc -l`
|
||||||
if [ $check -ge 1 ]
|
if [ $check -ge 1 ]
|
||||||
then
|
then
|
||||||
newPid=`ps aux | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'`
|
newPid=`ps | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'`
|
||||||
allPorts=""
|
allPorts=""
|
||||||
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX}
|
||||||
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${BACKGROUND_GREEN}${cron_task_name}${COLOR_SUFFIX}
|
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${BACKGROUND_GREEN}${cron_task_name}${COLOR_SUFFIX}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ echo -e "${BACKGROUND_GREEN}${CYAN_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"
|
|||||||
|
|
||||||
bin_dir="$BIN_DIR"
|
bin_dir="$BIN_DIR"
|
||||||
logs_dir="$OPENIM_ROOT/logs"
|
logs_dir="$OPENIM_ROOT/logs"
|
||||||
sdk_db_dir="$OPENIM_ROOT/sdk/db/"
|
|
||||||
|
|
||||||
#service filename
|
#service filename
|
||||||
service_filename=(
|
service_filename=(
|
||||||
@@ -75,7 +74,7 @@ service_prometheus_port_name=(
|
|||||||
|
|
||||||
for ((i = 0; i < ${#service_filename[*]}; i++)); do
|
for ((i = 0; i < ${#service_filename[*]}; i++)); do
|
||||||
#Check whether the service exists
|
#Check whether the service exists
|
||||||
service_name="ps -aux |grep -w ${service_filename[$i]} |grep -v grep"
|
service_name="ps |grep -w ${service_filename[$i]} |grep -v grep"
|
||||||
count="${service_name}| wc -l"
|
count="${service_name}| wc -l"
|
||||||
|
|
||||||
if [ $(eval ${count}) -gt 0 ]; then
|
if [ $(eval ${count}) -gt 0 ]; then
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ cd "$SCRIPTS_ROOT"
|
|||||||
|
|
||||||
for i in ${service_names[*]}; do
|
for i in ${service_names[*]}; do
|
||||||
#Check whether the service exists
|
#Check whether the service exists
|
||||||
name="ps -aux |grep -w $i |grep -v grep"
|
name="ps |grep -w $i |grep -v grep"
|
||||||
count="${name}| wc -l"
|
count="${name}| wc -l"
|
||||||
if [ $(eval ${count}) -gt 0 ]; then
|
if [ $(eval ${count}) -gt 0 ]; then
|
||||||
pid="${name}| awk '{print \$2}'"
|
pid="${name}| awk '{print \$2}'"
|
||||||
|
|||||||
+43
-40
@@ -13,50 +13,53 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
function style-info() {
|
||||||
|
COLOR_SUFFIX="\033[0m" # End all colors and special effects
|
||||||
|
|
||||||
COLOR_SUFFIX="\033[0m" # End all colors and special effects
|
BLACK_PREFIX="\033[30m" # Black prefix
|
||||||
|
RED_PREFIX="\033[31m" # Red prefix
|
||||||
|
GREEN_PREFIX="\033[32m" # Green prefix
|
||||||
|
YELLOW_PREFIX="\033[33m" # Yellow prefix
|
||||||
|
BLUE_PREFIX="\033[34m" # Blue prefix
|
||||||
|
PURPLE_PREFIX="\033[35m" # Purple prefix
|
||||||
|
SKY_BLUE_PREFIX="\033[36m" # Sky blue prefix
|
||||||
|
WHITE_PREFIX="\033[37m" # White prefix
|
||||||
|
BOLD_PREFIX="\033[1m" # Bold prefix
|
||||||
|
UNDERLINE_PREFIX="\033[4m" # Underline prefix
|
||||||
|
ITALIC_PREFIX="\033[3m" # Italic prefix
|
||||||
|
|
||||||
BLACK_PREFIX="\033[30m" # Black prefix
|
CYAN_PREFIX="033[0;36m" # Cyan prefix
|
||||||
RED_PREFIX="\033[31m" # Red prefix
|
|
||||||
GREEN_PREFIX="\033[32m" # Green prefix
|
|
||||||
YELLOW_PREFIX="\033[33m" # Yellow prefix
|
|
||||||
BLUE_PREFIX="\033[34m" # Blue prefix
|
|
||||||
PURPLE_PREFIX="\033[35m" # Purple prefix
|
|
||||||
SKY_BLUE_PREFIX="\033[36m" # Sky blue prefix
|
|
||||||
WHITE_PREFIX="\033[37m" # White prefix
|
|
||||||
BOLD_PREFIX="\033[1m" # Bold prefix
|
|
||||||
UNDERLINE_PREFIX="\033[4m" # Underline prefix
|
|
||||||
ITALIC_PREFIX="\033[3m" # Italic prefix
|
|
||||||
|
|
||||||
CYAN_PREFIX="033[0;36m" # Cyan prefix
|
BACKGROUND_BLACK="\033[40m" # Black background
|
||||||
|
BACKGROUND_RED="\033[41m" # Red background
|
||||||
|
BACKGROUND_GREEN="\033[42m" # Green background
|
||||||
|
BACKGROUND_YELLOW="\033[43m" # Yellow background
|
||||||
|
BACKGROUND_BLUE="\033[44m" # Blue background
|
||||||
|
BACKGROUND_PURPLE="\033[45m" # Purple background
|
||||||
|
BACKGROUND_SKY_BLUE="\033[46m" # Sky blue background
|
||||||
|
BACKGROUND_WHITE="\033[47m" # White background
|
||||||
|
|
||||||
BACKGROUND_BLACK="\033[40m" # Black background
|
BLINK="\033[5m" # Blinking effect
|
||||||
BACKGROUND_RED="\033[41m" # Red background
|
INVERT="\033[7m" # Invert color
|
||||||
BACKGROUND_GREEN="\033[42m" # Green background
|
HIDE="\033[8m" # Hide text
|
||||||
BACKGROUND_YELLOW="\033[43m" # Yellow background
|
|
||||||
BACKGROUND_BLUE="\033[44m" # Blue background
|
|
||||||
BACKGROUND_PURPLE="\033[45m" # Purple background
|
|
||||||
BACKGROUND_SKY_BLUE="\033[46m" # Sky blue background
|
|
||||||
BACKGROUND_WHITE="\033[47m" # White background
|
|
||||||
|
|
||||||
BLINK="\033[5m" # Blinking effect
|
GRAY_PREFIX="\033[90m" # Gray prefix
|
||||||
INVERT="\033[7m" # Invert color
|
LIGHT_RED_PREFIX="\033[91m" # Light red prefix
|
||||||
HIDE="\033[8m" # Hide text
|
LIGHT_GREEN_PREFIX="\033[92m" # Light green prefix
|
||||||
|
LIGHT_YELLOW_PREFIX="\033[93m" # Light yellow prefix
|
||||||
|
LIGHT_BLUE_PREFIX="\033[94m" # Light blue prefix
|
||||||
|
LIGHT_PURPLE_PREFIX="\033[95m" # Light purple prefix
|
||||||
|
LIGHT_SKY_BLUE_PREFIX="\033[96m" # Light sky blue prefix
|
||||||
|
LIGHT_WHITE_PREFIX="\033[97m" # Light white prefix
|
||||||
|
|
||||||
GRAY_PREFIX="\033[90m" # Gray prefix
|
BACKGROUND_GRAY="\033[100m" # Gray background
|
||||||
LIGHT_RED_PREFIX="\033[91m" # Light red prefix
|
BACKGROUND_LIGHT_RED="\033[101m" # Light red background
|
||||||
LIGHT_GREEN_PREFIX="\033[92m" # Light green prefix
|
BACKGROUND_LIGHT_GREEN="\033[102m" # Light green background
|
||||||
LIGHT_YELLOW_PREFIX="\033[93m" # Light yellow prefix
|
BACKGROUND_LIGHT_YELLOW="\033[103m" # Light yellow background
|
||||||
LIGHT_BLUE_PREFIX="\033[94m" # Light blue prefix
|
BACKGROUND_LIGHT_BLUE="\033[104m" # Light blue background
|
||||||
LIGHT_PURPLE_PREFIX="\033[95m" # Light purple prefix
|
BACKGROUND_LIGHT_PURPLE="\033[105m" # Light purple background
|
||||||
LIGHT_SKY_BLUE_PREFIX="\033[96m" # Light sky blue prefix
|
BACKGROUND_LIGHT_SKY_BLUE="\033[106m" # Light sky blue background
|
||||||
LIGHT_WHITE_PREFIX="\033[97m" # Light white prefix
|
BACKGROUND_LIGHT_WHITE="\033[107m" # Light white background
|
||||||
|
}
|
||||||
|
|
||||||
BACKGROUND_GRAY="\033[100m" # Gray background
|
style-info
|
||||||
BACKGROUND_LIGHT_RED="\033[101m" # Light red background
|
|
||||||
BACKGROUND_LIGHT_GREEN="\033[102m" # Light green background
|
|
||||||
BACKGROUND_LIGHT_YELLOW="\033[103m" # Light yellow background
|
|
||||||
BACKGROUND_LIGHT_BLUE="\033[104m" # Light blue background
|
|
||||||
BACKGROUND_LIGHT_PURPLE="\033[105m" # Light purple background
|
|
||||||
BACKGROUND_LIGHT_SKY_BLUE="\033[106m" # Light sky blue background
|
|
||||||
BACKGROUND_LIGHT_WHITE="\033[107m" # Light white background
|
|
||||||
@@ -12,4 +12,3 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user