diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml deleted file mode 100644 index ff20ce5a6..000000000 --- a/.github/workflows/build-docker-image.yml +++ /dev/null @@ -1,49 +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: OpenIM Build Docker Images -on: - push: - tags: - - v* -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - bin: - - openim-core - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Docker metadata - id: metadata - uses: docker/metadata-action@v4 - with: - images: ghcr.io/${{ github.repository_owner }}/openim-${{ matrix.bin }} - - name: Build and release Docker images - uses: docker/build-push-action@v3 - with: - platforms: linux/386,linux/amd64,linux/arm64/v8 - target: ${{ matrix.bin }} - tags: ${{ steps.metadata.outputs.tags }} - push: true \ No newline at end of file diff --git a/.github/workflows/openimci.yml b/.github/workflows/openimci.yml index 439afc7c1..006b1bef2 100644 --- a/.github/workflows/openimci.yml +++ b/.github/workflows/openimci.yml @@ -48,7 +48,7 @@ jobs: strategy: matrix: - go_version: ["1.18","1.19","1.20"] + go_version: ["1.18","1.19","1.20","1.21"] os: [ubuntu-latest] steps: @@ -92,7 +92,12 @@ jobs: - name: Build source code for host platform run: | sudo make build - echo "Build source code for host platform successfully" + echo "Build source code for host platform successfully" + + - name: Build wasm source code + run: | + sudo make build-wasm + echo "Build wasm source code successfully" - name: OpenIM verify copyright run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95771a59d..0819f47e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: OpenIM chat release +name: OpenIM OpenIM Core release on: push: @@ -25,6 +25,7 @@ permissions: packages: write issues: write + jobs: goreleaser: runs-on: ubuntu-latest @@ -43,9 +44,39 @@ jobs: # either 'goreleaser' (default) or 'goreleaser-pro': distribution: goreleaser version: latest - args: release --clean + workdir: . + args: release --clean --clean --release-footer-tmpl=scripts/template/footer.md.tmpl --release-header-tmpl=scripts/template/head.md.tmpl env: + USERNAME: ${{ github.repository_owner }} GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} + FURY_TOKEN: ${{ secrets.FURY_TOKEN }} # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' # distribution: # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} + + goreleaser-check-pkgs: + runs-on: ubuntu-latest + env: + DOCKER_CLI_EXPERIMENTAL: "enabled" + needs: [ goreleaser ] + if: github.ref == 'refs/heads/main' + strategy: + matrix: + format: [ deb, rpm, apk ] + steps: + - uses: actions/checkout@v3 # v3 + with: + fetch-depth: 0 + - uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1 + with: + version: 3.x + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3 + with: + path: | + ./_output/dist/*.deb + ./_output/dist/*.rpm + ./_output/dist/*.apk + key: ${{ github.ref }} + - run: task goreleaser:test:${{ matrix.format }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3c1e525d6..0df4c5f8a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -25,22 +25,24 @@ report_sizes: true builds: - binary: openim-sdk-core - id: openim-api + id: openim-sdk-core main: ./cmd/main.go goos: - - darwin - - windows - linux goarch: - - s390x - - mips64 - - mips64le - amd64 - - ppc64le - arm64 goarm: - 6 - 7 + - id: openIM.wasm + main: wasm/cmd/main.go # 指定 wasm 主文件路径 + binary: openIM.wasm + ldflags: "-s -w" + goos: + - js + goarch: + - wasm archives: - format: tar.gz @@ -56,7 +58,6 @@ archives: files: - LICENSE - README.md - - docs/* # a more complete example, check the globbing deep dive below - src: "*.md" dst: docs @@ -126,6 +127,7 @@ nfpms: - id: packages builds: - openim-sdk-core + - openIM.wasm # Your app's vendor. vendor: OpenIMSDK homepage: https://github.com/OpenIMSDK/openim-sdk-core @@ -193,42 +195,4 @@ checksum: algorithm: sha256 release: - footer: | - **Full Changelog**: https://github.com/OpenIMSDK/chat/compare/{{ .PreviousTag }}...{{ .Tag }} - - ## Helping out - - This release is only possible thanks to **all** the support of some **awesome people**! - - 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. - -

- - - - - - - - - -

