mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 10:22:36 +08:00
Merge branch 'openimsdk:main' into main
This commit is contained in:
commit
86d3a668fd
56
.github/workflows/pull-request.yml
vendored
56
.github/workflows/pull-request.yml
vendored
@ -14,12 +14,6 @@
|
|||||||
|
|
||||||
name: Github Pull Request
|
name: Github Pull Request
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths-ignore:
|
|
||||||
- 'README.md'
|
|
||||||
- 'CONTRIBUTING.md'
|
|
||||||
- 'docs/**'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 2 * * *'
|
- cron: '0 2 * * *'
|
||||||
@ -37,24 +31,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Get League branch Patch
|
|
||||||
run: |
|
|
||||||
git config user.name 'openimbot'
|
|
||||||
git config user.email 'openimsdk@qq.com'
|
|
||||||
BRANCH_NAME="auto-pr-$(date +'%Y%m%d%H%M%S')"
|
|
||||||
git checkout -b $BRANCH_NAME
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
- name: Run go modules tidy
|
- name: Run go modules tidy
|
||||||
run: |
|
run: |
|
||||||
|
sudo apt-get install jq
|
||||||
sudo make tidy
|
sudo make tidy
|
||||||
sudo make tools.verify.go-gitlint
|
sudo make tools.verify.go-gitlint
|
||||||
echo "Run go modules tidy successfully"
|
echo "Run go modules tidy successfully"
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Run go format
|
- name: Run go format and lint
|
||||||
run: |
|
run: |
|
||||||
sudo make format
|
sudo make format
|
||||||
echo "Run go format successfully"
|
echo "Run go format successfully"
|
||||||
@ -69,7 +57,21 @@ jobs:
|
|||||||
- name: Generate all necessary files, such as error code files
|
- name: Generate all necessary files, such as error code files
|
||||||
run: |
|
run: |
|
||||||
make generate
|
make generate
|
||||||
echo "Generate all necessary files successfully"
|
echo "Generate all necessary files successfully"
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: make init
|
||||||
|
run: |
|
||||||
|
export OPENIM_IP=127.0.0.1
|
||||||
|
export LOG_STORAGE_LOCATION="../logs/"
|
||||||
|
./scripts/init-config.sh --examples --force
|
||||||
|
echo "Generate all necessary files successfully"
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Generate Vertions
|
||||||
|
run: |
|
||||||
|
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
|
||||||
|
echo $latest_tag > pkg/common/config/version
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Run unit test and get test coverage
|
- name: Run unit test and get test coverage
|
||||||
@ -80,7 +82,6 @@ jobs:
|
|||||||
|
|
||||||
- name: OpenIM verify copyright
|
- name: OpenIM verify copyright
|
||||||
run: |
|
run: |
|
||||||
sudo make verify-copyright
|
|
||||||
sudo make add-copyright
|
sudo make add-copyright
|
||||||
echo "OpenIM verify successfully"
|
echo "OpenIM verify successfully"
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@ -90,23 +91,28 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||||
commit-message: "cicd: bump League Patch"
|
commit-message: "cicd: bump League Patch"
|
||||||
author: kubbot <kubbot@3293172751ysy@gmail.com>
|
author: kubbot <3293172751ysy@gmail.com>
|
||||||
signoff: false
|
committer: kubbot <3293172751ysy@gmail.com>
|
||||||
draft: false
|
# signoff: false
|
||||||
branch: ''
|
# draft: false
|
||||||
|
branch: "asf-auto-updates"
|
||||||
assignees: cubxxw
|
assignees: cubxxw
|
||||||
reviewers: cubxxw
|
reviewers: cubxxw
|
||||||
delete-branch: true
|
title: "[Auto PR 🤖] Bump League Patch auto PR"
|
||||||
title: "Bump League Patch auto PR: $(date +'%Y%m%d')"
|
|
||||||
body: |
|
body: |
|
||||||
|
I am a PR generated by robot automation.
|
||||||
|
|
||||||
Review criteria:
|
Review criteria:
|
||||||
|
|
||||||
- [ ] Disenchanter can connect and issue actions
|
- [ ] Disenchanter can connect and issue actions
|
||||||
|
|
||||||
|
Github Actions Status:
|
||||||
|
|
||||||
|
[](https://github.com/openimsdk/open-im-server/actions/workflows/pull-request.yml)
|
||||||
|
|
||||||
This is an automated PR. @ $(date +'%Y%m%d')
|
This is an automated PR.
|
||||||
<sub>[workflow](https://github.com/openimsdk/open-im-server/blob/main/.github/workflows/pull-request.yml).</sub>
|
<sub>[workflow](https://github.com/openimsdk/open-im-server/blob/main/.github/workflows/pull-request.yml).</sub>
|
||||||
base: main
|
|
||||||
labels: |
|
labels: |
|
||||||
kind/documentation
|
kind/documentation
|
||||||
enhancement
|
enhancement
|
||||||
report
|
report
|
||||||
|
45
build/images/openim-rpc-encryption/Dockerfile
Normal file
45
build/images/openim-rpc-encryption/Dockerfile
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
# 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 build BINS=openim-rpc-encryption
|
||||||
|
|
||||||
|
RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-encryption /usr/bin/openim-rpc-encryption
|
||||||
|
|
||||||
|
# FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
COPY --from=builder /usr/bin/openim-rpc-encryption ./bin/openim-rpc-encryption
|
||||||
|
|
||||||
|
ENTRYPOINT ["./bin/openim-rpc-encryption"]
|
45
build/images/openim-rpc-extend-msg/Dockerfile
Normal file
45
build/images/openim-rpc-extend-msg/Dockerfile
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
# 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 build BINS=openim-rpc-extend-msg
|
||||||
|
|
||||||
|
RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-extend-msg /usr/bin/openim-rpc-extend-msg
|
||||||
|
|
||||||
|
# FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||||
|
FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||||
|
|
||||||
|
WORKDIR /openim/openim-server
|
||||||
|
|
||||||
|
COPY --from=builder /usr/bin/openim-rpc-extend-msg ./bin/openim-rpc-extend-msg
|
||||||
|
|
||||||
|
ENTRYPOINT ["./bin/openim-rpc-extend-msg"]
|
4
go.mod
4
go.mod
@ -5,7 +5,7 @@ go 1.19
|
|||||||
require (
|
require (
|
||||||
firebase.google.com/go v3.13.0+incompatible
|
firebase.google.com/go v3.13.0+incompatible
|
||||||
github.com/OpenIMSDK/protocol v0.0.48
|
github.com/OpenIMSDK/protocol v0.0.48
|
||||||
github.com/OpenIMSDK/tools v0.0.28
|
github.com/OpenIMSDK/tools v0.0.29
|
||||||
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
|
||||||
@ -127,7 +127,7 @@ require (
|
|||||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
||||||
go.opencensus.io v0.24.0 // indirect
|
go.opencensus.io v0.24.0 // indirect
|
||||||
go.uber.org/atomic v1.7.0 // indirect
|
go.uber.org/atomic v1.7.0 // indirect
|
||||||
go.uber.org/multierr v1.6.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/arch v0.3.0 // indirect
|
golang.org/x/arch v0.3.0 // indirect
|
||||||
golang.org/x/net v0.17.0 // indirect
|
golang.org/x/net v0.17.0 // indirect
|
||||||
golang.org/x/oauth2 v0.13.0 // indirect
|
golang.org/x/oauth2 v0.13.0 // indirect
|
||||||
|
8
go.sum
8
go.sum
@ -20,8 +20,8 @@ github.com/IBM/sarama v1.41.3 h1:MWBEJ12vHC8coMjdEXFq/6ftO6DUZnQlFYcxtOJFa7c=
|
|||||||
github.com/IBM/sarama v1.41.3/go.mod h1:Xxho9HkHd4K/MDUo/T/sOqwtX/17D33++E9Wib6hUdQ=
|
github.com/IBM/sarama v1.41.3/go.mod h1:Xxho9HkHd4K/MDUo/T/sOqwtX/17D33++E9Wib6hUdQ=
|
||||||
github.com/OpenIMSDK/protocol v0.0.48 h1:8MIMjyzJRsruYhVv2ZKArFiOveroaofDOb3dlAdgjsw=
|
github.com/OpenIMSDK/protocol v0.0.48 h1:8MIMjyzJRsruYhVv2ZKArFiOveroaofDOb3dlAdgjsw=
|
||||||
github.com/OpenIMSDK/protocol v0.0.48/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
|
github.com/OpenIMSDK/protocol v0.0.48/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
|
||||||
github.com/OpenIMSDK/tools v0.0.28 h1:UT0rN1ysCFvsxQXyuxAj2TEkHt4C/sUezy+ChKpgt2Y=
|
github.com/OpenIMSDK/tools v0.0.29 h1:NS4PEwYl9sX3SWsMjDOLVxMo3LcTWREMr+2cjzWjcqc=
|
||||||
github.com/OpenIMSDK/tools v0.0.28/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
|
github.com/OpenIMSDK/tools v0.0.29/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/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
|
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
|
||||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
|
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
|
||||||
@ -356,8 +356,8 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
|||||||
go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8=
|
go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8=
|
||||||
go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
|
go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
|
||||||
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
|
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
|
||||||
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
|
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||||
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
|
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
|
||||||
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
|
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
|
||||||
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
|
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
|
||||||
|
@ -118,18 +118,25 @@ func (p *Pusher) Push2User(ctx context.Context, userIDs []string, msg *sdkws.Msg
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range wsResults {
|
if len(wsResults) == 0 {
|
||||||
if !v.OnlinePush && msg.SendID == v.UserID {
|
return nil
|
||||||
if err = callbackOfflinePush(ctx, userIDs, msg, &[]string{}); err != nil {
|
}
|
||||||
return err
|
onlinePushSuccUserIDSet := utils.SliceSet(utils.Filter(wsResults, func(e *msggateway.SingleMsgToUserResults) (string, bool) {
|
||||||
}
|
return e.UserID, e.OnlinePush && e.UserID != ""
|
||||||
|
}))
|
||||||
|
offlinePushUserIDList := utils.Filter(wsResults, func(e *msggateway.SingleMsgToUserResults) (string, bool) {
|
||||||
|
_, exist := onlinePushSuccUserIDSet[e.UserID]
|
||||||
|
return e.UserID, !exist && e.UserID != "" && e.UserID != msg.SendID
|
||||||
|
})
|
||||||
|
|
||||||
err = p.offlinePushMsg(ctx, msg.SendID, msg, []string{v.UserID})
|
if len(offlinePushUserIDList) > 0 {
|
||||||
if err != nil {
|
if err = callbackOfflinePush(ctx, offlinePushUserIDList, msg, &[]string{}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
err = p.offlinePushMsg(ctx, msg.SendID, msg, offlinePushUserIDList)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,6 @@ type userServer struct {
|
|||||||
RegisterCenter registry.SvcDiscoveryRegistry
|
RegisterCenter registry.SvcDiscoveryRegistry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func Start(client registry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
func Start(client registry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
||||||
rdb, err := cache.NewRedis()
|
rdb, err := cache.NewRedis()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1 +1 @@
|
|||||||
v3.5.0
|
3.5.1
|
||||||
|
@ -114,7 +114,8 @@ func (c *ConversationMgo) GetAllConversationIDs(ctx context.Context) ([]string,
|
|||||||
func (c *ConversationMgo) GetAllConversationIDsNumber(ctx context.Context) (int64, error) {
|
func (c *ConversationMgo) GetAllConversationIDsNumber(ctx context.Context) (int64, error) {
|
||||||
counts, err := mgoutil.Aggregate[int64](ctx, c.coll, []bson.M{
|
counts, err := mgoutil.Aggregate[int64](ctx, c.coll, []bson.M{
|
||||||
{"$group": bson.M{"_id": "$conversation_id"}},
|
{"$group": bson.M{"_id": "$conversation_id"}},
|
||||||
{"$project": bson.M{"_id": 0, "conversation_id": "$_id"}},
|
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": 1}}},
|
||||||
|
{"$project": bson.M{"_id": 0}},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
@ -1,11 +1,26 @@
|
|||||||
|
// Copyright © 2024 OpenIM. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package direct
|
package direct
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
|
||||||
"google.golang.org/grpc/resolver"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
"google.golang.org/grpc/resolver"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -1,13 +1,29 @@
|
|||||||
|
// Copyright © 2024 OpenIM. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package direct
|
package direct
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
|
|
||||||
|
config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServiceAddresses map[string][]int
|
type ServiceAddresses map[string][]int
|
||||||
|
@ -16,9 +16,10 @@ package discoveryregister
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/direct"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/direct"
|
||||||
|
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/kubernetes"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/kubernetes"
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/zookeeper"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/zookeeper"
|
||||||
|
|
||||||
|
@ -69,17 +69,18 @@ ${DOCKER_COMPOSE_COMMAND} up -d
|
|||||||
check_containers() {
|
check_containers() {
|
||||||
if ! ${DOCKER_COMPOSE_COMMAND} ps | grep -q 'Up'; then
|
if ! ${DOCKER_COMPOSE_COMMAND} ps | grep -q 'Up'; then
|
||||||
echo "Error: One or more docker containers failed to start."
|
echo "Error: One or more docker containers failed to start."
|
||||||
${DOCKER_COMPOSE_COMMAND} logs
|
${DOCKER_COMPOSE_COMMAND} logs openim-server
|
||||||
|
${DOCKER_COMPOSE_COMMAND} logs openim-chat
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Wait for a short period to allow containers to initialize
|
# Wait for a short period to allow containers to initialize
|
||||||
sleep 30
|
sleep 100
|
||||||
check_containers
|
|
||||||
|
|
||||||
${DOCKER_COMPOSE_COMMAND} logs openim-server
|
|
||||||
${DOCKER_COMPOSE_COMMAND} ps
|
${DOCKER_COMPOSE_COMMAND} ps
|
||||||
|
|
||||||
|
check_containers
|
||||||
|
|
||||||
popd
|
popd
|
@ -25,6 +25,7 @@
|
|||||||
readonly BUCKET="openim-1306374445"
|
readonly BUCKET="openim-1306374445"
|
||||||
readonly REGION="ap-guangzhou"
|
readonly REGION="ap-guangzhou"
|
||||||
readonly COS_RELEASE_DIR="openim-release"
|
readonly COS_RELEASE_DIR="openim-release"
|
||||||
|
# readonly COS_RELEASE_DIR="openim-advanced-release" # !pro
|
||||||
|
|
||||||
# default cos command tool coscli or coscmd
|
# default cos command tool coscli or coscmd
|
||||||
readonly COSTOOL="coscli"
|
readonly COSTOOL="coscli"
|
||||||
@ -37,9 +38,11 @@ readonly RELEASE_IMAGES="${LOCAL_OUTPUT_ROOT}/release-images"
|
|||||||
# OpenIM github account info
|
# OpenIM github account info
|
||||||
readonly OPENIM_GITHUB_ORG=openimsdk
|
readonly OPENIM_GITHUB_ORG=openimsdk
|
||||||
readonly OPENIM_GITHUB_REPO=open-im-server
|
readonly OPENIM_GITHUB_REPO=open-im-server
|
||||||
readonly CHAT_GITHUB_REPO=chat
|
# readonly OPENIM_GITHUB_REPO=open-im-server-enterprise # !pro
|
||||||
|
|
||||||
readonly ARTIFACT=openim.tar.gz
|
readonly ARTIFACT=openim.tar.gz
|
||||||
|
# readonly ARTIFACT=openim-enterprise.tar.gz # !pro
|
||||||
|
|
||||||
readonly CHECKSUM=${ARTIFACT}.sha1sum
|
readonly CHECKSUM=${ARTIFACT}.sha1sum
|
||||||
|
|
||||||
OPENIM_BUILD_CONFORMANCE=${OPENIM_BUILD_CONFORMANCE:-y}
|
OPENIM_BUILD_CONFORMANCE=${OPENIM_BUILD_CONFORMANCE:-y}
|
||||||
|
@ -45,7 +45,8 @@ endif
|
|||||||
IMAGES_DIR ?= $(wildcard ${ROOT_DIR}/build/images/*)
|
IMAGES_DIR ?= $(wildcard ${ROOT_DIR}/build/images/*)
|
||||||
# Determine images names by stripping out the dir names, and filter out the undesired directories
|
# Determine images names by stripping out the dir names, and filter out the undesired directories
|
||||||
# IMAGES ?= $(filter-out Dockerfile,$(foreach image,${IMAGES_DIR},$(notdir ${image})))
|
# IMAGES ?= $(filter-out Dockerfile,$(foreach image,${IMAGES_DIR},$(notdir ${image})))
|
||||||
IMAGES ?= $(filter-out Dockerfile openim-tools openim-cmdutils,$(foreach image,${IMAGES_DIR},$(notdir ${image})))
|
IMAGES ?= $(filter-out Dockerfile openim-tools openim-rpc-extend-msg openim-rpc-encryption openim-cmdutils,$(foreach image,${IMAGES_DIR},$(notdir ${image})))
|
||||||
|
# IMAGES ?= $(filter-out Dockerfile openim-tools openim-cmdutils,$(foreach image,${IMAGES_DIR},$(notdir ${image}))) # !pro
|
||||||
|
|
||||||
ifeq (${IMAGES},)
|
ifeq (${IMAGES},)
|
||||||
$(error Could not determine IMAGES, set ROOT_DIR or run in source dir)
|
$(error Could not determine IMAGES, set ROOT_DIR or run in source dir)
|
||||||
|
@ -130,7 +130,7 @@ perform_action() {
|
|||||||
|
|
||||||
if [ "$flag" == true ]; then
|
if [ "$flag" == true ]; then
|
||||||
openim::log::info "## $message..."
|
openim::log::info "## $message..."
|
||||||
if ! $command; then
|
if ! eval "$command"; then
|
||||||
openim::log::errexit "Error in $message"
|
openim::log::errexit "Error in $message"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user