From 58f591e5f69b51668fecf815eb5e0cb41122b1ba Mon Sep 17 00:00:00 2001
From: Xinwei Xiong <3293172751NSS@gmail.com>
Date: Wed, 23 Aug 2023 09:09:51 +0800
Subject: [PATCH] =?UTF-8?q?=E2=9C=A8Large=20refactoring=20projects:=20Open?=
=?UTF-8?q?IM=20automation,=20scripting,=20and=20openimctl=20refactoring?=
=?UTF-8?q?=20(#825)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: fix bin tools path
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: fix golang release file path
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: fix golang release file path
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: fix scripts and optimize
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: fix scripts path module
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: sync script code
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add lib and start scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* ci: add copyright scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* ci: add go-docs file and copyright scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add scripts cross ower
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* style: Formatting code make lint path
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* style: Formatting code make lint path
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* style: Formatting code make lint path
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* style: Formatting code make lint path
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: chat scripts path bug
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: channge smail images
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add makefile feature
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add config and images log
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* style: Migrate directory to remove docker to images
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* style: formatting style Code
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: set opneim's bash logs
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: option scripts and docs
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add git cherry
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add git cherry
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: save all bash and docs labels
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: scripts feature extend
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add config path config
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add config path config
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add feat scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add save scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add save scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add sctips help
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add start sctips help
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: save scripts file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: save all file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add openim server template file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add alot of system design
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: save all file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: save all file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add env config options
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add more robot details
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add more module explain
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add scripts environment details design
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add openim msgtransfer scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add openim msgtransfer scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add more design scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add file save
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add file save
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add rpc build and start
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add rpc build and start
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add rpc build and start
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: save all images file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add scripts set
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add test options
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: fix config path file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: update config file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: update config file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: update config file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: update config file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add readme docs
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: save build scripts
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add all actions file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add chat scripts name
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add all compose
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: commit tag
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: save server code
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add docker compose fix
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add docker compose fix
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add docker compose fix
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: save server code
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: optimize dockerfile option
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: optimize dockerfile option
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: optimize dockerfile option
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add all options
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add all options
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add more scrips
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add more options
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add more options
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add config path
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: Add some optimizations
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* fix: Add some optimizations
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: delele go work sum
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: delele go work sum
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* Delete go.work.sum
* feat: delele go work sum
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* Update .env
* feat: delele go work sum
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: delele go work sum
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: delele go work sum
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: delele go work sum
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add docker compose fix
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: add docker compose fix
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
* feat: delele go work sum
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---------
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
.dockerignore | 6 +-
.env | 4 +-
.github/release-drafter.yml | 51 ++
.github/sync.yml | 2 +-
.github/workflows/docker-buildx.yml | 26 +-
.github/workflows/golangci-lint.yml | 2 +-
.github/workflows/greetings.yml | 45 ++
.github/workflows/openimci.yml | 201 +++---
.github/workflows/release-drafter.yml | 55 ++
.github/workflows/release.yml | 7 +-
.github/workflows/scripts-test.yml | 89 ---
.github/workflows/sync.yml | 4 +
.gitignore | 9 +-
CHANGELOG/CHANGELOG-3.1.md | 87 +++
CHANGELOG/CHANGELOG.md | 61 ++
CONTRIBUTING.md | 4 +
Dockerfile | 9 +-
Makefile | 33 +-
README-zh_CN.md | 348 ++++++----
README.md | 112 +--
assets/demo/hello-openim.png | Bin 0 -> 49844 bytes
.goreleaser.yaml => build/goreleaser.yaml | 51 +-
.../{docker => images}/openim-api/Dockerfile | 7 +-
.../openim-cmdutils/Dockerfile | 4 +-
.../openim-crontask/Dockerfile | 2 +-
.../openim-msggateway/Dockerfile | 2 +-
.../openim-msgtransfer/Dockerfile | 2 +-
.../{docker => images}/openim-push/Dockerfile | 2 +-
.../openim-rpc-auth/Dockerfile | 2 +-
.../openim-rpc-conversation/Dockerfile | 2 +-
.../openim-rpc-friend/Dockerfile | 2 +-
.../openim-rpc-group/Dockerfile | 2 +-
.../openim-rpc-msg/Dockerfile | 2 +-
.../openim-rpc-third/Dockerfile | 2 +-
.../openim-rpc-user/Dockerfile | 2 +-
config/config-copy.yaml | 378 +++++++++++
config/config.yaml | 2 +-
deployments/README.md | 1 -
.../templates/env_template.yaml | 25 +-
deployments/templates/init/README.md | 220 ++++++
deployments/templates/init/openim-api.service | 16 +
.../templates/init/openim-cmdutils.service | 16 +
.../templates/init/openim-crontask.service | 16 +
.../templates/init/openim-msggateway.service | 15 +
.../templates/init/openim-msgtransfer.service | 15 +
.../templates/init/openim-push.service | 16 +
deployments/templates/init/openim-rpc.service | 15 +
deployments/templates/openim-api.yaml | 17 +
deployments/templates/openim.yaml | 387 +++++++++++
docker-compose.yaml | 71 +-
docs/.generated_docs | 4 -
docs/CODEOWNERS | 7 +-
docs/contrib/git_cherry-pick.md | 177 +++++
docs/contrib/init_config.md | 74 ++
docs/contrib/install_docker.md | 45 ++
docs/contrib/linux_development.md | 137 ++++
docs/contrib/local_actions.md | 14 +
docs/contrib/protoc_tools.md | 60 ++
docs/contrib/util_go.md | 8 +
docs/contrib/util_makefile.md | 90 +++
docs/contrib/util_scripts.md | 248 +++++++
docs/conversions/bash_log.md | 47 ++
.../cicd_actions.md} | 0
docs/conversions/go_code.md | 3 -
go.work | 5 +-
go.work.sum | 311 ---------
install_guide.sh | 2 +-
internal/api/user.go | 1 -
internal/tools/msg_doc_convert.go | 14 +
openim-chat/config/config.yaml | 104 ---
openim-chat/scripts/admin_rpc_start.sh | 65 --
openim-chat/scripts/build.cmd | 14 -
openim-chat/scripts/build_all_service.sh | 134 ----
openim-chat/scripts/check_all.sh | 49 --
openim-chat/scripts/docker_start_all.sh | 101 ---
openim-chat/scripts/githooks/commit-msg | 93 ---
openim-chat/scripts/githooks/pre-commit | 112 ---
openim-chat/scripts/githooks/pre-push | 120 ----
openim-chat/scripts/path_info.sh | 80 ---
openim-chat/scripts/start.bat | 5 -
openim-chat/scripts/start_all.sh | 105 ---
openim-chat/scripts/stop_all.sh | 47 --
openim-chat/scripts/style_info.sh | 66 --
pkg/apistruct/doc.go | 15 +
pkg/authverify/doc.go | 15 +
pkg/callbackstruct/doc.go | 15 +
pkg/common/cmd/doc.go | 15 +
pkg/common/config/doc.go | 15 +
pkg/common/convert/doc.go | 15 +
pkg/common/db/cache/doc.go | 15 +
pkg/common/db/controller/doc.go | 15 +
pkg/common/db/controller/user.go | 4 +-
pkg/common/db/localcache/doc.go | 15 +
pkg/common/db/relation/doc.go | 15 +
pkg/common/db/s3/cont/doc.go | 15 +
pkg/common/db/s3/cos/doc.go | 15 +
pkg/common/db/s3/doc.go | 15 +
pkg/common/db/s3/minio/doc.go | 15 +
pkg/common/db/s3/minio/image.go | 14 +
pkg/common/db/s3/minio/struct.go | 14 +
pkg/common/db/s3/oss/doc.go | 15 +
pkg/common/db/s3/oss/sign.go | 14 +
pkg/common/db/table/relation/doc.go | 15 +
pkg/common/db/table/unrelation/doc.go | 15 +
pkg/common/db/unrelation/doc.go | 15 +
pkg/common/db/unrelation/msg_convert.go | 14 +
pkg/common/http/doc.go | 15 +
pkg/common/kafka/doc.go | 15 +
pkg/common/locker/doc.go | 15 +
pkg/common/prome/doc.go | 15 +
pkg/common/startrpc/doc.go | 15 +
pkg/msgprocessor/doc.go | 15 +
pkg/rpcclient/doc.go | 15 +
pkg/rpcclient/notification/doc.go | 15 +
pkg/statistics/doc.go | 15 +
scripts/.spelling_failures | 6 +
scripts/LICENSE/LICENSE | 201 ------
scripts/LICENSE/LICENSE_TEMPLATES | 13 -
scripts/README.md | 209 +++++-
scripts/advertise.sh | 44 +-
scripts/batch_start_all.sh | 27 +-
scripts/build-all-service.sh | 78 +++
scripts/build_all_service.sh | 151 -----
scripts/build_push_k8s_images.sh | 46 --
scripts/check-all.sh | 83 +++
scripts/check_all.sh | 80 ---
scripts/cherry-pick.sh | 256 +++++++
scripts/common.sh | 3 +-
scripts/demo.sh | 92 +++
...eck_service.sh => docker-check-service.sh} | 21 +-
.../docker-start-all.sh | 25 +-
scripts/docker_start_all.sh | 60 --
scripts/enterprise/check_all.sh | 52 --
scripts/enterprise/path_info.cfg | 25 -
scripts/env_check.sh | 3 +-
scripts/environment.sh | 91 ---
scripts/function.sh | 34 -
scripts/gen-swagger-docs.sh | 73 ++
scripts/genconfig.sh | 22 +-
scripts/gendoc.sh | 78 +++
scripts/githooks/pre-commit | 2 +-
.golangci.yml => scripts/golangci.yml | 0
scripts/init-config.sh | 50 ++
scripts/init-env.sh | 31 +
scripts/init_pwd.sh | 3 +-
scripts/install-im-server.sh | 47 ++
scripts/install/README.md | 116 ++++
scripts/install/common.sh | 142 ++++
scripts/install/dependency.sh | 100 +++
scripts/install/environment.sh | 415 ++++++++++++
scripts/install/install-protobuf.sh | 116 ++++
scripts/install/install.sh | 149 ++++
scripts/install/openim-api.sh | 112 +++
scripts/install/openim-crontask.sh | 132 ++++
scripts/install/openim-man.sh | 96 +++
scripts/install/openim-msggateway.sh | 141 ++++
scripts/install/openim-msgtransfer.sh | 155 +++++
scripts/install/openim-push.sh | 153 +++++
scripts/install/openim-rpc.sh | 181 +++++
scripts/install/openim-tools.sh | 166 +++++
scripts/install/test.sh | 561 ++++++++++++++++
scripts/install/vimrc | 300 +++++++++
scripts/install_im_compose.sh | 140 ++--
scripts/install_im_server.sh | 85 ---
scripts/lib/chat.sh | 178 +++++
scripts/lib/color.sh | 120 +++-
scripts/lib/golang.sh | 131 +++-
scripts/lib/init.sh | 183 ++++-
scripts/lib/logging.sh | 82 ++-
scripts/lib/release.sh | 14 +-
scripts/lib/util.sh | 635 ++++++++++++++++--
scripts/lib/version.sh | 1 -
.../function.sh => list-feature-tests.sh} | 25 +-
scripts/make-rules/common.mk | 14 +-
scripts/make-rules/copyright.mk | 2 +-
scripts/make-rules/gen.mk | 17 +
scripts/make-rules/golang.mk | 72 +-
scripts/make-rules/image.mk | 47 +-
scripts/msg_gateway_start.sh | 82 ---
scripts/msg_transfer_start.sh | 72 --
scripts/path_info.sh | 141 ----
scripts/push_start.sh | 78 ---
scripts/run-in-gopath.sh | 34 +
scripts/start-all.sh | 74 ++
scripts/start_all.sh | 116 ----
scripts/start_component_check.sh | 42 --
scripts/start_cron.sh | 64 --
scripts/start_rpc_service.sh | 117 ----
scripts/stop-all.sh | 35 +
scripts/stop_all.sh | 41 --
scripts/style_info.sh | 67 --
.../LICENSE => scripts/template}/LICENSE | 0
.../template}/LICENSE_TEMPLATES | 0
scripts/template/boilerplate.txt | 3 +
scripts/template/footer.md.tmpl | 19 +
scripts/template/head.md.tmpl | 31 +
scripts/template/project_README.md | 41 ++
scripts/update-generated-docs.sh | 49 ++
scripts/update-yamlfmt.sh | 43 ++
scripts/verify-pkg-names.sh | 35 +
scripts/verify-shellcheck.sh | 139 ++++
scripts/verify-spelling.sh | 41 ++
scripts/verify-typecheck.sh | 41 ++
scripts/verify-yamlfmt.sh | 48 ++
scripts/wait-for-it.sh | 48 +-
test/README.md | 15 +
test/jwt/main.go | 48 ++
test/testdata/README.md | 64 ++
test/testdata/db/messages.json | 0
test/testdata/db/users.json | 0
test/testdata/requests/login.json | 0
test/testdata/requests/register.json | 0
test/testdata/requests/sendMessage.json | 0
test/testdata/responses/login.json | 0
test/testdata/responses/register.json | 0
test/testdata/responses/sendMessage.json | 0
test/typecheck/README.md | 27 +
test/typecheck/go.mod | 10 +
test/typecheck/go.sum | 7 +
test/typecheck/typecheck.go | 320 +++++++++
test/typecheck/typecheck_test.go | 121 ++++
test/wrktest.sh | 29 +-
tools/README.md | 20 -
tools/changelog/changelog.go | 308 +++++++++
tools/changelog/go.mod | 3 +
tools/component/{main.go => component.go} | 114 ++--
tools/imctl/README.md | 47 ++
tools/imctl/cmd/genman/README.md | 49 ++
tools/imctl/cmd/genman/genman.go | 63 ++
tools/imctl/cmd/imctl/imctl.go | 29 +
tools/imctl/go.mod | 19 +
tools/imctl/go.sum | 26 +
tools/imctl/internal/imctl/cmd/cmd.go | 133 ++++
tools/imctl/internal/imctl/cmd/profiling.go | 95 +++
.../imctl/util/interrupt/interrupt.go | 103 +++
.../imctl/util/templates/command_groups.go | 57 ++
.../internal/imctl/util/templates/markdown.go | 149 ++++
.../imctl/util/templates/normalizers.go | 99 +++
.../imctl/util/templates/templater.go | 296 ++++++++
.../imctl/util/templates/templates.go | 103 +++
.../imctl/internal/imctl/util/term/resize.go | 53 ++
tools/imctl/internal/imctl/util/term/term.go | 37 +
.../internal/imctl/util/term/term_writer.go | 124 ++++
.../imctl/util/term/term_writer_test.go | 114 ++++
tools/infra/infra.go | 40 ++
tools/infra/main.go | 26 -
tools/ncpu/README.md | 47 ++
tools/ncpu/main.go | 13 -
tools/ncpu/ncpu.go | 27 +
tools/ncpu/ncpu_test.go | 35 +
tools/yamlfmt/OWNERS | 10 +
tools/yamlfmt/go.mod | 8 +
tools/yamlfmt/go.sum | 6 +
tools/yamlfmt/yamlfmt.go | 72 ++
tools/yamlfmt/yamlfmt_test.go | 158 +++++
255 files changed, 12457 insertions(+), 4111 deletions(-)
create mode 100644 .github/release-drafter.yml
create mode 100644 .github/workflows/greetings.yml
create mode 100644 .github/workflows/release-drafter.yml
delete mode 100644 .github/workflows/scripts-test.yml
create mode 100644 CHANGELOG/CHANGELOG-3.1.md
create mode 100644 assets/demo/hello-openim.png
rename .goreleaser.yaml => build/goreleaser.yaml (78%)
rename build/{docker => images}/openim-api/Dockerfile (85%)
rename build/{docker => images}/openim-cmdutils/Dockerfile (86%)
rename build/{docker => images}/openim-crontask/Dockerfile (93%)
rename build/{docker => images}/openim-msggateway/Dockerfile (92%)
rename build/{docker => images}/openim-msgtransfer/Dockerfile (94%)
rename build/{docker => images}/openim-push/Dockerfile (93%)
rename build/{docker => images}/openim-rpc-auth/Dockerfile (91%)
rename build/{docker => images}/openim-rpc-conversation/Dockerfile (92%)
rename build/{docker => images}/openim-rpc-friend/Dockerfile (92%)
rename build/{docker => images}/openim-rpc-group/Dockerfile (92%)
rename build/{docker => images}/openim-rpc-msg/Dockerfile (92%)
rename build/{docker => images}/openim-rpc-third/Dockerfile (93%)
rename build/{docker => images}/openim-rpc-user/Dockerfile (93%)
create mode 100644 config/config-copy.yaml
rename openim-chat/scripts/function.sh => deployments/templates/env_template.yaml (58%)
create mode 100644 deployments/templates/init/README.md
create mode 100644 deployments/templates/init/openim-api.service
create mode 100644 deployments/templates/init/openim-cmdutils.service
create mode 100644 deployments/templates/init/openim-crontask.service
create mode 100644 deployments/templates/init/openim-msggateway.service
create mode 100644 deployments/templates/init/openim-msgtransfer.service
create mode 100644 deployments/templates/init/openim-push.service
create mode 100644 deployments/templates/init/openim-rpc.service
create mode 100644 deployments/templates/openim-api.yaml
create mode 100644 deployments/templates/openim.yaml
create mode 100644 docs/contrib/git_cherry-pick.md
create mode 100644 docs/contrib/init_config.md
create mode 100644 docs/contrib/install_docker.md
create mode 100644 docs/contrib/linux_development.md
create mode 100644 docs/contrib/local_actions.md
create mode 100644 docs/contrib/protoc_tools.md
create mode 100644 docs/contrib/util_go.md
create mode 100644 docs/contrib/util_makefile.md
create mode 100644 docs/contrib/util_scripts.md
create mode 100644 docs/conversions/bash_log.md
rename docs/{contrib/cicd-actions.md => conversions/cicd_actions.md} (100%)
delete mode 100644 go.work.sum
delete mode 100644 openim-chat/config/config.yaml
delete mode 100644 openim-chat/scripts/admin_rpc_start.sh
delete mode 100644 openim-chat/scripts/build.cmd
delete mode 100644 openim-chat/scripts/build_all_service.sh
delete mode 100644 openim-chat/scripts/check_all.sh
delete mode 100644 openim-chat/scripts/docker_start_all.sh
delete mode 100644 openim-chat/scripts/githooks/commit-msg
delete mode 100644 openim-chat/scripts/githooks/pre-commit
delete mode 100644 openim-chat/scripts/githooks/pre-push
delete mode 100644 openim-chat/scripts/path_info.sh
delete mode 100644 openim-chat/scripts/start.bat
delete mode 100644 openim-chat/scripts/start_all.sh
delete mode 100644 openim-chat/scripts/stop_all.sh
delete mode 100644 openim-chat/scripts/style_info.sh
create mode 100644 pkg/apistruct/doc.go
create mode 100644 pkg/authverify/doc.go
create mode 100644 pkg/callbackstruct/doc.go
create mode 100644 pkg/common/cmd/doc.go
create mode 100644 pkg/common/config/doc.go
create mode 100644 pkg/common/convert/doc.go
create mode 100644 pkg/common/db/cache/doc.go
create mode 100644 pkg/common/db/controller/doc.go
create mode 100644 pkg/common/db/localcache/doc.go
create mode 100644 pkg/common/db/relation/doc.go
create mode 100644 pkg/common/db/s3/cont/doc.go
create mode 100644 pkg/common/db/s3/cos/doc.go
create mode 100644 pkg/common/db/s3/doc.go
create mode 100644 pkg/common/db/s3/minio/doc.go
create mode 100644 pkg/common/db/s3/oss/doc.go
create mode 100644 pkg/common/db/table/relation/doc.go
create mode 100644 pkg/common/db/table/unrelation/doc.go
create mode 100644 pkg/common/db/unrelation/doc.go
create mode 100644 pkg/common/http/doc.go
create mode 100644 pkg/common/kafka/doc.go
create mode 100644 pkg/common/locker/doc.go
create mode 100644 pkg/common/prome/doc.go
create mode 100644 pkg/common/startrpc/doc.go
create mode 100644 pkg/msgprocessor/doc.go
create mode 100644 pkg/rpcclient/doc.go
create mode 100644 pkg/rpcclient/notification/doc.go
create mode 100644 pkg/statistics/doc.go
create mode 100644 scripts/.spelling_failures
delete mode 100644 scripts/LICENSE/LICENSE
delete mode 100644 scripts/LICENSE/LICENSE_TEMPLATES
create mode 100755 scripts/build-all-service.sh
delete mode 100755 scripts/build_all_service.sh
delete mode 100755 scripts/build_push_k8s_images.sh
create mode 100755 scripts/check-all.sh
delete mode 100755 scripts/check_all.sh
create mode 100755 scripts/cherry-pick.sh
create mode 100755 scripts/demo.sh
rename scripts/{docker_check_service.sh => docker-check-service.sh} (80%)
rename openim-chat/scripts/build_docker.sh => scripts/docker-start-all.sh (54%)
mode change 100644 => 100755
delete mode 100755 scripts/docker_start_all.sh
delete mode 100755 scripts/enterprise/check_all.sh
delete mode 100644 scripts/enterprise/path_info.cfg
delete mode 100755 scripts/environment.sh
delete mode 100755 scripts/function.sh
create mode 100755 scripts/gen-swagger-docs.sh
create mode 100755 scripts/gendoc.sh
rename .golangci.yml => scripts/golangci.yml (100%)
create mode 100755 scripts/init-config.sh
create mode 100755 scripts/init-env.sh
create mode 100755 scripts/install-im-server.sh
create mode 100644 scripts/install/README.md
create mode 100755 scripts/install/common.sh
create mode 100755 scripts/install/dependency.sh
create mode 100755 scripts/install/environment.sh
create mode 100755 scripts/install/install-protobuf.sh
create mode 100755 scripts/install/install.sh
create mode 100755 scripts/install/openim-api.sh
create mode 100755 scripts/install/openim-crontask.sh
create mode 100755 scripts/install/openim-man.sh
create mode 100755 scripts/install/openim-msggateway.sh
create mode 100755 scripts/install/openim-msgtransfer.sh
create mode 100755 scripts/install/openim-push.sh
create mode 100755 scripts/install/openim-rpc.sh
create mode 100755 scripts/install/openim-tools.sh
create mode 100755 scripts/install/test.sh
create mode 100644 scripts/install/vimrc
delete mode 100755 scripts/install_im_server.sh
create mode 100755 scripts/lib/chat.sh
rename scripts/{enterprise/function.sh => list-feature-tests.sh} (67%)
delete mode 100755 scripts/msg_gateway_start.sh
delete mode 100755 scripts/msg_transfer_start.sh
delete mode 100755 scripts/path_info.sh
delete mode 100755 scripts/push_start.sh
create mode 100755 scripts/run-in-gopath.sh
create mode 100755 scripts/start-all.sh
delete mode 100755 scripts/start_all.sh
delete mode 100644 scripts/start_component_check.sh
delete mode 100755 scripts/start_cron.sh
delete mode 100755 scripts/start_rpc_service.sh
create mode 100755 scripts/stop-all.sh
delete mode 100755 scripts/stop_all.sh
delete mode 100755 scripts/style_info.sh
rename {openim-chat/scripts/LICENSE => scripts/template}/LICENSE (100%)
rename {openim-chat/scripts/LICENSE => scripts/template}/LICENSE_TEMPLATES (100%)
create mode 100644 scripts/template/boilerplate.txt
create mode 100644 scripts/template/footer.md.tmpl
create mode 100644 scripts/template/head.md.tmpl
create mode 100644 scripts/template/project_README.md
create mode 100755 scripts/update-generated-docs.sh
create mode 100755 scripts/update-yamlfmt.sh
create mode 100755 scripts/verify-pkg-names.sh
create mode 100755 scripts/verify-shellcheck.sh
create mode 100755 scripts/verify-spelling.sh
create mode 100755 scripts/verify-typecheck.sh
create mode 100755 scripts/verify-yamlfmt.sh
create mode 100644 test/README.md
create mode 100644 test/jwt/main.go
create mode 100644 test/testdata/README.md
create mode 100644 test/testdata/db/messages.json
create mode 100644 test/testdata/db/users.json
create mode 100644 test/testdata/requests/login.json
create mode 100644 test/testdata/requests/register.json
create mode 100644 test/testdata/requests/sendMessage.json
create mode 100644 test/testdata/responses/login.json
create mode 100644 test/testdata/responses/register.json
create mode 100644 test/testdata/responses/sendMessage.json
create mode 100644 test/typecheck/README.md
create mode 100644 test/typecheck/go.mod
create mode 100644 test/typecheck/go.sum
create mode 100644 test/typecheck/typecheck.go
create mode 100644 test/typecheck/typecheck_test.go
create mode 100644 tools/changelog/changelog.go
create mode 100644 tools/changelog/go.mod
rename tools/component/{main.go => component.go} (71%)
create mode 100644 tools/imctl/README.md
create mode 100644 tools/imctl/cmd/genman/README.md
create mode 100644 tools/imctl/cmd/genman/genman.go
create mode 100644 tools/imctl/cmd/imctl/imctl.go
create mode 100644 tools/imctl/go.mod
create mode 100644 tools/imctl/go.sum
create mode 100644 tools/imctl/internal/imctl/cmd/cmd.go
create mode 100644 tools/imctl/internal/imctl/cmd/profiling.go
create mode 100644 tools/imctl/internal/imctl/util/interrupt/interrupt.go
create mode 100644 tools/imctl/internal/imctl/util/templates/command_groups.go
create mode 100644 tools/imctl/internal/imctl/util/templates/markdown.go
create mode 100644 tools/imctl/internal/imctl/util/templates/normalizers.go
create mode 100644 tools/imctl/internal/imctl/util/templates/templater.go
create mode 100644 tools/imctl/internal/imctl/util/templates/templates.go
create mode 100644 tools/imctl/internal/imctl/util/term/resize.go
create mode 100644 tools/imctl/internal/imctl/util/term/term.go
create mode 100644 tools/imctl/internal/imctl/util/term/term_writer.go
create mode 100644 tools/imctl/internal/imctl/util/term/term_writer_test.go
create mode 100644 tools/infra/infra.go
delete mode 100644 tools/infra/main.go
create mode 100644 tools/ncpu/README.md
delete mode 100644 tools/ncpu/main.go
create mode 100644 tools/ncpu/ncpu.go
create mode 100644 tools/ncpu/ncpu_test.go
create mode 100644 tools/yamlfmt/OWNERS
create mode 100644 tools/yamlfmt/go.mod
create mode 100644 tools/yamlfmt/go.sum
create mode 100644 tools/yamlfmt/yamlfmt.go
create mode 100644 tools/yamlfmt/yamlfmt_test.go
diff --git a/.dockerignore b/.dockerignore
index 9faeff616..8e6a7c121 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,4 +1,4 @@
-# Ignore files and directories starting with a dot
+
diff --git a/.env b/.env
index 412b75076..a4b5aaabc 100644
--- a/.env
+++ b/.env
@@ -1,5 +1,5 @@
USER=root
PASSWORD=openIM123
MINIO_ENDPOINT=http://127.0.0.1:10005
-API_URL=http://127.0.0.1:10002/object/
-DATA_DIR=./
\ No newline at end of file
+API_URL=http://127.0.0.1:10002
+DATA_DIR=./
diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml
new file mode 100644
index 000000000..154386ff5
--- /dev/null
+++ b/.github/release-drafter.yml
@@ -0,0 +1,51 @@
+# 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.
+
+name-template: 'v$RESOLVED_VERSION 🌈'
+tag-template: 'v$RESOLVED_VERSION'
+categories:
+ - title: '🚀 Features'
+ labels:
+ - 'feature'
+ - 'enhancement'
+ - title: '🐛 Bug Fixes'
+ labels:
+ - 'kind/fix'
+ - 'kind/feature'
+ - 'enhancement'
+ - 'kind/documentation'
+ - 'good first issue'
+ - title: '🧰 Maintenance'
+ label: 'chore'
+change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
+change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
+version-resolver:
+ major:
+ labels:
+ - 'major'
+ minor:
+ labels:
+ - 'minor'
+ patch:
+ labels:
+ - 'patch'
+ default: patch
+template: |
+ ## Changes $PREVIOUS_TAG
+
+ $CHANGES
+
+ ## Contributors to this $REPOSITORY release
+
+ $CONTRIBUTORS
\ No newline at end of file
diff --git a/.github/sync.yml b/.github/sync.yml
index 12b1c021f..6aa6dd566 100644
--- a/.github/sync.yml
+++ b/.github/sync.yml
@@ -97,7 +97,7 @@ group:
OpenIMSDK/community
OpenIMSDK/openim-charts
OpenIMSDK/openim-sdk-cpp@main
- files:
+ files:
- source: LICENSE
dest: LICENSE
replace: false
diff --git a/.github/workflows/docker-buildx.yml b/.github/workflows/docker-buildx.yml
index 3d1b3015f..6ca47e924 100644
--- a/.github/workflows/docker-buildx.yml
+++ b/.github/workflows/docker-buildx.yml
@@ -95,7 +95,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-api/Dockerfile
+ file: ./build/images/openim-api/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta1.outputs.tags }}
@@ -113,7 +113,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-cmdutils/Dockerfile
+ file: ./build/images/openim-cmdutils/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta2.outputs.tags }}
@@ -131,7 +131,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-crontask/Dockerfile
+ file: ./build/images/openim-crontask/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta3.outputs.tags }}
@@ -149,7 +149,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-msggateway/Dockerfile
+ file: ./build/images/openim-msggateway/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta4.outputs.tags }}
@@ -167,7 +167,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-msgtransfer/Dockerfile
+ file: ./build/images/openim-msgtransfer/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta5.outputs.tags }}
@@ -185,7 +185,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-push/Dockerfile
+ file: ./build/images/openim-push/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta6.outputs.tags }}
@@ -203,7 +203,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-rpc-auth/Dockerfile
+ file: ./build/images/openim-rpc-auth/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta7.outputs.tags }}
@@ -221,7 +221,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-rpc-conversation/Dockerfile
+ file: ./build/images/openim-rpc-conversation/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta8.outputs.tags }}
@@ -239,7 +239,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-rpc-friend/Dockerfile
+ file: ./build/images/openim-rpc-friend/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta9.outputs.tags }}
@@ -257,7 +257,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-rpc-group/Dockerfile
+ file: ./build/images/openim-rpc-group/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta10.outputs.tags }}
@@ -275,7 +275,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-rpc-msg/Dockerfile
+ file: ./build/images/openim-rpc-msg/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta11.outputs.tags }}
@@ -293,7 +293,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-rpc-third/Dockerfile
+ file: ./build/images/openim-rpc-third/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta12.outputs.tags }}
@@ -311,7 +311,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
- file: ./build/docker/openim-rpc-user/Dockerfile
+ file: ./build/images/openim-rpc-user/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta13.outputs.tags }}
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
index adf33d8d4..ba600f1f7 100644
--- a/.github/workflows/golangci-lint.yml
+++ b/.github/workflows/golangci-lint.yml
@@ -42,7 +42,7 @@ jobs:
#
# Note: by default the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
- # args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0
+ args: --timeout=30m --config=/scripts/golangci.yml # --issues-exit-code=0
# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml
new file mode 100644
index 000000000..47a58d2b6
--- /dev/null
+++ b/.github/workflows/greetings.yml
@@ -0,0 +1,45 @@
+# Copyright © 2023 OpenIM. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: first-interaction
+
+on:
+ issues:
+ types: [opened]
+ pull_request:
+ branches: [main]
+ types: [opened]
+
+jobs:
+ check_for_first_interaction:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/first-interaction@main
+ with:
+ repo-token: ${{ secrets.BOT_GITHUB_TOKEN }}
+ issue-message: |
+ Hello! Thank you for filing an issue.
+
+ If this is a bug report, please include relevant logs to help us debug the problem.
+
+ [Join slack 🤖](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg) to connect and communicate with our developers.
+ pr-message: |
+ Hello! Thank you for your contribution.
+
+ If you are fixing a bug, please reference the issue number in the description.
+
+ If you are implementing a feature request, please check with the maintainers that the feature will be accepted first.
+
+ [Join slack 🤖](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg) to connect and communicate with our developers.
\ No newline at end of file
diff --git a/.github/workflows/openimci.yml b/.github/workflows/openimci.yml
index d172eb251..54c30e4d8 100644
--- a/.github/workflows/openimci.yml
+++ b/.github/workflows/openimci.yml
@@ -36,124 +36,99 @@ env:
GO_VERSION: "1.19"
GOLANGCI_VERSION: "v1.50.1"
+
jobs:
openim:
name: Test with go ${{ matrix.go_version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
- # Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
environment:
name: openim
strategy:
matrix:
- go_version: ["1.18","1.19","1.20"]
+ go_version: ["1.18","1.19","1.20","1.21"]
os: [ubuntu-latest]
steps:
- - name: Set up Go ${{ matrix.go_version }}
- uses: actions/setup-go@v4
- with:
- go-version: ${{ matrix.go_version }}
- id: go
+ - name: Setup
+ uses: actions/checkout@v3
+
+ - name: Set up Go ${{ matrix.go_version }}
+ uses: actions/setup-go@v4
+ with:
+ go-version: ${{ matrix.go_version }}
+ id: go
- - name: Check out code into the Go module directory
- uses: actions/checkout@v3
+ - name: Install Task
+ uses: arduino/setup-task@v1
+ with:
+ version: 2.x
- - name: Install Task
- uses: arduino/setup-task@v1
- with:
- version: 2.x
+ - name: Module Operations
+ run: |
+ sudo make tidy
+ sudo make tools.verify.go-gitlint
- - name: Run go modules tidy
- run: |
- sudo make tidy
- sudo make tools.verify.go-gitlint
- echo "Run go modules tidy successfully"
+ - name: Format Code
+ run: sudo make format
+ continue-on-error: true
- - name: Run go format
- run: |
- sudo make format
- echo "Run go format successfully"
- continue-on-error: true
+ - name: Generate Files
+ run: make gen
+ continue-on-error: true
- - name: Generate all necessary files, such as error code files
- run: |
- make generate
- echo "Generate all necessary files successfully"
- continue-on-error: true
+ - name: Build Source
+ run: sudo make build
- - name: Run unit test and get test coverage
- run: |
- make cover
- echo "Run unit test and get test coverage successfully"
- continue-on-error: true
+ - name: Cleanup Build
+ run: sudo make clean
- - name: Build source code for host platform
- run: |
- sudo make build
- echo "Build source code for host platform successfully"
+ - name: Push Changes to Main
+ uses: stefanzweifel/git-auto-commit-action@v4
+ with:
+ commit_message: "cicd: robot automated Change"
+ branch: main
+ continue-on-error: true
- - name: OpenIM verify copyright
- run: |
- sudo make verify-copyright
- sudo make add-copyright
- echo "OpenIM verify successfully"
- continue-on-error: true
+ - name: Set Current Directory
+ id: set_directory
+ run: echo "::set-output name=directory::$(pwd)"
+ continue-on-error: true
- - name: Clean all build
- run: |
- sudo make clean
- echo "Clean all build successfully"
-
- - name: push OpenIM
- uses: stefanzweifel/git-auto-commit-action@v4
- with:
- commit_message: "cicd: robot automated Change"
- # commit_options: '--no-verify --signoff'
- branch: main
- # create_branch: true
- # # Optional commit user and author settings
- # commit_user_name: kubbot # defaults to "github-actions[bot]"
- # commit_user_email: 3293172751ysy@gmail.com # defaults to "41898282+github-actions[bot]@users.noreply.github.com"
- # commit_author: Kubbot # defaults to author of the commit that triggered the run
- continue-on-error: true
-
- - name: Commit Changes
- uses: stefanzweifel/git-auto-commit-action@v4
- with:
- commit_message: "chore(fmt): robot automated format and lint Change"
- commit_options: '--no-verify --signoff'
- branch: main
- continue-on-error: true
-
- - name: Set Current Directory
- id: set_directory
- run: |
- echo "::set-output name=directory::$(pwd)"
- continue-on-error: true
-
- - name: Collect Test Coverage File
- id: collect_coverage
- run: |
- cd ${{ steps.set_directory.outputs.directory }}
- make cover
- echo "::set-output name=coverage_file::./_output/tmp/coverage.out"
- continue-on-error: true
-
- - name: Display Test Coverage
- run: |
- echo "Test Coverage:"
- cat ${{ steps.collect_coverage.outputs.coverage_file }}
- continue-on-error: true
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v2
- continue-on-error: true
+ - name: Collect and Display Test Coverage
+ id: collect_coverage
+ run: |
+ cd ${{ steps.set_directory.outputs.directory }}
+ make cover
+ echo "::set-output name=coverage_file::./_output/tmp/coverage.out"
+ echo "Test Coverage:"
+ cat ${{ steps.collect_coverage.outputs.coverage_file }}
+ continue-on-error: true
openim-start:
- name: Teat OpenIM make install start on ${{ matrix.os }}
+ name: Test OpenIM install/start on ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ environment:
+ name: openim
+ strategy:
+ matrix:
+ go_version: ["1.21"]
+ os: ["ubuntu-latest"]
+ steps:
+ - name: Checkout and Install OpenIM
+ uses: actions/checkout@v3
+ - name: Install Task
+ uses: arduino/setup-task@v1
+ with:
+ version: 2.x
+ - name: Run OpenIM make install start
+ run: |
+ sudo make install
+
+ execute-scripts:
+ name: Execute OpenIM script on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
environment:
name: openim
@@ -162,15 +137,35 @@ jobs:
go_version: ["1.20"]
os: ["ubuntu-latest"]
steps:
- - name: Set up Go ${{ matrix.go_version }}
- uses: actions/setup-go@v4
- with:
- go-version: ${{ matrix.go_version }}
- id: go
+ - name: Checkout code
+ uses: actions/checkout@v3
- - name: Check out code into the Go module directory
- uses: actions/checkout@v3
+ - name: Set up Go ${{ matrix.go_version }}
+ uses: actions/setup-go@v4
+ with:
+ go-version: ${{ matrix.go_version }}
+ id: go
+ - name: Install Task
+ uses: arduino/setup-task@v1
+ with:
+ version: 2.x
+ - name: Docker Operations
+ run: |
+ curl -o docker-compose.yaml https://gist.githubusercontent.com/cubxxw/b1d5cbd2edfa23fee911118aa3e8249e/raw/openim-server.sh
+ sudo docker compose up -d
+ sudo sleep 60
- - name: Run OpenIM make install start
- run: |
- sudo make install
\ No newline at end of file
+ - name: Module Operations
+ run: |
+ sudo make tidy
+ sudo make tools.verify.go-gitlint
+
+ - name: Build, Start and Check Services
+ run: |
+ make build
+ make start
+ make check
+
+ - name: Print OpenIM Logs
+ run: sudo cat ./_output/logs/* 2>/dev/null
+ continue-on-error: true
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
new file mode 100644
index 000000000..0b014990e
--- /dev/null
+++ b/.github/workflows/release-drafter.yml
@@ -0,0 +1,55 @@
+# 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.
+
+name: Release Drafter
+
+on:
+ push:
+ # branches to consider in the event; optional, defaults to all
+ branches:
+ - master
+ # pull_request event is required only for autolabeler
+ pull_request:
+ # Only following types are handled by the action, but one can default to all as well
+ types: [opened, reopened, synchronize]
+ # pull_request_target event is required for autolabeler to support PRs from forks
+ # pull_request_target:
+ # types: [opened, reopened, synchronize]
+
+permissions:
+ contents: read
+
+jobs:
+ update_release_draft:
+ permissions:
+ # write permission is required to create a github release
+ contents: write
+ # write permission is required for autolabeler
+ # otherwise, read permission is required at least
+ pull-requests: write
+ runs-on: ubuntu-latest
+ steps:
+ # (Optional) GitHub Enterprise requires GHE_HOST variable set
+ #- name: Set GHE_HOST
+ # run: |
+ # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
+
+ # Drafts your next Release notes as Pull Requests are merged into "master"
+ - uses: release-drafter/release-drafter@v5
+ # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
+ # with:
+ # config-name: my-config.yml
+ # disable-autolabeler: true
+ env:
+ GITHUB_TOKEN: ${{ secrets.REDBOT_GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index fd019c4df..62b89e837 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-name: OpenIM Server Release
+name: OpenIM Server Release Workflow
on:
push:
@@ -43,9 +43,12 @@ jobs:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
- args: release --clean
+ 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
env:
+ USERNAME: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
+ FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro'
# distribution:
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
diff --git a/.github/workflows/scripts-test.yml b/.github/workflows/scripts-test.yml
deleted file mode 100644
index 44b217c59..000000000
--- a/.github/workflows/scripts-test.yml
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright © 2023 OpenIM. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-name: OpenIM Start Execute Scripts
-
-on:
- push:
- branches:
- - main
- paths-ignore:
- - "docs/**"
- - "README.md"
- - "README_zh-CN.md"
- - "CONTRIBUTING.md"
- pull_request:
- branches:
- - main
- paths-ignore:
- - "README.md"
- - "README_zh-CN.md"
- - "CONTRIBUTING.md"
- - "docs/**"
-
-jobs:
- execute-scripts:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
-
- - name: Download Docker Compose
- run: |
- curl -o docker-compose.yaml https://gist.githubusercontent.com/cubxxw/b1d5cbd2edfa23fee911118aa3e8249e/raw/openim-server.sh
- shell: bash
-
- - name: Start Docker Compose
- run: |
- sudo docker compose up -d
- sudo sleep 60
- continue-on-error: true
-
- - name: Stop all services
- run: |
- sudo chmod +x ./scripts/stop_all.sh
- sudo ./scripts/stop_all.sh
- sudo cat logs/openIM.log 2>/dev/null
- shell: bash
- continue-on-error: true
-
- - name: Build all services
- run: |
- sudo chmod +x ./scripts/build_all_service.sh
- sudo ./scripts/build_all_service.sh
- sudo cat logs/openIM.log 2>/dev/null
- shell: bash
-
- - name: Start all services
- run: |
- sudo chmod +x ./scripts/start_all.sh
- sudo ./scripts/start_all.sh
- sudo cat logs/openIM.log 2>/dev/null
- continue-on-error: true
- shell: bash
-
- - name: Check all services
- run: |
- sudo chmod +x ./scripts/check_all.sh
- sudo ./scripts/check_all.sh
- sudo cat logs/openIM.log 2>/dev/null
- shell: bash
-
- - name: Print openIM.log
- run: |
- sudo cat logs/* 2>/dev/null
- sudo cat logs/* 2>/dev/null >> "$GITHUB_OUTPUT"
- shell: bash
- continue-on-error: true
diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml
index d6e15bf23..b9e67d438 100644
--- a/.github/workflows/sync.yml
+++ b/.github/workflows/sync.yml
@@ -6,6 +6,10 @@
name: Synchronize kubecub public code to other repositories
on:
push:
+ paths:
+ - scripts/*
+ - docs/*
+ - config/*
branches:
- main
workflow_dispatch:
diff --git a/.gitignore b/.gitignore
index bb9e8e8c0..97d62f5fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,12 @@ bin/
output/
_output/
+### OpenIM Config ###
+config/config.yaml
+./config/config.yaml
+.env
+./.env
+
### OpenIM deploy ###
deploy/openim_demo
deploy/openim-api
@@ -153,10 +159,11 @@ flycheck_*.el
*.out
# Dependency directories (remove the comment below to include it)
-# vendor/
+vendor/
# Go workspace file
# go.work
+go.work.sum
### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
diff --git a/CHANGELOG/CHANGELOG-3.1.md b/CHANGELOG/CHANGELOG-3.1.md
new file mode 100644
index 000000000..c51eb2098
--- /dev/null
+++ b/CHANGELOG/CHANGELOG-3.1.md
@@ -0,0 +1,87 @@
+# Version logging for OpenIM
+
+
+
+- [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.2-beta.3] - 2023-08-09
+
+
+## [v3.1.2-beta.2] - 2023-08-09
+
+
+## [v3.1.2-beta.1] - 2023-08-09
+
+
+## [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))
+
+### 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
diff --git a/CHANGELOG/CHANGELOG.md b/CHANGELOG/CHANGELOG.md
index 822e9bc92..6ca4d08b2 100644
--- a/CHANGELOG/CHANGELOG.md
+++ b/CHANGELOG/CHANGELOG.md
@@ -3,6 +3,8 @@
- [Changelog](#changelog)
- [OpenIM versioning policy](#openim-versioning-policy)
- [command](#command)
+ - [install](#install)
+ - [User](#user)
- [create next tag](#create-next-tag)
- [Release version logs](#release-version-logs)
- [Introduction](#introduction)
@@ -22,10 +24,68 @@ All notable changes to this project will be documented in this file.
## command
+To use git-chglog you need to configure:
+
+1. CHANGELOG templates
+2. git-chglog configuration
+
+### install
+
+```bash
+$ go get github.com/git-chglog/git-chglog/cmd/git-chglog
+```
+
+
+## User
+
+```bash
+$ git-chglog --init
+```
+
+**Options**
+
+- 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:
+
+
-
- Open IM Server
+
-
- ⭐️ Open source Instant Messaging Server ⭐️
-
+
+
+ ⭐️ Open source Instant Messaging Server ⭐️
@@ -18,164 +21,220 @@
+
- English • - 中文 + English • + 简体中文 • + Docs
+ -## Open-IM-Server 是什么 +## ✨ 关于 OpenIM -Open-IM-Server 是一款即时通讯服务器,使用纯 Golang 开发,采用 JSON over WebSocket 传输协议。在 Open-IM-Server 中,所有东西都是消息,因此您可以轻松扩展自定义消息,而无需修改服务器代码。使用微服务架构,Open-IM-Server 可以使用集群进行部署。通过在服务器上部署 Open-IM-Server,开发人员可以快速地将即时通讯和实时网络功能集成到自己的应用程序中,并确保业务数据的安全性和隐私性。 +Open-IM-Server 是使用纯 Golang 精心制作的强大的即时消息服务器。其通过 JSON over WebSocket 进行通信的独特方法将每次交互都视为消息。这简化了定制并消除了修改服务器代码的需求。通过利用微服务架构,服务器可以通过集群部署,保证出色的性能和可伸缩性。 -Open-IM-Server并不是一个独立的产品,本身不包含账号的注册和登录服务。 -为方便大家测试,我们开源了包括登录注册功能的 [chat 仓库](https://github.com/OpenIMSDK/chat),chat 业务服务端和 Open-IM-Server 一起部署,即可搭建一个聊天产品。 +Open-IM-Server 不仅仅是一个即时消息服务器;它是将实时网络集成到您的应用程序中的强大工具,定位为您集成的首选选择!🚀 -## 特点 +请注意,Open-IM-Server 不作为独立产品运行,也不提供内置的帐户注册或登录服务。为了简化您的实施过程,我们已开源了 [chat repository](https://github.com/OpenIMSDK/chat),其中包括这些功能。与 Open-IM-Server 一起部署此聊天业务服务器可加快全面的聊天产品的设置。👥 -+ 开源 -+ 易于集成 -+ 良好的可扩展性 -+ 高性能 -+ 轻量级 -+ 支持多种协议 +为了进一步增强您的体验,我们还提供了 SDK 客户端,在其中实现了大多数复杂逻辑。可以在 [此链接](https://github.com/OpenIMSDK/openim-sdk-core) 找到 [SDK repository](https://github.com/OpenIMSDK/openim-sdk-core)。[chat repository](https://github.com/OpenIMSDK/chat) 是我们的业务服务器,而 'core' 代表 SDK 的高级封装,它们协同工作以提供卓越的结果。✨ -## 社区 +## :star2: 为什么选择 OpenIM -+ 访问中文官方网站:[OpenIM中文开发文档](https://doc.rentsoft.cn/) +**🔍 功能截图显示** -## 快速开始 +03IC2zwDcPL2EH#m*-Nf$ME4@k471F{G-sk>
zR@hizS?yv*)=!2@@2l3ppMpNku5;p+rx#4O1!>YKGXdp`O
zE3!tjGcdJ9c2+bwyq&?kt(PZfn
wcr
zW@yzA?6<6gf+k*}eK81Uru_}TZdjy}=Xm-_AE`~4@nGkir~Rz{iS&>;d^!bxRIia`
z4mDGtN;vfkGaEnwF|**QV1Q~uMJ~(SWSHi;=Ch)*e7zV)@q4YnQdVpGqyO5Kw%aB*
z)ZZ3f)tlvIcKuP}pZ_*dLXFl+IRgZ%7ghRdYz*`|VGRn--}n;zRW5mV%9E1n$01c)
zJ1bP_^SsgUX}a6szJLSc+}T82ccZ-F;2Rj>dV*>peLLM+vcr}*OOD%JlWCyyETRxO
z`L(-KBCF0)UCVF}lgDy!_$2eGV2jO@g1C41Ij)bt34mY&LcYP8AeUZ8=~Am9T!lzq
z-28Af)H@t`WTW+)8?Q;S2Qg`!#*nVzdPFc>4!8#f@!~)8TLO%#?p~D?p!+H
zPC~{c*t1#ytX4}d>w~so>ZyI~U~SgOMzvOwG7EikhbjJc{5@2wqj_pZI%l6j#R&KI
zCGykzR>IBBxa}TNrQX#jk2XA3xT^dnsIdF#PAg$|Y}-}f7&mfA|GSn&5`7{FGQx
zk+S^v;$9mcXs!S`B$(YricGOeW$OSD#&?^Hk2G??mvd*6&s5ELzVa`gQqtQxNi