- - - ## Contact Us - - We value close connections with our users, developers, and contributors here at OpenIMSDK. With a large community and maintainer team, we're always here to help and support you. Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us. - - Our most recommended way to get in touch is through [Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg). Even if you're in China, Slack is usually not blocked by firewalls, making it an easy way to connect with us. Our Slack community is the ideal place to discuss and share ideas and suggestions with other users and developers of OpenIMSDK. You can ask technical questions, seek help, or share your experiences with other users of OpenIMSDK. - - In [OpenIM community is recruiting new members! discussion](https://github.com/orgs/OpenIMSDK/discussions/426) please leave your information, convenient we will better developers around the small gift to send to your hands. - - In addition to Slack, we also offer the following ways to get in touch: - - + : We also have Slack channels for you to communicate and discuss. To join, visit https://slack.com/ and join our [👀 Open-IM-Server slack](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg) team channel. - + : Get in touch with us on [Gmail](winxu81@gmail.com). If you have any questions or issues that need resolving, or any suggestions and feedback for our open source projects, please feel free to contact us via email. - + : Read our [blog](https://doc.rentsoft.cn/). Our blog is a great place to stay up-to-date with Open-IM-Server projects and trends. On the blog, we share our latest developments, tech trends, and other interesting information. - + : Add [Wechat](https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg) and indicate that you are a user or developer of Open-IM-Server. We will process your request as soon as possible. - - Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us. + prerelease: auto \ No newline at end of file diff --git a/Makefile b/Makefile index 9b2c0804d..cff35032a 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ SPACE += # ============================================================================== # Build definition -GO_SUPPORTED_VERSIONS ?= 1.18|1.19|1.20 +GO_SUPPORTED_VERSIONS ?= 1.18|1.19|1.20|1.21 GO_LDFLAGS += -X $(VERSION_PACKAGE).GitVersion=$(VERSION) \ -X $(VERSION_PACKAGE).GitCommit=$(GIT_COMMIT) \ -X $(VERSION_PACKAGE).GitTreeState=$(GIT_TREE_STATE) \ @@ -156,7 +156,7 @@ ifeq (${BINS},) $(error Could not determine BINS, set ROOT_DIR or run in source dir) endif -EXCLUDE_TESTS=github.com/OpenIMSDK/chat/test +EXCLUDE_TESTS=github.com/OpenIMSDK/openim-sdk-core/test # ============================================================================== # Build @@ -165,51 +165,41 @@ EXCLUDE_TESTS=github.com/OpenIMSDK/chat/test .PHONY: all all: copyright-verify build # tidy lint cover -## build: Build binaries by default. +# Define available OS and ARCH +OSES = linux +ARCHS = amd64 arm64 + +ifeq ($(ARCH),arm64) + export CC=aarch64-linux-gnu-gcc + export CXX=aarch64-linux-gnu-g++ +endif + +# Set default OS and ARCH (e.g., current platform) +OS ?= $(shell go env GOOS) +ARCH ?= $(shell go env GOARCH) +BIN_DIR ?= ./_output/bin +TARGET ?= ./cmd/main.go + +## build: Build for current platform by default .PHONY: build build: - @CGO_ENABLED=1 GOOS=${OS} GOARCH=${ARCH} go build -o ${BIN_DIR} ./cmd/main.go -# build: go.build.verify $(addprefix go.build., $(addprefix $(PLATFORM)., $(BINS))) - -.PHONY: build.% -build.%: - @echo "$(shell go version)" - @echo "===========> Building binary $(BUILDAPP) *[Git Info]: $(VERSION)-$(GIT_COMMIT)" - @export CGO_ENABLED=0 && GOOS=linux go build -o $(BUILDAPP)/$*/ -ldflags '-s -w' $*/example/$(BUILDFILE) - -.PHONY: go.build.verify -go.build.verify: -ifneq ($(shell $(GO) version | grep -q -E '\bgo($(GO_SUPPORTED_VERSIONS))\b' && echo 0 || echo 1), 0) - $(error unsupported go version. Please make install one of the following supported version: '$(GO_SUPPORTED_VERSIONS)') -endif + @echo "===========> Building for $(OS)/$(ARCH)" + @CGO_ENABLED=1 GOOS=$(OS) GOARCH=$(ARCH) go build -o $(BIN_DIR)/openim-sdk-core-$(OS)-$(ARCH) $(TARGET) -## go.build: Build the binary file of the specified platform. -.PHONY: go.build.% -go.build.%: - $(eval COMMAND := $(word 2,$(subst ., ,$*))) - $(eval PLATFORM := $(word 1,$(subst ., ,$*))) - $(eval OS := $(word 1,$(subst _, ,$(PLATFORM)))) - $(eval ARCH := $(word 2,$(subst _, ,$(PLATFORM)))) - @echo "=====> COMMAND=$(COMMAND)" - @echo "=====> PLATFORM=$(PLATFORM)" - @echo "=====> BIN_DIR=$(BIN_DIR)" - @echo "===========> Building binary $(COMMAND) $(VERSION) for $(OS)_$(ARCH)" - @mkdir -p $(BIN_DIR)/platforms/$(OS)/$(ARCH) - @if [ "$(COMMAND)" = "rpc" ] || [ "$(COMMAND)" = "api" ]; then \ - for d in $(wildcard $(ROOT_DIR)/cmd/$(COMMAND)/*/); do \ - cd $$d && CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o \ - $(BIN_DIR)/platforms/$(OS)/$(ARCH)/$$(basename $$d)$(GO_OUT_EXT) .; \ - done; \ - else \ - @CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o \ - $(BIN_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) $(ROOT_PACKAGE)/cmd/$(COMMAND)/main.go; \ - fi - -## build-multiarch: Build binaries for multiple platforms. -.PHONY: build-multiarch -build-multiarch: go.build.verify $(foreach p,$(PLATFORMS),$(addprefix go.build., $(addprefix $(p)., $(BINS)))) -# ============================================================================== -# Targets +# sudo apt-get install gcc-aarch64-linux-gnu +## build-multiple: Build for all supported platforms +.PHONY: build-multiple +build-multiple: + @for os in $(OSES); do \ + for arch in $(ARCHS); do \ + $(MAKE) build OS=$$os ARCH=$$arch; \ + done \ + done + + +.PHONY: build-wasm +build-wasm: + GOOS=js GOARCH=wasm go build -trimpath -ldflags "-s -w" -o ${BIN_DIR}/openIM.wasm wasm/cmd/main.go ## install: Install the binary to the BIN_DIR .PHONY: install @@ -512,4 +502,15 @@ install.richgo: ## install.rts: Install rts .PHONY: install.rts install.rts: - @$(GO) install github.com/galeone/rts/cmd/rts@latest \ No newline at end of file + @$(GO) install github.com/galeone/rts/cmd/rts@latest + + +## install.gomobile: Install gomobile +.PHONY: install.gomobile +install.gomobile: + @$(GO) install golang.org/x/mobile/cmd/gomobile@latest + +## install.gobind: Install gobind +.PHONY: install.gobind +install.gobind: + @$(GO) install golang.org/x/mobile/cmd/gobind@latest diff --git a/go.mod b/go.mod index 603a67cd6..dc3f71fcd 100644 --- a/go.mod +++ b/go.mod @@ -39,6 +39,7 @@ require ( go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.24.0 // indirect + golang.org/x/mobile v0.0.0-20230531173138-3c911d8e3eda // indirect golang.org/x/sys v0.9.0 // indirect golang.org/x/text v0.11.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753 // indirect diff --git a/go.sum b/go.sum index 4de889d79..454fd2bec 100644 --- a/go.sum +++ b/go.sum @@ -111,8 +111,12 @@ golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 h1:estk1glOnSVeJ9tdEZZc5mAMDZk5lNJNyJ6DvrBkTEU= +golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/image v0.9.0 h1:QrzfX26snvCM20hIhBwuHI/ThTg18b/+kcKdXHvnR+g= golang.org/x/image v0.9.0/go.mod h1:jtrku+n79PfroUbvDdeUWMAI+heR786BofxrbiSF+J0= +golang.org/x/mobile v0.0.0-20230531173138-3c911d8e3eda h1:O+EUvnBNPwI4eLthn8W5K+cS8zQZfgTABPLNm6Bna34= +golang.org/x/mobile v0.0.0-20230531173138-3c911d8e3eda/go.mod h1:aAjjkJNdrh3PMckS4B10TGS2nag27cbKR1y2BpUxsiY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= diff --git a/internal/user/sdk.go b/internal/user/sdk.go index cda7b7d2f..7f5e85519 100644 --- a/internal/user/sdk.go +++ b/internal/user/sdk.go @@ -49,18 +49,18 @@ func (u *User) UpdateMsgSenderInfo(ctx context.Context, nickname, faceURL string return nil } -func (u *User) SubscribeUsersStatus(ctx context.Context, userID string, userIDs []string) ([]*userPb.OnlineStatus, error) { - return u.subscribeUsersStatus(ctx, userID, userIDs) +func (u *User) SubscribeUsersStatus(ctx context.Context, userIDs []string) ([]*userPb.OnlineStatus, error) { + return u.subscribeUsersStatus(ctx, userIDs) } -func (u *User) UnsubscribeUsersStatus(ctx context.Context, userID string, userIDs []string) error { - return u.unsubscribeUsersStatus(ctx, userID, userIDs) +func (u *User) UnsubscribeUsersStatus(ctx context.Context, userIDs []string) error { + return u.unsubscribeUsersStatus(ctx, userIDs) } -func (u *User) GetSubscribeUsersStatus(ctx context.Context, userID string) ([]*userPb.OnlineStatus, error) { - return u.getSubscribeUsersStatus(ctx, userID) +func (u *User) GetSubscribeUsersStatus(ctx context.Context) ([]*userPb.OnlineStatus, error) { + return u.getSubscribeUsersStatus(ctx) } -func (u *User) GetUserStatus(ctx context.Context, userID string, userIDs []string) ([]*userPb.OnlineStatus, error) { - return u.getUserStatus(ctx, userID, userIDs) +func (u *User) GetUserStatus(ctx context.Context, userIDs []string) ([]*userPb.OnlineStatus, error) { + return u.getUserStatus(ctx, userIDs) } diff --git a/internal/user/user.go b/internal/user/user.go index b15ca51e7..656e3a017 100644 --- a/internal/user/user.go +++ b/internal/user/user.go @@ -244,9 +244,9 @@ func (u *User) GetServerUserInfo(ctx context.Context, userIDs []string) ([]*sdkw } // subscribeUsersStatus Presence status of subscribed users. -func (u *User) subscribeUsersStatus(ctx context.Context, userID string, userIDs []string) ([]*userPb.OnlineStatus, error) { +func (u *User) subscribeUsersStatus(ctx context.Context, userIDs []string) ([]*userPb.OnlineStatus, error) { resp, err := util.CallApi[userPb.SubscribeOrCancelUsersStatusResp](ctx, constant.SubscribeUsersStatusRouter, &userPb.SubscribeOrCancelUsersStatusReq{ - UserID: userID, + UserID: u.loginUserID, UserIDs: userIDs, Genre: PbConstant.SubscriberUser, }) @@ -257,9 +257,9 @@ func (u *User) subscribeUsersStatus(ctx context.Context, userID string, userIDs } // unsubscribeUsersStatus Unsubscribe a user's presence. -func (u *User) unsubscribeUsersStatus(ctx context.Context, userID string, userIDs []string) error { +func (u *User) unsubscribeUsersStatus(ctx context.Context, userIDs []string) error { _, err := util.CallApi[userPb.SubscribeOrCancelUsersStatusResp](ctx, constant.UnsubscribeUsersStatusRouter, &userPb.SubscribeOrCancelUsersStatusReq{ - UserID: userID, + UserID: u.loginUserID, UserIDs: userIDs, Genre: PbConstant.Unsubscribe, }) @@ -270,9 +270,9 @@ func (u *User) unsubscribeUsersStatus(ctx context.Context, userID string, userID } // getSubscribeUsersStatus Get the online status of subscribers. -func (u *User) getSubscribeUsersStatus(ctx context.Context, userID string) ([]*userPb.OnlineStatus, error) { +func (u *User) getSubscribeUsersStatus(ctx context.Context) ([]*userPb.OnlineStatus, error) { resp, err := util.CallApi[userPb.GetSubscribeUsersStatusResp](ctx, constant.GetSubscribeUsersStatusRouter, &userPb.GetSubscribeUsersStatusReq{ - UserID: userID, + UserID: u.loginUserID, }) if err != nil { return nil, err @@ -281,9 +281,9 @@ func (u *User) getSubscribeUsersStatus(ctx context.Context, userID string) ([]*u } // getUserStatus Get the online status of users. -func (u *User) getUserStatus(ctx context.Context, userID string, userIDs []string) ([]*userPb.OnlineStatus, error) { +func (u *User) getUserStatus(ctx context.Context, userIDs []string) ([]*userPb.OnlineStatus, error) { resp, err := util.CallApi[userPb.GetUserStatusResp](ctx, constant.GetUserStatusRouter, &userPb.GetUserStatusReq{ - UserID: userID, + UserID: u.loginUserID, UserIDs: userIDs, }) if err != nil { diff --git a/msgtest/config.go b/msgtest/config.go index 97f4a85b4..7488ecddb 100644 --- a/msgtest/config.go +++ b/msgtest/config.go @@ -9,10 +9,12 @@ import ( // system var ( - TESTIP = "59.36.173.89" - APIADDR = fmt.Sprintf("http://%v:10002", TESTIP) - WSADDR = fmt.Sprintf("ws://%v:10001", TESTIP) - SECRET = "openIM123" + TESTIP = "59.36.173.89" + APIADDR = fmt.Sprintf("http://%v:10002", TESTIP) + WSADDR = fmt.Sprintf("ws://%v:10001", TESTIP) + SECRET = "openIM123" + MANAGERUSERID = "openIMAdmin" + PLATFORMID = constant.WindowsPlatformID REGISTERADDR = APIADDR + constant.UserRegister diff --git a/msgtest/module/msg_sender.go b/msgtest/module/msg_sender.go index ca129db18..2dda88f83 100644 --- a/msgtest/module/msg_sender.go +++ b/msgtest/module/msg_sender.go @@ -4,6 +4,8 @@ import ( "context" "fmt" "open_im_sdk/internal/interaction" + "open_im_sdk/pkg/ccontext" + "open_im_sdk/pkg/common" "open_im_sdk/pkg/constant" "open_im_sdk/pkg/utils" @@ -12,15 +14,17 @@ import ( "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/mcontext" ) type SendMsgUser struct { longConnMgr *interaction.LongConnMgr userID string - platformID int32 pushMsgAndMaxSeqCh chan common.Cmd2Value recvPushMsgCallback func(msg *sdkws.MsgData) failedMessageMap map[string]error + cancelFunc context.CancelFunc + ctx context.Context } func (b SendMsgUser) GetUserID() string { @@ -33,26 +37,57 @@ func WithRecvPushMsgCallback(callback func(msg *sdkws.MsgData)) func(core *SendM } } -func NewBaseCore(ctx context.Context, userID string, platformID int32, opts ...func(core *SendMsgUser)) *SendMsgUser { + +func newIMconfig(platformID int32, apiAddr, wsAddr string) sdk_struct.IMConfig { + return sdk_struct.IMConfig{ + PlatformID: platformID, + ApiAddr: apiAddr, + WsAddr: wsAddr, + } +} + +func newUserCtx(userID, token string, imConfig sdk_struct.IMConfig) context.Context { + return ccontext.WithInfo(context.Background(), &ccontext.GlobalConfig{ + UserID: userID, + Token: token, + IMConfig: imConfig}) +} + +func NewUser(userID, token string, imConfig sdk_struct.IMConfig, opts ...func(core *SendMsgUser)) *SendMsgUser { pushMsgAndMaxSeqCh := make(chan common.Cmd2Value, 1000) + ctx := newUserCtx(userID, token, imConfig) longConnMgr := interaction.NewLongConnMgr(ctx, &ConnListner{}, nil, pushMsgAndMaxSeqCh, nil) core := &SendMsgUser{ pushMsgAndMaxSeqCh: pushMsgAndMaxSeqCh, longConnMgr: longConnMgr, userID: userID, - platformID: platformID, failedMessageMap: make(map[string]error), + ctx: ctx, } for _, opt := range opts { opt(core) } - go core.recvPushMsg() - go core.longConnMgr.Run(ctx) + baseCtx, cancel := context.WithCancel(ctx) + core.cancelFunc = cancel + go core.recvPushMsg(baseCtx) + go core.longConnMgr.Run(baseCtx) return core } func (b *SendMsgUser) Close(ctx context.Context) { b.longConnMgr.Close(ctx) + b.cancelFunc() +} + +func (b *SendMsgUser) SendMsgWithContext(userID string, index int) error { + newCtx := mcontext.SetOperationID(b.ctx, utils.OperationIDGenerator()) + return b.SendSingleMsg(newCtx, userID, index) +} + +func (b *SendMsgUser) SendGroupMsgWithContext(groupID string, index int) error { + newCtx := mcontext.SetOperationID(b.ctx, utils.OperationIDGenerator()) + return b.SendGroupMsg(newCtx, groupID, index) + } func (b *SendMsgUser) SendSingleMsg(ctx context.Context, userID string, index int) error { @@ -72,6 +107,7 @@ func (b *SendMsgUser) BatchSendSingleMsg(ctx context.Context, userID string, ind func (b *SendMsgUser) SendGroupMsg(ctx context.Context, groupID string, index int) error { return b.sendMsg(ctx, "", groupID, index, constant.SuperGroupChatType, fmt.Sprintf("this is test msg user %s to group %s, index: %d", b.userID, groupID, index)) } + func (b *SendMsgUser) BatchSendGroupMsg(ctx context.Context, groupID string, index int) error { content := fmt.Sprintf("this is test msg user %s to group %s, index: %d", b.userID, groupID, index) err := b.sendMsg(ctx, "", groupID, index, constant.SuperGroupChatType, content) @@ -85,6 +121,7 @@ func (b *SendMsgUser) BatchSendGroupMsg(ctx context.Context, groupID string, ind func (b *SendMsgUser) sendMsg(ctx context.Context, userID, groupID string, index int, sesstionType int32, content string) error { var resp sdkws.UserSendMsgResp text := sdk_struct.TextElem{Content: content} + clientMsgID := utils.GetMsgID(b.userID) msg := &sdkws.MsgData{ SendID: b.userID, GroupID: groupID, @@ -94,11 +131,13 @@ func (b *SendMsgUser) sendMsg(ctx context.Context, userID, groupID string, index SenderNickname: b.userID, Content: []byte(utils.StructToJsonString(text)), CreateTime: time.Now().UnixMilli(), - SenderPlatformID: b.platformID, - ClientMsgID: utils.GetMsgID(b.userID), + SenderPlatformID: constant.AdminPlatformID, + ClientMsgID: clientMsgID, } now := time.Now().UnixMilli() if err := b.longConnMgr.SendReqWaitResp(ctx, msg, constant.SendMsg, &resp); err != nil { + b.failedMessageMap[clientMsgID] = err + return err } if resp.SendTime-now > 1500 { @@ -107,21 +146,26 @@ func (b *SendMsgUser) sendMsg(ctx context.Context, userID, groupID string, index return nil } -func (b *SendMsgUser) recvPushMsg() { + +func (b *SendMsgUser) recvPushMsg(ctx context.Context) { for { - cmd := <-b.pushMsgAndMaxSeqCh - switch cmd.Cmd { - case constant.CmdPushMsg: - pushMsgs := cmd.Value.(*sdkws.PushMessages) - for _, push := range pushMsgs.Msgs { - for _, msg := range push.Msgs { - if b.recvPushMsgCallback == nil { - b.defaultRecvPushMsgCallback(msg) - } else { - b.recvPushMsgCallback(msg) + select { + case cmd := <-b.pushMsgAndMaxSeqCh: + switch cmd.Cmd { + case constant.CmdPushMsg: + pushMsgs := cmd.Value.(*sdkws.PushMessages) + for _, push := range pushMsgs.Msgs { + for _, msg := range push.Msgs { + if b.recvPushMsgCallback == nil { + b.defaultRecvPushMsgCallback(msg) + } else { + b.recvPushMsgCallback(msg) + } } } } + case <-ctx.Done(): + return } } } diff --git a/msgtest/module/user_manager.go b/msgtest/module/user_manager.go index c5cbaed64..15256f968 100644 --- a/msgtest/module/user_manager.go +++ b/msgtest/module/user_manager.go @@ -30,3 +30,9 @@ func (t *TestUserManager) RegisterUsers(userIDs ...string) error { Users: users, }, nil) } + + +func (t *TestUserManager) GetToken(userID string, platformID int32) (string, error) { + return t.getToken(userID, platformID) +} + diff --git a/msgtest/pressure_test.go b/msgtest/pressure_test.go index 0ba57da86..ac625b581 100644 --- a/msgtest/pressure_test.go +++ b/msgtest/pressure_test.go @@ -1,17 +1,173 @@ package msgtest import ( + + "context" + "flag" + "open_im_sdk/msgtest/module" + "open_im_sdk/sdk_struct" + "sync" + "testing" + "time" + + "github.com/OpenIMSDK/tools/log" ) +func InitWithFlag() { + flag.IntVar(&totalOnlineUserNum, "t", 100000, "total online user num") + flag.IntVar(&friendMsgSenderNum, "f", 100, "friend msg sender num") + flag.IntVar(&NotFriendMsgSenderNum, "n", 100, "not friend msg sender num") + flag.IntVar(&groupMsgSenderNum, "g", 100, "group msg sender num") + flag.IntVar(&msgSenderNumEvreyUser, "m", 100, "msg sender num evrey user") + + flag.IntVar(&recvMsgUserNum, "r", 20, "recv msg user num") + +} + +const ( + TenThousandGroupUserNum = 10000 + ThousandGroupUserNum = 1000 + HundredGroupUserNum = 100 + FiftyGroupUserNum = 50 + + TenThousandGroupNum = 2 + ThousandGroupNum = 5 + HundredGroupNum = 50 + FiftyGroupNum = 100 +) + var ( - pressureTestAttribute PressureTestAttribute + totalOnlineUserNum int // 总在线用户数 + friendMsgSenderNum int // 好友消息发送者数 + NotFriendMsgSenderNum int // 非好友消息发送者数 + groupMsgSenderNum int // 群消息发送者数 + msgSenderNumEvreyUser int // 每个用户的消息数 + + recvMsgUserNum int // 消息接收者数, 抽样账号 ) func init() { - pressureTestAttribute.InitWithFlag() + + InitWithFlag() + flag.Parse() + if err := log.InitFromConfig("sdk.log", "sdk", 4, true, false, "./chat_log", 2, 24); err != nil { panic(err) } } + + +func Test_Pressure(t *testing.T) { + if friendMsgSenderNum+NotFriendMsgSenderNum+groupMsgSenderNum > totalOnlineUserNum { + t.Fatal("sender num > total online user num") + } + p := NewPressureTester() + // sample recv msg user + recvMsgUserIDs := p.userManager.GenUserIDs(recvMsgUserNum) + userIDs := p.userManager.GenUserIDs(totalOnlineUserNum) + var groupSenderUserIDs, friendSenderUserIDs, notfriendSenderUserIDs []string + if err := p.userManager.RegisterUsers(userIDs...); err != nil { + t.Fatal(err) + } + for i, userID := range userIDs { + token, err := p.userManager.GetToken(userID, int32(PLATFORMID)) + if err != nil { + log.ZError(context.Background(), "get token failed", err) + continue + } + user := module.NewUser(userID, token, sdk_struct.IMConfig{WsAddr: WSADDR, ApiAddr: APIADDR, PlatformID: int32(PLATFORMID)}) + if 0 <= i && i < friendMsgSenderNum { + p.msgSender[userID] = user + friendSenderUserIDs = append(friendSenderUserIDs, userID) + } else if friendMsgSenderNum <= i && i < friendMsgSenderNum+NotFriendMsgSenderNum { + p.msgSender[userID] = user + notfriendSenderUserIDs = append(notfriendSenderUserIDs, userID) + } else if friendMsgSenderNum+NotFriendMsgSenderNum <= i && i < friendMsgSenderNum+NotFriendMsgSenderNum+groupMsgSenderNum { + p.groupMsgSender[userID] = user + groupSenderUserIDs = append(groupSenderUserIDs, userID) + } + } + tenThousandGroupIDs, thousandGroupIDs, hundredGroupUserIDs, fiftyGroupUserIDs, err := p.createTestGroups(userIDs) + if err != nil { + t.Fatal(err) + } + totalGroupIDs := append(append(append(tenThousandGroupIDs, thousandGroupIDs...), hundredGroupUserIDs...), fiftyGroupUserIDs...) + // import friends + for _, recvMsgUserID := range recvMsgUserIDs { + p.friendManager.ImportFriends(recvMsgUserID, friendSenderUserIDs) + } + var wg sync.WaitGroup + wg.Add(3) + go func() { + defer wg.Done() + p.sendMsgs2Users(friendSenderUserIDs, recvMsgUserIDs, msgSenderNumEvreyUser, time.Second) + }() + go func() { + defer wg.Done() + p.sendMsgs2Users(notfriendSenderUserIDs, recvMsgUserIDs, msgSenderNumEvreyUser, time.Second) + }() + go func() { + defer wg.Done() + p.sendMsgs2Groups(groupSenderUserIDs, totalGroupIDs, msgSenderNumEvreyUser, time.Second) + }() + wg.Wait() +} + +type PressureTester struct { + friendManager *module.TestFriendManager + userManager *module.TestUserManager + groupManager *module.TestGroupManager + msgSender map[string]*module.SendMsgUser + groupMsgSender map[string]*module.SendMsgUser +} + +func NewPressureTester() *PressureTester { + metaManager := module.NewMetaManager(APIADDR, SECRET, MANAGERUSERID) + return &PressureTester{friendManager: metaManager.NewFriendManager(), userManager: metaManager.NewUserManager(), groupManager: metaManager.NewGroupMananger(), + msgSender: make(map[string]*module.SendMsgUser), groupMsgSender: make(map[string]*module.SendMsgUser)} +} + +func (p *PressureTester) createTestGroups(userIDs []string) (tenThousandGroupIDs, thousandGroupIDs, hundredGroupUserIDs, fiftyGroupUserIDs []string, err error) { + p.groupManager.CreateGroup("", "", userIDs[0], userIDs[:TenThousandGroupUserNum]) + return +} + +func (p *PressureTester) sendMsgs2Users(senderIDs, recvIDs []string, num int, duration time.Duration) { + var wg sync.WaitGroup + for _, senderID := range senderIDs { + for _, recvID := range recvIDs { + wg.Add(1) + go func(senderID, recvID string) { + defer wg.Done() + for i := 0; i < num; i++ { + if user, ok := p.msgSender[senderID]; ok { + user.SendMsgWithContext(recvID, i) + } + time.Sleep(duration) + } + }(senderID, recvID) + } + } + wg.Wait() +} + +func (p *PressureTester) sendMsgs2Groups(senderIDs, groupIDs []string, num int, duration time.Duration) { + var wg sync.WaitGroup + for _, senderID := range senderIDs { + for _, groupID := range groupIDs { + wg.Add(1) + go func(senderID, groupID string) { + for i := 0; i < num; i++ { + if user, ok := p.groupMsgSender[senderID]; ok { + user.SendGroupMsgWithContext(groupID, i) + } + time.Sleep(duration) + } + }(senderID, groupID) + } + } + wg.Wait() +} + diff --git a/msgtest/test_struct.go b/msgtest/test_struct.go deleted file mode 100644 index 851f83f6e..000000000 --- a/msgtest/test_struct.go +++ /dev/null @@ -1,37 +0,0 @@ -package msgtest - -import ( - "flag" - "strings" -) - -type sliceValue []string - -func (s *sliceValue) String() string { - return "" -} - -func (s *sliceValue) Set(val string) error { - *s = sliceValue(strings.Split(val, ",")) - return nil -} - -type PressureTestAttribute struct { - messageNumber int - sendNums int - recvNums int - groupNums int - timeInterval int64 -} - -func (r *PressureTestAttribute) InitWithFlag() { - flag.IntVar(&r.messageNumber, "m", 0, "messageNumber for single sender") - flag.IntVar(&r.sendNums, "s", 0, "the number of senders for testing") - flag.IntVar(&r.recvNums, "r", 0, "the number of receivers for testing") - flag.IntVar(&r.groupNums, "g", 0, "group for testing") - flag.Int64Var(&r.timeInterval, "t", 0, "timeInterVal during sending message") -} - -func ParseFlag() { - flag.Parse() -} diff --git a/open_im_sdk/user.go b/open_im_sdk/user.go index 25c064251..278830de1 100644 --- a/open_im_sdk/user.go +++ b/open_im_sdk/user.go @@ -43,21 +43,21 @@ func UpdateMsgSenderInfo(callback open_im_sdk_callback.Base, operationID string, } // SubscribeUsersStatus Presence status of subscribed users. -func SubscribeUsersStatus(callback open_im_sdk_callback.Base, operationID string, userID string, userIDs []string) { - call(callback, operationID, UserForSDK.User().SubscribeUsersStatus, userID, userIDs) +func SubscribeUsersStatus(callback open_im_sdk_callback.Base, operationID string, userIDs []string) { + call(callback, operationID, UserForSDK.User().SubscribeUsersStatus, userIDs) } // UnsubscribeUsersStatus Unsubscribe a user's presence. -func UnsubscribeUsersStatus(callback open_im_sdk_callback.Base, operationID string, userID string, userIDs []string) { - call(callback, operationID, UserForSDK.User().SubscribeUsersStatus, userID, userIDs) +func UnsubscribeUsersStatus(callback open_im_sdk_callback.Base, operationID string, userIDs []string) { + call(callback, operationID, UserForSDK.User().SubscribeUsersStatus, userIDs) } // GetSubscribeUsersStatus Get the online status of subscribers. -func GetSubscribeUsersStatus(callback open_im_sdk_callback.Base, operationID string, userID string) { - call(callback, operationID, UserForSDK.User().GetSubscribeUsersStatus, userID) +func GetSubscribeUsersStatus(callback open_im_sdk_callback.Base, operationID string) { + call(callback, operationID, UserForSDK.User().GetSubscribeUsersStatus) } // GetUserStatus Get the online status of users. -func GetUserStatus(callback open_im_sdk_callback.Base, operationID string, userID string, userIDs []string) { - call(callback, operationID, UserForSDK.User().GetUserStatus, userID, userIDs) +func GetUserStatus(callback open_im_sdk_callback.Base, operationID string, userIDs []string) { + call(callback, operationID, UserForSDK.User().GetUserStatus, userIDs) } diff --git a/scripts/template/LICENSE b/scripts/template/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/scripts/template/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/scripts/template/footer.md.tmpl b/scripts/template/footer.md.tmpl new file mode 100644 index 000000000..75a42d23c --- /dev/null +++ b/scripts/template/footer.md.tmpl @@ -0,0 +1,19 @@ +**Full Changelog**: https://github.com/{{ .Env.USERNAME }}/{{ .ProjectName }}/compare/{{ .PreviousTag }}...{{ .Tag }} + +## Get Involved with OpenIM! + +Your patronage towards OpenIM is greatly appreciated 🎉🎉. + +If you encounter any problems during its usage, please create an issue in the [GitHub repository](https://github.com/{{ .Env.USERNAME }}/{{ .ProjectName }}/), we're committed to resolving your problem as soon as possible. + +**Here are some ways to get involved with the OpenIM community:** + +📢 **Slack Channel**: Join our Slack channels for discussions, communication, and support. Click [here](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg) to join the Open-IM-Server Slack team channel. + +📧 **Gmail Contact**: If you have any questions, suggestions, or feedback for our open-source projects, please feel free to [contact us via email](https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=winxu81@gmail.com). + +📖 **Blog**: Stay up-to-date with OpenIM-Server projects and trends by reading our [blog](https://doc.rentsoft.cn/). We share the latest developments, tech trends, and other interesting information related to OpenIM. + +📱 **WeChat**: Add us on WeChat (QR Code) and indicate that you are a user or developer of Open-IM-Server. We'll process your request as soon as possible. + +Remember, your contributions play a vital role in making OpenIM successful, and we look forward to your active participation in our community! 🙌 \ No newline at end of file diff --git a/scripts/template/head.md.tmpl b/scripts/template/head.md.tmpl new file mode 100644 index 000000000..42cd18f67 --- /dev/null +++ b/scripts/template/head.md.tmpl @@ -0,0 +1,28 @@ +## Welcome to the {{ .Tag }} release of [OpenIM](https://github.com/{{ .Env.USERNAME }}/{{ .ProjectName }})!🎉🎉! + +We are excited to release {{.Tag}}, Branch: https://github.com/{{ .Env.USERNAME }}/{{ .ProjectName }}/tree/{{ .Tag }} , Git hash [{{ .ShortCommit }}], Install Address: [{{ .ReleaseURL }}]({{ .ReleaseURL }}) + +Learn more about versions of OpenIM: + ++ 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) + ++ 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) + +**Want to be one of them 😘?** + +

+ + + + + + + + + +

+ +> **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/{{ .Env.USERNAME }}/{{ .ProjectName }}/graphs/contributors), people from all over the world, OpenIM brings us together \ No newline at end of file