diff --git a/.env b/.env index 145d7e917..b2252cc9c 100644 --- a/.env +++ b/.env @@ -1,3 +1,17 @@ +# 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. + # ====================================== # ========= Basic Configuration ======== # ====================================== diff --git a/.github/workflows/auto-gh-pr.yml b/.github/workflows/auto-gh-pr.yml index f76a0c70a..98e4d83ff 100644 --- a/.github/workflows/auto-gh-pr.yml +++ b/.github/workflows/auto-gh-pr.yml @@ -51,7 +51,7 @@ jobs: # git checkout -b 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 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 env: GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/build-openim-web-image.yml b/.github/workflows/build-openim-web-image.yml new file mode 100644 index 000000000..471d7688e --- /dev/null +++ b/.github/workflows/build-openim-web-image.yml @@ -0,0 +1,274 @@ +# 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 OpenIM Web Docker image + +on: + push: + branches: + - main + - release-* + tags: + - v* + workflow_dispatch: + +env: + # Common versions + GO_VERSION: "1.20" + +jobs: + build-dockerhub: + 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 + +# docker.io/openim/openim-server:latest + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4.6.0 + with: + images: openim/openim-server + # 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 + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + # linux/ppc64le,linux/s390x + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + 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 + - name: Extract metadata (tags, labels) for Docker + id: meta2 + uses: docker/metadata-action@v4.6.0 + with: + images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server + + - name: Log in to AliYun Docker Hub + uses: docker/login-action@v2 + with: + registry: registry.cn-hangzhou.aliyuncs.com + username: ${{ secrets.ALIREGISTRY_USERNAME }} + password: ${{ secrets.ALIREGISTRY_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + # linux/ppc64le,linux/s390x + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta2.outputs.tags }} + 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 + - name: Extract metadata (tags, labels) for Docker + id: meta3 + uses: docker/metadata-action@v4.6.0 + with: + images: ghcr.io/openimsdk/openim-server + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + # linux/ppc64le,linux/s390x + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta3.outputs.tags }} + labels: ${{ steps.meta3.outputs.labels }} + + build-openim-web-dockerhub: + 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 + +# docker.io/openim/openim-server:latest + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4.6.0 + with: + images: openim/openim-server + # 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 + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: ./build/images/openim-tools/openim-web/Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + build-openim-web-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 + - name: Extract metadata (tags, labels) for Docker + id: meta2 + uses: docker/metadata-action@v4.6.0 + with: + images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server + + - name: Log in to AliYun Docker Hub + uses: docker/login-action@v2 + with: + registry: registry.cn-hangzhou.aliyuncs.com + username: ${{ secrets.ALIREGISTRY_USERNAME }} + password: ${{ secrets.ALIREGISTRY_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: ./build/images/openim-tools/openim-web/Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta2.outputs.tags }} + labels: ${{ steps.meta2.outputs.labels }} + + build-openim-web-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 }} + + - name: Extract metadata (tags, labels) for Docker openim-web + id: meta1 + uses: docker/metadata-action@v4.6.0 + with: + images: ghcr.io/openimsdk/openim-web + + - name: Build and push Docker image for openim-web + uses: docker/build-push-action@v4 + with: + context: . + file: ./build/images/openim-tools/openim-web/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-web + id: meta2 + uses: docker/metadata-action@v4.6.0 + with: + images: ghcr.io/openimsdk/component + + - name: Build and push Docker image for component + uses: docker/build-push-action@v4 + with: + context: . + file: ./build/images/openim-tools/component/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 diff --git a/.github/workflows/docker-buildx.yml b/.github/workflows/docker-buildx.yml index 9734e05e2..ae52fa242 100644 --- a/.github/workflows/docker-buildx.yml +++ b/.github/workflows/docker-buildx.yml @@ -319,67 +319,3 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache - build-tools-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 }} - - - name: Extract metadata (tags, labels) for Docker openim-web - id: meta1 - uses: docker/metadata-action@v4.6.0 - with: - images: ghcr.io/openimsdk/openim-web - - - name: Build and push Docker image for openim-web - uses: docker/build-push-action@v4 - with: - context: . - file: ./build/images/openim-tools/openim-web/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-web - id: meta2 - uses: docker/metadata-action@v4.6.0 - with: - images: ghcr.io/openimsdk/component - - - name: Build and push Docker image for component - uses: docker/build-push-action@v4 - with: - context: . - file: ./build/images/openim-tools/component/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 \ No newline at end of file diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9f3062fb2..d3a35e65d 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -114,7 +114,7 @@ jobs: - [ ] Disenchanter can connect and issue actions This is an automated PR. @ ${{ github.actor }} - [workflow](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/.github/workflows/pull-request.yml). + [workflow](https://github.com/openimsdk/open-im-server/blob/main/.github/workflows/pull-request.yml). base: main labels: | kind/documentation diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62b89e837..c14db3699 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: distribution: goreleaser version: latest workdir: . - args: release -f ./build/goreleaser.yaml --rm-dist --clean --release-footer-tmpl=scripts/template/footer.md.tmpl --release-header-tmpl=scripts/template/head.md.tmpl + args: release -f ./build/goreleaser.yaml --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 }} diff --git a/.gitignore b/.gitignore index 92408fa56..2d8f1e002 100644 --- a/.gitignore +++ b/.gitignore @@ -160,6 +160,7 @@ flycheck_*.el # Dependency directories (remove the comment below to include it) vendor/ +tools/imctl # Go workspace file # go.work diff --git a/.golangci.yml b/.golangci.yml index 3d50e109b..d588695dd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -176,7 +176,7 @@ linters-settings: # put imports beginning with prefix after 3rd-party packages; # only support one prefix # if not set, use goimports.local-prefixes - prefix: github.com/OpenIMSDK/Open-IM-Server + prefix: github.com/openimsdk/open-im-server gocognit: # minimal code complexity to report, 30 by default (but we recommend 10-20) min-complexity: 30 @@ -333,7 +333,7 @@ linters-settings: goimports: # put imports beginning with prefix after 3rd-party packages; # it's a comma-separated list of prefixes - local-prefixes: github.com/OpenIMSDK/Open-IM-Server + local-prefixes: github.com/openimsdk/open-im-server gomnd: settings: diff --git a/CHANGELOG/.chglog/config.yml b/CHANGELOG/.chglog/config.yml index 296ca2eb7..2a45bc26a 100644 --- a/CHANGELOG/.chglog/config.yml +++ b/CHANGELOG/.chglog/config.yml @@ -3,7 +3,7 @@ style: github template: CHANGELOG.tpl.md info: title: CHANGELOG - repository_url: https://github.com/OpenIMSDK/Open-IM-Server + repository_url: https://github.com/openimsdk/open-im-server options: tag_filter_pattern: '^v' sort: "date" diff --git a/CHANGELOG/CHANGELOG-1.0.md b/CHANGELOG/CHANGELOG-1.0.md index 04980fbd4..bed425943 100644 --- a/CHANGELOG/CHANGELOG-1.0.md +++ b/CHANGELOG/CHANGELOG-1.0.md @@ -47,10 +47,10 @@ - update -[Unreleased]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.7...HEAD -[v1.0.7]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.6...v1.0.7 -[v1.0.6]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.5...v1.0.6 -[v1.0.5]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.4...v1.0.5 -[v1.0.4]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.3...v1.0.4 -[v1.0.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.1...v1.0.3 -[v1.0.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.0...v1.0.1 +[Unreleased]: https://github.com/openimsdk/open-im-server/compare/v1.0.7...HEAD +[v1.0.7]: https://github.com/openimsdk/open-im-server/compare/v1.0.6...v1.0.7 +[v1.0.6]: https://github.com/openimsdk/open-im-server/compare/v1.0.5...v1.0.6 +[v1.0.5]: https://github.com/openimsdk/open-im-server/compare/v1.0.4...v1.0.5 +[v1.0.4]: https://github.com/openimsdk/open-im-server/compare/v1.0.3...v1.0.4 +[v1.0.3]: https://github.com/openimsdk/open-im-server/compare/v1.0.1...v1.0.3 +[v1.0.1]: https://github.com/openimsdk/open-im-server/compare/v1.0.0...v1.0.1 diff --git a/CHANGELOG/CHANGELOG-2.0.md b/CHANGELOG/CHANGELOG-2.0.md index b89ddeadc..8902f1814 100644 --- a/CHANGELOG/CHANGELOG-2.0.md +++ b/CHANGELOG/CHANGELOG-2.0.md @@ -14,7 +14,7 @@ ## [v2.0.9] - 2022-04-29 ### Reverts -- update etcd to v3.5.2 ([#206](https://github.com/OpenIMSDK/Open-IM-Server/issues/206)) +- update etcd to v3.5.2 ([#206](https://github.com/openimsdk/open-im-server/issues/206)) ### Pull Requests - Merge branch 'tuoyun' @@ -74,14 +74,14 @@ - update -[Unreleased]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.10...HEAD -[v2.0.10]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.9...v2.0.10 -[v2.0.9]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.8...v2.0.9 -[v2.0.8]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.7...v2.0.8 -[v2.0.7]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.6...v2.0.7 -[v2.0.6]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.5...v2.0.6 -[v2.0.5]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.04...v2.0.5 -[v2.04]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.3...v2.04 -[v2.0.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.2...v2.0.3 -[v2.0.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.1...v2.0.2 -[v2.0.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.0...v2.0.1 +[Unreleased]: https://github.com/openimsdk/open-im-server/compare/v2.0.10...HEAD +[v2.0.10]: https://github.com/openimsdk/open-im-server/compare/v2.0.9...v2.0.10 +[v2.0.9]: https://github.com/openimsdk/open-im-server/compare/v2.0.8...v2.0.9 +[v2.0.8]: https://github.com/openimsdk/open-im-server/compare/v2.0.7...v2.0.8 +[v2.0.7]: https://github.com/openimsdk/open-im-server/compare/v2.0.6...v2.0.7 +[v2.0.6]: https://github.com/openimsdk/open-im-server/compare/v2.0.5...v2.0.6 +[v2.0.5]: https://github.com/openimsdk/open-im-server/compare/v2.04...v2.0.5 +[v2.04]: https://github.com/openimsdk/open-im-server/compare/v2.0.3...v2.04 +[v2.0.3]: https://github.com/openimsdk/open-im-server/compare/v2.0.2...v2.0.3 +[v2.0.2]: https://github.com/openimsdk/open-im-server/compare/v2.0.1...v2.0.2 +[v2.0.1]: https://github.com/openimsdk/open-im-server/compare/v2.0.0...v2.0.1 diff --git a/CHANGELOG/CHANGELOG-2.1.md b/CHANGELOG/CHANGELOG-2.1.md index 32effd64d..7eef06f08 100644 --- a/CHANGELOG/CHANGELOG-2.1.md +++ b/CHANGELOG/CHANGELOG-2.1.md @@ -21,7 +21,7 @@ ## v2.1.0 - 2022-06-17 ### Reverts -- update etcd to v3.5.2 ([#206](https://github.com/OpenIMSDK/Open-IM-Server/issues/206)) +- update etcd to v3.5.2 ([#206](https://github.com/openimsdk/open-im-server/issues/206)) - friend modify - update @@ -47,4 +47,4 @@ - Merge branch 'tuoyun' -[Unreleased]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.1.0...HEAD +[Unreleased]: https://github.com/openimsdk/open-im-server/compare/v2.1.0...HEAD diff --git a/CHANGELOG/CHANGELOG-2.2.md b/CHANGELOG/CHANGELOG-2.2.md index e00204316..8afb24b29 100644 --- a/CHANGELOG/CHANGELOG-2.2.md +++ b/CHANGELOG/CHANGELOG-2.2.md @@ -21,7 +21,7 @@ ## v2.2.0 - 2022-07-01 ### Reverts -- update etcd to v3.5.2 ([#206](https://github.com/OpenIMSDK/Open-IM-Server/issues/206)) +- update etcd to v3.5.2 ([#206](https://github.com/openimsdk/open-im-server/issues/206)) - friend modify - update @@ -47,4 +47,4 @@ - Merge branch 'tuoyun' -[Unreleased]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.2.0...HEAD +[Unreleased]: https://github.com/openimsdk/open-im-server/compare/v2.2.0...HEAD diff --git a/CHANGELOG/CHANGELOG-2.3.md b/CHANGELOG/CHANGELOG-2.3.md index c33b81a9a..e14745f30 100644 --- a/CHANGELOG/CHANGELOG-2.3.md +++ b/CHANGELOG/CHANGELOG-2.3.md @@ -37,7 +37,7 @@ ## v2.3.0-rc0 - 2022-07-15 ### Reverts -- update etcd to v3.5.2 ([#206](https://github.com/OpenIMSDK/Open-IM-Server/issues/206)) +- update etcd to v3.5.2 ([#206](https://github.com/openimsdk/open-im-server/issues/206)) - friend modify - update @@ -63,8 +63,8 @@ - Merge branch 'tuoyun' -[Unreleased]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.3.3...HEAD -[v2.3.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.3.2...v2.3.3 -[v2.3.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.3.0-rc2...v2.3.2 -[v2.3.0-rc2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.3.0-rc1...v2.3.0-rc2 -[v2.3.0-rc1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.3.0-rc0...v2.3.0-rc1 +[Unreleased]: https://github.com/openimsdk/open-im-server/compare/v2.3.3...HEAD +[v2.3.3]: https://github.com/openimsdk/open-im-server/compare/v2.3.2...v2.3.3 +[v2.3.2]: https://github.com/openimsdk/open-im-server/compare/v2.3.0-rc2...v2.3.2 +[v2.3.0-rc2]: https://github.com/openimsdk/open-im-server/compare/v2.3.0-rc1...v2.3.0-rc2 +[v2.3.0-rc1]: https://github.com/openimsdk/open-im-server/compare/v2.3.0-rc0...v2.3.0-rc1 diff --git a/CHANGELOG/CHANGELOG-2.9.md b/CHANGELOG/CHANGELOG-2.9.md index b51212ba8..b921eb51b 100644 --- a/CHANGELOG/CHANGELOG-2.9.md +++ b/CHANGELOG/CHANGELOG-2.9.md @@ -38,15 +38,15 @@ ## v2.9.0 - 2023-07-04 ### Reverts -- update etcd to v3.5.2 ([#206](https://github.com/OpenIMSDK/Open-IM-Server/issues/206)) +- update etcd to v3.5.2 ([#206](https://github.com/openimsdk/open-im-server/issues/206)) ### Pull Requests - Merge branch 'tuoyun' -[Unreleased]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.9.0+1.839643f...HEAD -[v2.9.0+1.839643f]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.9.0+2.35f07fe...v2.9.0+1.839643f -[v2.9.0+2.35f07fe]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.9.0+1.b5072b1...v2.9.0+2.35f07fe -[v2.9.0+1.b5072b1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.9.0+3.2667a3a...v2.9.0+1.b5072b1 -[v2.9.0+3.2667a3a]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.9.0+7.04818ca...v2.9.0+3.2667a3a -[v2.9.0+7.04818ca]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.9.0...v2.9.0+7.04818ca +[Unreleased]: https://github.com/openimsdk/open-im-server/compare/v2.9.0+1.839643f...HEAD +[v2.9.0+1.839643f]: https://github.com/openimsdk/open-im-server/compare/v2.9.0+2.35f07fe...v2.9.0+1.839643f +[v2.9.0+2.35f07fe]: https://github.com/openimsdk/open-im-server/compare/v2.9.0+1.b5072b1...v2.9.0+2.35f07fe +[v2.9.0+1.b5072b1]: https://github.com/openimsdk/open-im-server/compare/v2.9.0+3.2667a3a...v2.9.0+1.b5072b1 +[v2.9.0+3.2667a3a]: https://github.com/openimsdk/open-im-server/compare/v2.9.0+7.04818ca...v2.9.0+3.2667a3a +[v2.9.0+7.04818ca]: https://github.com/openimsdk/open-im-server/compare/v2.9.0...v2.9.0+7.04818ca diff --git a/CHANGELOG/CHANGELOG-3.0.md b/CHANGELOG/CHANGELOG-3.0.md index cf1aa4b62..1b99e7e34 100644 --- a/CHANGELOG/CHANGELOG-3.0.md +++ b/CHANGELOG/CHANGELOG-3.0.md @@ -47,7 +47,7 @@ ## [v2.9.0] - 2023-07-04 ### Reverts -- update etcd to v3.5.2 ([#206](https://github.com/OpenIMSDK/Open-IM-Server/issues/206)) +- update etcd to v3.5.2 ([#206](https://github.com/openimsdk/open-im-server/issues/206)) ### Pull Requests - Merge branch 'tuoyun' @@ -85,7 +85,7 @@ ## [v2.0.9] - 2022-04-29 ### Reverts -- update etcd to v3.5.2 ([#206](https://github.com/OpenIMSDK/Open-IM-Server/issues/206)) +- update etcd to v3.5.2 ([#206](https://github.com/openimsdk/open-im-server/issues/206)) ### Pull Requests - Merge branch 'tuoyun' @@ -161,28 +161,28 @@ - update -[Unreleased]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.9.0...HEAD -[v2.9.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.3.3...v2.9.0 -[v2.3.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.3.2...v2.3.3 -[v2.3.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.3.0-rc2...v2.3.2 -[v2.3.0-rc2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.3.0-rc1...v2.3.0-rc2 -[v2.3.0-rc1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.3.0-rc0...v2.3.0-rc1 -[v2.3.0-rc0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.2.0...v2.3.0-rc0 -[v2.2.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.1.0...v2.2.0 -[v2.1.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.10...v2.1.0 -[v2.0.10]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.9...v2.0.10 -[v2.0.9]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.7...v2.0.9 -[v2.0.7]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.6...v2.0.7 -[v2.0.6]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.5...v2.0.6 -[v2.0.5]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.04...v2.0.5 -[v2.04]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.3...v2.04 -[v2.0.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.2...v2.0.3 -[v2.0.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.1...v2.0.2 -[v2.0.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v2.0.0...v2.0.1 -[v2.0.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.7...v2.0.0 -[v1.0.7]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.6...v1.0.7 -[v1.0.6]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.5...v1.0.6 -[v1.0.5]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.4...v1.0.5 -[v1.0.4]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.3...v1.0.4 -[v1.0.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.1...v1.0.3 -[v1.0.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v1.0.0...v1.0.1 +[Unreleased]: https://github.com/openimsdk/open-im-server/compare/v2.9.0...HEAD +[v2.9.0]: https://github.com/openimsdk/open-im-server/compare/v2.3.3...v2.9.0 +[v2.3.3]: https://github.com/openimsdk/open-im-server/compare/v2.3.2...v2.3.3 +[v2.3.2]: https://github.com/openimsdk/open-im-server/compare/v2.3.0-rc2...v2.3.2 +[v2.3.0-rc2]: https://github.com/openimsdk/open-im-server/compare/v2.3.0-rc1...v2.3.0-rc2 +[v2.3.0-rc1]: https://github.com/openimsdk/open-im-server/compare/v2.3.0-rc0...v2.3.0-rc1 +[v2.3.0-rc0]: https://github.com/openimsdk/open-im-server/compare/v2.2.0...v2.3.0-rc0 +[v2.2.0]: https://github.com/openimsdk/open-im-server/compare/v2.1.0...v2.2.0 +[v2.1.0]: https://github.com/openimsdk/open-im-server/compare/v2.0.10...v2.1.0 +[v2.0.10]: https://github.com/openimsdk/open-im-server/compare/v2.0.9...v2.0.10 +[v2.0.9]: https://github.com/openimsdk/open-im-server/compare/v2.0.7...v2.0.9 +[v2.0.7]: https://github.com/openimsdk/open-im-server/compare/v2.0.6...v2.0.7 +[v2.0.6]: https://github.com/openimsdk/open-im-server/compare/v2.0.5...v2.0.6 +[v2.0.5]: https://github.com/openimsdk/open-im-server/compare/v2.04...v2.0.5 +[v2.04]: https://github.com/openimsdk/open-im-server/compare/v2.0.3...v2.04 +[v2.0.3]: https://github.com/openimsdk/open-im-server/compare/v2.0.2...v2.0.3 +[v2.0.2]: https://github.com/openimsdk/open-im-server/compare/v2.0.1...v2.0.2 +[v2.0.1]: https://github.com/openimsdk/open-im-server/compare/v2.0.0...v2.0.1 +[v2.0.0]: https://github.com/openimsdk/open-im-server/compare/v1.0.7...v2.0.0 +[v1.0.7]: https://github.com/openimsdk/open-im-server/compare/v1.0.6...v1.0.7 +[v1.0.6]: https://github.com/openimsdk/open-im-server/compare/v1.0.5...v1.0.6 +[v1.0.5]: https://github.com/openimsdk/open-im-server/compare/v1.0.4...v1.0.5 +[v1.0.4]: https://github.com/openimsdk/open-im-server/compare/v1.0.3...v1.0.4 +[v1.0.3]: https://github.com/openimsdk/open-im-server/compare/v1.0.1...v1.0.3 +[v1.0.1]: https://github.com/openimsdk/open-im-server/compare/v1.0.0...v1.0.1 diff --git a/CHANGELOG/CHANGELOG-3.1.md b/CHANGELOG/CHANGELOG-3.1.md index c51eb2098..8d64c5ef7 100644 --- a/CHANGELOG/CHANGELOG-3.1.md +++ b/CHANGELOG/CHANGELOG-3.1.md @@ -2,31 +2,18 @@ -- [Version logging for OpenIM](#version-logging-for-openim) - - [Unreleased](#unreleased) - - [v3.1.2-beta.3 - 2023-08-09](#v312-beta3---2023-08-09) - - [v3.1.2-beta.2 - 2023-08-09](#v312-beta2---2023-08-09) - - [v3.1.2-beta.1 - 2023-08-09](#v312-beta1---2023-08-09) - - [v3.1.2-beta.0 - 2023-08-08](#v312-beta0---2023-08-08) - - [v3.1.2.beta.0 - 2023-08-08](#v312beta0---2023-08-08) - - [v3.1.1-beta.4 - 2023-08-07](#v311-beta4---2023-08-07) - - [v3.1.1-beta.3 - 2023-08-05](#v311-beta3---2023-08-05) - - [v3.1.1-beta.2 - 2023-08-04](#v311-beta2---2023-08-04) - - [v3.1.1-beta.1 - 2023-08-04](#v311-beta1---2023-08-04) - - [v3.1.1-alpha.3 - 2023-08-03](#v311-alpha3---2023-08-03) - - [v3.1.1-alpha.2 - 2023-08-03](#v311-alpha2---2023-08-03) - - [v3.1.1-alpha.1 - 2023-08-02](#v311-alpha1---2023-08-02) - - [v3.1.0 - 2023-07-28](#v310---2023-07-28) - - [Reverts](#reverts) - - [Pull Requests](#pull-requests) - - ## [Unreleased] + +## [v3.1.3-beta.1] - 2023-08-14 + + +## [v3.1.3] - 2023-08-14 + ## [v3.1.2-beta.3] - 2023-08-09 @@ -39,49 +26,19 @@ ## [v3.1.2-beta.0] - 2023-08-08 - -## [v3.1.2.beta.0] - 2023-08-08 - - -## [v3.1.1-beta.4] - 2023-08-07 - - -## [v3.1.1-beta.3] - 2023-08-05 - - -## [v3.1.1-beta.2] - 2023-08-04 - - -## [v3.1.1-beta.1] - 2023-08-04 - - -## [v3.1.1-alpha.3] - 2023-08-03 - - -## [v3.1.1-alpha.2] - 2023-08-03 - - -## [v3.1.1-alpha.1] - 2023-08-02 - ## v3.1.0 - 2023-07-28 ### Reverts -- update etcd to v3.5.2 ([#206](https://github.com/OpenIMSDK/Open-IM-Server/issues/206)) +- update etcd to v3.5.2 ([#206](https://github.com/openimsdk/open-im-server/issues/206)) ### Pull Requests - Merge branch 'tuoyun' -[Unreleased]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.2-beta.3...HEAD -[v3.1.2-beta.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.2-beta.2...v3.1.2-beta.3 -[v3.1.2-beta.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.2-beta.1...v3.1.2-beta.2 -[v3.1.2-beta.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.2-beta.0...v3.1.2-beta.1 -[v3.1.2-beta.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.2.beta.0...v3.1.2-beta.0 -[v3.1.2.beta.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-beta.4...v3.1.2.beta.0 -[v3.1.1-beta.4]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-beta.3...v3.1.1-beta.4 -[v3.1.1-beta.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-beta.2...v3.1.1-beta.3 -[v3.1.1-beta.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-beta.1...v3.1.1-beta.2 -[v3.1.1-beta.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-alpha.3...v3.1.1-beta.1 -[v3.1.1-alpha.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-alpha.2...v3.1.1-alpha.3 -[v3.1.1-alpha.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-alpha.1...v3.1.1-alpha.2 -[v3.1.1-alpha.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.0...v3.1.1-alpha.1 +[Unreleased]: https://github.com/openimsdk/open-im-server/compare/v3.1.3-beta.1...HEAD +[v3.1.3-beta.1]: https://github.com/openimsdk/open-im-server/compare/v3.1.3...v3.1.3-beta.1 +[v3.1.3]: https://github.com/openimsdk/open-im-server/compare/v3.1.2-beta.3...v3.1.3 +[v3.1.2-beta.3]: https://github.com/openimsdk/open-im-server/compare/v3.1.2-beta.2...v3.1.2-beta.3 +[v3.1.2-beta.2]: https://github.com/openimsdk/open-im-server/compare/v3.1.2-beta.1...v3.1.2-beta.2 +[v3.1.2-beta.1]: https://github.com/openimsdk/open-im-server/compare/v3.1.2-beta.0...v3.1.2-beta.1 +[v3.1.2-beta.0]: https://github.com/openimsdk/open-im-server/compare/v3.1.0...v3.1.2-beta.0 diff --git a/CHANGELOG/CHANGELOG-3.2.md b/CHANGELOG/CHANGELOG-3.2.md index 0074a7e88..f7823d119 100644 --- a/CHANGELOG/CHANGELOG-3.2.md +++ b/CHANGELOG/CHANGELOG-3.2.md @@ -8,6 +8,21 @@ ## [Unreleased] + +## [v3.2.2] - 2023-09-03 + + +## [v3.2.3] - 2023-09-03 + + +## [v3.2.1] - 2023-09-03 + + +## [v3.2.2-beta.4] - 2023-08-28 + + +## [v3.2.2-alpha.0] - 2023-08-25 + ## [v3.2.2-beta.3] - 2023-08-22 @@ -29,16 +44,21 @@ ## v3.2.0-alpha.0 - 2023-08-16 ### Reverts -- update etcd to v3.5.2 ([#206](https://github.com/OpenIMSDK/Open-IM-Server/issues/206)) +- update etcd to v3.5.2 ([#206](https://github.com/openimsdk/open-im-server/issues/206)) ### Pull Requests - Merge branch 'tuoyun' -[Unreleased]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.2.2-beta.3...HEAD -[v3.2.2-beta.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.2.2-beta.2...v3.2.2-beta.3 -[v3.2.2-beta.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.2.2-beta.1...v3.2.2-beta.2 -[v3.2.2-beta.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.2.0...v3.2.2-beta.1 -[v3.2.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.2.0-rc.0...v3.2.0 -[v3.2.0-rc.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.2.2-beta.0...v3.2.0-rc.0 -[v3.2.2-beta.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.2.0-alpha.0...v3.2.2-beta.0 +[Unreleased]: https://github.com/openimsdk/open-im-server/compare/v3.2.2...HEAD +[v3.2.2]: https://github.com/openimsdk/open-im-server/compare/v3.2.3...v3.2.2 +[v3.2.3]: https://github.com/openimsdk/open-im-server/compare/v3.2.1...v3.2.3 +[v3.2.1]: https://github.com/openimsdk/open-im-server/compare/v3.2.2-beta.4...v3.2.1 +[v3.2.2-beta.4]: https://github.com/openimsdk/open-im-server/compare/v3.2.2-alpha.0...v3.2.2-beta.4 +[v3.2.2-alpha.0]: https://github.com/openimsdk/open-im-server/compare/v3.2.2-beta.3...v3.2.2-alpha.0 +[v3.2.2-beta.3]: https://github.com/openimsdk/open-im-server/compare/v3.2.2-beta.2...v3.2.2-beta.3 +[v3.2.2-beta.2]: https://github.com/openimsdk/open-im-server/compare/v3.2.2-beta.1...v3.2.2-beta.2 +[v3.2.2-beta.1]: https://github.com/openimsdk/open-im-server/compare/v3.2.0...v3.2.2-beta.1 +[v3.2.0]: https://github.com/openimsdk/open-im-server/compare/v3.2.0-rc.0...v3.2.0 +[v3.2.0-rc.0]: https://github.com/openimsdk/open-im-server/compare/v3.2.2-beta.0...v3.2.0-rc.0 +[v3.2.2-beta.0]: https://github.com/openimsdk/open-im-server/compare/v3.2.0-alpha.0...v3.2.2-beta.0 diff --git a/CHANGELOG/CHANGELOG.md b/CHANGELOG/CHANGELOG.md index 6ca4d08b2..41df11bba 100644 --- a/CHANGELOG/CHANGELOG.md +++ b/CHANGELOG/CHANGELOG.md @@ -16,7 +16,7 @@ All notable changes to this project will be documented in this file. -+ [https://github.com/OpenIMSDK/Open-IM-Server/releases](https://github.com/OpenIMSDK/Open-IM-Server/releases) ++ [https://github.com/openimsdk/open-im-server/releases](https://github.com/openimsdk/open-im-server/releases) ## OpenIM versioning policy @@ -44,7 +44,7 @@ $ git-chglog --init **Options** -- What is the URL of your repository?: https://github.com/OpenIMSDK/Open-IM-Server +- What is the URL of your repository?: https://github.com/openimsdk/open-im-server - What is your favorite style?: github - Choose the format of your favorite commit message: (): -- feat(core): Add new feature - What is your favorite template style?: standard diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a3ee8b8a6..80cdf66c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,7 +46,7 @@ The [Makefile](./Makefile) is for every developer, even if you don't know how to #### Code and doc contribution -Every action to make project Open-IM-Server better is encouraged. On GitHub, every improvement for Open-IM-Server could be via a [PR](https://github.com/OpenIMSDK/Open-IM-Server/pulls) (short for pull request). +Every action to make project Open-IM-Server better is encouraged. On GitHub, every improvement for Open-IM-Server could be via a [PR](https://github.com/openimsdk/open-im-server/pulls) (short for pull request). + If you find a typo, try to fix it! + If you find a bug, try to fix it! @@ -61,14 +61,14 @@ Every action to make project Open-IM-Server better is encouraged. On GitHub, eve #### Where should I start? -+ If you are new to the project, don't know how to contribute Open-IM-Server, please check out the [good first issue](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aopen+label%3A"good+first+issue"+sort%3Aupdated-desc) label. -+ You should be good at filtering the Open-IM-Server issue tags and finding the ones you like, such as [RFC](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) for big initiatives, features for [feature](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+label%3Afeature) proposals, and [bug](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+label%3Abug+) fixes. -+ If you are looking for something to work on, check out our [open issues](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). -+ If you have an idea for a new feature, please [open an issue](https://github.com/OpenIMSDK/Open-IM-Server/issues/new/choose), and we can discuss it. ++ If you are new to the project, don't know how to contribute Open-IM-Server, please check out the [good first issue](https://github.com/openimsdk/open-im-server/issues?q=is%3Aopen+label%3A"good+first+issue"+sort%3Aupdated-desc) label. ++ You should be good at filtering the Open-IM-Server issue tags and finding the ones you like, such as [RFC](https://github.com/openimsdk/open-im-server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) for big initiatives, features for [feature](https://github.com/openimsdk/open-im-server/issues?q=is%3Aissue+label%3Afeature) proposals, and [bug](https://github.com/openimsdk/open-im-server/issues?q=is%3Aissue+label%3Abug+) fixes. ++ If you are looking for something to work on, check out our [open issues](https://github.com/openimsdk/open-im-server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). ++ If you have an idea for a new feature, please [open an issue](https://github.com/openimsdk/open-im-server/issues/new/choose), and we can discuss it. #### Design documents -For any substantial design, there should be a well-crafted design document. This document is not just a simple record, but also a detailed description and manifestation, which can help team members better understand the design thinking and grasp the design direction. In the process of writing the design document, we can choose to use tools such as `Google Docs` or `Notion`, and even mark RFC in [issues](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) or [discussions](https://github.com/OpenIMSDK/Open-IM-Server/discussions) for better collaboration. Of course, after completing the design document, we should also add it to our [Shared Drive](https://drive.google.com/drive/) and notify the appropriate working group to let everyone know of its existence. Only by doing so can we maximize the effectiveness of the design document and provide strong support for the smooth progress of the project. +For any substantial design, there should be a well-crafted design document. This document is not just a simple record, but also a detailed description and manifestation, which can help team members better understand the design thinking and grasp the design direction. In the process of writing the design document, we can choose to use tools such as `Google Docs` or `Notion`, and even mark RFC in [issues](https://github.com/openimsdk/open-im-server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) or [discussions](https://github.com/openimsdk/open-im-server/discussions) for better collaboration. Of course, after completing the design document, we should also add it to our [Shared Drive](https://drive.google.com/drive/) and notify the appropriate working group to let everyone know of its existence. Only by doing so can we maximize the effectiveness of the design document and provide strong support for the smooth progress of the project. Anybody can access the shared Drive for reading. To get access to comment. Once you've done that, head to the [shared Drive](https://drive.google.com/) and behold all the docs. @@ -95,10 +95,10 @@ To propose PR for the Open-IM-Server item, we assume you have registered a GitHu 2. **CLONE** your own repository to main locally. Use `git clone https://github.com//Open-IM-Server.git` to clone repository to your local machine. Then you can create new branches to finish the change you wish to make. -3. **Set Remote** upstream to be `https://github.com/OpenIMSDK/Open-IM-Server.git` using the following two commands: +3. **Set Remote** upstream to be `https://github.com/openimsdk/open-im-server.git` using the following two commands: ```bash - ❯ git remote add upstream https://github.com/OpenIMSDK/Open-IM-Server.git + ❯ git remote add upstream https://github.com/openimsdk/open-im-server.git ❯ git remote set-url --push upstream no-pushing ``` @@ -108,7 +108,7 @@ To propose PR for the Open-IM-Server item, we assume you have registered a GitHu ❯ git remote -v origin https://github.com//Open-IM-Server.git (fetch) origin https://github.com//Open-IM-Server.git (push) - upstream https://github.com/OpenIMSDK/Open-IM-Server.git (fetch) + upstream https://github.com/openimsdk/open-im-server.git (fetch) upstream no-pushing (push) ``` @@ -174,7 +174,7 @@ To propose PR for the Open-IM-Server item, we assume you have registered a GitHu # then create pull request, and merge ``` -7. **Open a pull request** to `OpenIMSDK/Open-IM-Server:main` +7. **Open a pull request** to `openimsdk/open-im-server:main` It is recommended to review your changes before filing a pull request. Check if your code doesn't conflict with the main branch and no redundant code is included. @@ -190,7 +190,7 @@ Instead we encourage you to send us a private email to winxu81@gmail.com to repo #### Reporting general issues -To be honest, we regard every user of Open-IM-Serveras a very kind contributor. After experiencing Open-IM-Server, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/OpenIMSDK/Open-IM-Server/issues/new/choose). +To be honest, we regard every user of Open-IM-Serveras a very kind contributor. After experiencing Open-IM-Server, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/openimsdk/open-im-server/issues/new/choose). Since we collaborate project Open-IM-Server in a distributed way, we appreciate **WELL-WRITTEN**, **DETAILED**, **EXPLICIT** issue reports. To make the communication more efficient, we wish everyone could search if your issue is an existing one in the searching list. If you find it existing, please add your details in comments under the existing issue instead of opening a brand new one. @@ -258,7 +258,7 @@ An example for this could be: PR is the only way to make change to Open-IM-Server project files. To help reviewers better get your purpose, PR description could not be too detailed. We encourage contributors to follow the [PR template](https://github.com/OpenIMSDK/.github/tree/main/.github/PULL_REQUEST_TEMPLATE.md) to finish the pull request. -You can find some very formal PR in [RFC](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) issues and learn about them. +You can find some very formal PR in [RFC](https://github.com/openimsdk/open-im-server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) issues and learn about them. **📖 Opening PRs:** @@ -307,8 +307,8 @@ git() { The documentation for Open-IM-Server includes: -+ [README.md](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/README.md): This file includes the basic information and instructions for getting started with Open-IM-Server. -+ [CONTRIBUTING.md](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CONTRIBUTING.md): This file contains guidelines for contributing to Open-IM-Server's codebase, such as how to submit issues, pull requests, and code reviews. ++ [README.md](https://github.com/openimsdk/open-im-server/blob/main/README.md): This file includes the basic information and instructions for getting started with Open-IM-Server. ++ [CONTRIBUTING.md](https://github.com/openimsdk/open-im-server/blob/main/CONTRIBUTING.md): This file contains guidelines for contributing to Open-IM-Server's codebase, such as how to submit issues, pull requests, and code reviews. + [Official Documentation](https://doc.rentsoft.cn/): This is the official documentation for Open-IM-Server, which includes comprehensive information on all of its features, configuration options, and troubleshooting tips. Please obey the following rules to better format the docs, which would greatly improve the reading experience. @@ -324,9 +324,9 @@ Please obey the following rules to better format the docs, which would greatly i We choose GitHub as the primary place for Open-IM-Server to collaborate. So the latest updates of Open-IM-Server are always here. Although contributions via PR is an explicit way to help, we still call for any other ways. -+ reply to other's [issues](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) if you could; ++ reply to other's [issues](https://github.com/openimsdk/open-im-server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) if you could; + help solve other user's problems; -+ help review other's [PR](https://github.com/OpenIMSDK/Open-IM-Server/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) design; ++ help review other's [PR](https://github.com/openimsdk/open-im-server/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) design; + discuss about Open-IM-Server to make things clearer; + advocate [Open-IM-Server](https://google.com/search?q=Open-IM-Server) technology beyond GitHub; + write blogs on Open-IM-Server and so on. diff --git a/Makefile b/Makefile index e869ec111..ff7878108 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,9 @@ all: tidy gen add-copyright verify lint cover restart # ============================================================================== # Build set -ROOT_PACKAGE=github.com/OpenIMSDK/Open-IM-Server -# TODO: This is version control for the future https://github.com/OpenIMSDK/Open-IM-Server/issues/574 -VERSION_PACKAGE=github.com/OpenIMSDK/Open-IM-Server/pkg/version +ROOT_PACKAGE=github.com/openimsdk/open-im-server +# TODO: This is version control for the future https://github.com/openimsdk/open-im-server/issues/574 +VERSION_PACKAGE=github.com/openimsdk/open-im-server/v3/pkg/version # ============================================================================== # Includes @@ -112,7 +112,7 @@ install: check: @$(MAKE) go.check -## check-component +## check-component: Check OpenIM component deployment ✨ .PHONY: check-component check-component: @$(MAKE) go.check-component diff --git a/README-zh_CN.md b/README-zh_CN.md index 951112ae4..37a4dd410 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -10,11 +10,11 @@

-A+ -good first - +A+ +good first + - +

@@ -99,9 +99,9 @@ Open-IM-Server 不仅仅是一个即时消息服务器;它是将实时网络 9. **终极部署体验 🤖** - ✅ 支持 [集群部署](https://github.com/OpenIMSDK/Open-IM-Server/edit/main/deployments/README.md) + ✅ 支持 [集群部署](https://github.com/openimsdk/open-im-server/edit/main/deployments/README.md) - ✅ 支持多架构镜像,我们的 Docker 镜像不仅托管在 GitHub 上,而且还在阿里云和 Docker Hub 上支持多个架构。请访问 [我们的 GitHub packages](https://github.com/orgs/OpenIMSDK/packages?repo_name=Open-IM-Server) 并阅读我们的 [版本管理文档](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md) 以获取更多信息。 + ✅ 支持多架构镜像,我们的 Docker 镜像不仅托管在 GitHub 上,而且还在阿里云和 Docker Hub 上支持多个架构。请访问 [我们的 GitHub packages](https://github.com/orgs/OpenIMSDK/packages?repo_name=Open-IM-Server) 并阅读我们的 [版本管理文档](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md) 以获取更多信息。 10. **开源社区的大生态系统 🤲** @@ -116,17 +116,17 @@ Open-IM-Server 不仅仅是一个即时消息服务器;它是将实时网络 1. 克隆项目 ``` -bashCopy code# 选择您需要的 +# 选择您需要的 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 ``` -> **注意** 阅读我们的发布策略:https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md +> **注意** 阅读我们的发布策略:https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md 1. 修改 `.env` ``` -bashCopy codeUSER=root #无需修改 +USER=root #无需修改 PASSWORD=openIM123 #8位或更多数字和字母的组合,此密码适用于redis、mysql、mongo,以及config/config.yaml中的accessSecret ENDPOINT=http://127.0.0.1:10005 #minio的外部服务IP和端口,或使用域名storage.xx.xx,应用程序必须能够访问此IP和端口或域名, API_URL=http://127.0.0.1:10002/object/ #应用程序必须能够访问此IP和端口或域名, @@ -138,38 +138,38 @@ DATA_DIR=./ #指定大磁盘目录 > **注意** 此命令只能执行一次。它会基于 `.env` 中的 `PASSWORD` 变量修改 docker-compose 中的组件密码,并修改 `config/config.yaml` 中的组件密码。如果 `.env` 中的密码发生变化,您需要首先执行 `docker-compose down`;`rm components -rf` 然后执行此命令。 ``` -bashCopy code + make install ``` 1. 检查服务 ``` -bashCopy code + make check ``` -![https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/images/docker_build.png](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/images/docker_build.png) +![https://github.com/openimsdk/open-im-server/blob/main/docs/images/docker_build.png](https://github.com/openimsdk/open-im-server/blob/main/docs/images/docker_build.png)
从源码编译 您需要 `Go 1.18` 或更高版本,以及 `make`。 -版本详情:https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md +版本详情:https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md ``` -bashCopy code# 选择您需要的 +# 选择您需要的 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 ``` -阅读关于 [OpenIM 版本策略](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md) +阅读关于 [OpenIM 版本策略](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md) 使用 `make help` 来查看 OpenIM 支持的指令。 如图所示,所有服务已成功构建 -![成功编译](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/images/build.png) +![成功编译](https://github.com/openimsdk/open-im-server/blob/main/docs/images/build.png)
组件配置说明 @@ -180,7 +180,7 @@ config/config.yaml 文件为存储组件提供了详细的配置说明。 - 用于 RPC 服务发现和注册,支持集群。 ``` - bashCopy codezookeeper: + zookeeper: schema: openim #不建议修改 address: [ 127.0.0.1:2181 ] #地址 username: #用户名 @@ -192,7 +192,7 @@ config/config.yaml 文件为存储组件提供了详细的配置说明。 - 用于存储用户、关系和群组,支持主从数据库。 ``` - bashCopy codemysql: + mysql: address: [ 127.0.0.1:13306 ] #地址 username: root #用户名 password: openIM123 #密码 @@ -209,7 +209,7 @@ config/config.yaml 文件为存储组件提供了详细的配置说明。 - 用于存储离线消息,支持 mongo 分片集群。 ``` - bashCopy codemongo: + mongo: uri: #如果不为空,则直接使用此值 address: [ 127.0.0.1:37017 ] #地址 database: openIM #默认 mongo 数据库 @@ -223,7 +223,7 @@ config/config.yaml 文件为存储组件提供了详细的配置说明。 - 用于存储消息序列号、最新消息、用户令牌和 mysql 缓存,支持集群部署。 ``` - bashCopy coderedis: + redis: address: [ 127.0.0.1:16379 ] #地址 username: #用户名 password: openIM123 #密码 @@ -234,7 +234,7 @@ config/config.yaml 文件为存储组件提供了详细的配置说明。 - 用于消息队列,用于消息解耦,支持集群部署。 ``` - bashCopy codekafka: + kafka: username: #用户名 password: #密码 addr: [ 127.0.0.1:9092 ] #地址 @@ -259,21 +259,21 @@ config/config.yaml 文件为存储组件提供了详细的配置说明。 启动服务 ``` -bashCopy code + ./scripts/start-all.sh; ``` 检查服务 ``` -bashCopy code + ./scripts/check-all.sh ``` 停止服务 ``` -bashCopy code + ./scripts/stop-all.sh ``` @@ -302,30 +302,30 @@ bashCopy code OpenIM 不仅仅是一个开源的即时消息组件,它是您的应用程序生态系统的一个不可分割的部分。查看此图表以了解 AppServer、AppClient、Open-IM-Server 和 Open-IM-SDK 如何互动。 -![App-OpenIM 关系](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/images/open-im-server.png) +![App-OpenIM 关系](https://github.com/openimsdk/open-im-server/blob/main/docs/images/open-im-server.png) ## :building_construction: 总体架构 深入了解 Open-IM-Server 的功能与我们的架构图。 -![总体架构](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/images/Architecture.jpg) +![总体架构](https://github.com/openimsdk/open-im-server/blob/main/docs/images/Architecture.jpg) ## :hammer_and_wrench: 开始开发 OpenIM OpenIM 我们的目标是建立一个顶级的开源社区。我们有一套标准,在 [Community repository](https://github.com/OpenIMSDK/community) 中。 -如果您想为这个 Open-IM-Server 仓库做贡献,请阅读我们的 [贡献者文档](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CONTRIBUTING.md)。 +如果您想为这个 Open-IM-Server 仓库做贡献,请阅读我们的 [贡献者文档](https://github.com/openimsdk/open-im-server/blob/main/CONTRIBUTING.md)。 -在您开始之前,请确保您的更改是需要的。最好的方法是创建一个 [新的讨论](https://github.com/OpenIMSDK/Open-IM-Server/discussions/new/choose) 或 [Slack 通讯](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q),或者如果您发现一个问题,首先 [报告它](https://github.com/OpenIMSDK/Open-IM-Server/issues/new/choose)。 +在您开始之前,请确保您的更改是需要的。最好的方法是创建一个 [新的讨论](https://github.com/openimsdk/open-im-server/discussions/new/choose) 或 [Slack 通讯](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q),或者如果您发现一个问题,首先 [报告它](https://github.com/openimsdk/open-im-server/issues/new/choose)。 -- [代码标准](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/go_code.md) -- [Docker 图像标准](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md) -- [目录标准](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/directory.md) -- [提交标准](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/commit.md) -- [版本控制标准](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md) -- [接口标准](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/api.md) -- [日志标准](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/) -- [错误代码标准](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/error_code.md) +- [代码标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/go_code.md) +- [Docker 图像标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md) +- [目录标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/directory.md) +- [提交标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/commit.md) +- [版本控制标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md) +- [接口标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/api.md) +- [日志标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/) +- [错误代码标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/error_code.md) ## :busts_in_silhouette: 社区 @@ -340,18 +340,18 @@ OpenIM 我们的目标是建立一个顶级的开源社区。我们有一套标 我们的会议在 [OpenIM Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q) 🎯,然后您可以搜索 Open-IM-Server 管道加入。 -我们在 [GitHub 讨论](https://github.com/OpenIMSDK/Open-IM-Server/discussions/categories/meeting) 中记下每次 [双周会议](https://github.com/orgs/OpenIMSDK/discussions/categories/meeting) 的笔记,我们的历史会议记录以及会议回放都可在 [Google Docs :bookmark_tabs:](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing) 中找到。 +我们在 [GitHub 讨论](https://github.com/openimsdk/open-im-server/discussions/categories/meeting) 中记下每次 [双周会议](https://github.com/orgs/OpenIMSDK/discussions/categories/meeting) 的笔记,我们的历史会议记录以及会议回放都可在 [Google Docs :bookmark_tabs:](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing) 中找到。 ## :eyes: 谁在使用 OpenIM -查看我们的 [用户案例研究](https://github.com/OpenIMSDK/community/blob/main/ADOPTERS.md) 页面以获取项目用户列表。不要犹豫,留下一个 [📝评论](https://github.com/OpenIMSDK/Open-IM-Server/issues/379) 并分享您的使用案例。 +查看我们的 [用户案例研究](https://github.com/OpenIMSDK/community/blob/main/ADOPTERS.md) 页面以获取项目用户列表。不要犹豫,留下一个 [📝评论](https://github.com/openimsdk/open-im-server/issues/379) 并分享您的使用案例。 ## :page_facing_up: 许可证 -OpenIM 根据 Apache 2.0 许可证授权。请查看 [LICENSE](https://github.com/OpenIMSDK/Open-IM-Server/tree/main/LICENSE) 以获取完整的许可证文本。 +OpenIM 根据 Apache 2.0 许可证授权。请查看 [LICENSE](https://github.com/openimsdk/open-im-server/tree/main/LICENSE) 以获取完整的许可证文本。 -OpenIM logo,包括其变体和动画版本,在此存储库 [OpenIM](https://github.com/OpenIMSDK/Open-IM-Server) 下的 [assets/logo](./assets/logo) 和 [assets/logo-gif](./assets/logo-gif) 目录中显示,受版权法保护。 +OpenIM logo,包括其变体和动画版本,在此存储库 [OpenIM](https://github.com/openimsdk/open-im-server) 下的 [assets/logo](./assets/logo) 和 [assets/logo-gif](./assets/logo-gif) 目录中显示,受版权法保护。 ## 🔮 感谢我们的贡献者! - \ No newline at end of file + \ No newline at end of file diff --git a/README.md b/README.md index da496c23a..504dcd012 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@

-A+ -good first - +A+ +good first + - +

@@ -99,9 +99,9 @@ Further enhancing your experience, we also provide an SDK client, wherein most c 9. **The ultimate deployment experience 🤖** - ✅ Supports [cluster deployment](https://github.com/OpenIMSDK/Open-IM-Server/edit/main/deployments/README.md) + ✅ Supports [cluster deployment](https://github.com/openimsdk/open-im-server/edit/main/deployments/README.md) - ✅ Supports multi-architecture mirroring, our Docker images are hosted not only on GitHub but also on Alibaba Cloud and Docker Hub supporting multiple architectures. Visit [our GitHub packages](https://github.com/orgs/OpenIMSDK/packages?repo_name=Open-IM-Server) and read our [version management document](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md) for more information. + ✅ Supports multi-architecture mirroring, our Docker images are hosted not only on GitHub but also on Alibaba Cloud and Docker Hub supporting multiple architectures. Visit [our GitHub packages](https://github.com/orgs/OpenIMSDK/packages?repo_name=Open-IM-Server) and read our [version management document](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md) for more information. 11. **A large ecosystem of open source communities 🤲** @@ -128,12 +128,11 @@ $ make demo ```bash -git clone -b feat/test https://github.com/openim-sigs/openim-docker openim/openim-docker && export openim=$(pwd)/openim && cd $openim/openim-docker && ./scripts/init-config.sh && docker-compose up -d +git clone -b main https://github.com/openim-sigs/openim-docker openim/openim-docker && export openim=$(pwd)/openim && cd $openim/openim-docker && ./scripts/init-config.sh && docker-compose up -d ``` > **Note** -> If you don't know OpenIM's versioning policy, 📚Read our release policy: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md - +> If you don't know OpenIM's versioning policy, 📚Read our release policy: https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md **2. Configure the config file** @@ -153,7 +152,7 @@ cat scripts/install/environment.sh ```bash export PASSWORD="openIM123" # Set password export USER="root" # Set username -# Choose chat version and server version https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md, eg: main, release-v*.* +# Choose chat version and server version https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md, eg: main, release-v*.* export CHAT_BRANCH="main" export SERVER_BRANCH="main" #... Other environment variables @@ -161,10 +160,15 @@ export SERVER_BRANCH="main" # MONGO_PASSWORD: Set the MongoDB password # MONGO_DATABASE: Sets the MongoDB database name # MINIO_ENDPOINT: set the MinIO service address +# DOCKER_BRIDGE_SUBNET: set the docker bridge network address +export DOCKER_BRIDGE_SUBNET="172.28.0.0/16" # API_URL: under network environment, set OpenIM Server API address export API_URL="http://127.0.0.1:10002" ``` +If you wish to use more custom features, read our [config documentation](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md). + + Next, update the configuration using make init: ```bash @@ -185,13 +189,28 @@ Ur need `Go 1.18` or higher version, and `make`. go version && make --version || echo "Error: One of the commands failed." ``` -Version Details: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md +Version Details: https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md + +You can get the version number from the command below or from [github releases](https://github.com/openimsdk/open-im-server/tags). + +```bash +$ curl --silent "https://api.github.com/repos/openimsdk/open-im-server/releases" | jq -r '.[].tag_name' +``` + +We have our own version management policy, if you are interested in our version management, I recommend reading [📚 OpenIM Version](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md), We recommend using stable versions such as `v3.3.0` and `v3.2.0` whenever possible. `v3.1.1-alpha.3` as well as `v3.3.0-beta.0` and `v3.2.0-rc.0` are pre-release or beta versions and are not recommended. + +Set `OPENIM_VERSION` environment variables for the latest `OPENIM_VERSION` number, or replace the `OPENIM_VERSION` for you to install the OpenIM-Server `OPENIM_VERSION`: + +```bash +$ OPENIM_VERSION=`curl -s https://api.github.com/repos/openimsdk/open-im-server/releases/latest | grep -oE '"tag_name": "[^"]+"' | head -n1 | cut -d'"' -f4` +# OPENIM_VERSION=v3.3.0 +``` + +Deploy basic components at the click of a command: ```bash -# choose what you need -$ BRANCH=release-v3.2 # install openim dependency -$ git clone -b $BRANCH https://github.com/OpenIMSDK/Open-IM-Server openim/openim-server && export openim=$(pwd)/openim/openim-server && cd $openim/openim-server +$ git clone https://github.com/openimsdk/open-im-server openim/openim-server && export openim=$(pwd)/openim/openim-server && cd $openim/openim-server && git checkout $OPENIM_VERSION $ curl https://raw.githubusercontent.com/OpenIMSDK/openim-docker/main/example/basic-openim-server-dependency.yml -o basic-openim-server-dependency.yml && make init && docker compose -f basic-openim-server-dependency.yml up -d && make start ``` @@ -208,96 +227,16 @@ You can use the `make help-all` see OpenIM in action.
Component Configuration Instructions -The `config/config.yaml` file has detailed configuration instructions for the storage components. - - -The config file is available via [environment.sh](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/scripts/install/environment.sh) configuration [openim.yaml](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployments/templates/openim.yaml) template, and then through the `make init` to automatically generate a new configuration. - -- Zookeeper - - - Used for RPC service discovery and registration, cluster support. - - ```bash - zookeeper: - schema: openim #Not recommended to modify - address: [ 127.0.0.1:2181 ] #address - username: #username - password: #password - ``` - -- MySQL - - - Used for storing users, relationships, and groups, supports master-slave database. - - ```bash - mysql: - address: [ 127.0.0.1:13306 ] #address - username: root #username - password: openIM123 #password - database: openIM_v2 #Not recommended to modify - maxOpenConn: 1000 #maximum connection - maxIdleConn: 100 #maximum idle connection - maxLifeTime: 60 #maximum time a connection can be reused (seconds) - logLevel: 4 #log level 1=slient 2=error 3=warn 4=info - slowThreshold: 500 #slow statement threshold (milliseconds) - ``` - -- Mongo - - - Used for storing offline messages, supports mongo sharded clusters. - - ```bash - mongo: - uri: #Use this value directly if not empty - address: [ 127.0.0.1:37017 ] #address - database: openIM #default mongo db - username: root #username - password: openIM123 #password - maxPoolSize: 100 #maximum connections - ``` - -- Redis - - - Used for storing message sequence numbers, latest messages, user tokens, and mysql cache, supports cluster deployment. - - ```bash - redis: - address: [ 127.0.0.1:16379 ] #address - username: #username - password: openIM123 #password - ``` - -- Kafka - - - Used for message queues, for message decoupling, supports cluster deployment. - - ```bash - kafka: - username: #username - password: #password - addr: [ 127.0.0.1:9092 ] #address - latestMsgToRedis: - topic: "latestMsgToRedis" - offlineMsgToMongo: - topic: "offlineMsgToMongoMysql" - msgToPush: - topic: "msqToPush" - msgToModify: - topic: "msgToModify" - consumerGroupID: - msgToRedis: redis - msgToMongo: mongo - msgToMySql: mysql - msgToPush: push - msgToModify: modify - ``` + +Read: Configuration center document:https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md
+
Deployed with kubernetes -read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployments/README.md +Read: https://github.com/openimsdk/open-im-server/blob/main/deployments/README.md
@@ -329,30 +268,30 @@ read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployments/README.m OpenIM isn't just an open-source instant messaging component, it's an integral part of your application ecosystem. Check out this diagram to understand how AppServer, AppClient, Open-IM-Server, and Open-IM-SDK interact. -![App-OpenIM Relationship](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/images/open-im-server.png) +![App-OpenIM Relationship](https://github.com/openimsdk/open-im-server/blob/main/docs/images/open-im-server.png) ## :building_construction: Overall Architecture Delve into the heart of Open-IM-Server's functionality with our architecture diagram. -![Overall Architecture](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/images/Architecture.jpg) +![Overall Architecture](https://github.com/openimsdk/open-im-server/blob/main/docs/images/Architecture.jpg) ## :hammer_and_wrench: To start developing OpenIM OpenIM Our goal is to build a top-level open source community. We have a set of standards, in the [Community repository](https://github.com/OpenIMSDK/community). -If you'd like to contribute to this Open-IM-Server repository, please read our [contributor documentation](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CONTRIBUTING.md). +If you'd like to contribute to this Open-IM-Server repository, please read our [contributor documentation](https://github.com/openimsdk/open-im-server/blob/main/CONTRIBUTING.md). -Before you start, please make sure your changes are in demand. The best for that is to create a [new discussion](https://github.com/OpenIMSDK/Open-IM-Server/discussions/new/choose) OR [Slack Communication](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q), or if you find an issue, [report it](https://github.com/OpenIMSDK/Open-IM-Server/issues/new/choose) first. +Before you start, please make sure your changes are in demand. The best for that is to create a [new discussion](https://github.com/openimsdk/open-im-server/discussions/new/choose) OR [Slack Communication](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q), or if you find an issue, [report it](https://github.com/openimsdk/open-im-server/issues/new/choose) first. -- [Code Standards](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/go_code.md) -- [Docker Images Standards](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md) -- [Directory Standards](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/directory.md) -- [Commit Standards](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/commit.md) -- [Versioning Standards](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md) -- [Interface Standards](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/api.md) -- [Log Standards](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/logging.md) -- [Error Code Standards](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/error_code.md) +- [Code Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/go_code.md) +- [Docker Images Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md) +- [Directory Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/directory.md) +- [Commit Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/commit.md) +- [Versioning Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md) +- [Interface Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/api.md) +- [Log Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/logging.md) +- [Error Code Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/error_code.md) ## :busts_in_silhouette: Community @@ -367,20 +306,20 @@ We want anyone to get involved in our community and contributing code, we offer Our conference is in the [OpenIM Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q) 🎯, then you can search the Open-IM-Server pipeline to join -We take notes of each [biweekly meeting](https://github.com/orgs/OpenIMSDK/discussions/categories/meeting) in [GitHub discussions](https://github.com/OpenIMSDK/Open-IM-Server/discussions/categories/meeting), Our historical meeting notes, as well as replays of the meetings are available at [Google Docs :bookmark_tabs:](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing). +We take notes of each [biweekly meeting](https://github.com/orgs/OpenIMSDK/discussions/categories/meeting) in [GitHub discussions](https://github.com/openimsdk/open-im-server/discussions/categories/meeting), Our historical meeting notes, as well as replays of the meetings are available at [Google Docs :bookmark_tabs:](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing). ## :eyes: Who are using OpenIM -Check out our [user case studies](https://github.com/OpenIMSDK/community/blob/main/ADOPTERS.md) page for a list of the project users. Don't hesitate to leave a [📝comment](https://github.com/OpenIMSDK/Open-IM-Server/issues/379) and share your use case. +Check out our [user case studies](https://github.com/OpenIMSDK/community/blob/main/ADOPTERS.md) page for a list of the project users. Don't hesitate to leave a [📝comment](https://github.com/openimsdk/open-im-server/issues/379) and share your use case. ## :page_facing_up: License -OpenIM is licensed under the Apache 2.0 license. See [LICENSE](https://github.com/OpenIMSDK/Open-IM-Server/tree/main/LICENSE) for the full license text. +OpenIM is licensed under the Apache 2.0 license. See [LICENSE](https://github.com/openimsdk/open-im-server/tree/main/LICENSE) for the full license text. -The OpenIM logo, including its variations and animated versions, displayed in this repository [OpenIM](https://github.com/OpenIMSDK/Open-IM-Server) under the [assets/logo](./assets/logo) and [assets/logo-gif](assets/logo-gif) directories, are protected by copyright laws. +The OpenIM logo, including its variations and animated versions, displayed in this repository [OpenIM](https://github.com/openimsdk/open-im-server) under the [assets/logo](./assets/logo) and [assets/logo-gif](assets/logo-gif) directories, are protected by copyright laws. ## 🔮 Thanks to our contributors! - - + + diff --git a/build/goreleaser.yaml b/build/goreleaser.yaml index ecd031921..d4e28fc2a 100644 --- a/build/goreleaser.yaml +++ b/build/goreleaser.yaml @@ -484,8 +484,8 @@ changelog: # use: buildx # build_flag_templates: # - "--pull" -# - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md" -# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png" +# - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/openimsdk/open-im-server/main/README.md" +# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/openimsdk/open-im-server/blob/main/assets/logo/openim-logo-green.png" # - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]' # - "--label=io.artifacthub.package.license=Apace-2.0" # - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system" @@ -504,8 +504,8 @@ changelog: # use: buildx # build_flag_templates: # - "--pull" -# - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md" -# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png" +# - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/openimsdk/open-im-server/main/README.md" +# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/openimsdk/open-im-server/blob/main/assets/logo/openim-logo-green.png" # - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]' # - "--label=io.artifacthub.package.license=Apace-2.0" # - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system" @@ -555,7 +555,7 @@ nfpms: - openim-rpc-user # Your app's vendor. vendor: OpenIMSDK - homepage: https://github.com/OpenIMSDK/Open-IM-Server + homepage: https://github.com/openimsdk/open-im-server maintainer: kubbot description: |- Auto sync github labels diff --git a/cmd/openim-api/main.go b/cmd/openim-api/main.go index 42bb7d1ac..cf452450c 100644 --- a/cmd/openim-api/main.go +++ b/cmd/openim-api/main.go @@ -28,10 +28,10 @@ import ( openkeeper "github.com/OpenIMSDK/tools/discoveryregistry/zookeeper" "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/Open-IM-Server/internal/api" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/internal/api" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" ) func main() { diff --git a/cmd/openim-cmdutils/main.go b/cmd/openim-cmdutils/main.go index 64079c7e1..058aa2e29 100644 --- a/cmd/openim-cmdutils/main.go +++ b/cmd/openim-cmdutils/main.go @@ -15,7 +15,7 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-crontask/main.go b/cmd/openim-crontask/main.go index 6fbb0558a..3bd0d882b 100644 --- a/cmd/openim-crontask/main.go +++ b/cmd/openim-crontask/main.go @@ -15,8 +15,8 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/tools" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/internal/tools" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-msggateway/main.go b/cmd/openim-msggateway/main.go index 2782e4fd3..f6870694b 100644 --- a/cmd/openim-msggateway/main.go +++ b/cmd/openim-msggateway/main.go @@ -15,7 +15,7 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-msgtransfer/main.go b/cmd/openim-msgtransfer/main.go index aef347793..722bf5960 100644 --- a/cmd/openim-msgtransfer/main.go +++ b/cmd/openim-msgtransfer/main.go @@ -15,7 +15,7 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-push/main.go b/cmd/openim-push/main.go index 03db8ae03..6ab2fedab 100644 --- a/cmd/openim-push/main.go +++ b/cmd/openim-push/main.go @@ -15,9 +15,9 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/push" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/internal/push" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-auth/main.go b/cmd/openim-rpc/openim-rpc-auth/main.go index 524804988..d27a3f11b 100644 --- a/cmd/openim-rpc/openim-rpc-auth/main.go +++ b/cmd/openim-rpc/openim-rpc-auth/main.go @@ -15,9 +15,9 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/auth" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/internal/rpc/auth" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-conversation/main.go b/cmd/openim-rpc/openim-rpc-conversation/main.go index fec8226f8..80a92de92 100644 --- a/cmd/openim-rpc/openim-rpc-conversation/main.go +++ b/cmd/openim-rpc/openim-rpc-conversation/main.go @@ -15,9 +15,9 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/conversation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/internal/rpc/conversation" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-friend/main.go b/cmd/openim-rpc/openim-rpc-friend/main.go index fbd44038e..c0c91e4dc 100644 --- a/cmd/openim-rpc/openim-rpc-friend/main.go +++ b/cmd/openim-rpc/openim-rpc-friend/main.go @@ -15,9 +15,9 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/friend" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/internal/rpc/friend" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-group/main.go b/cmd/openim-rpc/openim-rpc-group/main.go index 06baac155..d2d4f727a 100644 --- a/cmd/openim-rpc/openim-rpc-group/main.go +++ b/cmd/openim-rpc/openim-rpc-group/main.go @@ -15,9 +15,9 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/group" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/internal/rpc/group" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-msg/main.go b/cmd/openim-rpc/openim-rpc-msg/main.go index 356081d33..0ac258d0c 100644 --- a/cmd/openim-rpc/openim-rpc-msg/main.go +++ b/cmd/openim-rpc/openim-rpc-msg/main.go @@ -15,9 +15,9 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/msg" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/internal/rpc/msg" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-third/main.go b/cmd/openim-rpc/openim-rpc-third/main.go index c070e6811..913962b82 100644 --- a/cmd/openim-rpc/openim-rpc-third/main.go +++ b/cmd/openim-rpc/openim-rpc-third/main.go @@ -15,9 +15,9 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/third" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/internal/rpc/third" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-user/main.go b/cmd/openim-rpc/openim-rpc-user/main.go index 6d6d9008d..f2ebc94db 100644 --- a/cmd/openim-rpc/openim-rpc-user/main.go +++ b/cmd/openim-rpc/openim-rpc-user/main.go @@ -15,9 +15,9 @@ package main import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/user" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/internal/rpc/user" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func main() { diff --git a/config/config.yaml b/config/config.yaml index c8c994c36..c1059581b 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -132,14 +132,14 @@ api: # minio.signEndpoint is minio public network address object: enable: "minio" - apiURL: "http://14.153.6.114:10002" + apiURL: "http://172.28.0.1:10002" minio: bucket: "openim" endpoint: "http://172.28.0.1:10005" accessKeyID: "root" secretAccessKey: "openIM123" sessionToken: '' - signEndpoint: "http://14.153.6.114:10005" + signEndpoint: "http://172.28.0.1:10005" cos: bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com secretID: '' @@ -194,7 +194,7 @@ rpcRegisterName: # Whether to output in json format # Whether to include stack trace in logs log: - storageLocation: ../logs + storageLocation: /root/workspaces/openim/openim-server/logs/ rotationTime: 24 remainRotationCount: 2 remainLogLevel: 6 diff --git a/deployments/README.md b/deployments/README.md index 4e4beda9f..1dfb87217 100644 --- a/deployments/README.md +++ b/deployments/README.md @@ -7,7 +7,7 @@ OpenIM 支持很多种集群化部署方式,包括但不限于 helm, sealos, k 目前各个贡献者,以及之前的官方有出过一些可以参考的方案: - https://github.com/OpenIMSDK/k8s-jenkins -- https://github.com/OpenIMSDK/Open-IM-Server-k8s-deploy +- https://github.com/openimsdk/open-im-server-k8s-deploy - https://github.com/OpenIMSDK/openim-charts - https://github.com/showurl/deploy-openim @@ -41,6 +41,63 @@ $ make init ``` 此时会帮你在 `deployments/openim/config` 目录下生成配置文件,你可以根据自己的需求进行修改。 + +## 集群搭建 + +如果你已经有了一个 `kubernetes` 集群,或者是你希望自己从头开始搭建一个 `kubernetes` 那么你可以直接跳过这一步。 + +为了快速开始,我使用 [sealos](https://github.com/labring/sealos) 来快速搭建集群,sealos 底层也是对 kubeadm 的封装: + +```bash +$ SEALOS_VERSION=`curl -s https://api.github.com/repos/labring/sealos/releases/latest | grep -oE '"tag_name": "[^"]+"' | head -n1 | cut -d'"' -f4` && \ + curl -sfL https://raw.githubusercontent.com/labring/sealos/${SEALOS_VERSION}/scripts/install.sh | + sh -s ${SEALOS_VERSION} labring/sealos +``` + +**支持的版本:** + ++ docker: `labring/kubernetes-docker`:(v1.24.0~v1.27.0) ++ containerd: `labring/kubernetes`:(v1.24.0~v1.27.0) + + +#### 安装集群: + +集群的信息如下: + +| 机器名 | IP地址 | 系统信息 | +|---------|-----------------|------------------------------------------------------------------------------------------------------------| +| master01| 10.0.0.9 | Linux VM-0-9-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux | +| node01 | 10.0.0.4 | Linux VM-0-9-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux | +| node02 | 10.0.0.10 | Linux VM-0-9-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux | + +```bash +$ export CLUSTER_USERNAME=ubuntu +$ export CLUSTER_PASSWORD=123456 +$ sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 \ + --masters 10.0.0.9 \ + --nodes 10.0.0.4,10.0.0.10 \ + -u "$CLUSTER_USERNAME" \ + -p "$CLUSTER_PASSWORD" +``` + +### 安装 helm + +helm通过打包的方式,支持发布的版本管理和控制,很大程度上简化了Kubernetes应用的部署和管理。 + + +**使用脚本:** + +```bash +$ curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash +``` + +**添加仓库:** + +```bash +$ helm repo add brigade https://openimsdk.github.io/openim-charts +``` + + ### 容器化安装 具体安装步骤如下: diff --git a/deployments/templates/init/openim-api.service b/deployments/templates/init/openim-api.service index dba018b89..aed0e9b2d 100644 --- a/deployments/templates/init/openim-api.service +++ b/deployments/templates/init/openim-api.service @@ -1,7 +1,7 @@ [Unit] Description=OPENIM OPENIM API Documentation=Control interface for the OpenIM API service. -Documentation=https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployment/init/README.md +Documentation=https://github.com/openimsdk/open-im-server/blob/main/deployment/init/README.md [Service] WorkingDirectory=${OPENIM_DATA_DIR}/openim-api diff --git a/deployments/templates/init/openim-cmdutils.service b/deployments/templates/init/openim-cmdutils.service index f96976a89..0e1058483 100644 --- a/deployments/templates/init/openim-cmdutils.service +++ b/deployments/templates/init/openim-cmdutils.service @@ -1,7 +1,7 @@ [Unit] Description=OPENIM OPENIM CMDUTILS Documentation=Utility toolkit for common OpenIM command-line operations. -Documentation=https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployment/init/README.md +Documentation=https://github.com/openimsdk/open-im-server/blob/main/deployment/init/README.md [Service] WorkingDirectory=${OPENIM_DATA_DIR}/openim-cmdutils diff --git a/deployments/templates/init/openim-crontask.service b/deployments/templates/init/openim-crontask.service index 9f1a60898..30ebe997e 100644 --- a/deployments/templates/init/openim-crontask.service +++ b/deployments/templates/init/openim-crontask.service @@ -1,7 +1,7 @@ [Unit] Description=OPENIM OPENIM CRONTASK Documentation=Manages the OpenIM CronTask service, with both direct and systemctl installation methods. -Documentation=https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployment/init/README.md +Documentation=https://github.com/openimsdk/open-im-server/blob/main/deployment/init/README.md [Service] WorkingDirectory=${OPENIM_DATA_DIR}/openim-crontask diff --git a/deployments/templates/init/openim-msggateway.service b/deployments/templates/init/openim-msggateway.service index 4e280dd86..e0a322492 100644 --- a/deployments/templates/init/openim-msggateway.service +++ b/deployments/templates/init/openim-msggateway.service @@ -1,6 +1,6 @@ [Unit] Description=OPENIM OPENIM MSGGATEWAY -Documentation=https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployment/init/README.md +Documentation=https://github.com/openimsdk/open-im-server/blob/main/deployment/init/README.md [Service] WorkingDirectory=${OPENIM_DATA_DIR}/openim-msggateway diff --git a/deployments/templates/init/openim-msgtransfer.service b/deployments/templates/init/openim-msgtransfer.service index bd805a0ba..7e20c4c92 100644 --- a/deployments/templates/init/openim-msgtransfer.service +++ b/deployments/templates/init/openim-msgtransfer.service @@ -1,6 +1,6 @@ [Unit] Description=OPENIM OPENIM MSGTRANSFER -Documentation=https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployment/init/README.md +Documentation=https://github.com/openimsdk/open-im-server/blob/main/deployment/init/README.md [Service] WorkingDirectory=${OPENIM_DATA_DIR}/openim-msgtransfer diff --git a/deployments/templates/init/openim-push.service b/deployments/templates/init/openim-push.service index b2fdc237c..efcc88e89 100644 --- a/deployments/templates/init/openim-push.service +++ b/deployments/templates/init/openim-push.service @@ -1,7 +1,7 @@ [Unit] Description=OPENIM OPENIM PUSH Documentation=Interface for controlling the OpenIM Push Notification service. -Documentation=https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployment/init/README.md +Documentation=https://github.com/openimsdk/open-im-server/blob/main/deployment/init/README.md [Service] WorkingDirectory=${OPENIM_DATA_DIR}/openim-push diff --git a/deployments/templates/init/openim-rpc.service b/deployments/templates/init/openim-rpc.service index 15671602a..026e3ebe2 100644 --- a/deployments/templates/init/openim-rpc.service +++ b/deployments/templates/init/openim-rpc.service @@ -1,6 +1,6 @@ [Unit] Description=OPENIM OPENIM RPC AUTH -Documentation=https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployment/init/README.md +Documentation=https://github.com/openimsdk/open-im-server/blob/main/deployment/init/README.md [Service] WorkingDirectory=${OPENIM_DATA_DIR}/openim-rpc-auth diff --git a/docker-compose.yml b/docker-compose.yml index 4e9aa02b9..126409d3d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -#fixme Clone openIM Server project before using docker-compose,project address:https://github.com/OpenIMSDK/Open-IM-Server.git +#fixme Clone openIM Server project before using docker-compose,project address:https://github.com/openimsdk/open-im-server.git version: '3' networks: @@ -140,7 +140,7 @@ services: - "9090:9090" container_name: minio volumes: - - minio_data:/data + - minio_data:/data - minio_config:/root/.minio environment: MINIO_ROOT_USER: "${MINIO_ACCESS_KEY}" @@ -164,40 +164,40 @@ services: server: ipv4_address: ${OPENIM_WEB_NETWORK_ADDRESS} - openim-server: - # image: ghcr.io/openimsdk/openim-server:main - image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:main - # image: openim/openim-server:main -# build: . - container_name: openim-server - ports: - - ${OPENIM_WS_PORT}:10001 - - ${API_OPENIM_PORT}:10002 - healthcheck: - test: ["CMD", "/openim/openim-server/scripts/check-all.sh"] - interval: 300s - timeout: 10s - retries: 5 - volumes: - - ./logs:/openim/openim-server/logs - - ./_output:/openim/openim-server/_output - - ./config:/openim/openim-server/config - - ./scripts:/openim/openim-server/scripts - restart: always - depends_on: - - kafka - - mysql - - mongodb - - redis - - minio - logging: - driver: json-file - options: - max-size: "1g" - max-file: "2" - networks: - server: - ipv4_address: ${OPENIM_SERVER_NETWORK_ADDRESS} +# openim-server: +# # image: ghcr.io/openimsdk/openim-server:main +# image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:main +# # image: openim/openim-server:main +# # build: . +# container_name: openim-server +# ports: +# - ${OPENIM_WS_PORT}:10001 +# - ${API_OPENIM_PORT}:10002 +# healthcheck: +# test: ["CMD", "/openim/openim-server/scripts/check-all.sh"] +# interval: 300s +# timeout: 10s +# retries: 5 +# volumes: +# - ./logs:/openim/openim-server/logs +# - ./_output:/openim/openim-server/_output +# - ./config:/openim/openim-server/config +# - ./scripts:/openim/openim-server/scripts +# restart: always +# depends_on: +# - kafka +# - mysql +# - mongodb +# - redis +# - minio +# logging: +# driver: json-file +# options: +# max-size: "1g" +# max-file: "2" +# networks: +# server: +# ipv4_address: ${OPENIM_SERVER_NETWORK_ADDRESS} # openim-chat: # # image: ghcr.io/openimsdk/openim-chat:main diff --git a/docs/README.md b/docs/README.md index e1d8c5d58..f9d045c49 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,8 +4,8 @@ Welcome to the OpenIM Documentation hub! This center provides a comprehensive ra ## Table of Contents -1. [Contrib](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib) - Guidance on contributing and configurations for developers -2. [Conversions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions) - Coding conventions, logging policies, and other transformation tools +1. [Contrib](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib) - Guidance on contributing and configurations for developers +2. [Conversions](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions) - Coding conventions, logging policies, and other transformation tools ------ @@ -13,34 +13,34 @@ Welcome to the OpenIM Documentation hub! This center provides a comprehensive ra This section offers developers a detailed guide on how to contribute code, set up their environment, and follow the associated processes. -- [Code Conventions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/code_conventions.md) - Rules and conventions for writing code in OpenIM. -- [Development Guide](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/development.md) - A guide on how to carry out development within OpenIM. -- [Git Cherry Pick](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/git_cherry-pick.md) - Guidelines on cherry-picking operations. -- [Git Workflow](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/git_workflow.md) - The git workflow in OpenIM. -- [Initialization Configurations](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/init_config.md) - Guidance on setting up and initializing OpenIM. -- [Docker Installation](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/install_docker.md) - How to install Docker on your machine. -- [Linux Development Environment](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/linux_development.md) - Guide to set up the development environment on Linux. -- [Local Actions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/local_actions.md) - Guidelines on how to carry out certain common actions locally. -- [Offline Deployment](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/offline-deployment.md) - Methods of deploying OpenIM offline. -- [Protoc Tools](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/protoc_tools.md) - Guide on using protoc tools. -- [Go Tools](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/util_go.md) - Tools and libraries in OpenIM for Go. -- [Makefile Tools](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/util_makefile.md) - Best practices and tools for Makefile. -- [Script Tools](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/util_scripts.md) - Best practices and tools for scripts. +- [Code Conventions](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/code_conventions.md) - Rules and conventions for writing code in OpenIM. +- [Development Guide](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/development.md) - A guide on how to carry out development within OpenIM. +- [Git Cherry Pick](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/git_cherry-pick.md) - Guidelines on cherry-picking operations. +- [Git Workflow](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/git_workflow.md) - The git workflow in OpenIM. +- [Initialization Configurations](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/init_config.md) - Guidance on setting up and initializing OpenIM. +- [Docker Installation](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/install_docker.md) - How to install Docker on your machine. +- [Linux Development Environment](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/linux_development.md) - Guide to set up the development environment on Linux. +- [Local Actions](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/local_actions.md) - Guidelines on how to carry out certain common actions locally. +- [Offline Deployment](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/offline-deployment.md) - Methods of deploying OpenIM offline. +- [Protoc Tools](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/protoc_tools.md) - Guide on using protoc tools. +- [Go Tools](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/util_go.md) - Tools and libraries in OpenIM for Go. +- [Makefile Tools](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/util_makefile.md) - Best practices and tools for Makefile. +- [Script Tools](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/util_scripts.md) - Best practices and tools for scripts. ## Conversions This section introduces various conventions and policies within OpenIM, encompassing code, logs, versions, and more. -- [API Conversions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/api.md) - Guidelines and methods for API conversions. -- [Logging Policy](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/bash_log.md) - Logging policies and conventions in OpenIM. -- [CI/CD Actions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/cicd_actions.md) - Procedures and conventions for CI/CD. -- [Commit Conventions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/commit.md) - Conventions for code commits in OpenIM. -- [Directory Conventions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/directory.md) - Directory structure and conventions within OpenIM. -- [Error Codes](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/error_code.md) - List and descriptions of error codes. -- [Go Code Conversions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/go_code.md) - Conventions and conversions for Go code. -- [Docker Image Strategy](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md) - Management strategies for OpenIM Docker images, spanning multiple architectures and image repositories. -- [Logging Conventions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/logging.md) - Further detailed conventions on logging. -- [Version Conventions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md) - Naming and management strategies for OpenIM versions. +- [API Conversions](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/api.md) - Guidelines and methods for API conversions. +- [Logging Policy](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/bash_log.md) - Logging policies and conventions in OpenIM. +- [CI/CD Actions](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/cicd_actions.md) - Procedures and conventions for CI/CD. +- [Commit Conventions](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/commit.md) - Conventions for code commits in OpenIM. +- [Directory Conventions](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/directory.md) - Directory structure and conventions within OpenIM. +- [Error Codes](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/error_code.md) - List and descriptions of error codes. +- [Go Code Conversions](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/go_code.md) - Conventions and conversions for Go code. +- [Docker Image Strategy](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md) - Management strategies for OpenIM Docker images, spanning multiple architectures and image repositories. +- [Logging Conventions](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/logging.md) - Further detailed conventions on logging. +- [Version Conventions](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md) - Naming and management strategies for OpenIM versions. ## For Developers, Contributors, and Community Maintainers @@ -49,19 +49,19 @@ This section introduces various conventions and policies within OpenIM, encompas If you're a developer or someone keen on contributing: -- Familiarize yourself with our [Code Conventions](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/code_conventions.md) and [Git Workflow](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/git_workflow.md) to ensure smooth contributions. -- Dive into the [Development Guide](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/development.md) to get a hang of the development practices in OpenIM. +- Familiarize yourself with our [Code Conventions](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/code_conventions.md) and [Git Workflow](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/git_workflow.md) to ensure smooth contributions. +- Dive into the [Development Guide](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/development.md) to get a hang of the development practices in OpenIM. ### Community Maintainers As a community maintainer: - Ensure that contributions align with the standards outlined in our documentation. -- Regularly review the [Logging Policy](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/bash_log.md) and [Error Codes](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/error_code.md) to stay updated. +- Regularly review the [Logging Policy](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/bash_log.md) and [Error Codes](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/error_code.md) to stay updated. ## For Users Users should pay particular attention to: -- [Docker Installation](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/install_docker.md) - Necessary if you're planning to use Docker images of OpenIM. -- [Docker Image Strategy](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md) - To understand the different images available and how to choose the right one for your architecture. \ No newline at end of file +- [Docker Installation](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/install_docker.md) - Necessary if you're planning to use Docker images of OpenIM. +- [Docker Image Strategy](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md) - To understand the different images available and how to choose the right one for your architecture. \ No newline at end of file diff --git a/docs/contrib/code_conventions.md b/docs/contrib/code_conventions.md index 94478e6ff..39bec1114 100644 --- a/docs/contrib/code_conventions.md +++ b/docs/contrib/code_conventions.md @@ -35,4 +35,4 @@ ## Testing conventions -Please refer to [TESTING.md](https://github.com/OpenIMSDK/Open-IM-Server/tree/main/test/readme) document. +Please refer to [TESTING.md](https://github.com/openimsdk/open-im-server/tree/main/test/readme) document. diff --git a/docs/contrib/development.md b/docs/contrib/development.md index a8c640570..45039304a 100644 --- a/docs/contrib/development.md +++ b/docs/contrib/development.md @@ -61,7 +61,7 @@ OpenIM build and test processes development require Docker to run certain steps. ### Vagrant -As described in the [Testing documentation](https://github.com/OpenIMSDK/Open-IM-Server/tree/main/test/readme), all the smoke tests are run in virtual machines managed by Vagrant. To install Vagrant in the development environment, [follow the instructions from the Hashicorp website](https://www.vagrantup.com/downloads), alongside any of the following hypervisors: +As described in the [Testing documentation](https://github.com/openimsdk/open-im-server/tree/main/test/readme), all the smoke tests are run in virtual machines managed by Vagrant. To install Vagrant in the development environment, [follow the instructions from the Hashicorp website](https://www.vagrantup.com/downloads), alongside any of the following hypervisors: - [VirtualBox](https://www.virtualbox.org/) - [libvirt](https://libvirt.org/) and the [vagrant-libvirt plugin](https://github.com/vagrant-libvirt/vagrant-libvirt#installation) diff --git a/docs/contrib/environment.md b/docs/contrib/environment.md new file mode 100644 index 000000000..d539b961b --- /dev/null +++ b/docs/contrib/environment.md @@ -0,0 +1,215 @@ +# OpenIM enviroment + + +## How to change the configuration + + +**Modify the configuration files:** + +Three ways to modify the configuration: + +#### **1. Recommended using environment variables:** + +```bash +export PASSWORD="openIM123" # Set password +export USER="root" # Set username +# Choose chat version and server version https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md, eg: main, release-v*.* +export CHAT_BRANCH="main" +export SERVER_BRANCH="main" +#... Other environment variables +# MONGO_USERNAME: This sets the MongoDB username +# MONGO_PASSWORD: Set the MongoDB password +# MONGO_DATABASE: Sets the MongoDB database name +# MINIO_ENDPOINT: set the MinIO service address +# API_URL: under network environment, set OpenIM Server API address +export API_URL="http://127.0.0.1:10002" +``` + +Next, update the configuration using `make init`: + +```bash +make init +``` + +#### **2. Modify the automation script:** + +```bash +scripts/install/environment.sh +``` + +Next, update the configuration using `make init`: + +```bash +make init +``` + +#### 3. Modify `config.yaml` and `.env` files (but will be overwritten when using `make init` again). + +The `config/config.yaml` file has detailed configuration instructions for the storage components. + + +The config file is available via [environment.sh](https://github.com/openimsdk/open-im-server/blob/main/scripts/install/environment.sh) configuration [openim.yaml](https://github.com/openimsdk/open-im-server/blob/main/deployments/templates/openim.yaml) template, and then through the `make init` to automatically generate a new configuration. + + +## Environment variable + +By setting the environment variable below, You can then refresh the configuration using `make init` or `./scripts/init-config.sh` + +##### MINIO + ++ [MINIO DOCS](https://min.io/docs/minio/kubernetes/upstream/index.html) + +apiURL is the address of the api, the access address of the app, use s3 must be configured + +#### Overview + +MinIO is an object storage server that is API compatible with Amazon S3. It's best suited for storing unstructured data such as photos, videos, log files, backups, and container/VM images. In this guide, we'll walk through the process of configuring MinIO with custom settings. + +#### Default Configuration + +Configuration can be achieved by modifying the default variables in the `./scripts/install/environment.sh` file. However, for more flexibility and dynamic adjustments, setting environment variables is recommended. + +#### Setting Up the Environment Variables + +##### IP Configuration + +By default, the system generates the public IP of the machine. To manually set a public or local IP address, use: + +```bash +export IP=127.0.0.1 +``` + +##### API URL + +This is the address your application uses to communicate with MinIO. By default, it uses the public IP. However, you can adjust it to a public domain or another IP. + +```bash +export API_URL=127.0.0.1:10002 +``` + +##### MinIO Endpoint Configuration + +This is the primary address MinIO uses for communications: + +```bash +export MINIO_ENDPOINT="127.0.0.1" +``` + +##### MinIO Sign Endpoint + +For direct external access to stored content: + +```bash +export MINIO_SIGN_ENDPOINT=127.0.0.1:10005 +``` + +##### Modifying MinIO's Port + +If you need to adjust MinIO's port from the default: + +```bash +export MINIO_PORT="10005" +``` + +#### Applying the Configuration + +After setting your desired environment variables, restart the MinIO server to apply the changes. + +#### Verification + +It's crucial to verify the configurations by checking the connectivity between your application and MinIO using the set API URL and ensuring that the data can be directly accessed using the `signEndpoint`. + + +## Configuration Details + +###### Zookeeper + +- **Purpose**: Used for RPC service discovery and registration, cluster support. + + ```bash + zookeeper: + schema: openim # Not recommended to modify + address: [ 127.0.0.1:2181 ] # Address + username: # Username + password: # Password + ``` + +###### MySQL + +- **Purpose**: Used for storing users, relationships, and groups. Supports master-slave database. + + ```bash + mysql: + address: [ 127.0.0.1:13306 ] # Address + username: root # Username + password: openIM123 # Password + database: openIM_v2 # Not recommended to modify + maxOpenConn: 1000 # Maximum connection + maxIdleConn: 100 # Maximum idle connection + maxLifeTime: 60 # Max time a connection can be reused (seconds) + logLevel: 4 # Log level (1=silent, 2=error, 3=warn, 4=info) + slowThreshold: 500 # Slow statement threshold (milliseconds) + ``` + +###### Mongo + +- **Purpose**: Used for storing offline messages. Supports mongo sharded clusters. + + ```bash + mongo: + uri: # Use this value directly if not empty + address: [ 127.0.0.1:37017 ] # Address + database: openIM # Default mongo db + username: root # Username + password: openIM123 # Password + maxPoolSize: 100 # Maximum connections + ``` + +###### Redis + +- **Purpose**: Used for storing message sequence numbers, latest messages, user tokens, and MySQL cache. Supports cluster deployment. + + ```bash + redis: + address: [ 127.0.0.1:16379 ] # Address + username: # Username + password: openIM123 # Password + ``` + +###### Kafka + +- **Purpose**: Used for message queues for decoupling. Supports cluster deployment. + + ```bash + kafka: + username: # Username + password: # Password + addr: [ 127.0.0.1:9092 ] # Address + topics: + latestMsgToRedis: "latestMsgToRedis" + offlineMsgToMongo: "offlineMsgToMongoMysql" + msgToPush: "msgToPush" + msgToModify: "msgToModify" + consumerGroupID: + msgToRedis: redis + msgToMongo: mongo + msgToMySql: mysql + msgToPush: push + msgToModify: modify + ``` + + + + + +## Config options + +... + +## Use the default values + +A method to revert to the default value: + +```bash +export IP=127.0.0.1 +``` diff --git a/docs/contrib/git_cherry-pick.md b/docs/contrib/git_cherry-pick.md index 9afb9c232..010685d65 100644 --- a/docs/contrib/git_cherry-pick.md +++ b/docs/contrib/git_cherry-pick.md @@ -27,8 +27,8 @@ Ensuring this strategy's success extends beyond just documentation; it hinges on - [Contributor License Agreement](https://github.com/openim-sigs/cla) is considered implicit for all code within cherry pick pull requests, **unless there is a large conflict**. - A pull request merged against the `main` branch. -- The release branch exists (example: [`release-1.18`](https://github.com/OpenIMSDK/Open-IM-Server/tree/release-v3.1)) -- The normal git and GitHub configured shell environment for pushing to your openim-server `origin` fork on GitHub and making a pull request against a configured remote `upstream` that tracks `https://github.com/OpenIMSDK/Open-IM-Server.git`, including `GITHUB_USER`. +- The release branch exists (example: [`release-1.18`](https://github.com/openimsdk/open-im-server/tree/release-v3.1)) +- The normal git and GitHub configured shell environment for pushing to your openim-server `origin` fork on GitHub and making a pull request against a configured remote `upstream` that tracks `https://github.com/openimsdk/open-im-server.git`, including `GITHUB_USER`. - Have GitHub CLI (`gh`) installed following [installation instructions](https://github.com/cli/cli#installation). - A github personal access token which has permissions "repo" and "read:org". Permissions are required for [gh auth login](https://cli.github.com/manual/gh_auth_login) and not used for anything unrelated to cherry-pick creation process (creating a branch and initiating PR). @@ -65,7 +65,7 @@ It is critical that our full community is actively engaged on enhancements in th ### Steps -- Run the [cherry pick script](https://github.com/OpenIMSDK/Open-IM-Server/tree/main/scripts/cherry-pick.sh) +- Run the [cherry pick script](https://github.com/openimsdk/open-im-server/tree/main/scripts/cherry-pick.sh) This example applies a main branch PR #98765 to the remote branch `upstream/release-v3.1`: @@ -75,9 +75,9 @@ It is critical that our full community is actively engaged on enhancements in th - Be aware the cherry pick script assumes you have a git remote called `upstream` that points at the openim-server github org. - Please see our [recommended Git workflow](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contributors/github-workflow.md#workflow). + Please see our [recommended Git workflow](https://github.com/openimsdk/open-im-server/blob/main/docs/contributors/github-workflow.md#workflow). - - You will need to run the cherry pick script separately for each patch release you want to cherry pick to. Cherry picks should be applied to all [active](https://github.com/OpenIMSDK/Open-IM-Server/releases) release branches where the fix is applicable. + - You will need to run the cherry pick script separately for each patch release you want to cherry pick to. Cherry picks should be applied to all [active](https://github.com/openimsdk/open-im-server/releases) release branches where the fix is applicable. - If `GITHUB_TOKEN` is not set you will be asked for your github password: provide the github [personal access token](https://github.com/settings/tokens) rather than your actual github password. If you can securely set the environment variable `GITHUB_TOKEN` to your personal access token then you can avoid an interactive prompt. Refer [mislav/hub#2655 (comment)](https://github.com/mislav/hub/issues/2655#issuecomment-735836048) diff --git a/docs/contrib/git_workflow.md b/docs/contrib/git_workflow.md index 1d21f9cdd..32257e941 100644 --- a/docs/contrib/git_workflow.md +++ b/docs/contrib/git_workflow.md @@ -18,7 +18,7 @@ OpenIM project uses the [GitHub flow](https://docs.github.com/en/get-started/qui ### Branch naming conventions -Every forked repository works independently, meaning that any contributor can create branches with the name they see fit. However, it is worth noting that OpenIM mirrors [OpenIM version skew policy](https://github.com/OpenIMSDK/Open-IM-Server/releases) by maintaining release branches for the most recent three minor releases. The only exception is that the main branch mirrors the latest OpenIM release (3.10) instead of using a `release-` prefixed one. +Every forked repository works independently, meaning that any contributor can create branches with the name they see fit. However, it is worth noting that OpenIM mirrors [OpenIM version skew policy](https://github.com/openimsdk/open-im-server/releases) by maintaining release branches for the most recent three minor releases. The only exception is that the main branch mirrors the latest OpenIM release (3.10) instead of using a `release-` prefixed one. ```text main -------------------------------------------. (OpenIM 3.10) @@ -39,7 +39,7 @@ There are everyday tasks related to git that every contributor needs to perform, Creating a OpenIM fork, cloning it, and setting its upstream remote can be summarized on: -1. Visit +1. Visit 2. Click the `Fork` button (top right) to establish a cloud-based fork 3. Clone fork to local storage 4. Add to your fork OpenIM remote as upstream @@ -54,8 +54,8 @@ git clone https://github.com/$user/OpenIM.git ## Add OpenIM as upstream to your fork cd OpenIM -git remote add upstream https://github.com/OpenIMSDK/Open-IM-Server.git -# or: git remote add upstream git@github.com:OpenIMSDK/Open-IM-Server.git +git remote add upstream https://github.com/openimsdk/open-im-server.git +# or: git remote add upstream git@github.com:openimsdk/open-im-server.git ## Ensure to never push to upstream directly git remote set-url --push upstream no_push diff --git a/docs/contrib/linux_development.md b/docs/contrib/linux_development.md index e5569a069..4a0cb9f18 100644 --- a/docs/contrib/linux_development.md +++ b/docs/contrib/linux_development.md @@ -19,7 +19,7 @@ You can use tools like PuTTY or other SSH clients to log in to your Ubuntu serve Generally, a project will involve multiple developers. Instead of provisioning a server for every developer, many organizations share a single development machine among developers. To simulate this real-world scenario, we'll use a standard user for development. To create the `openim` user: ``` -bashCopy code# adduser openim # Create the openim user, which developers will use for login and development. +# adduser openim # Create the openim user, which developers will use for login and development. # passwd openim # Set the login password for openim. ``` @@ -30,7 +30,7 @@ Working with a non-root user ensures the system's safety and is a good practice. Often, even standard users need root privileges. Instead of frequently asking the system administrator for the root password, you can add the standard user to the sudoers. This allows them to temporarily gain root access using the sudo command. To add the `openim` user to sudoers: ``` -bashCopy code + # sed -i '/^root.*ALL=(ALL:ALL).*ALL/a\openim\tALL=(ALL) \tALL' /etc/sudoers ``` @@ -45,7 +45,7 @@ Assuming we're using the **openim** user, log in using PuTTY or other SSH client The first step after logging into a new server is to configure the `$HOME/.bashrc` file. It makes the Linux shell more user-friendly by setting environment variables like `LANG` and `PS1`. Here's how the configuration would look: ``` -bashCopy code# .bashrc +# .bashrc # User specific aliases and functions @@ -82,7 +82,7 @@ The OpenIM project on Ubuntu may have various dependencies. Some are direct, and You can use the `apt` command to install the required tools on Ubuntu: ``` -bashCopy code$ sudo apt-get update +$ sudo apt-get update $ sudo apt-get install build-essential autoconf automake cmake perl libcurl4-gnutls-dev libtool gcc g++ glibc-doc-reference zlib1g-dev git-lfs telnet lrzsz jq libexpat1-dev libssl-dev $ sudo apt install libcurl4-openssl-dev ``` @@ -92,7 +92,7 @@ $ sudo apt install libcurl4-openssl-dev A higher version of Git ensures compatibility with certain commands like `git fetch --unshallow`. To install a recent version: ``` -bashCopy code$ cd /tmp +$ cd /tmp $ wget --no-check-certificate https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.36.1.tar.gz $ tar -xvzf git-2.36.1.tar.gz $ cd git-2.36.1/ @@ -105,7 +105,7 @@ $ git --version Then, add Git's binary directory to the `PATH`: ``` -bashCopy code + $ echo 'export PATH=/usr/local/libexec/git-core:$PATH' >> $HOME/.bashrc ``` @@ -114,7 +114,7 @@ $ echo 'export PATH=/usr/local/libexec/git-core:$PATH' >> $HOME/.bashrc To set up Git: ``` -bashCopy code$ git config --global user.name "Your Name" +$ git config --global user.name "Your Name" $ git config --global user.email "your_email@example.com" $ git config --global credential.helper store $ git config --global core.longpaths true @@ -123,14 +123,14 @@ $ git config --global core.longpaths true Other Git configurations include: ``` -bashCopy code + $ git config --global core.quotepath off ``` And for handling larger files: ``` -bashCopy code + $ git lfs install --skip-repo ``` diff --git a/docs/contrib/offline-deployment.md b/docs/contrib/offline-deployment.md index 6272c7499..f5083ad12 100644 --- a/docs/contrib/offline-deployment.md +++ b/docs/contrib/offline-deployment.md @@ -26,11 +26,11 @@ docker pull minio/minio ## 2. OpenIM & Chat Images -**For detailed understanding of version management and storage of OpenIM and Chat**: [version.md](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md) +**For detailed understanding of version management and storage of OpenIM and Chat**: [version.md](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md) ### OpenIM Image -- Get image version info: [images.md](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md) +- Get image version info: [images.md](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md) - Depending on the required version, execute the following command: ```bash @@ -111,6 +111,6 @@ docker-compose ps ## 6. Reference Links -- [OpenIMSDK Issue #432](https://github.com/OpenIMSDK/Open-IM-Server/issues/432) +- [OpenIMSDK Issue #432](https://github.com/openimsdk/open-im-server/issues/432) - [Notion Link](https://nsddd.notion.site/435ee747c0bc44048da9300a2d745ad3?pvs=25) -- [OpenIMSDK Issue #474](https://github.com/OpenIMSDK/Open-IM-Server/issues/474) \ No newline at end of file +- [OpenIMSDK Issue #474](https://github.com/openimsdk/open-im-server/issues/474) \ No newline at end of file diff --git a/docs/contrib/protoc_tools.md b/docs/contrib/protoc_tools.md index 66f2e9dec..b164728d3 100644 --- a/docs/contrib/protoc_tools.md +++ b/docs/contrib/protoc_tools.md @@ -44,7 +44,7 @@ For Linux: The OpenIM Protoc tool provides a multitude of options for parsing `.proto` files and generating output: ``` -bashCopy code + ./protoc [OPTION] PROTO_FILES ``` diff --git a/docs/contrib/util_go.md b/docs/contrib/util_go.md index 4126aa97c..ca7b26ad1 100644 --- a/docs/contrib/util_go.md +++ b/docs/contrib/util_go.md @@ -1,6 +1,6 @@ # utils go -+ [toold readme](https://github.com/OpenIMSDK/Open-IM-Server/tree/main/tools) ++ [toold readme](https://github.com/openimsdk/open-im-server/tree/main/tools) about scripts fix: ``` diff --git a/docs/conversions/github-workflow.md b/docs/conversions/github-workflow.md index 013495e5e..64b530740 100644 --- a/docs/conversions/github-workflow.md +++ b/docs/conversions/github-workflow.md @@ -83,7 +83,7 @@ You may now edit files on the `myfeature` branch. ### Building open-im-server -This workflow is process-specific. For quick-start build instructions for [openimsdk/open-im-server](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/util_makefile.md) +This workflow is process-specific. For quick-start build instructions for [openimsdk/open-im-server](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/util_makefile.md) ## 4. Keep your branch in sync diff --git a/docs/conversions/go_code.md b/docs/conversions/go_code.md index aeb1a02ad..c0b49bb8a 100644 --- a/docs/conversions/go_code.md +++ b/docs/conversions/go_code.md @@ -103,12 +103,12 @@ v := make([]string, 0, 4) ```go // bad -var_s string = F() +var s string = F() func F() string { return "A" } // good -var_s = F() +var s = F() // Since F already explicitly returns a string type, we don't need to explicitly specify the type of _s // still of that type @@ -439,7 +439,7 @@ const ( // ErrUnknown - 0: An unknown error occurred. ErrUnknown Code = iota // ErrFatal - 1: An fatal error occurred. - Err Fatal + ErrFatal ) ``` @@ -495,7 +495,7 @@ package superman ### 3.1 Package Notes - Each package has one and only one package-level annotation. -- Package comments are uniformly commented with // in the format of `// Package package name package description`, for example: +- Package comments are uniformly commented with // in the format of `// Package package description`, for example: ```go // Package genericclioptions contains flags which can be added to you command, bound, completed, and produce @@ -757,7 +757,7 @@ defer fd. Close() - If only the first item (key) is needed, discard the second. ```go -for key := range keys { +for keyIndex := range keys { // normal code } ``` diff --git a/docs/conversions/logging.md b/docs/conversions/logging.md index 82f74c9aa..fd9e883ef 100644 --- a/docs/conversions/logging.md +++ b/docs/conversions/logging.md @@ -2,7 +2,7 @@ ### Log Standards -- The unified log package `github.com/OpenIMSDK/Open-IM-Server/internal/pkg/log` should be used for all logging; +- The unified log package `github.com/openimsdk/open-im-server/internal/pkg/log` should be used for all logging; - Use structured logging formats: `log.Infow`, `log.Warnw`, `log.Errorw`, etc. For example: `log.Infow("Update post function called")`; - All logs should start with an uppercase letter and should not end with a `.`. For example: `log.Infow("Update post function called")`; - Use past tense. For example, use `Could not delete B` instead of `Cannot delete B`; diff --git a/docs/conversions/version.md b/docs/conversions/version.md index 490c8e4a7..0980eaa27 100644 --- a/docs/conversions/version.md +++ b/docs/conversions/version.md @@ -27,15 +27,15 @@ In the OpenIM repository, version identification strictly complies with the `MAJ ## Main Branch: The Heart of OpenIM Development -The `main` branch is the operational heart of our development process. Housing the most recent and advanced features, this branch serves as the nerve center for all enhancements and updates. It encapsulates the freshest, though possibly unstable, facets of the software. Visit our `main` branch [here](https://github.com/OpenIMSDK/Open-IM-Server/tree/main). +The `main` branch is the operational heart of our development process. Housing the most recent and advanced features, this branch serves as the nerve center for all enhancements and updates. It encapsulates the freshest, though possibly unstable, facets of the software. Visit our `main` branch [here](https://github.com/openimsdk/open-im-server/tree/main). ## Release Branch: The Beacon of Stability -For every major release, we curate a corresponding `release` branch, e.g., `release-v3.1`. This branch symbolizes an embodiment of stability and ensures an updated version of the software, providing a dependable option for users favoring stability over nascent, yet possibly unstable, features. Visit the `release-v3.1` branch [here](https://github.com/OpenIMSDK/Open-IM-Server/tree/release-v3.1). +For every major release, we curate a corresponding `release` branch, e.g., `release-v3.1`. This branch symbolizes an embodiment of stability and ensures an updated version of the software, providing a dependable option for users favoring stability over nascent, yet possibly unstable, features. Visit the `release-v3.1` branch [here](https://github.com/openimsdk/open-im-server/tree/release-v3.1). ## Tag Management: The Cornerstone of Version Control -In OpenIM's version control system, the role of `tags` stands paramount. Owing to their immutable nature, tags can be effectively utilized to retrieve a specific version of the software. Explore our library of tags [here](https://github.com/OpenIMSDK/Open-IM-Server/tags). +In OpenIM's version control system, the role of `tags` stands paramount. Owing to their immutable nature, tags can be effectively utilized to retrieve a specific version of the software. Explore our library of tags [here](https://github.com/openimsdk/open-im-server/tags). Our Docker image versions are intimately entwined with these tripartite components. For instance, a Docker image tag may correspond to `ghcr.io/openimsdk/openim-server:v3.1.0`, a release to `ghcr.io/openimsdk/openim-server:release-v3.0`, and the main branch to `ghcr.io/openimsdk/openim-server:main` or `ghcr.io/openimsdk/openim-server:latest`. @@ -55,7 +55,7 @@ Whenever a project undergoes a partial functional addition, the minor version nu ## Release Management: A Guided Tour -Our GitHub repository at https://github.com/OpenIMSDK/Open-IM-Server/releases associates a release with each tag, with a distinction between Pre-release and Latest, determined by the branch source. Every significant feature launch prompts the issue of a `release` branch, such as `release-v3.2`, as a beacon of stability and Latest release. +Our GitHub repository at https://github.com/openimsdk/open-im-server/releases associates a release with each tag, with a distinction between Pre-release and Latest, determined by the branch source. Every significant feature launch prompts the issue of a `release` branch, such as `release-v3.2`, as a beacon of stability and Latest release. Pre-releases correspond to releases from the `main` branch, denoting tags with Version modifiers such as `v3.2.1-beta.0`, `v3.2.1-rc.1`, etc. If you are seeking the most recent, albeit possibly unstable, release with new features, these tags, originating from the latest `main` branch code, are your go-to. @@ -65,9 +65,9 @@ Conversely, if stability is your primary concern, you should opt for the release **About:** -+ [OpenIM Milestones](https://github.com/OpenIMSDK/Open-IM-Server/milestones) -+ [OpenIM Tags](https://github.com/OpenIMSDK/Open-IM-Server/tags) -+ [OpenIM Branches](https://github.com/OpenIMSDK/Open-IM-Server/branches) ++ [OpenIM Milestones](https://github.com/openimsdk/open-im-server/milestones) ++ [OpenIM Tags](https://github.com/openimsdk/open-im-server/tags) ++ [OpenIM Branches](https://github.com/openimsdk/open-im-server/branches) We create a new branch, such as `release-v3.1`, for each significant milestone (e.g., v3.1.0), housing all relevant code for that release. All enhancements and bug fixes targeting the subsequent version (e.g., v3.2.0) are integrated into this branch. @@ -82,7 +82,7 @@ We reinforce our approach to branch management and versioning with stringent tes The workflow to address a bug fix might follow these steps: ```bash -bashCopy codebashCopy code# Checkout the branch for the version that needs the bug fix +# Checkout the branch for the version that needs the bug fix git checkout release-v3.1 # Create a new branch for the bug fix @@ -120,5 +120,4 @@ Throughout this process, active communication within the team is pivotal to main ## Docker Images Version Management -For more details on managing Docker image versions, visit [OpenIM Docker Images Administration](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md). - +For more details on managing Docker image versions, visit [OpenIM Docker Images Administration](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md). diff --git a/go.mod b/go.mod index d32497f3d..262c2e82e 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,9 @@ -module github.com/OpenIMSDK/Open-IM-Server +module github.com/openimsdk/open-im-server/v3 go 1.18 require ( firebase.google.com/go v3.13.0+incompatible - github.com/Shopify/sarama v1.29.0 github.com/bwmarrin/snowflake v0.3.0 // indirect github.com/dtm-labs/rockscache v0.1.1 github.com/gin-gonic/gin v1.9.1 @@ -37,6 +36,7 @@ require ( require github.com/google/uuid v1.3.1 require ( + github.com/IBM/sarama v1.41.1 github.com/OpenIMSDK/protocol v0.0.19 github.com/OpenIMSDK/tools v0.0.14 github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible @@ -62,8 +62,8 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/eapache/go-resiliency v1.2.0 // indirect - github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect + github.com/eapache/go-resiliency v1.4.0 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect @@ -76,12 +76,14 @@ require ( github.com/google/s2a-go v0.1.5 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect - github.com/hashicorp/go-uuid v1.0.2 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect - github.com/jcmturner/gofork v1.0.0 // indirect - github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect + github.com/jcmturner/gofork v1.7.6 // indirect + github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect @@ -100,7 +102,7 @@ require ( github.com/onsi/ginkgo v1.16.5 // indirect github.com/onsi/gomega v1.18.1 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/pierrec/lz4 v2.6.0+incompatible // indirect + github.com/pierrec/lz4/v4 v4.1.18 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect diff --git a/go.sum b/go.sum index 2bade408e..e94b507ae 100644 --- a/go.sum +++ b/go.sum @@ -17,15 +17,13 @@ cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7Biccwk firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4= firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/OpenIMSDK/protocol v0.0.19 h1:uhIToUMv6AZK0g5k4uuSEMRwuRdeLSUmM4yMG0Hw5Rk= -github.com/OpenIMSDK/protocol v0.0.19/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y= +github.com/IBM/sarama v1.41.1 h1:B4/TdHce/8Ipza+qrLIeNJ9D1AOxZVp/3uDv6H/dp2M= +github.com/IBM/sarama v1.41.1/go.mod h1:JFCPURVskaipJdKRFkiE/OZqQHw7jqliaJmRwXCmSSw= +github.com/OpenIMSDK/protocol v0.0.18 h1:hXukFiDMLZx7s+hDCQePIK9ABiHyNlobNL4MppvOuMY= +github.com/OpenIMSDK/protocol v0.0.18/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y= github.com/OpenIMSDK/tools v0.0.14 h1:WLof/+WxyPyRST+QkoTKubYCiV73uCLiL8pgnpH/yKQ= github.com/OpenIMSDK/tools v0.0.14/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= -github.com/Shopify/sarama v1.29.0 h1:ARid8o8oieau9XrHI55f/L3EoRAhm9px6sonbD7yuUE= -github.com/Shopify/sarama v1.29.0/go.mod h1:2QpgD79wpdAESqNQMxNc0KYMkycd4slxGdV3TWSVqrU= -github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible h1:Sg/2xHwDrioHpxTN6WMiwbXTpUEinBpHsN7mG21Rc2k= github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -59,7 +57,6 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -69,10 +66,10 @@ github.com/dtm-labs/rockscache v0.1.1 h1:6S1vgaHvGqrLd8Ka4hRTKeKPV7v+tT0MSkTIX81 github.com/dtm-labs/rockscache v0.1.1/go.mod h1:c76WX0kyIibmQ2ACxUXvDvaLykoPakivMqIxt+UzE7A= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= -github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/go-resiliency v1.4.0 h1:3OK9bWpPk5q6pbFAaYSEwD9CLUSHG8bnZuqX2yMt3B0= +github.com/eapache/go-resiliency v1.4.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -82,9 +79,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -139,7 +133,6 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -149,7 +142,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -176,8 +168,13 @@ github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -186,12 +183,12 @@ github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFK 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/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= -github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= -github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= +github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= -github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA= -github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= +github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= +github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= @@ -205,7 +202,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= @@ -213,12 +209,8 @@ github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= @@ -270,8 +262,8 @@ github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A= -github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= +github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -308,7 +300,6 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -331,8 +322,6 @@ github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -github.com/xdg/scram v1.0.3/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -356,11 +345,10 @@ golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -389,11 +377,11 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210427231257-85d9c07bbe3a/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -504,7 +492,6 @@ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -517,7 +504,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= diff --git a/go.work b/go.work index 853ffd5a3..fd19bde42 100644 --- a/go.work +++ b/go.work @@ -4,9 +4,11 @@ use ( . ./test/typecheck ./tools/changelog + ./tools/imctl ./tools/infra ./tools/ncpu - ./tools/versionchecker ./tools/openim-web + ./tools/versionchecker ./tools/yamlfmt + ./tools/component ) diff --git a/install.sh b/install.sh index 7dba0a39e..d43767362 100755 --- a/install.sh +++ b/install.sh @@ -103,9 +103,9 @@ function check_git_repo() { # Inside a git repository for remote in $(git remote); do repo_url=$(git remote get-url $remote) - if [[ $repo_url == "https://github.com/OpenIMSDK/Open-IM-Server.git" || \ - $repo_url == "https://github.com/OpenIMSDK/Open-IM-Server" || \ - $repo_url == "git@github.com:OpenIMSDK/Open-IM-Server.git" ]]; then + if [[ $repo_url == "https://github.com/openimsdk/open-im-server.git" || \ + $repo_url == "https://github.com/openimsdk/open-im-server" || \ + $repo_url == "git@github.com:openimsdk/open-im-server.git" ]]; then # If it's OpenIMSDK repository info "Current directory is OpenIMSDK git repository." info "Executing installation directly." @@ -515,7 +515,7 @@ O:::::::OOO:::::::O p:::::ppppp:::::::pe::::::::e n::::n n::::nII: ' 0.0001 # Display product URL - print_with_delay "Discover more and contribute at: https://github.com/OpenIMSDK/Open-IM-Server" 0.01 + print_with_delay "Discover more and contribute at: https://github.com/openimsdk/open-im-server" 0.01 # Reset text color back to normal echo -e "\033[0m" diff --git a/install_guide.sh b/install_guide.sh index c6532feb8..f42e65b9d 100755 --- a/install_guide.sh +++ b/install_guide.sh @@ -91,7 +91,7 @@ install_docker_compose() { fi rm -rf ./Open-IM-Server set -e - git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive; + git clone https://github.com/openimsdk/open-im-server.git --recursive; set +e cd ./Open-IM-Server git checkout errcode diff --git a/internal/api/auth.go b/internal/api/auth.go index 9dcc8f7c7..44a97a013 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -20,7 +20,7 @@ import ( "github.com/OpenIMSDK/protocol/auth" "github.com/OpenIMSDK/tools/a2r" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type AuthApi rpcclient.Auth diff --git a/internal/api/conversation.go b/internal/api/conversation.go index 74b0e7c19..eae2353b2 100644 --- a/internal/api/conversation.go +++ b/internal/api/conversation.go @@ -20,7 +20,7 @@ import ( "github.com/OpenIMSDK/protocol/conversation" "github.com/OpenIMSDK/tools/a2r" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type ConversationApi rpcclient.Conversation diff --git a/internal/api/friend.go b/internal/api/friend.go index 2f708901e..23f337a9f 100644 --- a/internal/api/friend.go +++ b/internal/api/friend.go @@ -18,7 +18,7 @@ import ( "github.com/OpenIMSDK/protocol/friend" "github.com/OpenIMSDK/tools/a2r" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/gin-gonic/gin" ) diff --git a/internal/api/group.go b/internal/api/group.go index 1dbca3126..e525cd495 100644 --- a/internal/api/group.go +++ b/internal/api/group.go @@ -18,7 +18,7 @@ import ( "github.com/OpenIMSDK/protocol/group" "github.com/OpenIMSDK/tools/a2r" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/gin-gonic/gin" ) diff --git a/internal/api/msg.go b/internal/api/msg.go index e5a49199f..2777d8855 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -15,13 +15,14 @@ package api import ( - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/tools/mcontext" "github.com/gin-gonic/gin" "github.com/go-playground/validator/v10" "github.com/mitchellh/mapstructure" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/protocol/sdkws" @@ -31,8 +32,8 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/apistruct" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type MessageApi struct { diff --git a/internal/api/route.go b/internal/api/route.go index 08f5a092f..aa56f1638 100644 --- a/internal/api/route.go +++ b/internal/api/route.go @@ -23,9 +23,9 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/tokenverify" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" @@ -38,9 +38,9 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mw" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/prome" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.UniversalClient) *gin.Engine { diff --git a/internal/api/statistics.go b/internal/api/statistics.go index 9db38af4a..5750a7315 100644 --- a/internal/api/statistics.go +++ b/internal/api/statistics.go @@ -20,7 +20,7 @@ import ( "github.com/OpenIMSDK/protocol/user" "github.com/OpenIMSDK/tools/a2r" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type StatisticsApi rpcclient.User diff --git a/internal/api/third.go b/internal/api/third.go index 44a492fc4..dfc82d316 100644 --- a/internal/api/third.go +++ b/internal/api/third.go @@ -26,7 +26,7 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/mcontext" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type ThirdApi rpcclient.Third diff --git a/internal/api/user.go b/internal/api/user.go index bfa1d0df7..0a5a12698 100644 --- a/internal/api/user.go +++ b/internal/api/user.go @@ -25,8 +25,8 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type UserApi rpcclient.User diff --git a/internal/msggateway/callback.go b/internal/msggateway/callback.go index b2999f385..d7320a304 100644 --- a/internal/msggateway/callback.go +++ b/internal/msggateway/callback.go @@ -21,9 +21,9 @@ import ( "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/mcontext" - cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/http" + cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/http" ) func callBackURL() string { diff --git a/internal/msggateway/client.go b/internal/msggateway/client.go index 9f612e021..8121535ad 100644 --- a/internal/msggateway/client.go +++ b/internal/msggateway/client.go @@ -21,7 +21,7 @@ import ( "runtime/debug" "sync" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "google.golang.org/protobuf/proto" diff --git a/internal/msggateway/hub_server.go b/internal/msggateway/hub_server.go index 1ebbb5902..ae12c04a3 100644 --- a/internal/msggateway/hub_server.go +++ b/internal/msggateway/hub_server.go @@ -19,12 +19,12 @@ import ( "github.com/OpenIMSDK/tools/mcontext" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/OpenIMSDK/tools/errs" "google.golang.org/grpc" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msggateway" @@ -32,9 +32,9 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/startrpc" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/prome" + "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" ) func (s *Server) InitServer(disCov discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error { diff --git a/internal/msggateway/init.go b/internal/msggateway/init.go index 03fe9f581..7a4b6d6ad 100644 --- a/internal/msggateway/init.go +++ b/internal/msggateway/init.go @@ -18,7 +18,7 @@ import ( "fmt" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func RunWsAndServer(rpcPort, wsPort, prometheusPort int) error { diff --git a/internal/msggateway/message_handler.go b/internal/msggateway/message_handler.go index 6c26e5906..a8de5e0b5 100644 --- a/internal/msggateway/message_handler.go +++ b/internal/msggateway/message_handler.go @@ -27,7 +27,7 @@ import ( "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type Req struct { diff --git a/internal/msggateway/n_ws_server.go b/internal/msggateway/n_ws_server.go index 22e04b011..f437f9d8c 100644 --- a/internal/msggateway/n_ws_server.go +++ b/internal/msggateway/n_ws_server.go @@ -25,13 +25,13 @@ import ( "github.com/OpenIMSDK/protocol/msggateway" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/redis/go-redis/v9" diff --git a/internal/msgtransfer/init.go b/internal/msgtransfer/init.go index c532b3c07..db48ead70 100644 --- a/internal/msgtransfer/init.go +++ b/internal/msgtransfer/init.go @@ -26,14 +26,14 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mw" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/prome" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type MsgTransfer struct { diff --git a/internal/msgtransfer/online_history_msg_handler.go b/internal/msgtransfer/online_history_msg_handler.go index efaf28cc3..e83939a4c 100644 --- a/internal/msgtransfer/online_history_msg_handler.go +++ b/internal/msgtransfer/online_history_msg_handler.go @@ -21,11 +21,11 @@ import ( "sync" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "github.com/OpenIMSDK/tools/errs" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/go-redis/redis" "google.golang.org/protobuf/proto" @@ -35,10 +35,10 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) const ( diff --git a/internal/msgtransfer/online_msg_to_mongo_handler.go b/internal/msgtransfer/online_msg_to_mongo_handler.go index 90c54d917..8099d39d7 100644 --- a/internal/msgtransfer/online_msg_to_mongo_handler.go +++ b/internal/msgtransfer/online_msg_to_mongo_handler.go @@ -17,15 +17,15 @@ package msgtransfer import ( "context" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "google.golang.org/protobuf/proto" pbmsg "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - kfk "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + kfk "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" ) type OnlineHistoryMongoConsumerHandler struct { diff --git a/internal/msgtransfer/persistent_msg_handler.go b/internal/msgtransfer/persistent_msg_handler.go index 02cd49767..d1f27f48f 100644 --- a/internal/msgtransfer/persistent_msg_handler.go +++ b/internal/msgtransfer/persistent_msg_handler.go @@ -22,11 +22,11 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - kfk "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + kfk "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "google.golang.org/protobuf/proto" ) diff --git a/internal/push/callback.go b/internal/push/callback.go index 996341ac1..c646df3e2 100644 --- a/internal/push/callback.go +++ b/internal/push/callback.go @@ -23,9 +23,9 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/http" + "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/http" ) func url() string { diff --git a/internal/push/consumer_init.go b/internal/push/consumer_init.go index 3c07ab284..8595c1656 100644 --- a/internal/push/consumer_init.go +++ b/internal/push/consumer_init.go @@ -15,7 +15,7 @@ package push import ( - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" + "github.com/openimsdk/open-im-server/v3/pkg/common/prome" ) type Consumer struct { diff --git a/internal/push/offlinepush/fcm/push.go b/internal/push/offlinepush/fcm/push.go index ffa5db428..27e7dab18 100644 --- a/internal/push/offlinepush/fcm/push.go +++ b/internal/push/offlinepush/fcm/push.go @@ -18,7 +18,7 @@ import ( "context" "path/filepath" - config2 "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" firebase "firebase.google.com/go" "firebase.google.com/go/messaging" @@ -27,9 +27,9 @@ import ( "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" ) const SinglePushCountLimit = 400 diff --git a/internal/push/offlinepush/fcm/push_test.go b/internal/push/offlinepush/fcm/push_test.go index 856b75e0b..96d8ad3a3 100644 --- a/internal/push/offlinepush/fcm/push_test.go +++ b/internal/push/offlinepush/fcm/push_test.go @@ -20,8 +20,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" ) func Test_Push(t *testing.T) { diff --git a/internal/push/offlinepush/getui/body.go b/internal/push/offlinepush/getui/body.go index 915c6f603..218ed67b4 100644 --- a/internal/push/offlinepush/getui/body.go +++ b/internal/push/offlinepush/getui/body.go @@ -17,7 +17,7 @@ package getui import ( "fmt" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type Resp struct { diff --git a/internal/push/offlinepush/getui/push.go b/internal/push/offlinepush/getui/push.go index b784af029..1fd65647d 100644 --- a/internal/push/offlinepush/getui/push.go +++ b/internal/push/offlinepush/getui/push.go @@ -30,10 +30,10 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils/splitter" - "github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - http2 "github.com/OpenIMSDK/Open-IM-Server/pkg/common/http" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + http2 "github.com/openimsdk/open-im-server/v3/pkg/common/http" "github.com/OpenIMSDK/tools/utils" ) diff --git a/internal/push/offlinepush/jpush/body/notification.go b/internal/push/offlinepush/jpush/body/notification.go index cec725784..ddf3802af 100644 --- a/internal/push/offlinepush/jpush/body/notification.go +++ b/internal/push/offlinepush/jpush/body/notification.go @@ -15,7 +15,7 @@ package body import ( - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type Notification struct { diff --git a/internal/push/offlinepush/jpush/push.go b/internal/push/offlinepush/jpush/push.go index 64933db50..44de7ff65 100644 --- a/internal/push/offlinepush/jpush/push.go +++ b/internal/push/offlinepush/jpush/push.go @@ -19,10 +19,10 @@ import ( "encoding/base64" "fmt" - "github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush" - "github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/jpush/body" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - http2 "github.com/OpenIMSDK/Open-IM-Server/pkg/common/http" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/jpush/body" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + http2 "github.com/openimsdk/open-im-server/v3/pkg/common/http" ) type JPush struct{} diff --git a/internal/push/push_handler.go b/internal/push/push_handler.go index 736bfc7f9..91363282f 100644 --- a/internal/push/push_handler.go +++ b/internal/push/push_handler.go @@ -17,7 +17,7 @@ package push import ( "context" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "google.golang.org/protobuf/proto" "github.com/OpenIMSDK/protocol/constant" @@ -26,8 +26,8 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - kfk "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + kfk "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" ) type ConsumerHandler struct { diff --git a/internal/push/push_rpc_server.go b/internal/push/push_rpc_server.go index b86ec2374..6e9c56023 100644 --- a/internal/push/push_rpc_server.go +++ b/internal/push/push_rpc_server.go @@ -25,10 +25,10 @@ import ( "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/localcache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/localcache" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type pushServer struct { diff --git a/internal/push/push_to_client.go b/internal/push/push_to_client.go index 23df0f224..772cbdb46 100644 --- a/internal/push/push_to_client.go +++ b/internal/push/push_to_client.go @@ -20,7 +20,7 @@ import ( "errors" "github.com/OpenIMSDK/protocol/conversation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msggateway" @@ -30,16 +30,16 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush" - "github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/fcm" - "github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/getui" - "github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/jpush" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/localcache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/fcm" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/getui" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/jpush" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/localcache" + "github.com/openimsdk/open-im-server/v3/pkg/common/prome" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type Pusher struct { diff --git a/internal/rpc/auth/auth.go b/internal/rpc/auth/auth.go index c1fa0d6e6..9580ef8db 100644 --- a/internal/rpc/auth/auth.go +++ b/internal/rpc/auth/auth.go @@ -17,7 +17,7 @@ package auth import ( "context" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "google.golang.org/grpc" @@ -31,10 +31,10 @@ import ( "github.com/OpenIMSDK/tools/tokenverify" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type authServer struct { diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index d3223d2ed..36e92c04d 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -16,7 +16,8 @@ package conversation import ( "context" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "google.golang.org/grpc" @@ -28,13 +29,13 @@ import ( "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" - tablerelation "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation" + tablerelation "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" ) type conversationServer struct { diff --git a/internal/rpc/friend/black.go b/internal/rpc/friend/black.go index 176b9ef8e..b1a5ea6b5 100644 --- a/internal/rpc/friend/black.go +++ b/internal/rpc/friend/black.go @@ -18,13 +18,13 @@ import ( "context" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" pbfriend "github.com/OpenIMSDK/protocol/friend" "github.com/OpenIMSDK/tools/mcontext" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) func (s *friendServer) GetPaginationBlacks( diff --git a/internal/rpc/friend/callback.go b/internal/rpc/friend/callback.go index f29867bb0..bb687773e 100644 --- a/internal/rpc/friend/callback.go +++ b/internal/rpc/friend/callback.go @@ -22,9 +22,9 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/mcontext" - cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/http" + cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/http" ) func CallbackBeforeAddFriend(ctx context.Context, req *pbfriend.ApplyToAddFriendReq) error { diff --git a/internal/rpc/friend/friend.go b/internal/rpc/friend/friend.go index 7b753faa5..1524a7f27 100644 --- a/internal/rpc/friend/friend.go +++ b/internal/rpc/friend/friend.go @@ -19,12 +19,12 @@ import ( "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "google.golang.org/grpc" @@ -35,11 +35,11 @@ import ( "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" - tablerelation "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation" + tablerelation "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" ) type friendServer struct { diff --git a/internal/rpc/group/cache.go b/internal/rpc/group/cache.go index 40be7a18f..23c57ff89 100644 --- a/internal/rpc/group/cache.go +++ b/internal/rpc/group/cache.go @@ -19,7 +19,7 @@ import ( pbgroup "github.com/OpenIMSDK/protocol/group" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" ) func (s *groupServer) GetGroupInfoCache( diff --git a/internal/rpc/group/callback.go b/internal/rpc/group/callback.go index cb49d6f74..6d92cfde2 100644 --- a/internal/rpc/group/callback.go +++ b/internal/rpc/group/callback.go @@ -25,11 +25,11 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct" - "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/http" + "github.com/openimsdk/open-im-server/v3/pkg/apistruct" + "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/http" ) func CallbackBeforeCreateGroup(ctx context.Context, req *group.CreateGroupReq) (err error) { diff --git a/internal/rpc/group/convert.go b/internal/rpc/group/convert.go index 6f75234ff..2ee7f5056 100644 --- a/internal/rpc/group/convert.go +++ b/internal/rpc/group/convert.go @@ -17,7 +17,7 @@ package group import ( "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) func (s *groupServer) groupDB2PB(group *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo { diff --git a/internal/rpc/group/fill.go b/internal/rpc/group/fill.go index e4d03de36..cb47d9f6e 100644 --- a/internal/rpc/group/fill.go +++ b/internal/rpc/group/fill.go @@ -19,7 +19,7 @@ import ( "github.com/OpenIMSDK/tools/utils" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) func (s *groupServer) FindGroupMember(ctx context.Context, groupIDs []string, userIDs []string, roleLevels []int32) ([]*relationtb.GroupMemberModel, error) { diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index b09743759..507d83d81 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -26,18 +26,18 @@ import ( "strings" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" pbconversation "github.com/OpenIMSDK/protocol/conversation" "github.com/OpenIMSDK/protocol/wrapperspb" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" "github.com/OpenIMSDK/tools/mw/specialerror" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "google.golang.org/grpc" @@ -50,11 +50,11 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" ) func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error { diff --git a/internal/rpc/group/super_group.go b/internal/rpc/group/super_group.go index d60a55db9..6cd1a2943 100644 --- a/internal/rpc/group/super_group.go +++ b/internal/rpc/group/super_group.go @@ -25,9 +25,9 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) func (s *groupServer) GetJoinedSuperGroupList( diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go index ab037f6c1..68586ba85 100644 --- a/internal/rpc/msg/callback.go +++ b/internal/rpc/msg/callback.go @@ -27,9 +27,9 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/http" + cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/http" ) func cbURL() string { diff --git a/internal/rpc/msg/delete.go b/internal/rpc/msg/delete.go index ff258eaae..b5c23bed6 100644 --- a/internal/rpc/msg/delete.go +++ b/internal/rpc/msg/delete.go @@ -17,7 +17,7 @@ package msg import ( "context" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/conversation" diff --git a/internal/rpc/msg/message_interceptor.go b/internal/rpc/msg/message_interceptor.go index 2b41ccb51..bcb97d7d2 100644 --- a/internal/rpc/msg/message_interceptor.go +++ b/internal/rpc/msg/message_interceptor.go @@ -22,7 +22,7 @@ import ( "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type MessageInterceptorFunc func(ctx context.Context, req *msg.SendMsgReq) (*sdkws.MsgData, error) diff --git a/internal/rpc/msg/revoke.go b/internal/rpc/msg/revoke.go index 8977e5995..151d29fc1 100644 --- a/internal/rpc/msg/revoke.go +++ b/internal/rpc/msg/revoke.go @@ -19,7 +19,7 @@ import ( "encoding/json" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msg" @@ -29,8 +29,8 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - unrelationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) func (m *msgServer) RevokeMsg(ctx context.Context, req *msg.RevokeMsgReq) (*msg.RevokeMsgResp, error) { diff --git a/internal/rpc/msg/send.go b/internal/rpc/msg/send.go index 7e20a9148..2add9c0d1 100644 --- a/internal/rpc/msg/send.go +++ b/internal/rpc/msg/send.go @@ -17,7 +17,7 @@ package msg import ( "context" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "github.com/OpenIMSDK/protocol/constant" pbconversation "github.com/OpenIMSDK/protocol/conversation" @@ -29,7 +29,7 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - promepkg "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" + promepkg "github.com/openimsdk/open-im-server/v3/pkg/common/prome" ) func (m *msgServer) SendMsg(ctx context.Context, req *pbmsg.SendMsgReq) (resp *pbmsg.SendMsgResp, error error) { diff --git a/internal/rpc/msg/server.go b/internal/rpc/msg/server.go index 3aa4033d7..e8f80914f 100644 --- a/internal/rpc/msg/server.go +++ b/internal/rpc/msg/server.go @@ -24,12 +24,12 @@ import ( "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/localcache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/localcache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/prome" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type ( diff --git a/internal/rpc/msg/statistics.go b/internal/rpc/msg/statistics.go index 846580598..ac09e3f69 100644 --- a/internal/rpc/msg/statistics.go +++ b/internal/rpc/msg/statistics.go @@ -22,7 +22,7 @@ import ( "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) func (m *msgServer) GetActiveUser(ctx context.Context, req *msg.GetActiveUserReq) (*msg.GetActiveUserResp, error) { diff --git a/internal/rpc/msg/sync_msg.go b/internal/rpc/msg/sync_msg.go index 5eba8ae14..aaafb45bb 100644 --- a/internal/rpc/msg/sync_msg.go +++ b/internal/rpc/msg/sync_msg.go @@ -17,8 +17,8 @@ package msg import ( "context" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msg" diff --git a/internal/rpc/msg/utils.go b/internal/rpc/msg/utils.go index 9753a3e01..115df9946 100644 --- a/internal/rpc/msg/utils.go +++ b/internal/rpc/msg/utils.go @@ -22,7 +22,7 @@ import ( "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func isMessageHasReadEnabled(msgData *sdkws.MsgData) bool { diff --git a/internal/rpc/msg/verify.go b/internal/rpc/msg/verify.go index de85775d8..2837cb944 100644 --- a/internal/rpc/msg/verify.go +++ b/internal/rpc/msg/verify.go @@ -26,7 +26,7 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) var ExcludeContentType = []int{constant.HasReadReceipt} diff --git a/internal/rpc/third/s3.go b/internal/rpc/third/s3.go index 943cd5d54..984af88e1 100644 --- a/internal/rpc/third/s3.go +++ b/internal/rpc/third/s3.go @@ -19,7 +19,7 @@ import ( "strconv" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" "github.com/OpenIMSDK/protocol/third" "github.com/OpenIMSDK/tools/errs" @@ -27,8 +27,8 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/cont" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cont" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) func (t *thirdServer) PartLimit(ctx context.Context, req *third.PartLimitReq) (*third.PartLimitResp, error) { diff --git a/internal/rpc/third/third.go b/internal/rpc/third/third.go index 8a2f91f6f..221004bd5 100644 --- a/internal/rpc/third/third.go +++ b/internal/rpc/third/third.go @@ -20,22 +20,22 @@ import ( "net/url" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/cos" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/minio" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/oss" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cos" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/minio" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/oss" "google.golang.org/grpc" "github.com/OpenIMSDK/protocol/third" "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error { diff --git a/internal/rpc/third/tool.go b/internal/rpc/third/tool.go index f81a7ccf2..a65d882dd 100644 --- a/internal/rpc/third/tool.go +++ b/internal/rpc/third/tool.go @@ -21,7 +21,7 @@ import ( "strings" "unicode/utf8" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/OpenIMSDK/protocol/third" "github.com/OpenIMSDK/tools/errs" diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index 32a3e314b..443f70cae 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -26,19 +26,19 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/tx" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" registry "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" - tablerelation "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation" + tablerelation "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" pbuser "github.com/OpenIMSDK/protocol/user" "github.com/OpenIMSDK/tools/utils" diff --git a/internal/tools/cron_task.go b/internal/tools/cron_task.go index 0bc8b00a3..6702bc6c7 100644 --- a/internal/tools/cron_task.go +++ b/internal/tools/cron_task.go @@ -23,7 +23,7 @@ import ( "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func StartTask() error { diff --git a/internal/tools/msg.go b/internal/tools/msg.go index 3cbaa455c..93f5c3a8a 100644 --- a/internal/tools/msg.go +++ b/internal/tools/msg.go @@ -32,13 +32,13 @@ import ( "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" ) type MsgTool struct { diff --git a/internal/tools/msg_doc_convert.go b/internal/tools/msg_doc_convert.go index 75ae36eda..aa24d385f 100644 --- a/internal/tools/msg_doc_convert.go +++ b/internal/tools/msg_doc_convert.go @@ -19,7 +19,7 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" ) func (c *MsgTool) ConvertTools() { diff --git a/pkg/apistruct/doc.go b/pkg/apistruct/doc.go index d99eab7b6..2f1404584 100644 --- a/pkg/apistruct/doc.go +++ b/pkg/apistruct/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package apistruct // import "github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct" +package apistruct // import "github.com/openimsdk/open-im-server/v3/pkg/apistruct" diff --git a/pkg/authverify/doc.go b/pkg/authverify/doc.go index e07d69614..f9173a708 100644 --- a/pkg/authverify/doc.go +++ b/pkg/authverify/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package authverify // import "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" +package authverify // import "github.com/openimsdk/open-im-server/v3/pkg/authverify" diff --git a/pkg/authverify/token.go b/pkg/authverify/token.go index e508c75cb..a8e577fde 100644 --- a/pkg/authverify/token.go +++ b/pkg/authverify/token.go @@ -24,7 +24,7 @@ import ( "github.com/OpenIMSDK/tools/utils" "github.com/golang-jwt/jwt/v4" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func Secret() jwt.Keyfunc { diff --git a/pkg/callbackstruct/doc.go b/pkg/callbackstruct/doc.go index d9d9cd8d0..c3445c60e 100644 --- a/pkg/callbackstruct/doc.go +++ b/pkg/callbackstruct/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package callbackstruct // import "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct" +package callbackstruct // import "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" diff --git a/pkg/callbackstruct/group.go b/pkg/callbackstruct/group.go index 8282b6546..11b33bf0a 100644 --- a/pkg/callbackstruct/group.go +++ b/pkg/callbackstruct/group.go @@ -17,7 +17,7 @@ package callbackstruct import ( common "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct" + "github.com/openimsdk/open-im-server/v3/pkg/apistruct" ) type CallbackCommand string diff --git a/pkg/common/cmd/doc.go b/pkg/common/cmd/doc.go index 75da58c57..991a85eb9 100644 --- a/pkg/common/cmd/doc.go +++ b/pkg/common/cmd/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" +package cmd // import "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" diff --git a/pkg/common/cmd/msg_gateway.go b/pkg/common/cmd/msg_gateway.go index aae63351d..34a9f3b4e 100644 --- a/pkg/common/cmd/msg_gateway.go +++ b/pkg/common/cmd/msg_gateway.go @@ -15,8 +15,8 @@ package cmd import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/msggateway" - //"github.com/OpenIMSDK/Open-IM-Server/internal/msggateway". + "github.com/openimsdk/open-im-server/v3/internal/msggateway" + //"github.com/openimsdk/open-im-server/internal/msggateway". "github.com/spf13/cobra" "github.com/OpenIMSDK/protocol/constant" diff --git a/pkg/common/cmd/msg_transfer.go b/pkg/common/cmd/msg_transfer.go index 5c9c3d0cb..ae67ee9f7 100644 --- a/pkg/common/cmd/msg_transfer.go +++ b/pkg/common/cmd/msg_transfer.go @@ -17,7 +17,7 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/OpenIMSDK/Open-IM-Server/internal/msgtransfer" + "github.com/openimsdk/open-im-server/v3/internal/msgtransfer" ) type MsgTransferCmd struct { diff --git a/pkg/common/cmd/msg_utils.go b/pkg/common/cmd/msg_utils.go index c4f202d2b..cfaf631ec 100644 --- a/pkg/common/cmd/msg_utils.go +++ b/pkg/common/cmd/msg_utils.go @@ -17,7 +17,7 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/OpenIMSDK/Open-IM-Server/internal/tools" + "github.com/openimsdk/open-im-server/v3/internal/tools" ) type MsgUtilsCmd struct { diff --git a/pkg/common/cmd/root.go b/pkg/common/cmd/root.go index 96ecc20c3..508ef8377 100644 --- a/pkg/common/cmd/root.go +++ b/pkg/common/cmd/root.go @@ -17,13 +17,13 @@ package cmd import ( "fmt" - config2 "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/spf13/cobra" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/log" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type RootCmd struct { diff --git a/pkg/common/cmd/rpc.go b/pkg/common/cmd/rpc.go index 1f6fe16a5..a5fc1164c 100644 --- a/pkg/common/cmd/rpc.go +++ b/pkg/common/cmd/rpc.go @@ -22,7 +22,7 @@ import ( "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/startrpc" + "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" ) type RpcCmd struct { diff --git a/pkg/common/config/doc.go b/pkg/common/config/doc.go index a58dd1b8f..4b76cb9fa 100644 --- a/pkg/common/config/doc.go +++ b/pkg/common/config/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" +package config // import "github.com/openimsdk/open-im-server/v3/pkg/common/config" diff --git a/pkg/common/config/parse.go b/pkg/common/config/parse.go index 8b7999b25..84cddf0da 100644 --- a/pkg/common/config/parse.go +++ b/pkg/common/config/parse.go @@ -21,7 +21,7 @@ import ( "path/filepath" "runtime" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "gopkg.in/yaml.v3" diff --git a/pkg/common/convert/black.go b/pkg/common/convert/black.go index f0f74fbcc..50c270dcb 100644 --- a/pkg/common/convert/black.go +++ b/pkg/common/convert/black.go @@ -20,7 +20,7 @@ import ( "github.com/OpenIMSDK/protocol/sdkws" sdk "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) func BlackDB2Pb( diff --git a/pkg/common/convert/conversation.go b/pkg/common/convert/conversation.go index 4c9a5ea4e..165262b7f 100644 --- a/pkg/common/convert/conversation.go +++ b/pkg/common/convert/conversation.go @@ -18,7 +18,7 @@ import ( "github.com/OpenIMSDK/protocol/conversation" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) func ConversationDB2Pb(conversationDB *relation.ConversationModel) *conversation.Conversation { diff --git a/pkg/common/convert/doc.go b/pkg/common/convert/doc.go index 0789adc3f..29c1144c1 100644 --- a/pkg/common/convert/doc.go +++ b/pkg/common/convert/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package convert // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert" +package convert // import "github.com/openimsdk/open-im-server/v3/pkg/common/convert" diff --git a/pkg/common/convert/friend.go b/pkg/common/convert/friend.go index 255334840..7003c8aa6 100644 --- a/pkg/common/convert/friend.go +++ b/pkg/common/convert/friend.go @@ -20,7 +20,7 @@ import ( "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) func FriendPb2DB(friend *sdkws.FriendInfo) *relation.FriendModel { diff --git a/pkg/common/convert/group.go b/pkg/common/convert/group.go index 7562224d8..c13016b7e 100644 --- a/pkg/common/convert/group.go +++ b/pkg/common/convert/group.go @@ -20,7 +20,7 @@ import ( pbgroup "github.com/OpenIMSDK/protocol/group" sdkws "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) func Db2PbGroupInfo(m *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo { diff --git a/pkg/common/convert/msg.go b/pkg/common/convert/msg.go index d3d2d25e7..56f71f018 100644 --- a/pkg/common/convert/msg.go +++ b/pkg/common/convert/msg.go @@ -18,7 +18,7 @@ import ( "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) func MsgPb2DB(msg *sdkws.MsgData) *unrelation.MsgDataModel { diff --git a/pkg/common/convert/user.go b/pkg/common/convert/user.go index 07989af1d..abb3a2144 100644 --- a/pkg/common/convert/user.go +++ b/pkg/common/convert/user.go @@ -19,7 +19,7 @@ import ( "github.com/OpenIMSDK/protocol/sdkws" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) func UsersDB2Pb(users []*relationtb.UserModel) (result []*sdkws.UserInfo) { diff --git a/pkg/common/db/cache/black.go b/pkg/common/db/cache/black.go index b6ce091e8..6da7d5d05 100644 --- a/pkg/common/db/cache/black.go +++ b/pkg/common/db/cache/black.go @@ -21,7 +21,7 @@ import ( "github.com/dtm-labs/rockscache" "github.com/redis/go-redis/v9" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) const ( diff --git a/pkg/common/db/cache/conversation.go b/pkg/common/db/cache/conversation.go index 013afe19b..d02b021e3 100644 --- a/pkg/common/db/cache/conversation.go +++ b/pkg/common/db/cache/conversation.go @@ -26,8 +26,8 @@ import ( "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) const ( diff --git a/pkg/common/db/cache/doc.go b/pkg/common/db/cache/doc.go index e02c5b9ba..77651e3de 100644 --- a/pkg/common/db/cache/doc.go +++ b/pkg/common/db/cache/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cache // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" +package cache // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" diff --git a/pkg/common/db/cache/friend.go b/pkg/common/db/cache/friend.go index 267e0e833..fd8c1d3c0 100644 --- a/pkg/common/db/cache/friend.go +++ b/pkg/common/db/cache/friend.go @@ -23,7 +23,7 @@ import ( "github.com/OpenIMSDK/tools/utils" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) const ( diff --git a/pkg/common/db/cache/group.go b/pkg/common/db/cache/group.go index 90e71ab12..7d4c2b043 100644 --- a/pkg/common/db/cache/group.go +++ b/pkg/common/db/cache/group.go @@ -25,8 +25,8 @@ import ( "github.com/OpenIMSDK/tools/utils" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - unrelationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) const ( diff --git a/pkg/common/db/cache/init_redis.go b/pkg/common/db/cache/init_redis.go index 61273f49f..fd0aff4a7 100644 --- a/pkg/common/db/cache/init_redis.go +++ b/pkg/common/db/cache/init_redis.go @@ -25,7 +25,7 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/mw/specialerror" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) const ( diff --git a/pkg/common/db/cache/msg.go b/pkg/common/db/cache/msg.go index fe0a1e238..65b8d63de 100644 --- a/pkg/common/db/cache/msg.go +++ b/pkg/common/db/cache/msg.go @@ -19,7 +19,7 @@ import ( "strconv" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "github.com/dtm-labs/rockscache" @@ -32,8 +32,8 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - unrelationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" "github.com/redis/go-redis/v9" ) diff --git a/pkg/common/db/cache/user.go b/pkg/common/db/cache/user.go index 2db5e2190..8c270c6e4 100644 --- a/pkg/common/db/cache/user.go +++ b/pkg/common/db/cache/user.go @@ -29,7 +29,7 @@ import ( "github.com/dtm-labs/rockscache" "github.com/redis/go-redis/v9" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) const ( diff --git a/pkg/common/db/controller/auth.go b/pkg/common/db/controller/auth.go index f44263076..17b4a440d 100644 --- a/pkg/common/db/controller/auth.go +++ b/pkg/common/db/controller/auth.go @@ -17,7 +17,7 @@ package controller import ( "context" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/golang-jwt/jwt/v4" @@ -25,7 +25,7 @@ import ( "github.com/OpenIMSDK/tools/tokenverify" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" ) type AuthDatabase interface { diff --git a/pkg/common/db/controller/black.go b/pkg/common/db/controller/black.go index a962df213..70e942a77 100644 --- a/pkg/common/db/controller/black.go +++ b/pkg/common/db/controller/black.go @@ -20,8 +20,8 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type BlackDatabase interface { diff --git a/pkg/common/db/controller/chatlog.go b/pkg/common/db/controller/chatlog.go index 2b9a08ab6..def490265 100644 --- a/pkg/common/db/controller/chatlog.go +++ b/pkg/common/db/controller/chatlog.go @@ -17,7 +17,7 @@ package controller import ( pbmsg "github.com/OpenIMSDK/protocol/msg" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type ChatLogDatabase interface { diff --git a/pkg/common/db/controller/conversation.go b/pkg/common/db/controller/conversation.go index f7a0a9f66..99870bba1 100644 --- a/pkg/common/db/controller/conversation.go +++ b/pkg/common/db/controller/conversation.go @@ -18,15 +18,15 @@ import ( "context" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type ConversationDatabase interface { diff --git a/pkg/common/db/controller/doc.go b/pkg/common/db/controller/doc.go index d54b689a6..72316f128 100644 --- a/pkg/common/db/controller/doc.go +++ b/pkg/common/db/controller/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package controller // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" +package controller // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" diff --git a/pkg/common/db/controller/friend.go b/pkg/common/db/controller/friend.go index a1cb547bf..7816ef935 100644 --- a/pkg/common/db/controller/friend.go +++ b/pkg/common/db/controller/friend.go @@ -27,8 +27,8 @@ import ( "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type FriendDatabase interface { diff --git a/pkg/common/db/controller/group.go b/pkg/common/db/controller/group.go index 7ece8a07e..f7ded8a2e 100644 --- a/pkg/common/db/controller/group.go +++ b/pkg/common/db/controller/group.go @@ -28,11 +28,11 @@ import ( "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - unrelationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" ) type GroupDatabase interface { diff --git a/pkg/common/db/controller/msg.go b/pkg/common/db/controller/msg.go index 781401c13..af678f92c 100644 --- a/pkg/common/db/controller/msg.go +++ b/pkg/common/db/controller/msg.go @@ -24,13 +24,13 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - unrelationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" + "github.com/openimsdk/open-im-server/v3/pkg/common/prome" "go.mongodb.org/mongo-driver/mongo" diff --git a/pkg/common/db/controller/msg_test.go b/pkg/common/db/controller/msg_test.go index 9c2fffa3c..80e2db122 100644 --- a/pkg/common/db/controller/msg_test.go +++ b/pkg/common/db/controller/msg_test.go @@ -27,9 +27,9 @@ import ( "go.mongodb.org/mongo-driver/bson" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - unrelationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" ) func Test_BatchInsertChat2DB(t *testing.T) { diff --git a/pkg/common/db/controller/push.go b/pkg/common/db/controller/push.go index c4c761457..76d8c3efb 100644 --- a/pkg/common/db/controller/push.go +++ b/pkg/common/db/controller/push.go @@ -17,7 +17,7 @@ package controller import ( "context" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" ) type PushDatabase interface { diff --git a/pkg/common/db/controller/s3.go b/pkg/common/db/controller/s3.go index 1ced644c2..6ef3e73b3 100644 --- a/pkg/common/db/controller/s3.go +++ b/pkg/common/db/controller/s3.go @@ -19,9 +19,9 @@ import ( "path/filepath" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/cont" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cont" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type S3Database interface { diff --git a/pkg/common/db/controller/third.go b/pkg/common/db/controller/third.go index 906b9b2e4..c5476e490 100644 --- a/pkg/common/db/controller/third.go +++ b/pkg/common/db/controller/third.go @@ -17,7 +17,7 @@ package controller import ( "context" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" ) type ThirdDatabase interface { diff --git a/pkg/common/db/controller/user.go b/pkg/common/db/controller/user.go index 7c11bb9d3..ab86cfd27 100644 --- a/pkg/common/db/controller/user.go +++ b/pkg/common/db/controller/user.go @@ -20,14 +20,14 @@ import ( "github.com/OpenIMSDK/protocol/user" - unrelationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type UserDatabase interface { diff --git a/pkg/common/db/localcache/conversation.go b/pkg/common/db/localcache/conversation.go index e1243e4c1..3ede6fd4c 100644 --- a/pkg/common/db/localcache/conversation.go +++ b/pkg/common/db/localcache/conversation.go @@ -20,7 +20,7 @@ import ( "github.com/OpenIMSDK/protocol/conversation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type ConversationLocalCache struct { diff --git a/pkg/common/db/localcache/doc.go b/pkg/common/db/localcache/doc.go index 40afac0ba..d349373ee 100644 --- a/pkg/common/db/localcache/doc.go +++ b/pkg/common/db/localcache/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package localcache // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/localcache" +package localcache // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/localcache" diff --git a/pkg/common/db/localcache/group.go b/pkg/common/db/localcache/group.go index 093353c86..2e90d28bd 100644 --- a/pkg/common/db/localcache/group.go +++ b/pkg/common/db/localcache/group.go @@ -21,7 +21,7 @@ import ( "github.com/OpenIMSDK/protocol/group" "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type GroupLocalCache struct { diff --git a/pkg/common/db/relation/black_model.go b/pkg/common/db/relation/black_model.go index 3946c8fc2..34123c7a3 100644 --- a/pkg/common/db/relation/black_model.go +++ b/pkg/common/db/relation/black_model.go @@ -25,7 +25,7 @@ import ( "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type BlackGorm struct { diff --git a/pkg/common/db/relation/chat_log_model.go b/pkg/common/db/relation/chat_log_model.go index 929db8b87..f183a543f 100644 --- a/pkg/common/db/relation/chat_log_model.go +++ b/pkg/common/db/relation/chat_log_model.go @@ -25,7 +25,7 @@ import ( sdkws "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type ChatLogGorm struct { diff --git a/pkg/common/db/relation/conversation_model.go b/pkg/common/db/relation/conversation_model.go index 4b3b0cc41..60a27b185 100644 --- a/pkg/common/db/relation/conversation_model.go +++ b/pkg/common/db/relation/conversation_model.go @@ -23,7 +23,7 @@ import ( "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type ConversationGorm struct { diff --git a/pkg/common/db/relation/doc.go b/pkg/common/db/relation/doc.go index a3ac7243f..41135ac97 100644 --- a/pkg/common/db/relation/doc.go +++ b/pkg/common/db/relation/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package relation // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" +package relation // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/relation" diff --git a/pkg/common/db/relation/friend_model.go b/pkg/common/db/relation/friend_model.go index 4ab77132d..869254455 100644 --- a/pkg/common/db/relation/friend_model.go +++ b/pkg/common/db/relation/friend_model.go @@ -21,7 +21,7 @@ import ( "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type FriendGorm struct { diff --git a/pkg/common/db/relation/friend_request_model.go b/pkg/common/db/relation/friend_request_model.go index 689b31668..5678f7b7b 100644 --- a/pkg/common/db/relation/friend_request_model.go +++ b/pkg/common/db/relation/friend_request_model.go @@ -21,7 +21,7 @@ import ( "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type FriendRequestGorm struct { diff --git a/pkg/common/db/relation/group_member_model.go b/pkg/common/db/relation/group_member_model.go index 57b2d33e7..312e32054 100644 --- a/pkg/common/db/relation/group_member_model.go +++ b/pkg/common/db/relation/group_member_model.go @@ -23,7 +23,7 @@ import ( "github.com/OpenIMSDK/tools/ormutil" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) var _ relation.GroupMemberModelInterface = (*GroupMemberGorm)(nil) diff --git a/pkg/common/db/relation/group_model.go b/pkg/common/db/relation/group_model.go index 13e96b611..7a8eee9f0 100644 --- a/pkg/common/db/relation/group_model.go +++ b/pkg/common/db/relation/group_model.go @@ -26,7 +26,7 @@ import ( "github.com/OpenIMSDK/tools/ormutil" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) var _ relation.GroupModelInterface = (*GroupGorm)(nil) diff --git a/pkg/common/db/relation/group_request_model.go b/pkg/common/db/relation/group_request_model.go index 05f94c34b..af3f277e8 100644 --- a/pkg/common/db/relation/group_request_model.go +++ b/pkg/common/db/relation/group_request_model.go @@ -23,7 +23,7 @@ import ( "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type GroupRequestGorm struct { diff --git a/pkg/common/db/relation/mysql_init.go b/pkg/common/db/relation/mysql_init.go index 520f81297..0e5ea5e43 100644 --- a/pkg/common/db/relation/mysql_init.go +++ b/pkg/common/db/relation/mysql_init.go @@ -25,7 +25,7 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mw/specialerror" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" "gorm.io/gorm" "gorm.io/gorm/logger" diff --git a/pkg/common/db/relation/object_model.go b/pkg/common/db/relation/object_model.go index 8a97a49d5..c5624a8d4 100644 --- a/pkg/common/db/relation/object_model.go +++ b/pkg/common/db/relation/object_model.go @@ -21,7 +21,7 @@ import ( "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type ObjectInfoGorm struct { diff --git a/pkg/common/db/relation/user_model.go b/pkg/common/db/relation/user_model.go index 758a62037..b04c29816 100644 --- a/pkg/common/db/relation/user_model.go +++ b/pkg/common/db/relation/user_model.go @@ -24,7 +24,7 @@ import ( "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) type UserGorm struct { diff --git a/pkg/common/db/s3/cont/controller.go b/pkg/common/db/s3/cont/controller.go index 891ecf38e..6faa997a9 100644 --- a/pkg/common/db/s3/cont/controller.go +++ b/pkg/common/db/s3/cont/controller.go @@ -29,7 +29,7 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" ) func New(impl s3.Interface) *Controller { diff --git a/pkg/common/db/s3/cont/doc.go b/pkg/common/db/s3/cont/doc.go index bdba8501b..45737bc7c 100644 --- a/pkg/common/db/s3/cont/doc.go +++ b/pkg/common/db/s3/cont/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cont // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/cont" +package cont // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cont" diff --git a/pkg/common/db/s3/cont/error.go b/pkg/common/db/s3/cont/error.go index be77bcb9e..8225274d3 100644 --- a/pkg/common/db/s3/cont/error.go +++ b/pkg/common/db/s3/cont/error.go @@ -17,7 +17,7 @@ package cont import ( "fmt" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" ) type HashAlreadyExistsError struct { diff --git a/pkg/common/db/s3/cont/structs.go b/pkg/common/db/s3/cont/structs.go index 1ebbfcaed..ff5ca7943 100644 --- a/pkg/common/db/s3/cont/structs.go +++ b/pkg/common/db/s3/cont/structs.go @@ -14,7 +14,7 @@ package cont -import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" +import "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" type InitiateUploadResult struct { UploadID string `json:"uploadID"` // 上传ID diff --git a/pkg/common/db/s3/cos/cos.go b/pkg/common/db/s3/cos/cos.go index 32f213161..57a205cbe 100644 --- a/pkg/common/db/s3/cos/cos.go +++ b/pkg/common/db/s3/cos/cos.go @@ -26,8 +26,8 @@ import ( "github.com/tencentyun/cos-go-sdk-v5" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" ) const ( diff --git a/pkg/common/db/s3/cos/doc.go b/pkg/common/db/s3/cos/doc.go index bf405d0fc..592f90ee2 100644 --- a/pkg/common/db/s3/cos/doc.go +++ b/pkg/common/db/s3/cos/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cos // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/cos" +package cos // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cos" diff --git a/pkg/common/db/s3/doc.go b/pkg/common/db/s3/doc.go index 0a3cfe521..a43710676 100644 --- a/pkg/common/db/s3/doc.go +++ b/pkg/common/db/s3/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package s3 // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" +package s3 // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" diff --git a/pkg/common/db/s3/minio/doc.go b/pkg/common/db/s3/minio/doc.go index 704e12202..42e898c15 100644 --- a/pkg/common/db/s3/minio/doc.go +++ b/pkg/common/db/s3/minio/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package minio // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/minio" +package minio // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/minio" diff --git a/pkg/common/db/s3/minio/minio.go b/pkg/common/db/s3/minio/minio.go index bfe40a594..937b9f78a 100644 --- a/pkg/common/db/s3/minio/minio.go +++ b/pkg/common/db/s3/minio/minio.go @@ -41,8 +41,8 @@ import ( "github.com/minio/minio-go/v7/pkg/credentials" "github.com/minio/minio-go/v7/pkg/signer" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" ) const ( diff --git a/pkg/common/db/s3/oss/doc.go b/pkg/common/db/s3/oss/doc.go index 9520a7ed8..d2e2c91af 100644 --- a/pkg/common/db/s3/oss/doc.go +++ b/pkg/common/db/s3/oss/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package oss // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/oss" +package oss // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/oss" diff --git a/pkg/common/db/s3/oss/oss.go b/pkg/common/db/s3/oss/oss.go index d84cad1c6..384ce8093 100644 --- a/pkg/common/db/s3/oss/oss.go +++ b/pkg/common/db/s3/oss/oss.go @@ -26,8 +26,8 @@ import ( "github.com/aliyun/aliyun-oss-go-sdk/oss" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" ) const ( diff --git a/pkg/common/db/table/relation/doc.go b/pkg/common/db/table/relation/doc.go index fe78a700d..32185c8c7 100644 --- a/pkg/common/db/table/relation/doc.go +++ b/pkg/common/db/table/relation/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package relation // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" +package relation // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" diff --git a/pkg/common/db/table/unrelation/doc.go b/pkg/common/db/table/unrelation/doc.go index 1c0eab222..7596206a0 100644 --- a/pkg/common/db/table/unrelation/doc.go +++ b/pkg/common/db/table/unrelation/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package unrelation // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" +package unrelation // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" diff --git a/pkg/common/db/unrelation/doc.go b/pkg/common/db/unrelation/doc.go index b36a2406f..1a15e42c4 100644 --- a/pkg/common/db/unrelation/doc.go +++ b/pkg/common/db/unrelation/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package unrelation // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation" +package unrelation // import "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" diff --git a/pkg/common/db/unrelation/mongo.go b/pkg/common/db/unrelation/mongo.go index f08bb56a4..09e3e904e 100644 --- a/pkg/common/db/unrelation/mongo.go +++ b/pkg/common/db/unrelation/mongo.go @@ -29,8 +29,8 @@ import ( "github.com/OpenIMSDK/tools/mw/specialerror" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) const ( diff --git a/pkg/common/db/unrelation/msg.go b/pkg/common/db/unrelation/msg.go index b48066349..9b461dd1f 100644 --- a/pkg/common/db/unrelation/msg.go +++ b/pkg/common/db/unrelation/msg.go @@ -37,7 +37,7 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/utils" - table "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + table "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) var ErrMsgListNotExist = errors.New("user not have msg in mongoDB") diff --git a/pkg/common/db/unrelation/msg_convert.go b/pkg/common/db/unrelation/msg_convert.go index a5cf2da4e..810b4f419 100644 --- a/pkg/common/db/unrelation/msg_convert.go +++ b/pkg/common/db/unrelation/msg_convert.go @@ -22,7 +22,7 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" - table "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + table "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) func (m *MsgMongoDriver) ConvertMsgsDocLen(ctx context.Context, conversationIDs []string) { diff --git a/pkg/common/db/unrelation/super_group.go b/pkg/common/db/unrelation/super_group.go index 5a9bfccc8..c762140a2 100644 --- a/pkg/common/db/unrelation/super_group.go +++ b/pkg/common/db/unrelation/super_group.go @@ -23,7 +23,7 @@ import ( "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) func NewSuperGroupMongoDriver(database *mongo.Database) unrelation.SuperGroupModelInterface { diff --git a/pkg/common/db/unrelation/user.go b/pkg/common/db/unrelation/user.go index 12b61b384..777f27386 100644 --- a/pkg/common/db/unrelation/user.go +++ b/pkg/common/db/unrelation/user.go @@ -23,7 +23,7 @@ import ( "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) // prefixes and suffixes. diff --git a/pkg/common/http/doc.go b/pkg/common/http/doc.go index 33a0d5e5d..e6fd3ec1e 100644 --- a/pkg/common/http/doc.go +++ b/pkg/common/http/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package http // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/http" +package http // import "github.com/openimsdk/open-im-server/v3/pkg/common/http" diff --git a/pkg/common/http/http_client.go b/pkg/common/http/http_client.go index 7a0b7f037..2d7c24c77 100644 --- a/pkg/common/http/http_client.go +++ b/pkg/common/http/http_client.go @@ -27,8 +27,8 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) var client http.Client diff --git a/pkg/common/kafka/consumer.go b/pkg/common/kafka/consumer.go index e253ec5e0..98adfdcf1 100644 --- a/pkg/common/kafka/consumer.go +++ b/pkg/common/kafka/consumer.go @@ -17,9 +17,9 @@ package kafka import ( "sync" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) type Consumer struct { diff --git a/pkg/common/kafka/consumer_group.go b/pkg/common/kafka/consumer_group.go index da62fbe65..1eb7b522a 100644 --- a/pkg/common/kafka/consumer_group.go +++ b/pkg/common/kafka/consumer_group.go @@ -19,9 +19,9 @@ import ( "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) type MConsumerGroup struct { diff --git a/pkg/common/kafka/doc.go b/pkg/common/kafka/doc.go index c796db138..0f0c69a76 100644 --- a/pkg/common/kafka/doc.go +++ b/pkg/common/kafka/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package kafka // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka" +package kafka // import "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" diff --git a/pkg/common/kafka/producer.go b/pkg/common/kafka/producer.go index b7ec32714..4a52d2bef 100644 --- a/pkg/common/kafka/producer.go +++ b/pkg/common/kafka/producer.go @@ -24,12 +24,12 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "google.golang.org/protobuf/proto" - prome "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" + prome "github.com/openimsdk/open-im-server/v3/pkg/common/prome" ) const ( diff --git a/pkg/common/kafka/util.go b/pkg/common/kafka/util.go index cc3dc64c6..722205865 100644 --- a/pkg/common/kafka/util.go +++ b/pkg/common/kafka/util.go @@ -15,10 +15,10 @@ package kafka import ( - "github.com/Shopify/sarama" + "github.com/IBM/sarama" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/tls" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/tls" ) // SetupTLSConfig set up the TLS config from config file. diff --git a/pkg/common/locker/doc.go b/pkg/common/locker/doc.go index c94581aa9..8b9378f90 100644 --- a/pkg/common/locker/doc.go +++ b/pkg/common/locker/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package locker // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/locker" +package locker // import "github.com/openimsdk/open-im-server/v3/pkg/common/locker" diff --git a/pkg/common/locker/message_locker.go b/pkg/common/locker/message_locker.go index 2631f19b1..55241eb5f 100644 --- a/pkg/common/locker/message_locker.go +++ b/pkg/common/locker/message_locker.go @@ -18,7 +18,7 @@ import ( "context" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" ) const GlOBALLOCK = "GLOBAL_LOCK" diff --git a/pkg/common/prome/doc.go b/pkg/common/prome/doc.go index 0b82aa7bf..7058c711c 100644 --- a/pkg/common/prome/doc.go +++ b/pkg/common/prome/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package prome // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" +package prome // import "github.com/openimsdk/open-im-server/v3/pkg/common/prome" diff --git a/pkg/common/prome/prometheus.go b/pkg/common/prome/prometheus.go index d66b1df70..254a6c9ea 100644 --- a/pkg/common/prome/prometheus.go +++ b/pkg/common/prome/prometheus.go @@ -19,7 +19,7 @@ import ( "net/http" "strconv" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/gin-gonic/gin" "github.com/prometheus/client_golang/prometheus" diff --git a/pkg/common/startrpc/doc.go b/pkg/common/startrpc/doc.go index 571fd971a..1d5fd6787 100644 --- a/pkg/common/startrpc/doc.go +++ b/pkg/common/startrpc/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package startrpc // import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/startrpc" +package startrpc // import "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" diff --git a/pkg/common/startrpc/start.go b/pkg/common/startrpc/start.go index 59a53fa5a..3ef6e569d 100644 --- a/pkg/common/startrpc/start.go +++ b/pkg/common/startrpc/start.go @@ -20,7 +20,7 @@ import ( "strconv" "time" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "google.golang.org/grpc" diff --git a/pkg/common/tls/tls.go b/pkg/common/tls/tls.go index c473ca573..3bf91beb9 100644 --- a/pkg/common/tls/tls.go +++ b/pkg/common/tls/tls.go @@ -21,7 +21,7 @@ import ( "errors" "os" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func decryptPEM(data []byte, passphrase []byte) ([]byte, error) { diff --git a/pkg/msgprocessor/doc.go b/pkg/msgprocessor/doc.go index 2f1d0cb44..d1e24ce30 100644 --- a/pkg/msgprocessor/doc.go +++ b/pkg/msgprocessor/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package msgprocessor // import "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" +package msgprocessor // import "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" diff --git a/pkg/rpcclient/auth.go b/pkg/rpcclient/auth.go index 69f21f38d..0ee021de1 100644 --- a/pkg/rpcclient/auth.go +++ b/pkg/rpcclient/auth.go @@ -22,7 +22,7 @@ import ( "github.com/OpenIMSDK/protocol/auth" "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func NewAuth(discov discoveryregistry.SvcDiscoveryRegistry) *Auth { diff --git a/pkg/rpcclient/conversation.go b/pkg/rpcclient/conversation.go index 208bf53f7..60ca53351 100644 --- a/pkg/rpcclient/conversation.go +++ b/pkg/rpcclient/conversation.go @@ -24,7 +24,7 @@ import ( "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type Conversation struct { diff --git a/pkg/rpcclient/doc.go b/pkg/rpcclient/doc.go index f32f4f322..0fdfacc60 100644 --- a/pkg/rpcclient/doc.go +++ b/pkg/rpcclient/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package rpcclient // import "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" +package rpcclient // import "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" diff --git a/pkg/rpcclient/friend.go b/pkg/rpcclient/friend.go index 1bd004dd5..b84db40d4 100644 --- a/pkg/rpcclient/friend.go +++ b/pkg/rpcclient/friend.go @@ -23,7 +23,7 @@ import ( sdkws "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type Friend struct { diff --git a/pkg/rpcclient/group.go b/pkg/rpcclient/group.go index d85321cbe..bf0efe60c 100644 --- a/pkg/rpcclient/group.go +++ b/pkg/rpcclient/group.go @@ -27,7 +27,7 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type Group struct { diff --git a/pkg/rpcclient/msg.go b/pkg/rpcclient/msg.go index 54577b679..e3dad874e 100644 --- a/pkg/rpcclient/msg.go +++ b/pkg/rpcclient/msg.go @@ -28,7 +28,7 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" // "google.golang.org/protobuf/proto". ) diff --git a/pkg/rpcclient/notification/conevrsation.go b/pkg/rpcclient/notification/conevrsation.go index d92ee82a0..77fc623e4 100644 --- a/pkg/rpcclient/notification/conevrsation.go +++ b/pkg/rpcclient/notification/conevrsation.go @@ -20,7 +20,7 @@ import ( "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type ConversationNotificationSender struct { diff --git a/pkg/rpcclient/notification/doc.go b/pkg/rpcclient/notification/doc.go index eea54e59c..2d409bdc9 100644 --- a/pkg/rpcclient/notification/doc.go +++ b/pkg/rpcclient/notification/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package notification // import "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification" +package notification // import "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" diff --git a/pkg/rpcclient/notification/friend.go b/pkg/rpcclient/notification/friend.go index 18e2fec73..b061a24ae 100644 --- a/pkg/rpcclient/notification/friend.go +++ b/pkg/rpcclient/notification/friend.go @@ -23,10 +23,10 @@ import ( pbfriend "github.com/OpenIMSDK/protocol/friend" "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type FriendNotificationSender struct { diff --git a/pkg/rpcclient/notification/group.go b/pkg/rpcclient/notification/group.go index ee62f08b4..8e71f61c3 100644 --- a/pkg/rpcclient/notification/group.go +++ b/pkg/rpcclient/notification/group.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/OpenIMSDK/protocol/constant" pbgroup "github.com/OpenIMSDK/protocol/group" @@ -28,9 +28,9 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) func NewGroupNotificationSender( diff --git a/pkg/rpcclient/notification/msg.go b/pkg/rpcclient/notification/msg.go index 53e66fc7d..60fa64f40 100644 --- a/pkg/rpcclient/notification/msg.go +++ b/pkg/rpcclient/notification/msg.go @@ -20,7 +20,7 @@ import ( "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type MsgNotificationSender struct { diff --git a/pkg/rpcclient/notification/user.go b/pkg/rpcclient/notification/user.go index f076ed2d1..4feebf7b9 100644 --- a/pkg/rpcclient/notification/user.go +++ b/pkg/rpcclient/notification/user.go @@ -20,9 +20,9 @@ import ( "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" - relationtb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type UserNotificationSender struct { diff --git a/pkg/rpcclient/push.go b/pkg/rpcclient/push.go index 7b7adcfa5..6d0876972 100644 --- a/pkg/rpcclient/push.go +++ b/pkg/rpcclient/push.go @@ -22,7 +22,7 @@ import ( "github.com/OpenIMSDK/protocol/push" "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type Push struct { diff --git a/pkg/rpcclient/third.go b/pkg/rpcclient/third.go index 015702a93..48a537112 100644 --- a/pkg/rpcclient/third.go +++ b/pkg/rpcclient/third.go @@ -26,7 +26,7 @@ import ( "github.com/OpenIMSDK/protocol/third" "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type Third struct { diff --git a/pkg/rpcclient/user.go b/pkg/rpcclient/user.go index 5ea747381..6929b4fd9 100644 --- a/pkg/rpcclient/user.go +++ b/pkg/rpcclient/user.go @@ -18,7 +18,7 @@ import ( "context" "strings" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "google.golang.org/grpc" @@ -28,7 +28,7 @@ import ( "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/utils" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) // User represents a structure holding connection details for the User RPC client. diff --git a/pkg/statistics/doc.go b/pkg/statistics/doc.go index 4dabe2058..8051c4c71 100644 --- a/pkg/statistics/doc.go +++ b/pkg/statistics/doc.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package statistics // import "github.com/OpenIMSDK/Open-IM-Server/pkg/statistics" +package statistics // import "github.com/openimsdk/open-im-server/v3/pkg/statistics" diff --git a/scripts/advertise.sh b/scripts/advertise.sh index fbb68b4cc..9c8c284ad 100755 --- a/scripts/advertise.sh +++ b/scripts/advertise.sh @@ -78,7 +78,7 @@ O:::::::OOO:::::::O p:::::ppppp:::::::pe::::::::e n::::n n::::nII: ' 0.0001 # Display product URL - print_with_delay "Discover more and contribute at: https://github.com/OpenIMSDK/Open-IM-Server" 0.01 + print_with_delay "Discover more and contribute at: https://github.com/openimsdk/open-im-server" 0.01 # Reset text color back to normal echo -e "\033[0m" diff --git a/scripts/check-all.sh b/scripts/check-all.sh index d40e5a479..defc030f8 100755 --- a/scripts/check-all.sh +++ b/scripts/check-all.sh @@ -17,7 +17,7 @@ # # Usage: `scripts/check-all.sh`. # Encapsulated as: `make check`. -# READ: https://github.com/OpenIMSDK/Open-IM-Server/tree/main/scripts/install/environment.sh +# READ: https://github.com/openimsdk/open-im-server/tree/main/scripts/install/environment.sh set -o errexit set -o nounset @@ -71,7 +71,7 @@ fi if [[ $? -ne 0 ]]; then openim::log::error_exit "The service does not start properly, please check the port, query variable definition!" - echo "+++ https://github.com/OpenIMSDK/Open-IM-Server/tree/main/scripts/install/environment.sh +++" + echo "+++ https://github.com/openimsdk/open-im-server/tree/main/scripts/install/environment.sh +++" else echo "++++ Check all dependent service ports successfully !" fi diff --git a/scripts/cherry-pick.sh b/scripts/cherry-pick.sh index 8b81b3401..200ee8ed8 100755 --- a/scripts/cherry-pick.sh +++ b/scripts/cherry-pick.sh @@ -14,7 +14,7 @@ # limitations under the License. -# Usage Instructions: https://github.com/OpenIMSDK/Open-IM-Server/tree/main/docs/contrib/git_cherry-pick.md +# Usage Instructions: https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/git_cherry-pick.md # Checkout a PR from GitHub. (Yes, this is sitting in a Git tree. How # meta.) Assumes you care about pulls from remote "upstream" and @@ -68,7 +68,7 @@ if [[ "$#" -lt 2 ]]; then echo " Set UPSTREAM_REMOTE (default: upstream) and FORK_REMOTE (default: origin)" echo " to override the default remote names to what you have locally." echo - echo " For merge process info, see https://github.com/OpenIMSDK/Open-IM-Server/tree/main/docs/contrib/git_cherry-pick.md" + echo " For merge process info, see https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/git_cherry-pick.md" exit 2 fi @@ -145,7 +145,7 @@ Cherry pick of ${PULLSUBJ} on ${rel}. ${numandtitle} -For details on the cherry pick process, see the [cherry pick requests](https://github.com/OpenIMSDK/Open-IM-Server/tree/main/docs/contrib/git_cherry-pick.md) page. +For details on the cherry pick process, see the [cherry pick requests](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/git_cherry-pick.md) page. \`\`\`release-note diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh index fef411446..030c31faf 100755 --- a/scripts/genconfig.sh +++ b/scripts/genconfig.sh @@ -15,7 +15,7 @@ # 本脚本功能:根据 scripts/environment.sh 配置,生成 OPENIM 组件 YAML 配置文件。 # 示例:./scripts/genconfig.sh scripts/install/environment.sh scripts/template/config.yaml -# Read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/init_config.md +# Read: https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/init_config.md env_file="$1" template_file="$2" diff --git a/scripts/gendoc.sh b/scripts/gendoc.sh index 1d381483f..c948fcdf9 100755 --- a/scripts/gendoc.sh +++ b/scripts/gendoc.sh @@ -17,7 +17,7 @@ DEFAULT_DIRS=( "pkg" "internal/pkg" ) -BASE_URL="github.com/OpenIMSDK/Open-IM-Server" +BASE_URL="github.com/openimsdk/open-im-server" usage() { echo "Usage: $0 [OPTIONS]" diff --git a/scripts/githooks/pre-commit b/scripts/githooks/pre-commit.sh similarity index 100% rename from scripts/githooks/pre-commit rename to scripts/githooks/pre-commit.sh diff --git a/scripts/githooks/pre-push b/scripts/githooks/pre-push.sh similarity index 100% rename from scripts/githooks/pre-push rename to scripts/githooks/pre-push.sh diff --git a/scripts/init-config.sh b/scripts/init-config.sh index db77e7e76..6d8bef806 100755 --- a/scripts/init-config.sh +++ b/scripts/init-config.sh @@ -14,7 +14,7 @@ # limitations under the License. # This script automatically initializes the various configuration files -# Read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/init_config.md +# Read: https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/init_config.md set -o errexit set -o nounset diff --git a/scripts/init-githooks.sh b/scripts/init-githooks.sh index 9d1675c8e..399054bb8 100755 --- a/scripts/init-githooks.sh +++ b/scripts/init-githooks.sh @@ -36,7 +36,7 @@ # ----------------------------------------------------------------------------- OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -HOOKS_DIR=".git/hooks" +HOOKS_DIR="${OPENIM_ROOT}/.git/hooks" help_info() { echo "Usage: $0 [options]" @@ -50,32 +50,43 @@ help_info() { } delete_hooks() { - for file in scripts/githooks/*.sh; do - hook_name=$(basename "$file" .sh) + for file in ${OPENIM_ROOT}/scripts/githooks/*.sh; do + hook_name=$(basename "$file" .sh) # This removes the .sh extension rm -f "$HOOKS_DIR/$hook_name" done echo "Git hooks have been deleted." } enable_hooks() { - echo "Would you like to enable git hooks mode? [y/n]" + echo "Would you like to:" + echo "1) Enable git hooks mode" + echo "2) Delete existing git hooks" + echo "Please select a number (or any other key to exit):" read -r choice - if [[ $choice == "y" || $choice == "Y" ]]; then - for file in scripts/githooks/*.sh; do - cp -f "$file" "$HOOKS_DIR/$(basename "$file" .sh)" - done + case "$choice" in + 1) + for file in ${OPENIM_ROOT}/scripts/githooks/*.sh; do + hook_name=$(basename "$file" .sh) # This removes the .sh extension + cp -f "$file" "$HOOKS_DIR/$hook_name" + done - chmod +x $HOOKS_DIR/* - - echo "Git hooks mode has been enabled." - echo "With git hooks enabled, every time you perform a git action (e.g. git commit), the corresponding hooks script will be triggered automatically." - echo "This means that if the size of the file you're committing exceeds the set limit (e.g. 42MB), the commit will be rejected." - else - echo "Git hooks mode remains disabled." - fi + chmod +x $HOOKS_DIR/* + + echo "Git hooks mode has been enabled." + echo "With git hooks enabled, every time you perform a git action (e.g. git commit), the corresponding hooks script will be triggered automatically." + echo "This means that if the size of the file you're committing exceeds the set limit (e.g. 42MB), the commit will be rejected." + ;; + 2) + delete_hooks + ;; + *) + echo "Exiting without making changes." + ;; + esac } + case "$1" in -h|--help) help_info @@ -86,4 +97,4 @@ case "$1" in *) enable_hooks ;; -esac \ No newline at end of file +esac diff --git a/scripts/install/environment.sh b/scripts/install/environment.sh index 2967d825c..080e95042 100755 --- a/scripts/install/environment.sh +++ b/scripts/install/environment.sh @@ -15,8 +15,9 @@ # This is a file that initializes variables for the automation script that initializes the config file # You need to supplement the script according to the specification. -# Read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/init_config.md +# Read: https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/init_config.md # 格式化 bash 注释:https://tool.lu/shell/ +# 配置中心文档:https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md OPENIM_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" @@ -25,7 +26,7 @@ LOCAL_OUTPUT_ROOT=""${OPENIM_ROOT}"/${OUT_DIR:-_output}" source "${OPENIM_ROOT}/scripts/lib/init.sh" #TODO: Access to the IP networks outside, or you want to use the IP network -# IP=http://127.0.0.1 +# IP=127.0.0.1 if [ -z "${IP}" ]; then IP=$(openim::util::get_server_ip) fi @@ -41,9 +42,6 @@ function def() { eval "readonly $var_name=\"\${$var_name:-$(printf '%q' "$default_value")}\"" } -# app要能访问到此ip和端口或域名 -readonly API_URL=${API_URL:-"http://${IP}:10002"} - # OpenIM Docker Compose 数据存储的默认路径 def "DATA_DIR" "${OPENIM_ROOT}" @@ -108,7 +106,7 @@ LAST_OCTET=$((LAST_OCTET + 1)) GRAFANA_NETWORK_ADDRESS=$(generate_ip) ###################### openim 配置 ###################### -# read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployment/init/README.md +# read: https://github.com/openimsdk/open-im-server/blob/main/deployment/init/README.md def "OPENIM_DATA_DIR" "/data/openim" def "OPENIM_INSTALL_DIR" "/opt/openim" def "OPENIM_CONFIG_DIR" "/etc/openim" @@ -173,9 +171,12 @@ def "MONGO_PASSWORD" "${PASSWORD}" # MongoDB的密码 def "MONGO_MAX_POOL_SIZE" "100" # 最大连接池大小 ###################### Object 配置信息 ###################### +# app要能访问到此ip和端口或域名 +readonly API_URL=${API_URL:-"http://${IP}:${API_OPENIM_PORT}"} + def "OBJECT_ENABLE" "minio" # 对象是否启用 # 对象的API地址 -readonly OBJECT_APIURL=${OBJECT_APIURL:-"http://${IP}:10002"} +readonly OBJECT_APIURL=${OBJECT_APIURL:-"http://${API_URL}"} def "MINIO_BUCKET" "openim" # MinIO的存储桶名称 def "MINIO_PORT" "10005" # MinIO的端口 # MinIO的端点URL @@ -184,7 +185,7 @@ readonly MINIO_ENDPOINT=${MINIO_ENDPOINT:-"http://${MINIO_ADDRESS}:${MINIO_PORT} def "MINIO_ACCESS_KEY" "${USER}" # MinIO的访问密钥ID def "MINIO_SECRET_KEY" "${PASSWORD}" # MinIO的密钥 def "MINIO_SESSION_TOKEN" # MinIO的会话令牌 -readonly MINIO_SIGN_ENDPOINT=${MINIO_SIGN_ENDPOINT:-"http://${IP}:${MINIO_PORT}"} # signEndpoint为minio公网地址 # MinIO的会话令牌 +readonly MINIO_SIGN_ENDPOINT=${MINIO_SIGN_ENDPOINT:-"http://${IP}:${MINIO_PORT}"} # signEndpoint为minio公网地址 # 腾讯云COS的存储桶URL def "COS_BUCKET_URL" "https://temp-1252357374.cos.ap-chengdu.myqcloud.com" def "COS_SECRET_ID" # 腾讯云COS的密钥ID diff --git a/scripts/install/openim-msggateway.sh b/scripts/install/openim-msggateway.sh index 1010fbbec..c51c20646 100755 --- a/scripts/install/openim-msggateway.sh +++ b/scripts/install/openim-msggateway.sh @@ -30,12 +30,12 @@ function openim::msggateway::start() openim::log::info "Start OpenIM Msggateway, binary root: ${SERVER_NAME}" openim::log::status "Start OpenIM Msggateway, path: ${OPENIM_MSGGATEWAY_BINARY}" - openim::util::stop_services_with_name ${SERVER_NAME} + openim::util::stop_services_with_name ${OPENIM_MSGGATEWAY_BINARY} # OpenIM message gateway service port OPENIM_MESSAGE_GATEWAY_PORTS=$(openim::util::list-to-string ${OPENIM_MESSAGE_GATEWAY_PORT} ) read -a OPENIM_MSGGATEWAY_PORTS_ARRAY <<< ${OPENIM_MESSAGE_GATEWAY_PORTS} - + openim::util::stop_services_on_ports ${OPENIM_MSGGATEWAY_PORTS_ARRAY[*]} # OpenIM WS port OPENIM_WS_PORTS=$(openim::util::list-to-string ${OPENIM_WS_PORT} ) read -a OPENIM_WS_PORTS_ARRAY <<< ${OPENIM_WS_PORTS} diff --git a/scripts/install/openim-msgtransfer.sh b/scripts/install/openim-msgtransfer.sh index 612acd738..428f6b64e 100755 --- a/scripts/install/openim-msgtransfer.sh +++ b/scripts/install/openim-msgtransfer.sh @@ -30,7 +30,7 @@ function openim::msgtransfer::start() openim::log::info "Start OpenIM Msggateway, binary root: ${SERVER_NAME}" openim::log::status "Start OpenIM Msggateway, path: ${OPENIM_MSGTRANSFER_BINARY}" - openim::util::stop_services_with_name ${SERVER_NAME} + openim::util::stop_services_with_name ${OPENIM_MSGTRANSFER_BINARY} # Message Transfer Prometheus port list MSG_TRANSFER_PROM_PORTS=(openim::util::list-to-string ${MSG_TRANSFER_PROM_PORT} ) diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index 6825797e1..2455f91dc 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -635,7 +635,7 @@ openim::util::remove-gen-docs() { # repo, e.g. "upstream" or "origin". openim::util::git_upstream_remote_name() { git remote -v | grep fetch |\ - grep -E 'github.com[/:]OpenIMSDK/Open-IM-Server|openim.cc/server' |\ + grep -E 'github.com[/:]openimsdk/open-im-server|openim.cc/server' |\ head -n 1 | awk '{print $1}' } diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk index 26fe721cc..0614bdf6f 100644 --- a/scripts/make-rules/golang.mk +++ b/scripts/make-rules/golang.mk @@ -73,7 +73,7 @@ ifeq ($(strip $(BINS)),) endif # TODO: EXCLUDE_TESTS variable, which contains the name of the package to be excluded from the test -EXCLUDE_TESTS=github.com/OpenIMSDK/Open-IM-Server/test github.com/OpenIMSDK/Open-IM-Server/pkg/log github.com/OpenIMSDK/Open-IM-Server/db github.com/OpenIMSDK/Open-IM-Server/scripts github.com/OpenIMSDK/Open-IM-Server/config +EXCLUDE_TESTS=github.com/openimsdk/open-im-server/test github.com/openimsdk/open-im-server/v3/pkg/log github.com/openimsdk/open-im-server/db github.com/openimsdk/open-im-server/scripts github.com/openimsdk/open-im-server/config # ============================================================================== # ❯ tree -L 1 cmd diff --git a/scripts/make-rules/image.mk b/scripts/make-rules/image.mk index 8320bc023..bb353034f 100644 --- a/scripts/make-rules/image.mk +++ b/scripts/make-rules/image.mk @@ -23,7 +23,7 @@ DOCKER := docker DOCKER_SUPPORTED_API_VERSION ?= 1.32|1.40|1.41 -# read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md +# read: https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md REGISTRY_PREFIX ?= ghcr.io/openimsdk BASE_IMAGE ?= ghcr.io/openim-sigs/openim-bash-image diff --git a/scripts/verify-typecheck.sh b/scripts/verify-typecheck.sh index 0aa79482a..a0b818135 100755 --- a/scripts/verify-typecheck.sh +++ b/scripts/verify-typecheck.sh @@ -36,6 +36,6 @@ scripts/run-in-gopath.sh \ go run test/typecheck/typecheck.go "$@" "--serial=$TYPECHECK_SERIAL" || ret=$? if [[ $ret -ne 0 ]]; then openim::log::error "Type Check has failed. This may cause cross platform build failures." >&2 - openim::log::error "Please see https://github.com/OpenIMSDK/Open-IM-Server/tree/main/test/typecheck for more information." >&2 + openim::log::error "Please see https://github.com/openimsdk/open-im-server/tree/main/test/typecheck for more information." >&2 exit 1 fi diff --git a/test/data-conversion/kafka-conversation.go b/test/data-conversion/kafka-conversation.go index a3fd0dc87..cb6976d67 100644 --- a/test/data-conversion/kafka-conversation.go +++ b/test/data-conversion/kafka-conversation.go @@ -17,7 +17,7 @@ package data_conversion import ( "fmt" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) var ( @@ -31,7 +31,7 @@ var ( ) func init() { - //Producer + // Producer config := sarama.NewConfig() // Instantiate a sarama Config config.Producer.Return.Successes = true // Whether to enable the successes channel to be notified after the message is sent successfully config.Producer.Return.Errors = true diff --git a/test/data-conversion/mysql-conversion.go b/test/data-conversion/mysql-conversion.go index 58318cd3d..468f5f11d 100644 --- a/test/data-conversion/mysql-conversion.go +++ b/test/data-conversion/mysql-conversion.go @@ -23,7 +23,7 @@ import ( "gorm.io/driver/mysql" "gorm.io/gorm" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) var ( diff --git a/test/typecheck/go.mod b/test/typecheck/go.mod index 253c4641e..f644c5b25 100644 --- a/test/typecheck/go.mod +++ b/test/typecheck/go.mod @@ -1,4 +1,4 @@ -module github.com/OpenIMSDK/Open-IM-Server/test/typecheck +module github.com/openimsdk/open-im-server/test/typecheck go 1.18 diff --git a/tools/README.md b/tools/README.md index 45c66564d..bd16a84d1 100644 --- a/tools/README.md +++ b/tools/README.md @@ -18,7 +18,7 @@ export OPENIM_TOOLS_NAME= # copy and paste to create a new CRD and Controller mkdir tools/${OPENIM_TOOLS_NAME} cd tools/${OPENIM_TOOLS_NAME} -go mod init github.com/OpenIMSDK/Open-IM-Server/tools/${OPENIM_TOOLS_NAME} +go mod init github.com/openimsdk/open-im-server/tools/${OPENIM_TOOLS_NAME} go mod tidy go work use -r . cd ../.. diff --git a/tools/changelog/changelog.go b/tools/changelog/changelog.go index 9a25826b1..17a9e5404 100644 --- a/tools/changelog/changelog.go +++ b/tools/changelog/changelog.go @@ -299,7 +299,7 @@ func sortAndUniq(lines []string) []string { func upstreamLinkify(line string) string { if m := upstreamKube.FindStringSubmatch(line); len(m) > 0 { - return fmt.Sprintf("UPSTREAM: [#%s](https://github.com/OpenIMSDK/Open-IM-Server/pull/%s):%s", m[1], m[1], m[2]) + return fmt.Sprintf("UPSTREAM: [#%s](https://github.com/openimsdk/open-im-server/pull/%s):%s", m[1], m[1], m[2]) } if m := upstreamRepo.FindStringSubmatch(line); len(m) > 0 { return fmt.Sprintf("UPSTREAM: [%s#%s](https://github.com/%s/pull/%s):%s", m[1], m[2], m[1], m[2], m[3]) diff --git a/tools/changelog/go.mod b/tools/changelog/go.mod index bc3f2192d..924f6709a 100644 --- a/tools/changelog/go.mod +++ b/tools/changelog/go.mod @@ -1,3 +1,3 @@ -module github.com/OpenIMSDK/Open-IM-Server/tools/changelog +module github.com/openimsdk/open-im-server/v3/tools/changelog go 1.18 diff --git a/tools/component/component.go b/tools/component/component.go index be454f900..04c6ba9a5 100644 --- a/tools/component/component.go +++ b/tools/component/component.go @@ -25,21 +25,22 @@ import ( "strings" "time" + "github.com/minio/minio-go/v7" + "github.com/redis/go-redis/v9" + "gopkg.in/yaml.v3" + + "github.com/IBM/sarama" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/utils" - "github.com/Shopify/sarama" "github.com/go-zookeeper/zk" - "github.com/minio/minio-go/v7" - "github.com/redis/go-redis/v9" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/readpref" - "gopkg.in/yaml.v3" "gorm.io/driver/mysql" "gorm.io/gorm" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" "github.com/minio/minio-go/v7/pkg/credentials" ) @@ -205,7 +206,7 @@ func checkMinio() error { } } if exactIP(config.Config.Object.ApiURL) == "127.0.0.1" || exactIP(config.Config.Object.Minio.SignEndpoint) == "127.0.0.1" { - return ErrConfig.Wrap("apiURL or Minio SignEndpoint endpoint contain 127.0.0.1.") + return ErrConfig.Wrap("apiURL or Minio SignEndpoint endpoint contain 127.0.0.1") } } return nil diff --git a/tools/component/component_test.go b/tools/component/component_test.go index eaf139418..afa51ef2c 100644 --- a/tools/component/component_test.go +++ b/tools/component/component_test.go @@ -19,7 +19,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func TestCheckMysql(t *testing.T) { diff --git a/tools/component/go.mod b/tools/component/go.mod index c38541ed7..8d5548ee8 100644 --- a/tools/component/go.mod +++ b/tools/component/go.mod @@ -1,3 +1,3 @@ -module github.com/OpenIMSDK/Open-IM-Server/tools/component +module github.com/openimsdk/open-im-server/v3/tools/component go 1.18 diff --git a/tools/imctl/README.md b/tools/imctl/README.md new file mode 100644 index 000000000..28df87e26 --- /dev/null +++ b/tools/imctl/README.md @@ -0,0 +1,89 @@ +# [RFC #0005] OpenIM CTL Module Proposal + +## Meta + +- Name: OpenIM CTL Module Enhancement +- Start Date: 2023-08-23 +- Author(s): @cubxxw +- Status: Draft +- RFC Pull Request: (leave blank) +- OpenIMSDK Pull Request: (leave blank) +- OpenIMSDK Issue: https://github.com/openimsdk/open-im-server/issues/924 +- Supersedes: N/A + +## 📇Topics + +- RFC #0000 OpenIMSDK CTL Module Proposal + - [Meta](#meta) + - [Summary](#summary) + - [Definitions](#definitions) + - [Motivation](#motivation) + - [What it is](#what-it-is) + - [How it Works](#how-it-works) + - [Migration](#migration) + - [Drawbacks](#drawbacks) + - [Alternatives](#alternatives) + - [Prior Art](#prior-art) + - [Unresolved Questions](#unresolved-questions) + - [Spec. Changes (OPTIONAL)](#spec-changes-optional) + - [History](#history) + +## Summary + +The OpenIM CTL module proposal aims to provide an integrated tool for the OpenIM system, offering utilities for user management, system monitoring, debugging, configuration, and more. This tool will enhance the extensibility of the OpenIM system and reduce dependencies on individual modules. + +## Definitions + +- **OpenIM**: An Instant Messaging system. +- **`imctl`**: The control command-line tool for OpenIM. +- **E2E Testing**: End-to-End Testing. +- **API**: Application Programming Interface. + +## Motivation + +- Improve the OpenIM system's extensibility and reduce dependencies on individual modules. +- Simplify the process for testers to perform automated tests. +- Enhance interaction with scripts and reduce the system's coupling. +- Implement a consistent tool similar to kubectl for a streamlined user experience. + +## What it is + +`imctl` is a command-line utility designed for OpenIM to provide functionalities including: + +- User Management: Add, delete, or disable user accounts. +- System Monitoring: View metrics like online users, message transfer rate. +- Debugging: View logs, adjust log levels, check system states. +- Configuration Management: Update system settings, manage plugins/modules. +- Data Management: Backup, restore, import, or export data. +- System Maintenance: Update, restart services, or maintenance mode. + +## How it Works + +`imctl`, inspired by kubectl, will have sub-commands and options for the functionalities mentioned. Developers, operations, and testers can invoke these commands to manage and monitor the OpenIM system. + +## Migration + +Currently, the `imctl` will be housed in `tools/imctl`, and later on, the plan is to move it to `cmd/imctl`. Migration guidelines will be provided to ensure smooth transitions. + +## Drawbacks + +- Overhead in learning and adapting to a new tool for existing users. +- Potential complexities in implementing some of the advanced functionalities. + +## Alternatives + +- Continue using individual modules for OpenIM management. +- Utilize third-party tools or platforms with similar functionalities, customizing them for OpenIM. + +## Prior Art + +Kubectl from Kubernetes is a significant inspiration for `imctl`, offering a comprehensive command-line tool for managing clusters. + +## Unresolved Questions + +- What other functionalities might be required in future versions of `imctl`? +- What's the expected timeline for transitioning from `tools/imctl` to `cmd/imctl`? + +## Spec. Changes (OPTIONAL) + +As of now, there are no proposed changes to the core specifications or extensions. Future changes based on community feedback might necessitate spec changes, which will be documented accordingly. \ No newline at end of file diff --git a/tools/imctl/cmd/genman/README.md b/tools/imctl/cmd/genman/README.md new file mode 100644 index 000000000..7b46cbefb --- /dev/null +++ b/tools/imctl/cmd/genman/README.md @@ -0,0 +1,49 @@ +# OpenIM `man` Module README + +Welcome to the `man` module of OpenIM, the comprehensive guide for using OpenIM's range of powerful commands. Here, you'll find in-depth details for each command, its options, and examples to help you harness the full power of the OpenIM suite. + +## Overview + +OpenIM is a robust instant messaging solution. To ensure users can effectively harness its capabilities, OpenIM provides a suite of commands that serve different functionalities, from the API level to RPC calls and utilities. + +The `man` module ensures that users, both new and experienced, have a reliable source of information and documentation to use these commands effectively. + +## Available Commands + +The OpenIM commands are divided into core services and tools. Below is a brief overview of each: + +### Core Services + +- **openim-api**: Interface to the main functionalities of OpenIM. +- **openim-cmdutils**: Utilities for executing common tasks. +- **openim-crontask**: Schedule and manage routine tasks within OpenIM. +- **openim-msggateway**: Gateway for managing messages within the OpenIM system. +- **openim-msgtransfer**: Handle message transfers across different parts of OpenIM. +- **openim-push**: Service for pushing notifications and updates. +- **openim-rpc-auth**: RPC interface for authentication tasks. +- **openim-rpc-conversation**: RPC service for handling conversations. +- **openim-rpc-friend**: Manage friend lists and related functionalities through RPC. +- **openim-rpc-group**: Group management via RPC. +- **openim-rpc-msg**: Message handling at the RPC level. +- **openim-rpc-third**: Third-party integrations and related tasks through RPC. +- **openim-rpc-user**: User management and tasks via RPC. + +### Tools + +- **changelog**: Track and manage changes in OpenIM. +- **component**: Utilities related to different components within OpenIM. +- **infra**: Infrastructure and backend management tools. +- **ncpu**: Monitor and manage CPU usage and related tasks. +- **yamlfmt**: A tool for formatting and linting YAML files within the OpenIM configuration. + +## How to Use + +To view the manual page for any of the OpenIM commands, use the `man` command followed by the command name. For example: + +``` +man openim-api +``` + +## Contributions + +We welcome contributions to enhance the `man` pages. If you discover inconsistencies, errors, or areas where further details are required, feel free to raise an issue or submit a pull request. \ No newline at end of file diff --git a/tools/imctl/cmd/genman/genman.go b/tools/imctl/cmd/genman/genman.go new file mode 100644 index 000000000..1de5c68cd --- /dev/null +++ b/tools/imctl/cmd/genman/genman.go @@ -0,0 +1,62 @@ +// Copyright © 2023 OpenIM. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "fmt" + "os" + + "k8s.io/kubernetes/cmd/genutils" +) + +func main() { + // TODO use os.Args instead of "flags" because "flags" will mess up the man pages! + path := "docs/man/man1" + module := "" + if len(os.Args) == 3 { + path = os.Args[1] + module = os.Args[2] + } else { + fmt.Fprintf(os.Stderr, "usage: %s [output directory] [module] \n", os.Args[0]) + os.Exit(1) + } + + outDir, err := genutils.OutDir(path) + if err != nil { + fmt.Fprintf(os.Stderr, "failed to get output directory: %v\n", err) + os.Exit(1) + } + + // Set environment variables used by command so the output is consistent, + // regardless of where we run. + os.Setenv("HOME", "/home/username") + + // openim-api + // openim-cmdutils + // openim-crontask + // openim-msggateway + // openim-msgtransfer + // openim-push + // openim-rpc-auth + // openim-rpc-conversation + // openim-rpc-friend + // openim-rpc-group + // openim-rpc-msg + // openim-rpc-third + // openim-rpc-user + switch module { + case "openim-api": + } +} diff --git a/tools/imctl/cmd/genopenimdocs/config_flags.go b/tools/imctl/cmd/genopenimdocs/config_flags.go new file mode 100644 index 000000000..efd5297b8 --- /dev/null +++ b/tools/imctl/cmd/genopenimdocs/config_flags.go @@ -0,0 +1,243 @@ +// Copyright © 2023 OpenIM. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package genericclioptions + +import ( + "flag" + "fmt" + "sync" + "time" + + "github.com/AlekSi/pointer" + "github.com/marmotedu/marmotedu-sdk-go/rest" + "github.com/marmotedu/marmotedu-sdk-go/tools/clientcmd" + "github.com/spf13/pflag" + "github.com/spf13/viper" +) + +// Defines flag for imctl. +const ( + FlagIMConfig = "imconfig" + FlagBearerToken = "user.token" + FlagUsername = "user.username" + FlagPassword = "user.password" + FlagSecretID = "user.secret-id" + FlagSecretKey = "user.secret-key" + FlagCertFile = "user.client-certificate" + FlagKeyFile = "user.client-key" + FlagTLSServerName = "server.tls-server-name" + FlagInsecure = "server.insecure-skip-tls-verify" + FlagCAFile = "server.certificate-authority" + FlagAPIServer = "server.address" + FlagTimeout = "server.timeout" + FlagMaxRetries = "server.max-retries" + FlagRetryInterval = "server.retry-interval" +) + +// RESTClientGetter is an interface that the ConfigFlags describe to provide an easier way to mock for commands +// and eliminate the direct coupling to a struct type. Users may wish to duplicate this type in their own packages +// as per the golang type overlapping. +type RESTClientGetter interface { + // ToRESTConfig returns restconfig + ToRESTConfig() (*rest.Config, error) + // ToRawIMConfigLoader return imconfig loader as-is + ToRawIMConfigLoader() clientcmd.ClientConfig +} + +var _ RESTClientGetter = &ConfigFlags{} + +// ConfigFlags composes the set of values necessary +// for obtaining a REST client config. +type ConfigFlags struct { + IMConfig *string + + BearerToken *string + Username *string + Password *string + SecretID *string + SecretKey *string + + Insecure *bool + TLSServerName *string + CertFile *string + KeyFile *string + CAFile *string + + APIServer *string + Timeout *time.Duration + MaxRetries *int + RetryInterval *time.Duration + + clientConfig clientcmd.ClientConfig + lock sync.Mutex + // If set to true, will use persistent client config and + // propagate the config to the places that need it, rather than + // loading the config multiple times + usePersistentConfig bool +} + +// ToRESTConfig implements RESTClientGetter. +// Returns a REST client configuration based on a provided path +// to a .imconfig file, loading rules, and config flag overrides. +// Expects the AddFlags method to have been called. +func (f *ConfigFlags) ToRESTConfig() (*rest.Config, error) { + return f.ToRawIMConfigLoader().ClientConfig() +} + +// ToRawIMConfigLoader binds config flag values to config overrides +// Returns an interactive clientConfig if the password flag is enabled, +// or a non-interactive clientConfig otherwise. +func (f *ConfigFlags) ToRawIMConfigLoader() clientcmd.ClientConfig { + if f.usePersistentConfig { + return f.toRawIMPersistentConfigLoader() + } + + return f.toRawIMConfigLoader() +} + +func (f *ConfigFlags) toRawIMConfigLoader() clientcmd.ClientConfig { + config := clientcmd.NewConfig() + if err := viper.Unmarshal(&config); err != nil { + panic(err) + } + + return clientcmd.NewClientConfigFromConfig(config) +} + +// toRawIMPersistentConfigLoader binds config flag values to config overrides +// Returns a persistent clientConfig for propagation. +func (f *ConfigFlags) toRawIMPersistentConfigLoader() clientcmd.ClientConfig { + f.lock.Lock() + defer f.lock.Unlock() + + if f.clientConfig == nil { + f.clientConfig = f.toRawIMConfigLoader() + } + + return f.clientConfig +} + +// AddFlags binds client configuration flags to a given flagset. +func (f *ConfigFlags) AddFlags(flags *pflag.FlagSet) { + if f.IMConfig != nil { + flags.StringVar(f.IMConfig, FlagIMConfig, *f.IMConfig, + fmt.Sprintf("Path to the %s file to use for CLI requests", FlagIMConfig)) + } + + if f.BearerToken != nil { + flags.StringVar( + f.BearerToken, + FlagBearerToken, + *f.BearerToken, + "Bearer token for authentication to the API server", + ) + } + + if f.Username != nil { + flags.StringVar(f.Username, FlagUsername, *f.Username, "Username for basic authentication to the API server") + } + + if f.Password != nil { + flags.StringVar(f.Password, FlagPassword, *f.Password, "Password for basic authentication to the API server") + } + + if f.SecretID != nil { + flags.StringVar(f.SecretID, FlagSecretID, *f.SecretID, "SecretID for JWT authentication to the API server") + } + + if f.SecretKey != nil { + flags.StringVar(f.SecretKey, FlagSecretKey, *f.SecretKey, "SecretKey for jwt authentication to the API server") + } + + if f.CertFile != nil { + flags.StringVar(f.CertFile, FlagCertFile, *f.CertFile, "Path to a client certificate file for TLS") + } + if f.KeyFile != nil { + flags.StringVar(f.KeyFile, FlagKeyFile, *f.KeyFile, "Path to a client key file for TLS") + } + if f.TLSServerName != nil { + flags.StringVar(f.TLSServerName, FlagTLSServerName, *f.TLSServerName, ""+ + "Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used") + } + if f.Insecure != nil { + flags.BoolVar(f.Insecure, FlagInsecure, *f.Insecure, ""+ + "If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure") + } + if f.CAFile != nil { + flags.StringVar(f.CAFile, FlagCAFile, *f.CAFile, "Path to a cert file for the certificate authority") + } + + if f.APIServer != nil { + flags.StringVarP(f.APIServer, FlagAPIServer, "s", *f.APIServer, "The address and port of the IM API server") + } + + if f.Timeout != nil { + flags.DurationVar( + f.Timeout, + FlagTimeout, + *f.Timeout, + "The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.", + ) + } + + if f.MaxRetries != nil { + flag.IntVar(f.MaxRetries, FlagMaxRetries, *f.MaxRetries, "Maximum number of retries.") + } + + if f.RetryInterval != nil { + flags.DurationVar( + f.RetryInterval, + FlagRetryInterval, + *f.RetryInterval, + "The interval time between each attempt.", + ) + } +} + +// WithDeprecatedPasswordFlag enables the username and password config flags. +func (f *ConfigFlags) WithDeprecatedPasswordFlag() *ConfigFlags { + f.Username = pointer.ToString("") + f.Password = pointer.ToString("") + + return f +} + +// WithDeprecatedSecretFlag enables the secretID and secretKey config flags. +func (f *ConfigFlags) WithDeprecatedSecretFlag() *ConfigFlags { + f.SecretID = pointer.ToString("") + f.SecretKey = pointer.ToString("") + + return f +} + +// NewConfigFlags returns ConfigFlags with default values set. +func NewConfigFlags(usePersistentConfig bool) *ConfigFlags { + return &ConfigFlags{ + IMConfig: pointer.ToString(""), + + BearerToken: pointer.ToString(""), + Insecure: pointer.ToBool(false), + TLSServerName: pointer.ToString(""), + CertFile: pointer.ToString(""), + KeyFile: pointer.ToString(""), + CAFile: pointer.ToString(""), + + APIServer: pointer.ToString(""), + Timeout: pointer.ToDuration(30 * time.Second), + MaxRetries: pointer.ToInt(0), + RetryInterval: pointer.ToDuration(1 * time.Second), + usePersistentConfig: usePersistentConfig, + } +} diff --git a/tools/imctl/cmd/imctl/imctl.go b/tools/imctl/cmd/imctl/imctl.go new file mode 100644 index 000000000..04032c64c --- /dev/null +++ b/tools/imctl/cmd/imctl/imctl.go @@ -0,0 +1,29 @@ +// 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. + +// iactl is the command line tool for openim platform. +package main + +import ( + "os" + + "github.com/openimsdk/open-im-server/v3/tools/imctl/internal/imctl/cmd" +) + +func main() { + command := cmd.NewDefaultIMCtlCommand() + if err := command.Execute(); err != nil { + os.Exit(1) + } +} diff --git a/tools/imctl/go.mod b/tools/imctl/go.mod new file mode 100644 index 000000000..60b06b45b --- /dev/null +++ b/tools/imctl/go.mod @@ -0,0 +1,18 @@ +module github.com/openimsdk/open-im-server/v3/tools/imctl + +go 1.18 + +require ( + github.com/MakeNowJust/heredoc/v2 v2.0.1 + github.com/mitchellh/go-wordwrap v1.0.1 + github.com/moby/term v0.5.0 + github.com/russross/blackfriday v1.6.0 + github.com/spf13/cobra v1.7.0 + github.com/spf13/pflag v1.0.5 +) + +require ( + github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + golang.org/x/sys v0.1.0 // indirect +) diff --git a/tools/imctl/go.sum b/tools/imctl/go.sum new file mode 100644 index 000000000..3d4c61343 --- /dev/null +++ b/tools/imctl/go.sum @@ -0,0 +1,24 @@ +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/MakeNowJust/heredoc/v2 v2.0.1 h1:rlCHh70XXXv7toz95ajQWOWQnN4WNLt0TdpZYIR/J6A= +github.com/MakeNowJust/heredoc/v2 v2.0.1/go.mod h1:6/2Abh5s+hc3g9nbWLe9ObDIOhaRrqsyY9MWy+4JdRM= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= +github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/imctl/internal/imctl/cmd/cmd.go b/tools/imctl/internal/imctl/cmd/cmd.go new file mode 100644 index 000000000..ced641fd6 --- /dev/null +++ b/tools/imctl/internal/imctl/cmd/cmd.go @@ -0,0 +1,146 @@ +// Copyright © 2023 OpenIM. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cmd + +import ( + "flag" + "io" + "os" + + cliflag "github.com/openimsdk/component-base/pkg/cli/flag" + "github.com/spf13/cobra" + "github.com/spf13/viper" + + "github.com/openimsdk/open-im-server/tools/imctl/pkg/cli/genericclioptions" + + cmdutil "github.com/openimsdk/open-im-server/tools/imctl/inernal/iamctl/cmd/util" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/color" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/completion" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/info" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/jwt" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/new" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/options" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/policy" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/secret" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/set" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/user" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/validate" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/version" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/util/templates" + genericapiserver "github.com/openimsdk/open-im-server/tools/imctl/internal/pkg/server" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/cli/genericclioptions" +) + +// NewDefaultIAMCtlCommand creates the `imctl` command with default arguments. +func NewDefaultIMCtlCommand() *cobra.Command { + return NewIMCtlCommand(os.Stdin, os.Stdout, os.Stderr) +} + +// NewIAMCtlCommand returns new initialized instance of 'imctl' root command. +func NewIMCtlCommand(in io.Reader, out, err io.Writer) *cobra.Command { + // Parent command to which all subcommands are added. + cmds := &cobra.Command{ + Use: "imctl", + Short: "imctl controls the IM platform", + Long: templates.LongDesc(` + imctl controls the IM platform, is the client side tool for IM platform. + + Find more information at: + // TODO: add link to docs, from auto scripts and gendocs + https://github.com/openimsdk/open-im-server/tree/main/docs`), + Run: runHelp, + // Hook before and after Run initialize and write profiles to disk, + // respectively. + PersistentPreRunE: func(*cobra.Command, []string) error { + return initProfiling() + }, + PersistentPostRunE: func(*cobra.Command, []string) error { + return flushProfiling() + }, + } + + flags := cmds.PersistentFlags() + flags.SetNormalizeFunc(cliflag.WarnWordSepNormalizeFunc) // Warn for "_" flags + + // Normalize all flags that are coming from other packages or pre-configurations + // a.k.a. change all "_" to "-". e.g. glog package + flags.SetNormalizeFunc(cliflag.WordSepNormalizeFunc) + + addProfilingFlags(flags) + + iamConfigFlags := genericclioptions.NewConfigFlags(true).WithDeprecatedPasswordFlag().WithDeprecatedSecretFlag() + iamConfigFlags.AddFlags(flags) + matchVersionIAMConfigFlags := cmdutil.NewMatchVersionFlags(iamConfigFlags) + matchVersionIAMConfigFlags.AddFlags(cmds.PersistentFlags()) + + _ = viper.BindPFlags(cmds.PersistentFlags()) + cobra.OnInitialize(func() { + genericapiserver.LoadConfig(viper.GetString(genericclioptions.FlagIAMConfig), "iamctl") + }) + cmds.PersistentFlags().AddGoFlagSet(flag.CommandLine) + + f := cmdutil.NewFactory(matchVersionIAMConfigFlags) + + // From this point and forward we get warnings on flags that contain "_" separators + cmds.SetGlobalNormalizationFunc(cliflag.WarnWordSepNormalizeFunc) + + ioStreams := genericclioptions.IOStreams{In: in, Out: out, ErrOut: err} + + groups := templates.CommandGroups{ + { + Message: "Basic Commands:", + Commands: []*cobra.Command{ + info.NewCmdInfo(f, ioStreams), + color.NewCmdColor(f, ioStreams), + new.NewCmdNew(f, ioStreams), + jwt.NewCmdJWT(f, ioStreams), + }, + }, + { + Message: "Identity and Access Management Commands:", + Commands: []*cobra.Command{ + user.NewCmdUser(f, ioStreams), + secret.NewCmdSecret(f, ioStreams), + policy.NewCmdPolicy(f, ioStreams), + }, + }, + { + Message: "Troubleshooting and Debugging Commands:", + Commands: []*cobra.Command{ + validate.NewCmdValidate(f, ioStreams), + }, + }, + { + Message: "Settings Commands:", + Commands: []*cobra.Command{ + set.NewCmdSet(f, ioStreams), + completion.NewCmdCompletion(ioStreams.Out, ""), + }, + }, + } + groups.Add(cmds) + + filters := []string{"options"} + templates.ActsAsRootCommand(cmds, filters, groups...) + + cmds.AddCommand(version.NewCmdVersion(f, ioStreams)) + cmds.AddCommand(options.NewCmdOptions(ioStreams.Out)) + + return cmds +} + +func runHelp(cmd *cobra.Command, args []string) { + _ = cmd.Help() +} diff --git a/tools/imctl/internal/imctl/cmd/color/color.go b/tools/imctl/internal/imctl/cmd/color/color.go new file mode 100644 index 000000000..551ec379c --- /dev/null +++ b/tools/imctl/internal/imctl/cmd/color/color.go @@ -0,0 +1,352 @@ +// Copyright © 2023 OpenIM. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package color print colors supported by the current terminal. +package color + +import ( + "fmt" + "strings" + + "github.com/fatih/color" + "github.com/olekukonko/tablewriter" + "github.com/openim-sigs/component-base/util/stringutil" + "github.com/spf13/cobra" + + cmdutil "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/util" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/cli/genericclioptions" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/util/templates" +) + +// ColorOptions is an options struct to support color subcommands. +type ColorOptions struct { + Type []string + Example bool + + genericclioptions.IOStreams +} + +var ( + colorLong = templates.LongDesc(`Print the colors supported by the current terminal. + +Color lets you use colorized outputs in terms of ANSI Escape Codes in Go (Golang). +It has support for Windows too! The API can be used in several ways, pick one that suits you. + +Find more information at: + https://github.com/fatih/color`) + + colorExample = templates.Examples(` + # Print supported foreground and background colors + imctl color + + # Print supported colors by type + imctl color -t fg-hi + + # Print all supported colors + imctl color -t all`) + + availableTypes = []string{"fg", "fg-hi", "bg", "bg-hi", "base", "all"} + + colorCodeExample = templates.Examples(` +### 1. Standard colors + +// Print with default helper functions +color.Cyan("Prints text in cyan.") + +// A newline will be appended automatically +color.Blue("Prints %s in blue.", "text") + +// These are using the default foreground colors +color.Red("We have red") +color.Magenta("And many others ..") + +### 2. Mix and reuse colors + +// Create a new color object +c := color.New(color.FgCyan).Add(color.Underline) +c.Println("Prints cyan text with an underline.") + +// Or just add them to New() +d := color.New(color.FgCyan, color.Bold) +d.Printf("This prints bold cyan %s\n", "too!.") + +// Mix up foreground and background colors, create new mixes! +red := color.New(color.FgRed) + +boldRed := red.Add(color.Bold) +boldRed.Println("This will print text in bold red.") + +whiteBackground := red.Add(color.BgWhite) +whiteBackground.Println("Red text with white background.") + +### 3. Use your own output (io.Writer) + +// Use your own io.Writer output +color.New(color.FgBlue).Fprintln(myWriter, "blue color!") + +blue := color.New(color.FgBlue) +blue.Fprint(writer, "This will print text in blue.") + +### 4. Custom print functions (PrintFunc) + +// Create a custom print function for convenience +red := color.New(color.FgRed).PrintfFunc() +red("Warning") +red("Error: %s", err) + +// Mix up multiple attributes +notice := color.New(color.Bold, color.FgGreen).PrintlnFunc() +notice("Don't forget this...") + +### 5. Custom fprint functions (FprintFunc) + +blue := color.New(FgBlue).FprintfFunc() +blue(myWriter, "important notice: %s", stars) + +// Mix up with multiple attributes +success := color.New(color.Bold, color.FgGreen).FprintlnFunc() +success(myWriter, "Don't forget this...") + +### 6. Insert into noncolor strings (SprintFunc) + +// Create SprintXxx functions to mix strings with other non-colorized strings: +yellow := color.New(color.FgYellow).SprintFunc() +red := color.New(color.FgRed).SprintFunc() +fmt.Printf("This is a %s and this is %s.\n", yellow("warning"), red("error")) + +info := color.New(color.FgWhite, color.BgGreen).SprintFunc() +fmt.Printf("This %s rocks!\n", info("package")) + +// Use helper functions +fmt.Println("This", color.RedString("warning"), "should be not neglected.") +fmt.Printf("%v %v\n", color.GreenString("Info:"), "an important message.") + +// Windows supported too! Just don't forget to change the output to color.Output +fmt.Fprintf(color.Output, "Windows support: %s", color.GreenString("PASS")) + +### 7. Plug into existing code + +// Use handy standard colors +color.Set(color.FgYellow) + +fmt.Println("Existing text will now be in yellow") +fmt.Printf("This one %s\n", "too") + +color.Unset() // Don't forget to unset + +// You can mix up parameters +color.Set(color.FgMagenta, color.Bold) +defer color.Unset() // Use it in your function + +fmt.Println("All text will now be bold magenta.") + +### 8. Disable/Enable color + +There might be a case where you want to explicitly disable/enable color output. the +go-isatty package will automatically disable color output for non-tty output streams +(for example if the output were piped directly to less) + +Color has support to disable/enable colors both globally and for single color +definitions. For example suppose you have a CLI app and a --no-color bool flag. You +can easily disable the color output with: + + +var flagNoColor = flag.Bool("no-color", false, "Disable color output") + +if *flagNoColor { + color.NoColor = true // disables colorized output +} + +It also has support for single color definitions (local). You can +disable/enable color output on the fly: + +c := color.New(color.FgCyan) +c.Println("Prints cyan text") + +c.DisableColor() +c.Println("This is printed without any color") + +c.EnableColor() +c.Println("This prints again cyan...")`) +) + +// NewColorOptions returns an initialized ColorOptions instance. +func NewColorOptions(ioStreams genericclioptions.IOStreams) *ColorOptions { + return &ColorOptions{ + Type: []string{}, + Example: false, + IOStreams: ioStreams, + } +} + +// NewCmdColor returns new initialized instance of color sub command. +func NewCmdColor(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { + o := NewColorOptions(ioStreams) + + cmd := &cobra.Command{ + Use: "color", + DisableFlagsInUseLine: true, + Aliases: []string{}, + Short: "Print colors supported by the current terminal", + TraverseChildren: true, + Long: colorLong, + Example: colorExample, + // NoArgs, ArbitraryArgs, OnlyValidArgs, MinimumArgs, MaximumArgs, ExactArgs, ExactArgs + ValidArgs: []string{}, + Run: func(cmd *cobra.Command, args []string) { + cmdutil.CheckErr(o.Complete(f, cmd, args)) + cmdutil.CheckErr(o.Validate(cmd, args)) + cmdutil.CheckErr(o.Run(args)) + }, + SuggestFor: []string{}, + } + + cmd.Flags().StringSliceVarP(&o.Type, "type", "t", o.Type, + fmt.Sprintf("Specify the color type, available types: `%s`.", strings.Join(availableTypes, ","))) + cmd.Flags().BoolVar(&o.Example, "example", o.Example, "Print code to show how to use color package.") + + return cmd +} + +// Complete completes all the required options. +func (o *ColorOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error { + if len(o.Type) == 0 { + o.Type = []string{"fg", "bg"} + + return nil + } + + if stringutil.StringIn("all", o.Type) { + o.Type = []string{"fg", "fg-hi", "bg", "bg-hi", "base"} + } + + return nil +} + +// Validate makes sure there is no discrepency in command options. +func (o *ColorOptions) Validate(cmd *cobra.Command, args []string) error { + for _, t := range o.Type { + if !stringutil.StringIn(t, availableTypes) { + return cmdutil.UsageErrorf(cmd, "--type must be in: %s", strings.Join(availableTypes, ",")) + } + } + + return nil +} + +// Run executes a color subcommand using the specified options. +func (o *ColorOptions) Run(args []string) error { + if o.Example { + fmt.Fprint(o.Out, colorCodeExample+"\n") + + return nil + } + + var data [][]string + + // print table to stdout + table := tablewriter.NewWriter(o.Out) + + // set table attributes + table.SetAutoMergeCells(true) + table.SetRowLine(false) + table.SetBorder(false) + table.SetAutoWrapText(false) + table.SetAutoFormatHeaders(true) + table.SetHeaderAlignment(tablewriter.ALIGN_CENTER) + table.SetAlignment(tablewriter.ALIGN_LEFT) + table.SetHeader([]string{"Category", "Color Name", "Effect"}) + table.SetHeaderColor(tablewriter.Colors{tablewriter.FgGreenColor}, + tablewriter.Colors{tablewriter.FgRedColor}, + tablewriter.Colors{tablewriter.FgCyanColor}) + + for _, t := range o.Type { + switch t { + // Foreground text colors + case "fg": + fg := [][]string{ + {"fg", "black", color.BlackString("color.BlackString")}, + {"fg", "red", color.RedString("color.RedString")}, + {"fg", "green", color.GreenString("color.GreenString")}, + {"fg", "yellow", color.YellowString("color.YellowString")}, + {"fg", "blue", color.BlueString("color.BlueString")}, + {"fg", "magenta", color.MagentaString("color.MagentaString")}, + {"fg", "Cyan", color.CyanString("color.CyanString")}, + {"fg", "white", color.WhiteString("color.WhiteString")}, + } + data = append(data, fg...) + // Foreground Hi-Intensity text colors + case "fg-hi": + fg := [][]string{ + {"fg-hi", "black", color.HiBlackString("color.HiBlackString")}, + {"fg-hi", "red", color.HiRedString("color.HiRedString")}, + {"fg-hi", "green", color.HiGreenString("color.HiGreenString")}, + {"fg-hi", "yellow", color.HiYellowString("color.HiYellowString")}, + {"fg-hi", "blue", color.HiBlueString("color.HiBlueString")}, + {"fg-hi", "magenta", color.HiMagentaString("color.HiMagentaString")}, + {"fg-hi", "Cyan", color.HiCyanString("color.HiCyanString")}, + {"fg-hi", "white", color.HiWhiteString("color.HiWhiteString")}, + } + data = append(data, fg...) + + // Background text colors + case "bg": + bg := [][]string{ + {"bg", "black", color.New(color.FgWhite, color.BgBlack).SprintFunc()("color.BgBlack")}, + {"bg", "red", color.New(color.FgBlack, color.BgRed).SprintFunc()("color.BgRed")}, + {"bg", "greep", color.New(color.FgBlack, color.BgGreen).SprintFunc()("color.BgGreen")}, + {"bg", "yellow", color.New(color.FgWhite, color.BgYellow).SprintFunc()("color.BgYellow")}, + {"bg", "blue", color.New(color.FgWhite, color.BgBlue).SprintFunc()("color.BgBlue")}, + {"bg", "magenta", color.New(color.FgWhite, color.BgMagenta).SprintFunc()("color.BgMagenta")}, + {"bg", "cyan", color.New(color.FgWhite, color.BgCyan).SprintFunc()("color.BgCyan")}, + {"bg", "white", color.New(color.FgBlack, color.BgWhite).SprintFunc()("color.BgWhite")}, + } + data = append(data, bg...) + // Background Hi-Intensity text colors + case "bg-hi": + bghi := [][]string{ + {"bg-hi", "black", color.New(color.FgWhite, color.BgHiBlack).SprintFunc()("color.BgHiBlack")}, + {"bg-hi", "red", color.New(color.FgBlack, color.BgHiRed).SprintFunc()("color.BgHiRed")}, + {"bg-hi", "greep", color.New(color.FgBlack, color.BgHiGreen).SprintFunc()("color.BgHiGreen")}, + {"bg-hi", "yellow", color.New(color.FgWhite, color.BgHiYellow).SprintFunc()("color.BgHiYellow")}, + {"bg-hi", "blue", color.New(color.FgWhite, color.BgHiBlue).SprintFunc()("color.BgHiBlue")}, + {"bg-hi", "magenta", color.New(color.FgWhite, color.BgHiMagenta).SprintFunc()("color.BgHiMagenta")}, + {"bg-hi", "cyan", color.New(color.FgWhite, color.BgHiCyan).SprintFunc()("color.BgHiCyan")}, + {"bg-hi", "white", color.New(color.FgBlack, color.BgHiWhite).SprintFunc()("color.BgHiWhite")}, + } + data = append(data, bghi...) + // Base attributes + case "base": + base := [][]string{ + {"base", "black", color.New(color.FgGreen, color.Reset).SprintFunc()("color.Reset")}, + {"base", "red", color.New(color.FgGreen, color.Bold).SprintFunc()("color.Bold")}, + {"base", "greep", color.New(color.FgGreen, color.Faint).SprintFunc()("color.Faint")}, + {"base", "yellow", color.New(color.FgGreen, color.Italic).SprintFunc()("color.Italic")}, + {"base", "blue", color.New(color.FgGreen, color.Underline).SprintFunc()("color.Underline")}, + {"base", "magenta", color.New(color.FgGreen, color.BlinkSlow).SprintFunc()("color.BlinkSlow")}, + {"base", "cyan", color.New(color.FgGreen, color.BlinkRapid).SprintFunc()("color.BlinkRapid")}, + {"base", "white", color.New(color.FgGreen, color.ReverseVideo).SprintFunc()("color.ReverseVideo")}, + {"base", "white", color.New(color.FgGreen, color.Concealed).SprintFunc()("color.Concealed")}, + {"base", "white", color.New(color.FgGreen, color.CrossedOut).SprintFunc()("color.CrossedOut")}, + } + data = append(data, base...) + default: + } + } + + table.AppendBulk(data) + table.Render() + + return nil +} diff --git a/tools/imctl/internal/imctl/cmd/completion/completion.go b/tools/imctl/internal/imctl/cmd/completion/completion.go new file mode 100644 index 000000000..6242dbd45 --- /dev/null +++ b/tools/imctl/internal/imctl/cmd/completion/completion.go @@ -0,0 +1,283 @@ +// Copyright © 2023 OpenIM. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package completion output shell completion code for the specified shell (bash or zsh). +package completion + +import ( + "bytes" + "io" + + "github.com/spf13/cobra" + + cmdutil "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/util" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/util/templates" +) + +const defaultBoilerPlate = ` +# 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. +` + +var ( + completionLong = templates.LongDesc(` + Output shell completion code for the specified shell (bash or zsh). + The shell code must be evaluated to provide interactive + completion of imctl commands. This can be done by sourcing it from + the .bash_profile. + + Detailed instructions on how to do this are available here: + http://github.com/marmotedu/iam/docs/installation/imctl.md#enabling-shell-autocompletion + + Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2`) + + completionExample = templates.Examples(` + # Installing bash completion on macOS using homebrew + ## If running Bash 3.2 included with macOS + brew install bash-completion + ## or, if running Bash 4.1+ + brew install bash-completion@2 + ## If imctl is installed via homebrew, this should start working immediately. + ## If you've installed via other means, you may need add the completion to your completion directory + imctl completion bash > $(brew --prefix)/etc/bash_completion.d/imctl + + + # Installing bash completion on Linux + ## If bash-completion is not installed on Linux, please install the 'bash-completion' package + ## via your distribution's package manager. + ## Load the imctl completion code for bash into the current shell + source <(imctl completion bash) + ## Write bash completion code to a file and source if from .bash_profile + imctl completion bash > ~/.iam/completion.bash.inc + printf " + # IAM shell completion + source '$HOME/.iam/completion.bash.inc' + " >> $HOME/.bash_profile + source $HOME/.bash_profile + + # Load the imctl completion code for zsh[1] into the current shell + source <(imctl completion zsh) + # Set the imctl completion code for zsh[1] to autoload on startup + imctl completion zsh > "${fpath[1]}/_imctl"`) +) + +var completionShells = map[string]func(out io.Writer, boilerPlate string, cmd *cobra.Command) error{ + "bash": runCompletionBash, + "zsh": runCompletionZsh, +} + +// NewCmdCompletion creates the `completion` command. +func NewCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command { + shells := []string{} + for s := range completionShells { + shells = append(shells, s) + } + + cmd := &cobra.Command{ + Use: "completion SHELL", + DisableFlagsInUseLine: true, + Short: "Output shell completion code for the specified shell (bash or zsh)", + Long: completionLong, + Example: completionExample, + Run: func(cmd *cobra.Command, args []string) { + err := RunCompletion(out, boilerPlate, cmd, args) + cmdutil.CheckErr(err) + }, + ValidArgs: shells, + } + + return cmd +} + +// RunCompletion checks given arguments and executes command. +func RunCompletion(out io.Writer, boilerPlate string, cmd *cobra.Command, args []string) error { + if len(args) == 0 { + return cmdutil.UsageErrorf(cmd, "Shell not specified.") + } + + if len(args) > 1 { + return cmdutil.UsageErrorf(cmd, "Too many arguments. Expected only the shell type.") + } + + run, found := completionShells[args[0]] + if !found { + return cmdutil.UsageErrorf(cmd, "Unsupported shell type %q.", args[0]) + } + + return run(out, boilerPlate, cmd.Parent()) +} + +func runCompletionBash(out io.Writer, boilerPlate string, imctl *cobra.Command) error { + if len(boilerPlate) == 0 { + boilerPlate = defaultBoilerPlate + } + + if _, err := out.Write([]byte(boilerPlate)); err != nil { + return err + } + + return imctl.GenBashCompletion(out) +} + +func runCompletionZsh(out io.Writer, boilerPlate string, imctl *cobra.Command) error { + zshHead := "#compdef imctl\n" + + if _, err := out.Write([]byte(zshHead)); err != nil { + return err + } + + if len(boilerPlate) == 0 { + boilerPlate = defaultBoilerPlate + } + + if _, err := out.Write([]byte(boilerPlate)); err != nil { + return err + } + + zshInitialization := ` +__imctl_bash_source() { + alias shopt=':' + emulate -L sh + setopt kshglob noshglob braceexpand + + source "$@" +} + +__imctl_type() { + # -t is not supported by zsh + if [ "$1" == "-t" ]; then + shift + + # fake Bash 4 to disable "complete -o nospace". Instead + # "compopt +-o nospace" is used in the code to toggle trailing + # spaces. We don't support that, but leave trailing spaces on + # all the time + if [ "$1" = "__imctl_compopt" ]; then + echo builtin + return 0 + fi + fi + type "$@" +} + +__imctl_compgen() { + local completions w + completions=( $(compgen "$@") ) || return $? + + # filter by given word as prefix + while [[ "$1" = -* && "$1" != -- ]]; do + shift + shift + done + if [[ "$1" == -- ]]; then + shift + fi + for w in "${completions[@]}"; do + if [[ "${w}" = "$1"* ]]; then + echo "${w}" + fi + done +} + +__imctl_compopt() { + true # don't do anything. Not supported by bashcompinit in zsh +} + +__imctl_ltrim_colon_completions() +{ + if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then + # Remove colon-word prefix from COMPREPLY items + local colon_word=${1%${1##*:}} + local i=${#COMPREPLY[*]} + while [[ $((--i)) -ge 0 ]]; do + COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} + done + fi +} + +__imctl_get_comp_words_by_ref() { + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[${COMP_CWORD}-1]}" + words=("${COMP_WORDS[@]}") + cword=("${COMP_CWORD[@]}") +} + +__imctl_filedir() { + # Don't need to do anything here. + # Otherwise we will get trailing space without "compopt -o nospace" + true +} + +autoload -U +X bashcompinit && bashcompinit + +# use word boundary patterns for BSD or GNU sed +LWORD='[[:<:]]' +RWORD='[[:>:]]' +if sed --help 2>&1 | grep -q 'GNU\|BusyBox'; then + LWORD='\<' + RWORD='\>' +fi + +__imctl_convert_bash_to_zsh() { + sed \ + -e 's/declare -F/whence -w/' \ + -e 's/_get_comp_words_by_ref "\$@"/_get_comp_words_by_ref "\$*"/' \ + -e 's/local \([a-zA-Z0-9_]*\)=/local \1; \1=/' \ + -e 's/flags+=("\(--.*\)=")/flags+=("\1"); two_word_flags+=("\1")/' \ + -e 's/must_have_one_flag+=("\(--.*\)=")/must_have_one_flag+=("\1")/' \ + -e "s/${LWORD}_filedir${RWORD}/__imctl_filedir/g" \ + -e "s/${LWORD}_get_comp_words_by_ref${RWORD}/__imctl_get_comp_words_by_ref/g" \ + -e "s/${LWORD}__ltrim_colon_completions${RWORD}/__imctl_ltrim_colon_completions/g" \ + -e "s/${LWORD}compgen${RWORD}/__imctl_compgen/g" \ + -e "s/${LWORD}compopt${RWORD}/__imctl_compopt/g" \ + -e "s/${LWORD}declare${RWORD}/builtin declare/g" \ + -e "s/\\\$(type${RWORD}/\$(__imctl_type/g" \ + <<'BASH_COMPLETION_EOF' +` + if _, err := out.Write([]byte(zshInitialization)); err != nil { + return err + } + + buf := new(bytes.Buffer) + if err := imctl.GenBashCompletion(buf); err != nil { + return err + } + + if _, err := out.Write(buf.Bytes()); err != nil { + return err + } + + zshTail := ` +BASH_COMPLETION_EOF +} + +__imctl_bash_source <(__imctl_convert_bash_to_zsh) +` + if _, err := out.Write([]byte(zshTail)); err != nil { + return err + } + + return nil +} diff --git a/tools/imctl/internal/imctl/cmd/info/info.go b/tools/imctl/internal/imctl/cmd/info/info.go new file mode 100644 index 000000000..a51c2f4de --- /dev/null +++ b/tools/imctl/internal/imctl/cmd/info/info.go @@ -0,0 +1,119 @@ +// Copyright © 2023 OpenIM. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package info print the host information. +package info + +import ( + "fmt" + "reflect" + "strconv" + + hoststat "github.com/likexian/host-stat-go" + "github.com/openim-sigs/component-base/util/iputil" + "github.com/spf13/cobra" + + cmdutil "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/cmd/util" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/cli/genericclioptions" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/util/templates" +) + +// Info defines the host information struct. +type Info struct { + HostName string + IPAddress string + OSRelease string + CPUCore uint64 + MemTotal string + MemFree string +} + +// InfoOptions is an options struct to support 'info' sub command. +type InfoOptions struct { + genericclioptions.IOStreams +} + +var infoExample = templates.Examples(` + # Print the host information + imctl info`) + +// NewInfoOptions returns an initialized InfoOptions instance. +func NewInfoOptions(ioStreams genericclioptions.IOStreams) *InfoOptions { + return &InfoOptions{ + IOStreams: ioStreams, + } +} + +// NewCmdInfo returns new initialized instance of 'info' sub command. +func NewCmdInfo(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { + o := NewInfoOptions(ioStreams) + + cmd := &cobra.Command{ + Use: "info", + DisableFlagsInUseLine: true, + Aliases: []string{}, + Short: "Print the host information", + Long: "Print the host information.", + Example: infoExample, + Run: func(cmd *cobra.Command, args []string) { + cmdutil.CheckErr(o.Run(args)) + }, + SuggestFor: []string{}, + } + + return cmd +} + +// Run executes an info sub command using the specified options. +func (o *InfoOptions) Run(args []string) error { + var info Info + + hostInfo, err := hoststat.GetHostInfo() + if err != nil { + return fmt.Errorf("get host info failed!error:%w", err) + } + + info.HostName = hostInfo.HostName + info.OSRelease = hostInfo.Release + " " + hostInfo.OSBit + + memStat, err := hoststat.GetMemStat() + if err != nil { + return fmt.Errorf("get mem stat failed!error:%w", err) + } + + info.MemTotal = strconv.FormatUint(memStat.MemTotal, 10) + "M" + info.MemFree = strconv.FormatUint(memStat.MemFree, 10) + "M" + info.IPAddress = iputil.GetLocalIP() + + cpuStat, err := hoststat.GetCPUInfo() + if err != nil { + return fmt.Errorf("get cpu stat failed!error:%w", err) + } + + info.CPUCore = cpuStat.CoreCount + + s := reflect.ValueOf(&info).Elem() + typeOfInfo := s.Type() + + for i := 0; i < s.NumField(); i++ { + f := s.Field(i) + + v := fmt.Sprintf("%v", f.Interface()) + if v != "" { + fmt.Fprintf(o.Out, "%12s %v\n", typeOfInfo.Field(i).Name+":", f.Interface()) + } + } + + return nil +} diff --git a/tools/imctl/internal/imctl/cmd/new/new.go b/tools/imctl/internal/imctl/cmd/new/new.go new file mode 100644 index 000000000..95ec853b1 --- /dev/null +++ b/tools/imctl/internal/imctl/cmd/new/new.go @@ -0,0 +1,619 @@ +// Copyright © 2023 OpenIM. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package new used to generate demo command code. +// nolint: predeclared +package new + +import ( + "fmt" + "os" + "path/filepath" + "strings" + "text/template" + + "github.com/openim-sigs/component-base/pkg/util/fileutil" + "github.com/spf13/cobra" + "golang.org/x/text/cases" + "golang.org/x/text/language" + + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/util/templates" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/cli/genericclioptions" + cmdutil "github.com/openimsdk/open-im-server/tools/imctl/pkg/util" +) + +const ( + newUsageStr = "new CMD_NAME | CMD_NAME CMD_DESCRIPTION" +) + +var ( + newLong = templates.LongDesc(`Used to generate demo command source code file. + +Can use this command generate a command template file, and do some modify based on your needs. +This can improve your R&D efficiency.`) + + newExample = templates.Examples(` + # Create a default 'test' command file without a description + imctl new test + + # Create a default 'test' command file in /tmp/ + imctl new test -d /tmp/ + + # Create a default 'test' command file with a description + imctl new test "This is a test command" + + # Create command 'test' with two subcommands + imctl new -g test "This is a test command with two subcommands"`) + + newUsageErrStr = fmt.Sprintf( + "expected '%s'.\nat least CMD_NAME is a required argument for the new command", + newUsageStr, + ) + + cmdTemplate = `package {{.CommandName}} + +import ( + "fmt" + + "github.com/spf13/cobra" + + cmdutil "github.com/openimsdk/open-im-server/tools/imctl/pkg/util" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/util/templates" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/cli/genericclioptions" +) + +const ( + {{.CommandName}}UsageStr = "{{.CommandName}} USERNAME PASSWORD" + maxStringLength = 17 +) + +// {{.CommandFunctionName}}Options is an options struct to support '{{.CommandName}}' sub command. +type {{.CommandFunctionName}}Options struct { + // options + StringOption string + StringSliceOption []string + IntOption int + BoolOption bool + + // args + Username string + Password string + + genericclioptions.IOStreams +} + +var ( + {{.CommandName}}Long = templates.LongDesc({{.Dot}}A longer description that spans multiple lines and likely contains examples +and usage of using your command. For example: + +Cobra is a CLI library for Go that empowers applications. +This application is a tool to generate the needed files +to quickly create a Cobra application.{{.Dot}}) + + {{.CommandName}}Example = templates.Examples({{.Dot}} + # Print all option values for {{.CommandName}} + imctl {{.CommandName}} marmotedu marmotedupass{{.Dot}}) + + {{.CommandName}}UsageErrStr = fmt.Sprintf("expected '%s'.\nUSERNAME and PASSWORD are required arguments for the {{.CommandName}} command", {{.CommandName}}UsageStr) +) + +// New{{.CommandFunctionName}}Options returns an initialized {{.CommandFunctionName}}Options instance. +func New{{.CommandFunctionName}}Options(ioStreams genericclioptions.IOStreams) *{{.CommandFunctionName}}Options { + return &{{.CommandFunctionName}}Options{ + StringOption: "default", + IOStreams: ioStreams, + } +} + +// NewCmd{{.CommandFunctionName}} returns new initialized instance of '{{.CommandName}}' sub command. +func NewCmd{{.CommandFunctionName}}(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { + o := New{{.CommandFunctionName}}Options(ioStreams) + + cmd := &cobra.Command{ + Use: {{.CommandName}}UsageStr, + DisableFlagsInUseLine: true, + Aliases: []string{}, + Short: "{{.CommandDescription}}", + TraverseChildren: true, + Long: {{.CommandName}}Long, + Example: {{.CommandName}}Example, + Run: func(cmd *cobra.Command, args []string) { + cmdutil.CheckErr(o.Complete(f, cmd, args)) + cmdutil.CheckErr(o.Validate(cmd, args)) + cmdutil.CheckErr(o.Run(args)) + }, + SuggestFor: []string{}, + Args: func(cmd *cobra.Command, args []string) error { + // nolint: gomnd // no need + if len(args) < 2 { + return cmdutil.UsageErrorf(cmd, {{.CommandName}}UsageErrStr) + } + + // if need args equal to zero, uncomment the following code + /* + if len(args) != 0 { + return cmdutil.UsageErrorf(cmd, "Unexpected args: %v", args) + } + */ + + return nil + }, + } + + // mark flag as deprecated + _ = cmd.Flags().MarkDeprecated("deprecated-opt", "This flag is deprecated and will be removed in future.") + cmd.Flags().StringVarP(&o.StringOption, "string", "", o.StringOption, "String option.") + cmd.Flags().StringSliceVar(&o.StringSliceOption, "slice", o.StringSliceOption, "String slice option.") + cmd.Flags().IntVarP(&o.IntOption, "int", "i", o.IntOption, "Int option.") + cmd.Flags().BoolVarP(&o.BoolOption, "bool", "b", o.BoolOption, "Bool option.") + + return cmd +} + +// Complete completes all the required options. +func (o *{{.CommandFunctionName}}Options) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error { + if o.StringOption != "" { + o.StringOption += "(complete)" + } + + o.Username = args[0] + o.Password = args[1] + + return nil +} + +// Validate makes sure there is no discrepency in command options. +func (o *{{.CommandFunctionName}}Options) Validate(cmd *cobra.Command, args []string) error { + if len(o.StringOption) > maxStringLength { + return cmdutil.UsageErrorf(cmd, "--string length must less than 18") + } + + if o.IntOption < 0 { + return cmdutil.UsageErrorf(cmd, "--int must be a positive integer: %v", o.IntOption) + } + + return nil +} + +// Run executes a {{.CommandName}} sub command using the specified options. +func (o *{{.CommandFunctionName}}Options) Run(args []string) error { + fmt.Fprintf(o.Out, "The following is option values:\n") + fmt.Fprintf(o.Out, "==> --string: %v\n==> --slice: %v\n==> --int: %v\n==> --bool: %v\n", + o.StringOption, o.StringSliceOption, o.IntOption, o.BoolOption) + + fmt.Fprintf(o.Out, "\nThe following is args values:\n") + fmt.Fprintf(o.Out, "==> username: %v\n==> password: %v\n", o.Username, o.Password) + + return nil +} +` + + maincmdTemplate = `package {{.CommandName}} + +import ( + "github.com/spf13/cobra" + "github.com/spf13/viper" + + cmdutil "github.com/openimsdk/open-im-server/tools/imctl/pkg/util" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/util/templates" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/cli/genericclioptions" +) + +const maxStringLength = 17 + +var ( + {{.CommandName}}Long = templates.LongDesc({{.Dot}} + Demo command. + + This commands show you how to implement a command with two sub commands.{{.Dot}}) +) + +// NewCmd{{.CommandFunctionName}} returns new initialized instance of '{{.CommandName}}' sub command. +func NewCmd{{.CommandFunctionName}}(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { + cmd := &cobra.Command{ + Use: "{{.CommandName}} SUBCOMMAND", + DisableFlagsInUseLine: true, + Short: "{{.CommandDescription}}", + Long: {{.CommandName}}Long, + Run: cmdutil.DefaultSubCommandRun(ioStreams.ErrOut), + } + + // add subcommands + cmd.AddCommand(NewCmdSubCmd1(f, ioStreams)) + cmd.AddCommand(NewCmdSubCmd2(f, ioStreams)) + + // add persistent flags for '{{.CommandName}}' + cmdutil.AddCleanFlags(cmd) + + // persistent flag, we can get the value in subcommand via {{.Dot}}viper.Get{{.Dot}} + cmd.PersistentFlags().StringP("persistent", "p", "this is a persistent option", "Cobra persistent option.") + + // bind flags with viper + viper.BindPFlag("persistent", cmd.PersistentFlags().Lookup("persistent")) + + return cmd +} +` + subcmd1Template = `package {{.CommandName}} + +import ( + "fmt" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + + cmdutil "github.com/openimsdk/open-im-server/tools/imctl/pkg/util" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/util/templates" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/cli/genericclioptions" +) + +const ( + subcmd1UsageStr = "subcmd1 USERNAME PASSWORD" +) + +// SubCmd1Options is an options struct to support subcmd1 subcommands. +type SubCmd1Options struct { + // options + StringOption string + StringSliceOption []string + IntOption int + BoolOption bool + PersistentOption string + + // args + Username string + Password string + + genericclioptions.IOStreams +} + +var ( + subcmd1Long = templates.LongDesc({{.Dot}}A longer description that spans multiple lines and likely contains examples +and usage of using your command. For example: + +Cobra is a CLI library for Go that empowers applications. +This application is a tool to generate the needed files +to quickly create a Cobra application.{{.Dot}}) + + subcmd1Example = templates.Examples({{.Dot}} + # Print all option values for subcmd1 + imctl {{.CommandName}} subcmd1 marmotedu marmotedupass + + # Print all option values for subcmd1 with --persistent specified + imctl {{.CommandName}} subcmd1 marmotedu marmotedupass --persistent="specified persistent option in command line"{{.Dot}}) + + subcmd1UsageErrStr = fmt.Sprintf("expected '%s'.\nUSERNAME and PASSWORD are required arguments for the subcmd1 command", subcmd1UsageStr) +) + +// NewSubCmd1Options returns an initialized SubCmd1Options instance. +func NewSubCmd1Options(ioStreams genericclioptions.IOStreams) *SubCmd1Options { + return &SubCmd1Options{ + StringOption: "default", + IOStreams: ioStreams, + } +} + +// NewCmdSubCmd1 returns new initialized instance of subcmd1 sub command. +func NewCmdSubCmd1(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { + o := NewSubCmd1Options(ioStreams) + + cmd := &cobra.Command{ + Use: "subcmd1 USERNAME PASSWORD", + DisableFlagsInUseLine: true, + Aliases: []string{"sub1"}, + Short: "A brief description of your command", + TraverseChildren: true, + Long: subcmd1Long, + Example: subcmd1Example, + Run: func(cmd *cobra.Command, args []string) { + cmdutil.CheckErr(o.Complete(f, cmd, args)) + cmdutil.CheckErr(o.Validate(cmd, args)) + cmdutil.CheckErr(o.Run(args)) + }, + SuggestFor: []string{}, + Args: func(cmd *cobra.Command, args []string) error { + // nolint: gomnd // no need + if len(args) < 2 { + return cmdutil.UsageErrorf(cmd, subcmd1UsageErrStr) + } + + return nil + }, + } + + // mark flag as deprecated + _ = cmd.Flags().MarkDeprecated("deprecated-opt", "This flag is deprecated and will be removed in future.") + cmd.Flags().StringVarP(&o.StringOption, "string", "", o.StringOption, "String option.") + cmd.Flags().StringSliceVar(&o.StringSliceOption, "slice", o.StringSliceOption, "String slice option.") + cmd.Flags().IntVarP(&o.IntOption, "int", "i", o.IntOption, "Int option.") + cmd.Flags().BoolVarP(&o.BoolOption, "bool", "b", o.BoolOption, "Bool option.") + + return cmd +} + +// Complete completes all the required options. +func (o *SubCmd1Options) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error { + if o.StringOption != "" { + o.StringOption += "(complete)" + } + + o.PersistentOption = viper.GetString("persistent") + o.Username = args[0] + o.Password = args[1] + + return nil +} + +// Validate makes sure there is no discrepency in command options. +func (o *SubCmd1Options) Validate(cmd *cobra.Command, args []string) error { + if len(o.StringOption) > maxStringLength { + return cmdutil.UsageErrorf(cmd, "--string length must less than 18") + } + + if o.IntOption < 0 { + return cmdutil.UsageErrorf(cmd, "--int must be a positive integer: %v", o.IntOption) + } + + return nil +} + +// Run executes a subcmd1 subcommand using the specified options. +func (o *SubCmd1Options) Run(args []string) error { + fmt.Fprintf(o.Out, "The following is option values:\n") + fmt.Fprintf(o.Out, "==> --string: %v\n==> --slice: %v\n==> --int: %v\n==> --bool: %v\n==> --persistent: %v\n", + o.StringOption, o.StringSliceOption, o.IntOption, o.BoolOption, o.PersistentOption) + + fmt.Fprintf(o.Out, "\nThe following is args values:\n") + fmt.Fprintf(o.Out, "==> username: %v\n==> password: %v\n", o.Username, o.Password) + return nil +} +` + subcmd2Template = `package {{.CommandName}} + +import ( + "fmt" + + "github.com/spf13/cobra" + + cmdutil "github.com/openimsdk/open-im-server/tools/imctl/pkg/util" + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/util/templates" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/cli/genericclioptions" +) + +// SubCmd2Options is an options struct to support subcmd2 subcommands. +type SubCmd2Options struct { + StringOption string + StringSliceOption []string + IntOption int + BoolOption bool + + genericclioptions.IOStreams +} + +var ( + subcmd2Long = templates.LongDesc({{.Dot}}A longer description that spans multiple lines and likely contains examples +and usage of using your command. For example: + +Cobra is a CLI library for Go that empowers applications. +This application is a tool to generate the needed files +to quickly create a Cobra application.{{.Dot}}) + + subcmd2Example = templates.Examples({{.Dot}} + # Print all option values for subcmd2 + imctl {{.CommandName}} subcmd2{{.Dot}}) +) + +// NewSubCmd2Options returns an initialized SubCmd2Options instance. +func NewSubCmd2Options(ioStreams genericclioptions.IOStreams) *SubCmd2Options { + return &SubCmd2Options{ + StringOption: "default", + IOStreams: ioStreams, + } +} + +// NewCmdSubCmd2 returns new initialized instance of subcmd2 sub command. +func NewCmdSubCmd2(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { + o := NewSubCmd2Options(ioStreams) + + cmd := &cobra.Command{ + Use: "subcmd2", + DisableFlagsInUseLine: true, + Aliases: []string{"sub2"}, + Short: "A brief description of your command", + TraverseChildren: true, + Long: subcmd2Long, + Example: subcmd2Example, + Run: func(cmd *cobra.Command, args []string) { + cmdutil.CheckErr(o.Complete(f, cmd, args)) + cmdutil.CheckErr(o.Validate(cmd, args)) + cmdutil.CheckErr(o.Run(args)) + }, + SuggestFor: []string{}, + } + + // mark flag as deprecated + cmd.Flags().StringVarP(&o.StringOption, "string", "", o.StringOption, "String option.") + cmd.Flags().StringSliceVar(&o.StringSliceOption, "slice", o.StringSliceOption, "String slice option.") + cmd.Flags().IntVarP(&o.IntOption, "int", "i", o.IntOption, "Int option.") + cmd.Flags().BoolVarP(&o.BoolOption, "bool", "b", o.BoolOption, "Bool option.") + + return cmd +} + +// Complete completes all the required options. +func (o *SubCmd2Options) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error { + if len(args) != 0 { + return cmdutil.UsageErrorf(cmd, "Unexpected args: %v", args) + } + + if o.StringOption != "" { + o.StringOption += "(complete)" + } + + return nil +} + +// Validate makes sure there is no discrepency in command options. +func (o *SubCmd2Options) Validate(cmd *cobra.Command, args []string) error { + if len(o.StringOption) > maxStringLength { + return cmdutil.UsageErrorf(cmd, "--string length must less than 18") + } + + if o.IntOption < 0 { + return cmdutil.UsageErrorf(cmd, "--int must be a positive integer: %v", o.IntOption) + } + + return nil +} + +// Run executes a subcmd2 subcommand using the specified options. +func (o *SubCmd2Options) Run(args []string) error { + fmt.Fprintf(o.Out, "The following is option values:\n") + fmt.Fprintf(o.Out, "==> --string: %v\n==> --slice: %v\n==> --int: %v\n==> --bool: %v\n", + o.StringOption, o.StringSliceOption, o.IntOption, o.BoolOption) + return nil +} +` +) + +// NewOptions is an options struct to support 'new' sub command. +type NewOptions struct { + Group bool + Outdir string + + // command template options, will render to command template + CommandName string + CommandDescription string + CommandFunctionName string + Dot string + + genericclioptions.IOStreams +} + +// NewNewOptions returns an initialized NewOptions instance. +func NewNewOptions(ioStreams genericclioptions.IOStreams) *NewOptions { + return &NewOptions{ + Group: false, + Outdir: ".", + CommandDescription: "A brief description of your command", + Dot: "`", + IOStreams: ioStreams, + } +} + +// NewCmdNew returns new initialized instance of 'new' sub command. +func NewCmdNew(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { + o := NewNewOptions(ioStreams) + + cmd := &cobra.Command{ + Use: newUsageStr, + DisableFlagsInUseLine: true, + Short: "Generate demo command code", + Long: newLong, + Example: newExample, + Run: func(cmd *cobra.Command, args []string) { + cmdutil.CheckErr(o.Complete(cmd, args)) + cmdutil.CheckErr(o.Validate(cmd)) + cmdutil.CheckErr(o.Run(args)) + }, + Aliases: []string{}, + SuggestFor: []string{}, + } + + cmd.Flags().BoolVarP(&o.Group, "group", "g", o.Group, "Generate two subcommands.") + cmd.Flags().StringVarP(&o.Outdir, "outdir", "d", o.Outdir, "Where to create demo command files.") + + return cmd +} + +// Complete completes all the required options. +func (o *NewOptions) Complete(cmd *cobra.Command, args []string) error { + if len(args) < 1 { + return cmdutil.UsageErrorf(cmd, newUsageErrStr) + } + + o.CommandName = strings.ToLower(args[0]) + if len(args) > 1 { + o.CommandDescription = args[1] + } + + o.CommandFunctionName = cases.Title(language.English).String(o.CommandName) + + return nil +} + +// Validate makes sure there is no discrepency in command options. +func (o *NewOptions) Validate(cmd *cobra.Command) error { + return nil +} + +// Run executes a new sub command using the specified options. +func (o *NewOptions) Run(args []string) error { + if o.Group { + return o.CreateCommandWithSubCommands() + } + + return o.CreateCommand() +} + +// CreateCommand create the command with options. +func (o *NewOptions) CreateCommand() error { + return o.GenerateGoCode(o.CommandName+".go", cmdTemplate) +} + +// CreateCommandWithSubCommands create sub commands with options. +func (o *NewOptions) CreateCommandWithSubCommands() error { + if err := o.GenerateGoCode(o.CommandName+".go", maincmdTemplate); err != nil { + return err + } + + if err := o.GenerateGoCode(o.CommandName+"_subcmd1.go", subcmd1Template); err != nil { + return err + } + + if err := o.GenerateGoCode(o.CommandName+"_subcmd2.go", subcmd2Template); err != nil { + return err + } + + return nil +} + +// GenerateGoCode generate go source file. +func (o *NewOptions) GenerateGoCode(name, codeTemplate string) error { + tmpl, err := template.New("cmd").Parse(codeTemplate) + if err != nil { + return err + } + + err = fileutil.EnsureDirAll(o.Outdir) + if err != nil { + return err + } + + filename := filepath.Join(o.Outdir, name) + fd, err := os.Create(filename) + if err != nil { + return err + } + defer fd.Close() + + err = tmpl.Execute(fd, o) + if err != nil { + return err + } + + fmt.Printf("Command file generated: %s\n", filename) + + return nil +} diff --git a/tools/imctl/internal/imctl/cmd/options/options.go b/tools/imctl/internal/imctl/cmd/options/options.go new file mode 100644 index 000000000..52e236d13 --- /dev/null +++ b/tools/imctl/internal/imctl/cmd/options/options.go @@ -0,0 +1,50 @@ +// Copyright © 2023 OpenIM. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package options print a list of global command-line options (applies to all commands). +package options + +import ( + "io" + + "github.com/spf13/cobra" + + "github.com/openimsdk/open-im-server/tools/imctl/pkg/util/templates" +) + +var optionsExample = templates.Examples(` + # Print flags inherited by all commands + iamctl options`) + +// NewCmdOptions implements the options command. +func NewCmdOptions(out io.Writer) *cobra.Command { + cmd := &cobra.Command{ + Use: "options", + Short: "Print the list of flags inherited by all commands", + Long: "Print the list of flags inherited by all commands", + Example: optionsExample, + Run: func(cmd *cobra.Command, args []string) { + _ = cmd.Usage() + }, + } + + // The `options` command needs write its output to the `out` stream + // (typically stdout). Without calling SetOutput here, the Usage() + // function call will fall back to stderr. + cmd.SetOutput(out) + + templates.UseOptionsTemplates(cmd) + + return cmd +} diff --git a/tools/imctl/internal/imctl/cmd/profiling.go b/tools/imctl/internal/imctl/cmd/profiling.go new file mode 100644 index 000000000..f0be6e38c --- /dev/null +++ b/tools/imctl/internal/imctl/cmd/profiling.go @@ -0,0 +1,95 @@ +// Copyright © 2023 OpenIM. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cmd + +import ( + "errors" + "fmt" + "os" + "runtime" + "runtime/pprof" + + "github.com/spf13/pflag" +) + +// profiling configuration variables +var ( + profileName string = "none" // Name of the profile to capture. + profileOutput string = "profile.pprof" // File to write the profile data. +) + +// addProfilingFlags registers profiling related flags to the given FlagSet. +func addProfilingFlags(flags *pflag.FlagSet) { + flags.StringVar( + &profileName, + "profile", + "none", + "Type of profile to capture. Options: none, cpu, heap, goroutine, threadcreate, block, mutex", + ) + flags.StringVar(&profileOutput, "profile-output", "profile.pprof", "File to write the profile data") +} + +// initProfiling sets up profiling based on the user's choice. +// If 'cpu' is selected, it starts the CPU profile. For block and mutex profiles, +// sampling rates are set up. +func initProfiling() error { + switch profileName { + case "none": + return nil + case "cpu": + f, err := os.Create(profileOutput) + if err != nil { + return err + } + return pprof.StartCPUProfile(f) + case "block": + runtime.SetBlockProfileRate(1) // Sampling every block event + return nil + case "mutex": + runtime.SetMutexProfileFraction(1) // Sampling every mutex event + return nil + default: + if profile := pprof.Lookup(profileName); profile == nil { + return fmt.Errorf("unknown profile type: '%s'", profileName) + } + return nil + } +} + +// flushProfiling writes the profiling data to the specified file. +// For heap profiles, it runs the GC before capturing the data. +// It stops the CPU profile if it was started. +func flushProfiling() error { + switch profileName { + case "none": + return nil + case "cpu": + pprof.StopCPUProfile() + return nil + case "heap": + runtime.GC() // Run garbage collection before writing heap profile + fallthrough + default: + profile := pprof.Lookup(profileName) + if profile == nil { + return errors.New("invalid profile type") + } + f, err := os.Create(profileOutput) + if err != nil { + return err + } + return profile.WriteTo(f, 0) + } +} diff --git a/tools/imctl/internal/imctl/cmd/version/version.go b/tools/imctl/internal/imctl/cmd/version/version.go new file mode 100644 index 000000000..c2636bfd2 --- /dev/null +++ b/tools/imctl/internal/imctl/cmd/version/version.go @@ -0,0 +1,165 @@ +// Copyright © 2023 OpenIM. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package version print the client and server version information. +package version + +import ( + "context" + "errors" + "fmt" + + "github.com/ghodss/yaml" + "github.com/openim-sigs/component-base/pkg/json" + "github.com/openim-sigs/component-base/pkg/version" + "github.com/spf13/cobra" + + "github.com/openimsdk/open-im-server/tools/imctl/internal/imctl/util/templates" + "github.com/openimsdk/open-im-server/tools/imctl/pkg/cli/genericclioptions" + cmdutil "github.com/openimsdk/open-im-server/tools/imctl/pkg/util" +) + +// Version is a struct for version information. +type Version struct { + ClientVersion *version.Info `json:"clientVersion,omitempty" yaml:"clientVersion,omitempty"` + ServerVersion *version.Info `json:"serverVersion,omitempty" yaml:"serverVersion,omitempty"` +} + +var versionExample = templates.Examples(` + # Print the client and server versions for the current context + imctl version`) + +// Options is a struct to support version command. +type Options struct { + ClientOnly bool + Short bool + Output string + + client *restclient.RESTClient + genericclioptions.IOStreams +} + +// NewOptions returns initialized Options. +func NewOptions(ioStreams genericclioptions.IOStreams) *Options { + return &Options{ + IOStreams: ioStreams, + } +} + +// NewCmdVersion returns a cobra command for fetching versions. +func NewCmdVersion(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { + o := NewOptions(ioStreams) + cmd := &cobra.Command{ + Use: "version", + Short: "Print the client and server version information", + Long: "Print the client and server version information for the current context", + Example: versionExample, + Run: func(cmd *cobra.Command, args []string) { + cmdutil.CheckErr(o.Complete(f, cmd)) + cmdutil.CheckErr(o.Validate()) + cmdutil.CheckErr(o.Run()) + }, + } + + cmd.Flags().BoolVar( + &o.ClientOnly, + "client", + o.ClientOnly, + "If true, shows client version only (no server required).", + ) + cmd.Flags().BoolVar(&o.Short, "short", o.Short, "If true, print just the version number.") + cmd.Flags().StringVarP(&o.Output, "output", "o", o.Output, "One of 'yaml' or 'json'.") + + return cmd +} + +// Complete completes all the required options. +func (o *Options) Complete(f cmdutil.Factory, cmd *cobra.Command) error { + var err error + if o.ClientOnly { + return nil + } + + o.client, err = f.RESTClient() + if err != nil { + return err + } + + return nil +} + +// Validate validates the provided options. +func (o *Options) Validate() error { + if o.Output != "" && o.Output != "yaml" && o.Output != "json" { + return errors.New(`--output must be 'yaml' or 'json'`) + } + + return nil +} + +// Run executes version command. +func (o *Options) Run() error { + var ( + serverVersion *version.Info + serverErr error + versionInfo Version + ) + + clientVersion := version.Get() + versionInfo.ClientVersion = &clientVersion + + if !o.ClientOnly && o.client != nil { + // Always request fresh data from the server + if err := o.client.Get().AbsPath("/version").Do(context.TODO()).Into(&serverVersion); err != nil { + return err + } + versionInfo.ServerVersion = serverVersion + } + + switch o.Output { + case "": + if o.Short { + fmt.Fprintf(o.Out, "Client Version: %s\n", clientVersion.GitVersion) + + if serverVersion != nil { + fmt.Fprintf(o.Out, "Server Version: %s\n", serverVersion.GitVersion) + } + } else { + fmt.Fprintf(o.Out, "Client Version: %s\n", fmt.Sprintf("%#v", clientVersion)) + if serverVersion != nil { + fmt.Fprintf(o.Out, "Server Version: %s\n", fmt.Sprintf("%#v", *serverVersion)) + } + } + case "yaml": + marshaled, err := yaml.Marshal(&versionInfo) + if err != nil { + return err + } + + fmt.Fprintln(o.Out, string(marshaled)) + case "json": + marshaled, err := json.MarshalIndent(&versionInfo, "", " ") + if err != nil { + return err + } + + fmt.Fprintln(o.Out, string(marshaled)) + default: + // There is a bug in the program if we hit this case. + // However, we follow a policy of never panicking. + return fmt.Errorf("VersionOptions were not validated: --output=%q should have been rejected", o.Output) + } + + return serverErr +} diff --git a/tools/infra/go.mod b/tools/infra/go.mod index acac79508..6ee10304b 100644 --- a/tools/infra/go.mod +++ b/tools/infra/go.mod @@ -1,3 +1,3 @@ -module github.com/OpenIMSDK/Open-IM-Server/tools/infra +module github.com/openimsdk/open-im-server/v3/tools/infra go 1.18 diff --git a/tools/ncpu/go.mod b/tools/ncpu/go.mod index 4173d306e..dfccea27a 100644 --- a/tools/ncpu/go.mod +++ b/tools/ncpu/go.mod @@ -1,4 +1,4 @@ -module github.com/OpenIMSDK/Open-IM-Server/tools/ncpu +module github.com/openimsdk/open-im-server/v3/tools/ncpu go 1.18 diff --git a/tools/openim-web/go.mod b/tools/openim-web/go.mod index 27d658d3b..6f30c673c 100644 --- a/tools/openim-web/go.mod +++ b/tools/openim-web/go.mod @@ -1,4 +1,4 @@ -module github.com/OpenIMSDK/Open-IM-Server/tools/openim-web +module github.com/openimsdk/open-im-server/v3/tools/openim-web go 1.18 diff --git a/tools/versionchecker/go.mod b/tools/versionchecker/go.mod index 1c189e604..5858649e8 100644 --- a/tools/versionchecker/go.mod +++ b/tools/versionchecker/go.mod @@ -1,3 +1,3 @@ -module github.com/OpenIMSDK/Open-IM-Server/tools/versionchecker +module github.com/openimsdk/open-im-server/v3/tools/versionchecker go 1.18 diff --git a/tools/yamlfmt/go.mod b/tools/yamlfmt/go.mod index 223264de8..5b3581efc 100644 --- a/tools/yamlfmt/go.mod +++ b/tools/yamlfmt/go.mod @@ -1,4 +1,4 @@ -module github.com/OpenIMSDK/Open-IM-Server/tools/yamlfmt +module github.com/openimsdk/open-im-server/v3/tools/yamlfmt go 1.18