From 4a383075815435b921217dcfc4a02eb3eaf296e4 Mon Sep 17 00:00:00 2001
From: OpenIM-Gordon <46924906+FGadvancer@users.noreply.github.com>
Date: Wed, 24 Apr 2024 12:11:36 +0800
Subject: [PATCH 1/7] 3.6.1 code conventions (#2203)
* Adjust configuration settings
* Adjust configuration settings
* Adjust configuration settings
* refactor: webhooks update.
* refactor: kafka update.
* Simplify the Docker Compose configuration, remove unnecessary environment variables, and eliminate the gateway service.
* refactor: kafka update.
* refactor: kafka update.
* Simplify the Docker Compose configuration, remove unnecessary environment variables, and eliminate the gateway service.
* Simplify the Docker Compose configuration, remove unnecessary environment variables, and eliminate the gateway service.
* Windows can compile and run.
* Windows can compile and run.
* refactor: kafka update.
* feat: msg cache split
* refactor: webhooks update
* refactor: webhooks update
* refactor: friends update
* refactor: group update
* refactor: third update
* refactor: api update
* refactor: crontab update
* refactor: msggateway update
* mage
* mage
* refactor: all module update.
* check
* refactor: all module update.
* load config
* load config
* load config
* load config
* refactor: all module update.
* refactor: all module update.
* refactor: all module update.
* refactor: all module update.
* refactor: all module update.
* Optimize Docker configuration and script.
* refactor: all module update.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* refactor: all module update.
* Optimize Docker configuration and script.
* refactor: all module update.
* refactor: all module update.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* update tools
* update tools
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* update protocol
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* refactor: all module update.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* refactor: api remove token auth by redis directly.
* Code Refactoring
* refactor: websocket auth change to call rpc of auth.
* refactor: kick online user and remove token change to call auth rpc.
* refactor: kick online user and remove token change to call auth rpc.
* refactor: remove msggateway redis.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor webhook
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor webhook
* refactor: cmd update.
* refactor: cmd update.
* fix: runtime: goroutine stack exceeds
* refactor: cmd update.
* refactor notification
* refactor notification
* refactor
* refactor: cmd update.
* refactor: cmd update.
* refactor
* refactor
* refactor
* protojson
* protojson
* protojson
* go mod
* wrapperspb
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: context update.
* refactor: websocket update info.
* refactor: websocket update info.
* refactor: websocket update info.
* refactor: websocket update info.
* refactor: api name change.
* refactor: debug info.
* refactor: debug info.
* refactor: debug info.
* fix: update file
* refactor
* refactor
* refactor: debug info.
* refactor: debug info.
* refactor: debug info.
* refactor: debug info.
* refactor: debug info.
* refactor: debug info.
* fix: callback update.
* fix: callback update.
* refactor
* fix: update message.
* fix: msg cache timeout.
* refactor
* refactor
* fix: push update.
* fix: push update.
* fix: push update.
* fix: push update.
* fix: push update.
* fix: push update.
* refactor
* refactor
* fix: push update.
* fix: websocket handle error remove when upgrade error.
* fix: priority url
* fix: minio config
* refactor: add zk logger.
* refactor
* fix: minio config
* refactor
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* fix bug: get localIP
* refactor
* refactor
* refactor
* refactor: remove zk logger.
* refactor: update tools version.
* refactor
* refactor: update server version to 3.7.0.
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor: zk log debug.
* refactor: zk log debug.
* refactor: zk log debug.
* refactor: zk log debug.
* refactor: zk log debug.
* refactor
* refactor
* refactor
* refactor: log level change.
* refactor: 3.7.0 code conventions.
---------
Co-authored-by: skiffer-git <44203734@qq.com>
Co-authored-by: withchao <993506633@qq.com>
Co-authored-by: root
---
.dockerignore | 5 +-
.gitattributes | 1 +
Dockerfile | 59 +++++++++++------
config/README.md | 63 +++++++++++++++++++
config/minio.yml | 8 +--
go.mod | 9 +--
go.sum | 8 +--
internal/api/init.go | 4 --
internal/msgtransfer/init.go | 5 --
.../msgtransfer/online_history_msg_handler.go | 2 +-
internal/push/push_handler.go | 6 +-
internal/rpc/third/third.go | 16 -----
pkg/common/config/config.go | 23 ++++---
pkg/common/config/load_config_test.go | 4 +-
pkg/common/config/version | 2 +-
.../discoveryregister/discoveryregister.go | 1 +
pkg/localcache/cache.go | 4 +-
pkg/localcache/go.mod | 5 --
pkg/localcache/go.sum | 1 -
pkg/localcache/option.go | 2 +-
pkg/rpccache/conversation.go | 2 +-
pkg/rpccache/friend.go | 2 +-
pkg/rpccache/group.go | 2 +-
pkg/rpccache/user.go | 2 +-
scripts/docker-start-all.sh | 9 +--
25 files changed, 148 insertions(+), 97 deletions(-)
create mode 100644 .gitattributes
create mode 100644 config/README.md
delete mode 100644 pkg/localcache/go.mod
delete mode 100644 pkg/localcache/go.sum
diff --git a/.dockerignore b/.dockerignore
index 263798e07..cf6c3cd59 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -5,9 +5,8 @@
.git
# Ignore build artifacts
-_output/
logs/
-
+_output/
# Ignore non-essential documentation
README.md
README-zh_CN.md
@@ -18,8 +17,6 @@ CHANGELOG/
# Ignore testing and linting configuration
.golangci.yml
-# Ignore deployment-related files
-docker-compose.yaml
# Ignore assets
assets/
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..dfdb8b771
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+*.sh text eol=lf
diff --git a/Dockerfile b/Dockerfile
index 9b1021216..746dddf65 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,30 +1,49 @@
-# Build Stage
-FROM golang:1.20 AS builder
+# Use Go 1.21 Alpine as the base image for building the application
+FROM golang:1.21-alpine as builder
-# Set go mod installation source and proxy
-ARG GO111MODULE=on
+# Define the base directory for the application as an environment variable
+ENV SERVER_DIR=/openim-server
-ENV GO111MODULE=$GO111MODULE
-ENV GOPROXY=$GOPROXY
+# Set the working directory inside the container based on the environment variable
+WORKDIR $SERVER_DIR
-# Set up the working directory
-WORKDIR /openim/openim-server
+# Set the Go proxy to improve dependency resolution speed
+ENV GOPROXY=https://goproxy.io,direct
+# Copy all files from the current directory into the container
+COPY . .
-# Copy all files to the container
-ADD . .
+RUN go mod download
-RUN make clean
-RUN make build
+# Install Mage to use for building the application
+RUN go install github.com/magefile/mage@v1.15.0
-FROM ghcr.io/openim-sigs/openim-ubuntu-image:latest
+# Optionally build your application if needed
+RUN mage build
-WORKDIR ${SERVER_WORKDIR}
+# Using Alpine Linux with Go environment for the final image
+FROM golang:1.21-alpine
-# Copy scripts and binary files to the production image
-COPY --from=builder ${OPENIM_SERVER_BINDIR} /openim/openim-server/_output/bin
-COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts
-COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config
-COPY --from=builder ${SERVER_WORKDIR}/deployments /openim/openim-server/deployments
+# Install necessary packages, such as bash
+RUN apk add --no-cache bash
-CMD ["/openim/openim-server/scripts/docker-start-all.sh"]
+# Set the environment and work directory
+ENV SERVER_DIR=/openim-server
+WORKDIR $SERVER_DIR
+
+
+# Copy the compiled binaries and mage from the builder image to the final image
+COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
+COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
+COPY --from=builder /go/bin/mage /usr/local/bin/mage
+COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/
+COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/
+COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/
+COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/
+COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/
+COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/
+
+RUN go get github.com/openimsdk/gomake@v0.0.9
+
+# Set the command to run when the container starts
+ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"]
diff --git a/config/README.md b/config/README.md
new file mode 100644
index 000000000..048d7fe36
--- /dev/null
+++ b/config/README.md
@@ -0,0 +1,63 @@
+---
+title: 'OpenIM Configuration Files and Common Configuration Item Modifications Guide'
+
+## Configuration Files Explanation
+
+| Configuration File | Description |
+| ------------------------------- | ------------------------------------------------------------ |
+| **kafka.yml** | Configurations for Kafka username, password, address, etc. |
+| **redis.yml** | Configurations for Redis password, address, etc. |
+| **minio.yml** | Configurations for MinIO username, password, address, and external IP/domain; failing to modify external IP or domain may cause image file sending failures |
+| **zookeeper.yml** | Configurations for ZooKeeper user, password, address, etc. |
+| **mongodb.yml** | Configurations for MongoDB username, password, address, etc. |
+| **log.yml** | Configurations for log level and storage directory. |
+| **notification.yml** | Configurations for events like adding friends, creating groups, etc. |
+| **share.yml** | Common configurations needed by various OpenIM services, such as secret. |
+| **webhooks.yml** | Configurations for URLs in Webhook. |
+| **local-cache.yml** | Local cache configurations. |
+| **openim-rpc-third.yml** | Configurations for listening IP, port, and storage settings for images and videos in openim-rpc-third service. |
+| **openim-rpc-user.yml** | Configurations for listening IP and port in openim-rpc-user service. |
+| **openim-api.yml** | Configurations for listening IP, port, etc., in openim-api service. |
+| **openim-crontask.yml** | Configurations for openim-crontask service. |
+| **openim-msggateway.yml** | Configurations for listening IP, port, etc., in openim-msggateway service. |
+| **openim-msgtransfer.yml** | Configurations for openim-msgtransfer service. |
+| **openim-push.yml** | Configurations for listening IP, port, and offline push settings in openim-push service. |
+| **openim-rpc-auth.yml** | Configurations for listening IP, port, and token expiration settings in openim-rpc-auth service. |
+| **openim-rpc-conversation.yml** | Configurations for listening IP, port, etc., in openim-rpc-conversation service. |
+| **openim-rpc-friend.yml** | Configurations for listening IP, port, etc., in openim-rpc-friend service. |
+| **openim-rpc-group.yml** | Configurations for listening IP, port, etc., in openim-rpc-group service. |
+| **openim-rpc-msg.yml** | Configurations for listening IP, port, and whether to verify friendship before sending messages in openim-rpc-msg service. |
+
+## Common Configuration Item Modifications
+
+| Configuration Item Modification | Configuration File |
+| ----------------------------------------------------- | ----------------------- |
+| Using MinIO for image and video file object storage | `minio.yml` |
+| Adjusting production environment logs | `log.yml` |
+| Verifying friendship before sending messages | `openim-rpc-msg.yml` |
+| Modifying secret | `share.yml` |
+| Using OSS, COS, AWS, Kodo for image and video storage | `openim-rpc-third.yml` |
+| Setting multiple login policy | `openim-msggateway.yml` |
+| Setting up offline push | `openim-push.yml` |
+
+## Starting Multiple Instances of an OpenIM Service
+
+To start multiple instances of an OpenIM service, simply increase the corresponding port numbers and modify the `start-config.yml` file in the project root directory. Restart the service to take effect. For example, the configuration to start 2 instances of `openim-rpc-user` is as follows:
+
+```yaml
+rpc:
+ registerIP: ''
+ listenIP: 0.0.0.0
+ ports: [ 10110, 10111 ]
+
+prometheus:
+ enable: true
+ ports: [ 20100, 20101 ]
+```
+
+Modify `start-config.yml`:
+
+```yaml
+serviceBinaries:
+ openim-rpc-user: 2
+```
diff --git a/config/minio.yml b/config/minio.yml
index 0cabb7f36..0a80bb845 100644
--- a/config/minio.yml
+++ b/config/minio.yml
@@ -1,9 +1,7 @@
bucket: "openim"
-port: 10005
accessKeyID: "root"
secretAccessKey: "openIM123"
sessionToken: ''
-internalIP: localhost
-externalIP: 150.109.93.151
-url: https://image.rentsoft.cn/
-publicRead: false
+internalAddress: "minio:9000"
+externalAddress: "http://external_ip:10005"
+publicRead: false
\ No newline at end of file
diff --git a/go.mod b/go.mod
index 8ada8f2e7..891125a89 100644
--- a/go.mod
+++ b/go.mod
@@ -13,9 +13,8 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
github.com/mitchellh/mapstructure v1.5.0
- github.com/openimsdk/localcache v0.0.1
github.com/openimsdk/protocol v0.0.64
- github.com/openimsdk/tools v0.0.47-alpha.42
+ github.com/openimsdk/tools v0.0.49-alpha.2
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.18.0
github.com/stretchr/testify v1.9.0
@@ -32,9 +31,10 @@ require (
github.com/IBM/sarama v1.43.0
github.com/fatih/color v1.14.1
github.com/go-redis/redis v6.15.9+incompatible
+ github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/kelindar/bitmap v1.5.2
github.com/likexian/gokit v0.25.13
- github.com/openimsdk/gomake v0.0.6
+ github.com/openimsdk/gomake v0.0.9
github.com/redis/go-redis/v9 v9.4.0
github.com/robfig/cron/v3 v3.0.1
github.com/shirou/gopsutil v3.21.11+incompatible
@@ -83,7 +83,6 @@ require (
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
- github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
@@ -173,5 +172,3 @@ require (
golang.org/x/crypto v0.21.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)
-
-replace github.com/openimsdk/localcache => ./pkg/localcache
diff --git a/go.sum b/go.sum
index 0ef6209fc..5dc0cc524 100644
--- a/go.sum
+++ b/go.sum
@@ -266,12 +266,12 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
-github.com/openimsdk/gomake v0.0.6 h1:bJmQWDHBj8PQ7oGJ2SL3Gsx0k5CdI/BPfGzlGcV105s=
-github.com/openimsdk/gomake v0.0.6/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI=
+github.com/openimsdk/gomake v0.0.9 h1:ouf25ygN2PMQ68Gfgns/EQRPiLPnp+77SIr68GfE+n4=
+github.com/openimsdk/gomake v0.0.9/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI=
github.com/openimsdk/protocol v0.0.64 h1:OrjSs4CgKN9VLvJvrAsc37O7Ru0E0VllXZQSmG/ab7U=
github.com/openimsdk/protocol v0.0.64/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8=
-github.com/openimsdk/tools v0.0.47-alpha.42 h1:wM6t9otTLhXECq8aQcYaZGvBgo/ZAmbNTqVt3g3NHGg=
-github.com/openimsdk/tools v0.0.47-alpha.42/go.mod h1:P4oGP1Pd+d4ctbLD5U/XQTgl8yu8Hd3skx640Fr69ko=
+github.com/openimsdk/tools v0.0.49-alpha.2 h1:8IfV6o2ySU7C54sh/MG7ctEp1h3lSNe03OCUDWSk5Ws=
+github.com/openimsdk/tools v0.0.49-alpha.2/go.mod h1:P4oGP1Pd+d4ctbLD5U/XQTgl8yu8Hd3skx640Fr69ko=
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
diff --git a/internal/api/init.go b/internal/api/init.go
index dcce69a12..6e784da9a 100644
--- a/internal/api/init.go
+++ b/internal/api/init.go
@@ -64,10 +64,6 @@ func Start(ctx context.Context, index int, config *Config) error {
return errs.WrapMsg(err, "failed to register discovery service")
}
- if err = client.CreateRpcRootNodes(config.Share.RpcRegisterName.GetServiceNames()); err != nil {
- return errs.WrapMsg(err, "failed to create RPC root nodes")
- }
-
var (
netDone = make(chan struct{}, 1)
netErr error
diff --git a/internal/msgtransfer/init.go b/internal/msgtransfer/init.go
index 685e847b8..68d953e90 100644
--- a/internal/msgtransfer/init.go
+++ b/internal/msgtransfer/init.go
@@ -80,11 +80,6 @@ func Start(ctx context.Context, index int, config *Config) error {
if err != nil {
return err
}
-
- if err := client.CreateRpcRootNodes(config.Share.RpcRegisterName.GetServiceNames()); err != nil {
- return err
- }
-
client.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, "round_robin")))
//todo MsgCacheTimeout
diff --git a/internal/msgtransfer/online_history_msg_handler.go b/internal/msgtransfer/online_history_msg_handler.go
index 9960aa518..8691e92ab 100644
--- a/internal/msgtransfer/online_history_msg_handler.go
+++ b/internal/msgtransfer/online_history_msg_handler.go
@@ -394,7 +394,7 @@ func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(
break
}
}
- log.ZDebug(context.Background(), "online new session msg come", "highWaterMarkOffset",
+ log.ZInfo(context.Background(), "online new session msg come", "highWaterMarkOffset",
claim.HighWaterMarkOffset(), "topic", claim.Topic(), "partition", claim.Partition())
var (
diff --git a/internal/push/push_handler.go b/internal/push/push_handler.go
index 2246fb3f6..e09b0b2ec 100644
--- a/internal/push/push_handler.go
+++ b/internal/push/push_handler.go
@@ -96,7 +96,7 @@ func (c *ConsumerHandler) handleMs2PsChat(ctx context.Context, msg []byte) {
var err error
switch msgFromMQ.MsgData.SessionType {
case constant.ReadGroupChatType:
- err = c.Push2SuperGroup(ctx, pbData.MsgData.GroupID, pbData.MsgData)
+ err = c.Push2Group(ctx, pbData.MsgData.GroupID, pbData.MsgData)
default:
var pushUserIDList []string
isSenderSync := datautil.GetSwitchFromOptions(pbData.MsgData.Options, constant.IsSenderSync)
@@ -108,7 +108,7 @@ func (c *ConsumerHandler) handleMs2PsChat(ctx context.Context, msg []byte) {
err = c.Push2User(ctx, pushUserIDList, pbData.MsgData)
}
if err != nil {
- log.ZError(ctx, "push failed", err, "msg", pbData.String())
+ log.ZWarn(ctx, "push failed", err, "msg", pbData.String())
}
}
@@ -179,7 +179,7 @@ func (c *ConsumerHandler) shouldPushOffline(_ context.Context, msg *sdkws.MsgDat
return true
}
-func (c *ConsumerHandler) Push2SuperGroup(ctx context.Context, groupID string, msg *sdkws.MsgData) (err error) {
+func (c *ConsumerHandler) Push2Group(ctx context.Context, groupID string, msg *sdkws.MsgData) (err error) {
log.ZDebug(ctx, "Get super group msg from msg_transfer and push msg", "msg", msg.String(), "groupID", groupID)
var pushToUserIDs []string
if err = c.webhookBeforeGroupOnlinePush(ctx, &c.config.WebhooksConfig.BeforeGroupOnlinePush, groupID, msg,
diff --git a/internal/rpc/third/third.go b/internal/rpc/third/third.go
index ad87fa6f5..9bf8cafa9 100644
--- a/internal/rpc/third/third.go
+++ b/internal/rpc/third/third.go
@@ -18,7 +18,6 @@ import (
"context"
"fmt"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
- "net/url"
"time"
"github.com/openimsdk/open-im-server/v3/pkg/common/db/cache"
@@ -29,7 +28,6 @@ import (
"github.com/openimsdk/tools/db/mongoutil"
"github.com/openimsdk/tools/db/redisutil"
"github.com/openimsdk/tools/discovery"
- "github.com/openimsdk/tools/errs"
"github.com/openimsdk/tools/s3"
"github.com/openimsdk/tools/s3/cos"
"github.com/openimsdk/tools/s3/minio"
@@ -38,7 +36,6 @@ import (
)
type thirdServer struct {
- apiURL string
thirdDatabase controller.ThirdDatabase
s3dataBase controller.S3Database
userRpcClient rpcclient.UserRpcClient
@@ -73,18 +70,6 @@ func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryReg
if err != nil {
return err
}
- apiURL := config.MinioConfig.URL
- if apiURL == "" {
- return errs.Wrap(fmt.Errorf("api is empty"))
- }
- if _, err := url.Parse(config.MinioConfig.URL); err != nil {
- return err
- }
- if apiURL[len(apiURL)-1] != '/' {
- apiURL += "/"
- }
- apiURL += "object/"
-
// Select the oss method according to the profile policy
enable := config.RpcConfig.Object.Enable
var o s3.Interface
@@ -103,7 +88,6 @@ func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryReg
}
cache.InitLocalCache(&config.LocalCacheConfig)
third.RegisterThirdServer(server, &thirdServer{
- apiURL: apiURL,
thirdDatabase: controller.NewThirdDatabase(cache.NewThirdCache(rdb), logdb),
userRpcClient: rpcclient.NewUserRpcClient(client, config.Share.RpcRegisterName.User, config.Share.IMAdminUserID),
s3dataBase: controller.NewS3Database(rdb, o, s3db),
diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go
index 19edccbab..df2639cab 100644
--- a/pkg/common/config/config.go
+++ b/pkg/common/config/config.go
@@ -22,6 +22,7 @@ import (
"github.com/openimsdk/tools/s3/cos"
"github.com/openimsdk/tools/s3/minio"
"github.com/openimsdk/tools/s3/oss"
+ "net"
"time"
)
@@ -52,13 +53,11 @@ type Log struct {
type Minio struct {
Bucket string `mapstructure:"bucket"`
- Port int `mapstructure:"port"`
AccessKeyID string `mapstructure:"accessKeyID"`
SecretAccessKey string `mapstructure:"secretAccessKey"`
SessionToken string `mapstructure:"sessionToken"`
- InternalIP string `mapstructure:"internalIP"`
- ExternalIP string `mapstructure:"externalIP"`
- URL string `mapstructure:"url"`
+ InternalAddress string `mapstructure:"internalAddress"`
+ ExternalAddress string `mapstructure:"externalAddress"`
PublicRead bool `mapstructure:"publicRead"`
}
@@ -477,16 +476,24 @@ func (k *Kafka) Build() *kafka.Config {
}
}
func (m *Minio) Build() *minio.Config {
- return &minio.Config{
+ conf := minio.Config{
Bucket: m.Bucket,
- Endpoint: fmt.Sprintf("http://%s:%d", m.InternalIP, m.Port),
AccessKeyID: m.AccessKeyID,
SecretAccessKey: m.SecretAccessKey,
SessionToken: m.SessionToken,
- SignEndpoint: fmt.Sprintf("http://%s:%d", m.ExternalIP, m.Port),
PublicRead: m.PublicRead,
}
-
+ if _, _, err := net.SplitHostPort(m.InternalAddress); err == nil {
+ conf.Endpoint = fmt.Sprintf("http://%s", m.InternalAddress)
+ } else {
+ conf.Endpoint = m.InternalAddress
+ }
+ if _, _, err := net.SplitHostPort(m.ExternalAddress); err == nil {
+ conf.SignEndpoint = fmt.Sprintf("http://%s", m.ExternalAddress)
+ } else {
+ conf.SignEndpoint = m.ExternalAddress
+ }
+ return &conf
}
func (c *Cos) Build() *cos.Config {
return &cos.Config{
diff --git a/pkg/common/config/load_config_test.go b/pkg/common/config/load_config_test.go
index 575448393..256214565 100644
--- a/pkg/common/config/load_config_test.go
+++ b/pkg/common/config/load_config_test.go
@@ -31,6 +31,8 @@ func TestLoadOpenIMRpcUserConfig(t *testing.T) {
var user User
err := LoadConfig("../../../config/openim-rpc-user.yml", "IMENV_OPENIM_RPC_USER", &user)
assert.Nil(t, err)
+ //export IMENV_OPENIM_RPC_USER_RPC_LISTENIP="0.0.0.0"
assert.Equal(t, "0.0.0.0", user.RPC.ListenIP)
- assert.Equal(t, []int{10110}, user.RPC.Ports)
+ //export IMENV_OPENIM_RPC_USER_RPC_PORTS="10110,10111,10112"
+ assert.Equal(t, []int{10110, 10111, 10112}, user.RPC.Ports)
}
diff --git a/pkg/common/config/version b/pkg/common/config/version
index 084e244ce..240bba906 100644
--- a/pkg/common/config/version
+++ b/pkg/common/config/version
@@ -1 +1 @@
-3.6.0
\ No newline at end of file
+3.7.0
\ No newline at end of file
diff --git a/pkg/common/discoveryregister/discoveryregister.go b/pkg/common/discoveryregister/discoveryregister.go
index b664ee34e..38d7382fa 100644
--- a/pkg/common/discoveryregister/discoveryregister.go
+++ b/pkg/common/discoveryregister/discoveryregister.go
@@ -33,6 +33,7 @@ const (
func NewDiscoveryRegister(zookeeperConfig *config.ZooKeeper, share *config.Share) (discovery.SvcDiscoveryRegistry, error) {
switch share.Env {
case zookeeperConst:
+
return zookeeper.NewZkClient(
zookeeperConfig.Address,
zookeeperConfig.Schema,
diff --git a/pkg/localcache/cache.go b/pkg/localcache/cache.go
index 91c490922..0e040ad38 100644
--- a/pkg/localcache/cache.go
+++ b/pkg/localcache/cache.go
@@ -19,8 +19,8 @@ import (
"hash/fnv"
"unsafe"
- "github.com/openimsdk/localcache/link"
- "github.com/openimsdk/localcache/lru"
+ "github.com/openimsdk/open-im-server/v3/pkg/localcache/link"
+ "github.com/openimsdk/open-im-server/v3/pkg/localcache/lru"
)
type Cache[V any] interface {
diff --git a/pkg/localcache/go.mod b/pkg/localcache/go.mod
deleted file mode 100644
index 5f0793042..000000000
--- a/pkg/localcache/go.mod
+++ /dev/null
@@ -1,5 +0,0 @@
-module github.com/openimsdk/localcache
-
-go 1.19
-
-require github.com/hashicorp/golang-lru/v2 v2.0.7
diff --git a/pkg/localcache/go.sum b/pkg/localcache/go.sum
deleted file mode 100644
index b1d8cf8c4..000000000
--- a/pkg/localcache/go.sum
+++ /dev/null
@@ -1 +0,0 @@
-github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
diff --git a/pkg/localcache/option.go b/pkg/localcache/option.go
index e60d5aa07..00bb9d044 100644
--- a/pkg/localcache/option.go
+++ b/pkg/localcache/option.go
@@ -18,7 +18,7 @@ import (
"context"
"time"
- "github.com/openimsdk/localcache/lru"
+ "github.com/openimsdk/open-im-server/v3/pkg/localcache/lru"
)
func defaultOption() *option {
diff --git a/pkg/rpccache/conversation.go b/pkg/rpccache/conversation.go
index 196657b4b..55897a8da 100644
--- a/pkg/rpccache/conversation.go
+++ b/pkg/rpccache/conversation.go
@@ -17,9 +17,9 @@ package rpccache
import (
"context"
- "github.com/openimsdk/localcache"
"github.com/openimsdk/open-im-server/v3/pkg/common/cachekey"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
+ "github.com/openimsdk/open-im-server/v3/pkg/localcache"
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
pbconversation "github.com/openimsdk/protocol/conversation"
"github.com/openimsdk/tools/errs"
diff --git a/pkg/rpccache/friend.go b/pkg/rpccache/friend.go
index 557b5cffc..3e9e7863a 100644
--- a/pkg/rpccache/friend.go
+++ b/pkg/rpccache/friend.go
@@ -17,9 +17,9 @@ package rpccache
import (
"context"
- "github.com/openimsdk/localcache"
"github.com/openimsdk/open-im-server/v3/pkg/common/cachekey"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
+ "github.com/openimsdk/open-im-server/v3/pkg/localcache"
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
"github.com/openimsdk/tools/log"
"github.com/redis/go-redis/v9"
diff --git a/pkg/rpccache/group.go b/pkg/rpccache/group.go
index daf76a7a0..7ba22beb8 100644
--- a/pkg/rpccache/group.go
+++ b/pkg/rpccache/group.go
@@ -17,9 +17,9 @@ package rpccache
import (
"context"
- "github.com/openimsdk/localcache"
"github.com/openimsdk/open-im-server/v3/pkg/common/cachekey"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
+ "github.com/openimsdk/open-im-server/v3/pkg/localcache"
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
"github.com/openimsdk/protocol/sdkws"
"github.com/openimsdk/tools/errs"
diff --git a/pkg/rpccache/user.go b/pkg/rpccache/user.go
index b31f187db..0a7a4e4b8 100644
--- a/pkg/rpccache/user.go
+++ b/pkg/rpccache/user.go
@@ -17,9 +17,9 @@ package rpccache
import (
"context"
- "github.com/openimsdk/localcache"
"github.com/openimsdk/open-im-server/v3/pkg/common/cachekey"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
+ "github.com/openimsdk/open-im-server/v3/pkg/localcache"
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
"github.com/openimsdk/protocol/sdkws"
"github.com/openimsdk/tools/errs"
diff --git a/scripts/docker-start-all.sh b/scripts/docker-start-all.sh
index 8d91cd771..116038b53 100755
--- a/scripts/docker-start-all.sh
+++ b/scripts/docker-start-all.sh
@@ -21,9 +21,6 @@
#fixme This scripts is the total startup scripts
#fixme The full name of the shell scripts that needs to be started is placed in the need_to_start_server_shell array
-OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
-source "${OPENIM_ROOT}/scripts/install/common.sh"
-openim::log::info "\n# Use Docker to start all OpenIM service"
-trap 'openim::util::onCtrlC' INT
-"${OPENIM_ROOT}"/scripts/start-all.sh 2>&1 &
-tail -f ${DOCKER_LOG_FILE}
+cd /openim/openim-server
+mage start
+tail -f /dev/null
From 837e365a800cc069ac653046e865708abe74510a Mon Sep 17 00:00:00 2001
From: skiffer-git <72860476+skiffer-git@users.noreply.github.com>
Date: Wed, 24 Apr 2024 15:43:03 +0800
Subject: [PATCH 2/7] update go.mod go.sum (#2209)
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* remove \r
* fix bug: get localIP
* update some ci file (#2200)
* Update openimci.yml
* Update golangci-lint.yml
* Update e2e-test.yml
* 3.6.1 code conventions (#2202)
* refactor: webhooks update.
* Adjust configuration settings
* Adjust configuration settings
* Adjust configuration settings
* feat: s3 api addr
* refactor: webhooks update.
* Adjust configuration settings
* Adjust configuration settings
* Adjust configuration settings
* Adjust configuration settings
* Adjust configuration settings
* Adjust configuration settings
* Adjust configuration settings
* refactor: webhooks update.
* refactor: kafka update.
* Simplify the Docker Compose configuration, remove unnecessary environment variables, and eliminate the gateway service.
* refactor: kafka update.
* refactor: kafka update.
* Simplify the Docker Compose configuration, remove unnecessary environment variables, and eliminate the gateway service.
* Simplify the Docker Compose configuration, remove unnecessary environment variables, and eliminate the gateway service.
* Windows can compile and run.
* Windows can compile and run.
* refactor: kafka update.
* feat: msg cache split
* refactor: webhooks update
* refactor: webhooks update
* refactor: friends update
* refactor: group update
* refactor: third update
* refactor: api update
* refactor: crontab update
* refactor: msggateway update
* mage
* mage
* refactor: all module update.
* check
* refactor: all module update.
* load config
* load config
* load config
* load config
* refactor: all module update.
* refactor: all module update.
* refactor: all module update.
* refactor: all module update.
* refactor: all module update.
* Optimize Docker configuration and script.
* refactor: all module update.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* refactor: all module update.
* Optimize Docker configuration and script.
* refactor: all module update.
* refactor: all module update.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* update tools
* update tools
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* update protocol
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* refactor: all module update.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* Optimize Docker configuration and script.
* refactor: api remove token auth by redis directly.
* Code Refactoring
* refactor: websocket auth change to call rpc of auth.
* refactor: kick online user and remove token change to call auth rpc.
* refactor: kick online user and remove token change to call auth rpc.
* refactor: remove msggateway redis.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor webhook
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor webhook
* refactor: cmd update.
* refactor: cmd update.
* fix: runtime: goroutine stack exceeds
* refactor: cmd update.
* refactor notification
* refactor notification
* refactor
* refactor: cmd update.
* refactor: cmd update.
* refactor
* refactor
* refactor
* protojson
* protojson
* protojson
* go mod
* wrapperspb
* refactor: cmd update.
* refactor: cmd update.
* refactor: cmd update.
* refactor: context update.
* refactor: websocket update info.
* refactor: websocket update info.
* refactor: websocket update info.
* refactor: websocket update info.
* refactor: api name change.
* refactor: debug info.
* refactor: debug info.
* refactor: debug info.
* fix: update file
* refactor
* refactor
* refactor: debug info.
* refactor: debug info.
* refactor: debug info.
* refactor: debug info.
* refactor: debug info.
* refactor: debug info.
* fix: callback update.
* fix: callback update.
* refactor
* fix: update message.
* fix: msg cache timeout.
* refactor
* refactor
* fix: push update.
* fix: push update.
* fix: push update.
* fix: push update.
* fix: push update.
* fix: push update.
* refactor
* refactor
* fix: push update.
* fix: websocket handle error remove when upgrade error.
* fix: priority url
* fix: minio config
* refactor: add zk logger.
* refactor
* fix: minio config
* refactor
* refactor
* refactor
* refactor
* refactor: remove zk logger.
* refactor: update tools version.
* refactor
* refactor: update server version to 3.7.0.
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor: zk log debug.
* refactor: zk log debug.
* refactor: zk log debug.
* refactor: zk log debug.
* refactor: zk log debug.
* refactor
* refactor
* refactor
* refactor: log level change.
* refactor: 3.7.0 code conventions.
---------
Co-authored-by: skiffer-git <44203734@qq.com>
Co-authored-by: withchao <993506633@qq.com>
* update go.mod go.sum
* Remove Chinese comments
* user localhost for minio
* user localhost for minio
* Remove Chinese comments
* Remove Chinese comments
* Remove Chinese comments
* Set up 4 instances of transfer
* Set up 4 instances of transfer
* Add comments to the configuration file
* Add comments to the configuration file
---------
Co-authored-by: root
Co-authored-by: xuan <146319162+wxuanF@users.noreply.github.com>
Co-authored-by: OpenIM-Gordon <46924906+FGadvancer@users.noreply.github.com>
Co-authored-by: withchao <993506633@qq.com>
---
.github/workflows/e2e-test.yml | 45 ++-
.github/workflows/golangci-lint.yml | 8 +-
.github/workflows/openimci.yml | 381 +++++++--------------
config/kafka.yml | 18 +
config/minio.yml | 13 +-
config/mongodb.yml | 9 +-
config/notification.yml | 9 -
config/openim-msggateway.yml | 11 +
config/openim-msgtransfer.yml | 3 +
config/openim-push.yml | 9 +-
config/openim-rpc-auth.yml | 7 +-
config/openim-rpc-conversation.yml | 8 +-
config/openim-rpc-friend.yml | 5 +
config/openim-rpc-group.yml | 6 +-
config/openim-rpc-msg.yml | 8 +-
config/openim-rpc-third.yml | 7 +
go.mod | 2 +-
go.sum | 19 +
internal/push/offlinepush/offlinepusher.go | 2 +-
internal/push/push_handler.go | 2 +-
start-config.yml | 4 +-
21 files changed, 286 insertions(+), 290 deletions(-)
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index f98221e41..62df69ed5 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -73,14 +73,22 @@ jobs:
- name: Docker Operations
run: |
- sudo make init
sudo docker compose up -d
+ sudo bash bootstrap.sh
+ sudo mage
sudo sleep 20
- name: Module Operations
run: |
- sudo make tidy
- sudo make tools.verify.go-gitlint
+ sudo go mod tidy
+ echo "===========> Verifying go-gitlint is installed"
+ if [ ! -f ./_output/tools/go-gitlint ]; then
+ export GOBIN=$(pwd)/_output/tools
+ echo "===========> Installing The default installation path is /home/ubuntu/DF/open-im-server/_output/tools/go-gitlint"
+ sudo go install github.com/marmotedu/go-gitlint/cmd/go-gitlint@latest
+ echo "===========> go-gitlint is installed in /home/ubuntu/DF/open-im-server/_output/tools/go-gitlint"
+ fi
+
- name: Build, Start(make build && make start)
run: |
@@ -90,7 +98,8 @@ jobs:
run: |
sudo ./scripts/install/install.sh -s
- - name: Exec OpenIM API test (make test-api)
+# - name: Exec OpenIM API test (make test-api)
+ - name: Exec OpenIM test (make test)
run: |
mkdir -p ./tmp
touch ./tmp/test.md
@@ -98,23 +107,27 @@ jobs:
echo "## OpenIM API Test" >> ./tmp/test.md
echo "Command Output for OpenIM API Test
" >> ./tmp/test.md
echo "" >> ./tmp/test.md
- sudo make test-api | tee -a ./tmp/test.md
+ echo "===========> Run api test"
+ ./scripts/install/test.sh
+ echo "===========> Run api test" >> ./tmp/test.md
+ ./scripts/install/test.sh >> ./tmp/test.md
echo "
" >> ./tmp/test.md
echo " " >> ./tmp/test.md
- sudo make test-api
+ echo "===========> Run api test"
+ ./scripts/install/test.sh
- - name: Exec OpenIM E2E Test (make test-e2e)
- run: |
- echo "" >> ./tmp/test.md
- echo "## OpenIM E2E Test" >> ./tmp/test.md
- echo "Command Output for OpenIM E2E Test
" >> ./tmp/test.md
- echo "" >> ./tmp/test.md
- sudo make test-e2e | tee -a ./tmp/test.md
- echo "
" >> ./tmp/test.md
- echo " " >> ./tmp/test.md
+ # - name: Exec OpenIM E2E Test (make test-e2e)
+ # run: |
+ # echo "" >> ./tmp/test.md
+ # echo "## OpenIM E2E Test" >> ./tmp/test.md
+ # echo "Command Output for OpenIM E2E Test
" >> ./tmp/test.md
+ # echo "" >> ./tmp/test.md
+ # sudo make test-e2e | tee -a ./tmp/test.md
+ # echo "
" >> ./tmp/test.md
+ # echo " " >> ./tmp/test.md
- sudo make test-e2e
+ # sudo make test-e2e
- name: Comment PR with file
uses: thollander/actions-comment-pull-request@v2
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
index 31e491d6b..64bd498c5 100644
--- a/.github/workflows/golangci-lint.yml
+++ b/.github/workflows/golangci-lint.yml
@@ -29,7 +29,13 @@ jobs:
go-version: '1.21'
cache: false
- name: OpenIM Scripts Verification(make verify)
- run: sudo make verify
+ run: |
+ cd scripts
+ for script in verify-*; do
+ if [ -x "$script" ]; then
+ ./"$script"
+ fi
+ done
- name: golangci-lint
uses: golangci/golangci-lint-action@v4.0.0
with:
diff --git a/.github/workflows/openimci.yml b/.github/workflows/openimci.yml
index f47283997..033868a2e 100644
--- a/.github/workflows/openimci.yml
+++ b/.github/workflows/openimci.yml
@@ -1,3 +1,4 @@
+
# Copyright © 2023 OpenIM open source community. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,8 +12,7 @@
# 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 CI Aotu Build and Install
+name: OpenIM CI Auto Build
on:
push:
@@ -37,269 +37,154 @@ on:
- "**.md"
- "docs/**"
-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:
- contents: write
- pull-requests: write
- environment:
- name: openim
- strategy:
- matrix:
- go_version: ["1.19","1.20","1.21"]
- os: [ubuntu-latest]
- steps:
- - name: Setup
- uses: actions/checkout@v4
-
- - name: Set up Go ${{ matrix.go_version }}
- uses: actions/setup-go@v5
- with:
- go-version: ${{ matrix.go_version }}
- id: go
-
- - name: Install Task
- uses: arduino/setup-task@v1
- with:
- version: '3.x' # If available, use the latest major version that's compatible
- repo-token: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Code Typecheck Detector
- uses: kubecub/typecheck@main
-
- - name: Conformity Checker for Project
- uses: kubecub/standardizer@main
-
- - name: Module Operations
- run: |
- sudo make tidy
- sudo make tools.verify.go-gitlint
-
- - name: Format Code
- run: sudo make format
- continue-on-error: true
-
- - name: Generate Files
- run: make gen
- continue-on-error: true
-
- - name: Build Source
- run: sudo make build
-
- - name: Build multiarch PLATFORMS
- if: startsWith(github.ref, 'refs/heads/release-')
- run: |
- sudo make multiarch
-
- - name: Cleanup Build
- run: sudo make clean
-
- - name: Set Current Directory
- id: set_directory
- run: echo "::set-output name=directory::$(pwd)"
- 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: Test OpenIM install/start on ${{ matrix.os }}-${{ matrix.arch }}
- runs-on: ${{ matrix.os }}
- permissions:
- contents: write
- pull-requests: write
- environment:
- name: openim
- strategy:
- matrix:
- go_version: ["1.21"]
- os: ["ubuntu-latest"]
- steps:
- - name: Checkout and Install OpenIM
- uses: actions/checkout@v4
- - name: Install Task
- uses: arduino/setup-task@v1
- with:
- version: '3.x' # If available, use the latest major version that's compatible
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Run OpenIM make install start
- run: |
- sudo make install
-
- # - name: Check the OpenIM environment and status
- # run: |
- # sudo docker images
- # sudo docker ps
- - name: Check the OpenIM environment and status
- if: runner.os == 'Linux' && matrix.arch == 'amd64'
- id: docker_info
- run: |
- sleep 30
- echo "images<> $GITHUB_ENV
- sudo docker images >> $GITHUB_ENV
- echo "EOF" >> $GITHUB_ENV
- echo "containers<> $GITHUB_ENV
- sudo docker ps >> $GITHUB_ENV
- echo "EOF" >> $GITHUB_ENV
-
- - name: Comment PR
- uses: thollander/actions-comment-pull-request@v2
- if: runner.os == 'Linux' && matrix.arch == 'amd64'
- with:
- message: |
- > [!TIP]
- > Run make install to check the status
-
- ### Docker Images:
- Click to expand docker images
- ```bash
- ${{ env.images }}
- ```
-
-
- ### Docker Processes:
- Click to expand docker ps
- ```bash
- ${{ env.containers }}
- ```
-
- GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
-
- execute-scripts:
- name: Execute OpenIM Script On ${{ matrix.os }}-${{ matrix.arch }}
- runs-on: ${{ matrix.os }}
+ build-linux:
+ name: Execute OpenIM Script On Linux
+ runs-on: ubuntu-latest
permissions:
- contents: write
- pull-requests: write
+ contents: write
+ pull-requests: write
environment:
name: openim
strategy:
matrix:
- go_version: ["1.21"]
- os: ["ubuntu-latest", "macos-latest"]
arch: [arm64, armv7, amd64]
+
steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Set up Go ${{ matrix.go_version }}
- uses: actions/setup-go@v5
- with:
- go-version: ${{ matrix.go_version }}
- id: go
+ - uses: actions/checkout@v3
- - name: Install Task
- uses: arduino/setup-task@v1
+ - name: Set up Go
+ uses: actions/setup-go@v4
with:
- version: '3.x' # If available, use the latest major version that's compatible
- repo-token: ${{ secrets.GITHUB_TOKEN }}
-
- # - name: Install latest Bash (macOS only)
- # if: runner.os == 'macOS' && matrix.arch == 'arm64'
- # run: |
- # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- # brew update
-
- # brew install bash
- # brew install gnu-sed
-
- # echo "/usr/local/bin" >> $GITHUB_PATH
- # echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
- # continue-on-error: true
+ go-version: '1.21'
- - name: Set up Docker for Ubuntu
- if: runner.os == 'Linux'
+ - name: Set up Docker for Linux
run: |
- sudo make init
sudo docker compose up -d
- sudo sleep 20
-
- # - name: Set up Docker for macOS
- # if: runner.os == 'macOS' && matrix.arch == 'arm64'
- # run: |
- # brew install --cask docker
- # open /Applications/Docker.app
-
- # sleep 10
- # docker-compose --version || brew install docker-compose
+ sudo sleep 30 # Increased sleep time for better stability
+ timeout-minutes: 20 # Increased timeout for Docker setup
- # docker-compose up -d
- # sleep 20
- - name: Module Operations for Ubuntu
- if: runner.os == 'Linux'
- run: |
- sudo make tidy
- sudo make tools.verify.go-gitlint
-
- # - name: Module Operations for macOS
- # if: runner.os == 'macOS'
- # run: |
- # make tidy
- # make tools.verify.go-gitlint
-
- - name: Build, Start, Check Services and Print Logs for Ubuntu
- if: runner.os == 'Linux'
- run: |
- sudo make build
- sudo make start
- sudo make check
-
- - name: Restart Services and Print Logs for Ubuntu
- if: runner.os == 'Linux' && matrix.arch == 'amd64'
- run: |
- sudo make restart
- sudo make check
-
- - name: Build, Start, Check Services and Print Logs for macOS
- if: runner.os == 'macOS' && matrix.arch == 'arm64'
- run: |
- make build
-
- openim-test-build-image:
- name: Build OpenIM Docker Image
- runs-on: ubuntu-latest
- permissions:
- contents: write
- pull-requests: write
- environment:
- name: openim
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
- - name: Set up Go ${{ matrix.go_version }}
- uses: actions/setup-go@v5
- with:
- go-version: ${{ matrix.go_version }}
- id: go
-
- - name: Install Task
- uses: arduino/setup-task@v1
- with:
- version: '3.x' # If available, use the latest major version that's compatible
- repo-token: ${{ secrets.GITHUB_TOKEN }}
+ - name: init
+ run: sudo bash bootstrap.sh
+ timeout-minutes: 20
- - name: Test Docker Build
+ - name: Build, Start, Check Services and Print Logs for Linux
run: |
- sudo make init
- sudo make image
+ sudo mage
+ sudo mage start
+ sudo mage check
+
- - name: Get OpenIM Docker Images Status
- id: docker_processes
+ - name: Restart Services and Print Logs
run: |
- sudo docker images
- sudo docker ps
+ sudo mage stop
+ sudo mage start
+ sudo mage check
+
+
+# build-mac:
+# name: Execute OpenIM Script On macOS
+# runs-on: macos-latest
+# permissions:
+# contents: write
+# pull-requests: write
+# environment:
+# name: openim
+# strategy:
+# matrix:
+# arch: [arm64, armv7, amd64]
+#
+# steps:
+# - uses: actions/checkout@v3
+
+# - name: Set up Go
+# uses: actions/setup-go@v4
+# with:
+# go-version: '1.21'
+
+
+# while ! docker system info > /dev/null 2>&1; do
+# echo "Waiting for Docker to start..."
+# sleep 10 # Increased delay to ensure Docker starts properly
+# done
+
+# - name: Install Docker
+# run: |
+# brew install docker
+# brew install docker-compose
+# sleep 10
+# docker-compose up -d
+# sleep 30
+# timeout-minutes: 20
+#
+
+# - name: init
+# run: sudo bash bootstrap.sh
+# timeout-minutes: 20
+
+# - name: Build, Start, Check Services and Print Logs for Linux
+# run: |
+# sudo mage
+# sudo mage start
+# sudo mage check
+
+# - name: Restart Services and Print Logs
+# run: |
+# sudo mage stop
+# sudo mage start
+# sudo mage check
+
+# build-windows:
+# name: Execute OpenIM Script On Windows
+# runs-on: windows-latest
+# permissions:
+# contents: write
+# pull-requests: write
+# environment:
+# name: openim
+# strategy:
+# matrix:
+# arch: [arm64, armv7, amd64]
+#
+# steps:
+# - uses: actions/checkout@v3
+
+# - name: Set up Go
+# uses: actions/setup-go@v4
+# with:
+# go-version: '1.21'
+
+# - name: Set up Docker for Windows
+# run: |
+# $images = @("zookeeper", "redis", "kafka")
+# foreach ($image in $images) {
+# $tag = "$image:latest"
+# docker pull $tag | Out-Null
+# if ($LASTEXITCODE -ne 0) {
+# Write-Host "Skipping $image as it is not available for Windows"
+# } else {
+# Write-Host "Successfully pulled $image"
+# }
+# }
+# docker compose up -d
+# Start-Sleep -Seconds 30
+# timeout-minutes: 20
+# shell: pwsh
+
+# - name: init
+# run: bootstrap.bat
+# timeout-minutes: 20
+
+# - name: Build, Start, Check Services and Print Logs for Linux
+# run: |
+# mage
+# mage start
+# mage check
+
+# - name: Restart Services and Print Logs
+# run: |
+# mage stop
+# mage start
+# mage check
diff --git a/config/kafka.yml b/config/kafka.yml
index b1773c80a..d412e1be0 100644
--- a/config/kafka.yml
+++ b/config/kafka.yml
@@ -1,18 +1,36 @@
+# Username for authentication
username: ''
+# Password for authentication
password: ''
+# Producer acknowledgment settings
producerAck: ""
+# Compression type to use (e.g., none, gzip, snappy)
compressType: "none"
+# List of Kafka broker addresses
address: [ localhost:19094 ]
+# Kafka topic for Redis integration
toRedisTopic: "toRedis"
+# Kafka topic for MongoDB integration
toMongoTopic: "toMongo"
+# Kafka topic for push notifications
toPushTopic: "toPush"
+# Consumer group ID for Redis topic
toRedisGroupID: redis
+# Consumer group ID for MongoDB topic
toMongoGroupID: mongo
+# Consumer group ID for push notifications topic
toPushGroupID: push
+# TLS (Transport Layer Security) configuration
tls:
+ # Enable or disable TLS
enableTLS: false
+ # CA certificate file path
caCrt: ""
+ # Client certificate file path
clientCrt: ""
+ # Client key file path
clientKey: ""
+ # Client key password
clientKeyPwd: ""
+ # Whether to skip TLS verification (not recommended for production)
insecureSkipVerify: false
diff --git a/config/minio.yml b/config/minio.yml
index 0a80bb845..11a9ace35 100644
--- a/config/minio.yml
+++ b/config/minio.yml
@@ -1,7 +1,16 @@
+# Name of the bucket in MinIO
bucket: "openim"
+# Access key ID for MinIO authentication
accessKeyID: "root"
+# Secret access key for MinIO authentication
secretAccessKey: "openIM123"
+# Session token for MinIO authentication (optional)
sessionToken: ''
-internalAddress: "minio:9000"
+# Internal address of the MinIO server
+internalAddress: "localhost:10005"
+# External address of the MinIO server, accessible from outside. Supports both HTTP and HTTPS using a domain name
externalAddress: "http://external_ip:10005"
-publicRead: false
\ No newline at end of file
+# Flag to enable or disable public read access to the bucket
+publicRead: false
+
+
diff --git a/config/mongodb.yml b/config/mongodb.yml
index 12f1f66a5..98f5694e4 100644
--- a/config/mongodb.yml
+++ b/config/mongodb.yml
@@ -1,7 +1,14 @@
+# URI for database connection, leave empty if using address and credential settings directly
uri: ''
+# List of MongoDB server addresses
address: [ localhost:37017 ]
+# Name of the database
database: openim_v3
+# Username for database authentication
username: openIM
+# Password for database authentication
password: openIM123
+# Maximum number of connections in the connection pool
maxPoolSize: 100
-maxRetry: 10
\ No newline at end of file
+# Maximum number of retry attempts for a failed database connection
+maxRetry: 10
diff --git a/config/notification.yml b/config/notification.yml
index 1afb44e46..278376c24 100644
--- a/config/notification.yml
+++ b/config/notification.yml
@@ -17,32 +17,23 @@
# The options field 'isNotification' indicates if it's a notification.
groupCreated:
isSendMsg: true
-
# Reliability level of the message sending.
# Set to 1 to send only when online, 2 for guaranteed delivery.
reliabilityLevel: 1
-
# This setting is effective only when 'isSendMsg' is true.
# It controls whether to count unread messages.
unreadCount: false
-
# Configuration for offline push notifications.
offlinePush:
# Enables or disables offline push notifications.
enable: false
-
# Title for the notification when a group is created.
title: "create group title"
-
# Description for the notification.
desc: "create group desc"
-
# Additional information for the notification.
ext: "create group ext"
-# Content type is not added here.
-# Content should use a JSON structure conforming to the protobuf format.
-
groupInfoSet:
isSendMsg: false
reliabilityLevel: 1
diff --git a/config/openim-msggateway.yml b/config/openim-msggateway.yml
index ad6e180cc..0c92d8327 100644
--- a/config/openim-msggateway.yml
+++ b/config/openim-msggateway.yml
@@ -1,19 +1,30 @@
rpc:
+ # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP
registerIP: ''
+ # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports
ports: [ 10140 ]
prometheus:
+ # Enable or disable Prometheus monitoring
enable: true
+ # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup
ports: [ 20112 ]
+# IP address that the RPC/WebSocket service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP
listenIP: 0.0.0.0
longConnSvr:
+ # WebSocket listening ports, must match the number of rpc.ports
ports: [ 10001 ]
+ # Maximum number of WebSocket connections
websocketMaxConnNum: 100000
+ # Maximum length of the entire WebSocket message packet
websocketMaxMsgLen: 4096
+ # WebSocket connection handshake timeout in seconds
websocketTimeout: 10
+# 1: For Android, iOS, Windows, Mac, and web platforms, only one instance can be online at a time
multiLoginPolicy: 1
+
diff --git a/config/openim-msgtransfer.yml b/config/openim-msgtransfer.yml
index 9cb1598b5..07a7dc1ab 100644
--- a/config/openim-msgtransfer.yml
+++ b/config/openim-msgtransfer.yml
@@ -1,3 +1,6 @@
prometheus:
+ # Enable or disable Prometheus monitoring
enable: true
+ # List of ports that Prometheus listens on; each port corresponds to an instance of monitoring. Ensure these are managed accordingly
+ # Because four instances have been launched, four ports need to be specified
ports: [ 20108, 20109, 20110, 20111 ]
diff --git a/config/openim-push.yml b/config/openim-push.yml
index 35e1b2c07..a1abfcf88 100644
--- a/config/openim-push.yml
+++ b/config/openim-push.yml
@@ -1,14 +1,20 @@
rpc:
+ # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP
registerIP: ''
+ # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP
listenIP: 0.0.0.0
+ # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports
ports: [ 10170 ]
prometheus:
+ # Enable or disable Prometheus monitoring
enable: true
+ # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup
ports: [ 20107 ]
maxConcurrentWorkers: 3
-enable: getui
+#"Use geTui for offline push notifications, or choose fcm or jpns; corresponding configuration settings must be specified."
+enable: "geTui"
geTui:
pushUrl: "https://restapi.getui.com/v2/$appId"
masterSecret: ''
@@ -24,6 +30,7 @@ jpns:
pushURL: ''
pushIntent: ''
+# iOS system push sound and badge count
iosPush:
pushSound: "xxx"
badgeCount: true
diff --git a/config/openim-rpc-auth.yml b/config/openim-rpc-auth.yml
index a77b5457e..2d861cd5a 100644
--- a/config/openim-rpc-auth.yml
+++ b/config/openim-rpc-auth.yml
@@ -1,13 +1,18 @@
rpc:
+ # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP
registerIP: ''
+ # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP
listenIP: 0.0.0.0
+ # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports
ports: [ 10160 ]
prometheus:
+ # Enable or disable Prometheus monitoring
enable: true
+ # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup
ports: [ 20106 ]
tokenPolicy:
- #token有效期,单位(天)
+ # Token validity period, in days
expire: 90
diff --git a/config/openim-rpc-conversation.yml b/config/openim-rpc-conversation.yml
index e2d9b6a53..a094bfac1 100644
--- a/config/openim-rpc-conversation.yml
+++ b/config/openim-rpc-conversation.yml
@@ -1,11 +1,13 @@
rpc:
+ # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP
registerIP: ''
+ # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP
listenIP: 0.0.0.0
+ # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports
ports: [ 10180 ]
prometheus:
+ # Enable or disable Prometheus monitoring
enable: true
+ # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup
ports: [ 20105 ]
-
-
-
diff --git a/config/openim-rpc-friend.yml b/config/openim-rpc-friend.yml
index 109e3f658..7b829f971 100644
--- a/config/openim-rpc-friend.yml
+++ b/config/openim-rpc-friend.yml
@@ -1,8 +1,13 @@
rpc:
+ # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP
registerIP: ''
+ # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP
listenIP: 0.0.0.0
+ # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports
ports: [ 10120 ]
prometheus:
+ # Enable or disable Prometheus monitoring
enable: true
+ # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup
ports: [ 20104 ]
diff --git a/config/openim-rpc-group.yml b/config/openim-rpc-group.yml
index a70d6f96e..78b44030e 100644
--- a/config/openim-rpc-group.yml
+++ b/config/openim-rpc-group.yml
@@ -1,9 +1,13 @@
rpc:
+ # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP
registerIP: ''
+ # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP
listenIP: 0.0.0.0
+ # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports
ports: [ 10150 ]
prometheus:
+ # Enable or disable Prometheus monitoring
enable: true
+ # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup
ports: [ 20103 ]
-
diff --git a/config/openim-rpc-msg.yml b/config/openim-rpc-msg.yml
index de5e2324d..17ce26e9b 100644
--- a/config/openim-rpc-msg.yml
+++ b/config/openim-rpc-msg.yml
@@ -1,13 +1,19 @@
rpc:
+ # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP
registerIP: ''
+ # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP
listenIP: 0.0.0.0
+ # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports
ports: [ 10130 ]
prometheus:
+ # Enable or disable Prometheus monitoring
enable: true
+ # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup
ports: [ 20102 ]
-#发消息是否需要好友验证
+
+# Does sending messages require friend verification
friendVerify: false
diff --git a/config/openim-rpc-third.yml b/config/openim-rpc-third.yml
index e3a847bf2..bb41c93ae 100644
--- a/config/openim-rpc-third.yml
+++ b/config/openim-rpc-third.yml
@@ -1,13 +1,20 @@
rpc:
+ # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP
registerIP: ''
+ # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP
listenIP: 0.0.0.0
+ # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports
ports: [ 10190 ]
prometheus:
+ # Enable or disable Prometheus monitoring
enable: true
+ # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup
ports: [ 20101 ]
+
object:
+ # Use MinIO as object storage, or set to "cos", "oss", "kodo", "aws", while also configuring the corresponding settings
enable: "minio"
cos:
bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com
diff --git a/go.mod b/go.mod
index 891125a89..1279a1285 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/openimsdk/open-im-server/v3
-go 1.20
+go 1.21.2
require (
firebase.google.com/go v3.13.0+incompatible
diff --git a/go.sum b/go.sum
index 5dc0cc524..9b31342d8 100644
--- a/go.sum
+++ b/go.sum
@@ -22,10 +22,13 @@ github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mo
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible h1:8psS8a+wKfiLt1iVDX79F7Y6wUM49Lcha2FMXt4UM8g=
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
+github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
+github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
+github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s=
github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
@@ -43,6 +46,7 @@ github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5P
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ=
+github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -66,12 +70,15 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=
+github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew=
github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
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.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
+github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
@@ -90,6 +97,7 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
+github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
@@ -137,11 +145,13 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.3/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.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw=
+github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
@@ -194,6 +204,7 @@ github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkr
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
+github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kelindar/bitmap v1.5.2 h1:XwX7CTvJtetQZ64zrOkApoZZHBJRkjE23NfqUALA/HE=
@@ -209,7 +220,9 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
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.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8=
@@ -282,6 +295,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
+github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -298,6 +312,7 @@ github.com/redis/go-redis/v9 v9.4.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
+github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@@ -376,6 +391,7 @@ go.opentelemetry.io/otel v1.23.0/go.mod h1:YCycw9ZeKhcJFrb34iVSkyT0iczq/zYDtZYFu
go.opentelemetry.io/otel/metric v1.23.0 h1:pazkx7ss4LFVVYSxYew7L5I6qvLXHA0Ap2pwV+9Cnpo=
go.opentelemetry.io/otel/metric v1.23.0/go.mod h1:MqUW2X2a6Q8RN96E2/nqNoT+z9BSms20Jb7Bbp+HiTo=
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
+go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
go.opentelemetry.io/otel/trace v1.23.0 h1:37Ik5Ib7xfYVb4V1UtnT97T1jI+AoIYkJyPkuL4iJgI=
go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk=
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
@@ -383,6 +399,7 @@ go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8=
go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
+go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
@@ -489,6 +506,7 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
+golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
google.golang.org/api v0.165.0 h1:zd5d4JIIIaYYsfVy1HzoXYZ9rWCSBxxAglbczzo7Bgc=
google.golang.org/api v0.165.0/go.mod h1:2OatzO7ZDQsoS7IFf3rvsE17/TldiU3F/zxFHeqUB5o=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
@@ -526,6 +544,7 @@ google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGm
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
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=
diff --git a/internal/push/offlinepush/offlinepusher.go b/internal/push/offlinepush/offlinepusher.go
index 0706be64a..d4fcae434 100644
--- a/internal/push/offlinepush/offlinepusher.go
+++ b/internal/push/offlinepush/offlinepusher.go
@@ -26,7 +26,7 @@ import (
)
const (
- geTUI = "getui"
+ geTUI = "geTui"
firebase = "fcm"
jPush = "jpush"
)
diff --git a/internal/push/push_handler.go b/internal/push/push_handler.go
index e09b0b2ec..3a9a696f6 100644
--- a/internal/push/push_handler.go
+++ b/internal/push/push_handler.go
@@ -259,7 +259,7 @@ func (c *ConsumerHandler) groupMessagesHandler(ctx context.Context, groupID stri
*pushToUserIDs = append(*pushToUserIDs, kickedUsers...)
case constant.GroupDismissedNotification:
- if msgprocessor.IsNotification(msgprocessor.GetConversationIDByMsg(msg)) { // 消息先到,通知后到
+ if msgprocessor.IsNotification(msgprocessor.GetConversationIDByMsg(msg)) {
var tips sdkws.GroupDismissedTips
if unmarshalNotificationElem(msg.Content, &tips) != nil {
return err
diff --git a/start-config.yml b/start-config.yml
index cd9663c98..a9c412b33 100644
--- a/start-config.yml
+++ b/start-config.yml
@@ -4,7 +4,7 @@ serviceBinaries:
openim-rpc-user: 1
openim-msggateway: 1
openim-push: 1
- openim-msgtransfer: 1
+ openim-msgtransfer: 4
openim-rpc-conversation: 1
openim-rpc-auth: 1
openim-rpc-group: 1
@@ -12,8 +12,6 @@ serviceBinaries:
openim-rpc-msg: 1
openim-rpc-third: 1
toolBinaries:
- - ncpu
- check-free-memory
- - versionchecker
- check-component
maxFileDescriptors: 10000
From e11b928f4f6f73c5208a1b31c93ef41678a93f33 Mon Sep 17 00:00:00 2001
From: skiffer-git <72860476+skiffer-git@users.noreply.github.com>
Date: Thu, 25 Apr 2024 14:17:17 +0800
Subject: [PATCH 3/7] Update the document (#2221)
* Update the document
* Update the document
---
.github/workflows/e2e-test.yml | 2 -
.github/workflows/golangci-lint.yml | 58 -------------
.github/workflows/openimci.yml | 1 +
README.md | 128 +++++++++-------------------
README_zh_CN.md | 87 ++++++-------------
docs/CODEOWNERS | 38 ++++-----
6 files changed, 88 insertions(+), 226 deletions(-)
delete mode 100644 .github/workflows/golangci-lint.yml
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index 62df69ed5..6231697c2 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -80,7 +80,6 @@ jobs:
- name: Module Operations
run: |
- sudo go mod tidy
echo "===========> Verifying go-gitlint is installed"
if [ ! -f ./_output/tools/go-gitlint ]; then
export GOBIN=$(pwd)/_output/tools
@@ -89,7 +88,6 @@ jobs:
echo "===========> go-gitlint is installed in /home/ubuntu/DF/open-im-server/_output/tools/go-gitlint"
fi
-
- name: Build, Start(make build && make start)
run: |
sudo ./scripts/install/install.sh -i
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
deleted file mode 100644
index 64bd498c5..000000000
--- a/.github/workflows/golangci-lint.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright © 2023 OpenIM open source community. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-name: OpenIM golangci-lint
-on:
- push:
- branches: [main]
- pull_request:
-jobs:
- golangci:
- name: lint
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v5
- with:
- go-version: '1.21'
- cache: false
- - name: OpenIM Scripts Verification(make verify)
- run: |
- cd scripts
- for script in verify-*; do
- if [ -x "$script" ]; then
- ./"$script"
- fi
- done
- - name: golangci-lint
- uses: golangci/golangci-lint-action@v4.0.0
- with:
- # Require: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
- version: v1.54
-
- # Optional: working directory, useful for monorepos
- # working-directory: server
-
- # Optional: golangci-lint command line arguments.
- #
- # 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=/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
-
- # Optional:The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
- # install-mode: "goinstall"
diff --git a/.github/workflows/openimci.yml b/.github/workflows/openimci.yml
index 033868a2e..83d495a0e 100644
--- a/.github/workflows/openimci.yml
+++ b/.github/workflows/openimci.yml
@@ -36,6 +36,7 @@ on:
- "CONTRIBUTING/**"
- "**.md"
- "docs/**"
+ workflow_dispatch:
jobs:
diff --git a/README.md b/README.md
index 175db3326..a80bd1432 100644
--- a/README.md
+++ b/README.md
@@ -51,137 +51,89 @@
-## :busts_in_silhouette: Community
+## :busts_in_silhouette: Join Our Community
-+ 💬 [Follow our Twitter account](https://twitter.com/founder_im63606)
-+ 👫 [Join our Reddit](https://www.reddit.com/r/OpenIMessaging)
-+ 🚀 [Join our Slack community](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)
-+ :eyes: [Join our wechat (微信群)](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg)
-+ 📚 [OpenIM Community](https://github.com/OpenIMSDK/community)
-+ 💕 [OpenIM Interest Group](https://github.com/Openim-sigs)
++ 💬 [Follow us on Twitter](https://twitter.com/founder_im63606)
++ 🚀 [Join our Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)
++ :eyes: [Join our WeChat Group](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg)
## Ⓜ️ About OpenIM
-OpenIM is a service platform specifically designed for integrating chat, audio-video calls, notifications, and AI chatbots into applications. It provides a range of powerful APIs and Webhooks, enabling developers to easily incorporate these interactive features into their applications. OpenIM is not a standalone chat application, but rather serves as a platform to support other applications in achieving rich communication functionalities. The following diagram illustrates the interaction between AppServer, AppClient, OpenIMServer, and OpenIMSDK to explain in detail.
+Unlike standalone chat applications such as Telegram, Signal, and Rocket.Chat, OpenIM offers an open-source instant messaging solution designed specifically for developers rather than as a directly installable standalone chat app. Comprising OpenIM SDK and OpenIM Server, it provides developers with a complete set of tools and services to integrate instant messaging functions into their applications, including message sending and receiving, user management, and group management. Overall, OpenIM aims to provide developers with the necessary tools and framework to implement efficient instant messaging solutions in their applications.

-## 🚀 About OpenIMSDK
+## 🚀 Introduction to OpenIMSDK
-**OpenIMSDK** is an IM SDK designed for **OpenIMServer**, created specifically for embedding in client applications. Its main features and modules are as follows:
+**OpenIMSDK**, designed for **OpenIMServer**, is an IM SDK created specifically for integration into client applications. It supports various functionalities and modules:
+ 🌟 Main Features:
-
- - 📦 Local storage
- - 🔔 Listener callbacks
- - 🛡️ API wrapping
- - 🌐 Connection management
+ - 📦 Local Storage
+ - 🔔 Listener Callbacks
+ - 🛡️ API Wrapping
+ - 🌐 Connection Management
+ 📚 Main Modules:
-
1. 🚀 Initialization and Login
2. 👤 User Management
- 3. 👫 Friend Management
+ 3. 👫 Friends Management
4. 🤖 Group Functions
- 5. 💬 Conversation Handling
-
-It is built using Golang and supports cross-platform deployment, ensuring a consistent access experience across all platforms.
-
-👉 **[Explore GO SDK](https://github.com/openimsdk/openim-sdk-core)**
-
-## 🌐 About OpenIMServer
+ 5. 💬 Session Handling
-+ **OpenIMServer** has the following characteristics:
- - 🌐 Microservice architecture: Supports cluster mode, including a gateway and multiple rpc services.
- - 🚀 Diverse deployment methods: Supports deployment via source code, Kubernetes, or Docker.
- - Support for massive user base: Super large groups with hundreds of thousands of users, tens of millions of users, and billions of messages.
+Built with Golang and supports cross-platform deployment to ensure a consistent integration experience across all platforms.
-### Enhanced Business Functionality:
+👉 **[Explore the GO SDK](https://github.com/openimsdk/openim-sdk-core)**
-+ **REST API**: OpenIMServer offers REST APIs for business systems, aimed at empowering businesses with more functionalities, such as creating groups and sending push messages through backend interfaces.
-+ **Webhooks**: OpenIMServer provides callback capabilities to extend more business forms. A callback means that OpenIMServer sends a request to the business server before or after a certain event, like callbacks before or after sending a message.
+## 🌐 Introduction to OpenIMServer
-👉 **[Learn more](https://docs.openim.io/guides/introduction/product)**
++ **OpenIMServer** features include:
+ - 🌐 Microservices Architecture: Supports cluster mode, including a gateway and multiple rpc services.
+ - 🚀 Diverse Deployment Options: Supports source code, Kubernetes, or Docker deployment.
+ - Massive User Support: Supports large-scale groups with hundreds of thousands, millions of users, and billions of messages.
-## :building_construction: Overall Architecture
+### Enhanced Business Functions:
-Delve into the heart of Open-IM-Server's functionality with our architecture diagram.
++ **REST API**: Provides a REST API for business systems to enhance functionality, such as group creation and message pushing through backend interfaces.
-
++ **Webhooks**: Expands business forms through callbacks, sending requests to business servers before or after certain events.
+ 
## :rocket: Quick Start
-We support many platforms. Here are the addresses for quick experience on the web side:
+Experience online for iOS/Android/H5/PC/Web:
-👉 **[OpenIM online web demo](https://web-enterprise.rentsoft.cn/)**
+👉 **[OpenIM Online Demo](https://www.openim.io/en/commercial)**
-🤲 To facilitate user experience, we offer various deployment solutions. You can choose your deployment method from the list below:
+To facilitate user experience, we offer various deployment solutions. You can choose your preferred deployment method from the list below:
+ **[Source Code Deployment Guide](https://docs.openim.io/guides/gettingStarted/imSourceCodeDeployment)**
+ **[Docker Deployment Guide](https://docs.openim.io/guides/gettingStarted/dockerCompose)**
-+ **[Kubernetes Deployment Guide](https://docs.openim.io/guides/gettingStarted/k8s-deployment)**
-+ **[Mac Developer Deployment Guide](https://docs.openim.io/guides/gettingstarted/mac-deployment-guide)**
-
-## :hammer_and_wrench: To Start Developing OpenIM
-
-[](https://vscode.dev/github/openimsdk/open-im-server)
-
-[](https://codespaces.new/openimsdk/open-im-server)
-
-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).
+## System Support
-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.
+Supports Linux, Windows, Mac systems, and ARM and AMD CPU architectures.
-- [OpenIM API Reference](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/api.md)
-- [OpenIM Bash Logging](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/bash-log.md)
-- [OpenIM CI/CD Actions](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/cicd-actions.md)
-- [OpenIM Code Conventions](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/code-conventions.md)
-- [OpenIM Commit Guidelines](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/commit.md)
-- [OpenIM Development Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/development.md)
-- [OpenIM Directory Structure](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/directory.md)
-- [OpenIM Environment Setup](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/environment.md)
-- [OpenIM Error Code Reference](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/error-code.md)
-- [OpenIM Git Workflow](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/git-workflow.md)
-- [OpenIM Git Cherry Pick Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/gitcherry-pick.md)
-- [OpenIM GitHub Workflow](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/github-workflow.md)
-- [OpenIM Go Code Standards](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/go-code.md)
-- [OpenIM Image Guidelines](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/images.md)
-- [OpenIM Initial Configuration](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/init-config.md)
-- [OpenIM Docker Installation Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/install-docker.md)
-- [OpenIM OpenIM Linux System Installation](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/install-openim-linux-system.md)
-- [OpenIM Linux Development Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/linux-development.md)
-- [OpenIM Local Actions Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/local-actions.md)
-- [OpenIM Logging Conventions](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/logging.md)
-- [OpenIM Offline Deployment](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/offline-deployment.md)
-- [OpenIM Protoc Tools](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/protoc-tools.md)
-- [OpenIM Testing Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/test.md)
-- [OpenIM Utility Go](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/util-go.md)
-- [OpenIM Makefile Utilities](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/util-makefile.md)
-- [OpenIM Script Utilities](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/util-scripts.md)
-- [OpenIM Versioning](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/version.md)
-- [Manage backend and monitor deployment](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/prometheus-grafana.md)
-- [Mac Developer Deployment Guide for OpenIM](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/mac-developer-deployment-guide.md)
+## :link: Links
-## :calendar: Community Meetings
+ + **[Developer Manual](https://docs.openim.io/)**
+ + **[Changelog](https://github.com/openimsdk/open-im-server/blob/main/CHANGELOG.md)**
-We want anyone to get involved in our community and contributing code, we offer gifts and rewards, and we welcome you to join us every Thursday night.
+## :writing_hand: How to Contribute
-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 welcome contributions of any kind! Please make sure to read our [Contributor Documentation](https://github.com/openimsdk/open-im-server/blob/main/CONTRIBUTING.md) before submitting a Pull Request.
-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).
+ + **[Report a Bug](https://github.com/openimsdk/open-im-server/issues/new?assignees=&labels=bug&template=bug_report.md&title=)**
+ + **[Suggest a Feature](https://github.com/openimsdk/open-im-server/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=)**
+ + **[Submit a Pull Request](https://github.com/openimsdk/open-im-server/pulls)**
-## :eyes: Who Are Using OpenIM
+Thank you for contributing to building a powerful instant messaging solution!
-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.
+## :closed_book: License
-## :page_facing_up: License
+OpenIMSDK is available under the Apache License 2.0. See the [LICENSE file](https://github.com/openimsdk/open-im-server/blob/main/LICENSE) for more information.
-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.
## 🔮 Thanks to our contributors!
diff --git a/README_zh_CN.md b/README_zh_CN.md
index f42031165..e9e56994f 100644
--- a/README_zh_CN.md
+++ b/README_zh_CN.md
@@ -51,31 +51,29 @@
-## 🟢 扫描微信进群交流
-
+## :busts_in_silhouette: 加入我们的社区
++ 💬 [关注我们的 Twitter](https://twitter.com/founder_im63606)
++ 🚀 [加入我们的 Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)
++ :eyes: [加入我们的微信群](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg)
## Ⓜ️ 关于 OpenIM
-OpenIM 是一个专门设计用于在应用程序中集成聊天、音视频通话、通知以及AI聊天机器人等通信功能的服务平台。它通过提供一系列强大的API和Webhooks,使开发者可以轻松地在他们的应用中加入这些交互特性。OpenIM 本身并不是一个独立运行的聊天应用,而是作为一个平台,为其他应用提供支持,实现丰富的通信功能。下图展示 AppServer、AppClient、OpenIMServer 和 OpenIMSDK 之间的交互关系来具体说明。
-
-
+与Telegram、Signal、Rocket.Chat等独立聊天应用不同,OpenIM提供了专为开发者设计的开源即时通讯解决方案,而不是直接安装使用的独立聊天应用。OpenIM由OpenIM SDK和OpenIM Server两大部分组成,为开发者提供了一整套集成即时通讯功能的工具和服务,包括消息发送接收、用户管理和群组管理等。总体来说,OpenIM旨在为开发者提供必要的工具和框架,帮助他们在自己的应用中实现高效的即时通讯解决方案。

-## 🚀 关于 OpenIMSDK
+## 🚀 OpenIMSDK 介绍
-**OpenIMSDK** 是为 **OpenIMServer** 设计的IM SDK,专为嵌入客户端应用而生。其主要功能及模块如下:
+**OpenIMSDK** 是为 **OpenIMServer** 设计的IM SDK,专为集成到客户端应用而生。它支持多种功能和模块:
+ 🌟 主要功能:
-
- 📦 本地存储
- 🔔 监听器回调
- 🛡️ API封装
- 🌐 连接管理
- ## 📚 主要模块:
-
++ 📚 主要模块:
1. 🚀 初始化及登录
2. 👤 用户管理
3. 👫 好友管理
@@ -86,81 +84,52 @@ OpenIM 是一个专门设计用于在应用程序中集成聊天、音视频通
👉 **[探索 GO SDK](https://github.com/openimsdk/openim-sdk-core)**
-## 🌐 关于 OpenIMServer
+## 🌐 OpenIMServer 介绍
-+ **OpenIMServer** 具有以下特点:
++ **OpenIMServer** 的特点包括:
- 🌐 微服务架构:支持集群模式,包括网关(gateway)和多个rpc服务。
- - 🚀 部署方式多样:支持源代码、kubernetes或docker部署。
- - 海量用户支持:十万超级大群,千万用户,及百亿消息
+ - 🚀 多样的部署方式:支持源代码、Kubernetes或Docker部署。
+ - 海量用户支持:支持十万级超大群组,千万级用户和百亿级消息。
### 增强的业务功能:
-+ **REST API**:OpenIMServer 提供了REST API供业务系统使用,旨在赋予业务更多功能,例如通过后台接口建立群组、发送推送消息等。
-+ **Webhooks**:OpenIMServer提供了回调能力以扩展更多的业务形态,所谓回调,即OpenIMServer会在某一事件发生之前或者之后,向业务服务器发送请求,如发送消息之前或之后的回调。
++ **REST API**:为业务系统提供REST API,增加群组创建、消息推送等后台接口功能。
+
++ **Webhooks**:通过事件前后的回调,向业务服务器发送请求,扩展更多的业务形态。
-👉 **[了解更多](https://docs.openim.io/guides/introduction/product)**
+ 
-## :rocket: 快速开始
+
+
+## :rocket: 快速入门
在线体验iOS/Android/H5/PC/Web:
-👉 **[OpenIM online demo](https://www.openim.io/zh/commercial)**
+👉 **[OpenIM在线演示](https://www.openim.io/en/commercial)**
-🤲 为了方便用户体验,我们提供了多种部署解决方案,您可以根据下面的列表选择自己的部署方法:
+为了便于用户体验,我们提供了多种部署解决方案,您可以根据以下列表选择适合您的部署方式:
+ **[源代码部署指南](https://docs.openim.io/guides/gettingStarted/imSourceCodeDeployment)**
+ **[Docker 部署指南](https://docs.openim.io/guides/gettingStarted/dockerCompose)**
-+ **[Kubernetes 部署指南](https://docs.openim.io/guides/gettingStarted/k8s-deployment)**
-
-## :hammer_and_wrench: 开始开发 OpenIM
-
-OpenIM 我们的目标是建立一个顶级的开源社区。我们有一套标准,在[社区仓库](https://github.com/OpenIMSDK/community)中。
-
-如果你想为这个 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/blob/main/docs/contrib/go-code.md)
+## 系统支持
-+ [Docker 镜像标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/images.md)
+支持 Linux、Windows、Mac 系统以及 ARM 和 AMD CPU 架构。
-+ [目录标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/directory.md)
+## :link: 相关链接
-+ [提交标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/commit.md)
-
-+ [版本控制标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/version.md)
-
-+ [接口标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/interface.md)
-
-+ [OpenIM配置和环境变量设置](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md)
-
-> **Note**
-> 针对中国的用户,阅读我们的 [Docker 镜像标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/images.md) 以便使用国内 aliyun 的镜像地址。OpenIM 也有针对中国的 gitee 同步仓库,你可以在 [gitee.com](https://gitee.com/openimsdk) 上找到它。
-
-## :link: 链接
-
- + **[完整文档](https://doc.rentsoft.cn/)**
+ + **[开发手册](https://docs.openim.io/)**
+ **[更新日志](https://github.com/openimsdk/open-im-server/blob/main/CHANGELOG.md)**
- + **[FAQ](https://github.com/openimsdk/open-im-server/blob/main/FAQ.md)**
- + **[代码示例](https://github.com/openimsdk/open-im-server/blob/main/examples)**
-
-## :handshake: 社区
-
- + **[GitHub Discussions](https://github.com/openimsdk/open-im-server/discussions)**
- + **[Slack 通信](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)**
- + **[GitHub Issues](https://github.com/openimsdk/open-im-server/issues)**
-
- 您可以加入这些平台,讨论问题,提出建议,或分享您的成功故事!
-## :writing_hand: 贡献
+## :writing_hand: 如何贡献
- 我们欢迎任何形式的贡献!请确保在提交 Pull Request 之前阅读我们的[贡献者文档](https://github.com/openimsdk/open-im-server/blob/main/CONTRIBUTING.md)。
+我们欢迎任何形式的贡献!在提交 Pull Request 之前,请确保阅读我们的[贡献者文档](https://github.com/openimsdk/open-im-server/blob/main/CONTRIBUTING.md)
+ **[报告 Bug](https://github.com/openimsdk/open-im-server/issues/new?assignees=&labels=bug&template=bug_report.md&title=)**
+ **[提出新特性](https://github.com/openimsdk/open-im-server/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=)**
+ **[提交 Pull Request](https://github.com/openimsdk/open-im-server/pulls)**
- 感谢您的贡献,我们一起打造一个强大的即时通信解决方案!
+感谢您的贡献,一起来打造强大的即时通讯解决方案!
## :closed_book: 许可证
diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS
index d1119eb61..68e459f9d 100644
--- a/docs/CODEOWNERS
+++ b/docs/CODEOWNERS
@@ -2,28 +2,28 @@
# Each line is a file pattern followed by one or more owners.
# README files
-README.md @openimsdk/openim @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @rfyiamcool @withchao
+README.md @openimsdk/openim @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @withchao
# Contributing guidelines
-CONTRIBUTING.md @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @rfyiamcool @withchao
+CONTRIBUTING.md @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @withchao
# License files
-LICENSE @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @rfyiamcool @withchao
+LICENSE @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @withchao
# Makefile
-Makefile @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @rfyiamcool @withchao
+Makefile @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @withchao
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
-# @cubxxw and @openimsdk/bot will be requested for
+# and @openimsdk/bot will be requested for
# review when someone opens a pull request.
-* @openimsdk/openim @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @rfyiamcool @withchao
+* @openimsdk/openim @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @withchao
# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
-*.js @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @rfyiamcool @withchao
+*.js @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @withchao
# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
@@ -35,7 +35,7 @@ Makefile @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @rfyiam
# be identified in the format @org/team-name. Teams must have
# explicit write access to the repository. In this example,
# the OpenIMSDK team in the github organization owns all .txt files.
-*.txt @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @rfyiamcool @withchao
+*.txt @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @withchao
# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
@@ -44,13 +44,13 @@ docs/* 3293172751nss@gmail.com @openimsdk/bot @skiffer-git
# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
-api/ @openimsdk/openim @cubxxw @skiffer-git
+api/ @openimsdk/openim @skiffer-git
# This is a comment.
# Each line is a file pattern followed by one or more owners.
# CHANGELOG file
-CHANGELOG/* @cubxxw @skiffer-git
+CHANGELOG/* @skiffer-git
# _output directory
_output/* @skiffer-git
@@ -67,21 +67,21 @@ config/* @skiffer-git
# internal directory
internal/ @openimsdk/openim @skiffer-git @FGadvancer
-tools @openimsdk/openim @openimsdk/bot @cubxxw @skiffer-git @FGadvancer
+tools @openimsdk/openim @openimsdk/bot @skiffer-git @FGadvancer
# logs directory
logs/* @skiffer-git @FGadvancer
# pkg directory
-pkg/a2r @openimsdk/openim @skiffer-git @cubxxw @openimsdk/bot
+pkg/a2r @openimsdk/openim @skiffer-git @openimsdk/bot
# scripts directory
-scripts/template/* @openimsdk/openim @cubxxw @skiffer-git @FGadvancer
-scripts/enterprise/* @openimsdk/openim @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
-scripts/githooks/* @openimsdk/openim @cubxxw @skiffer-git @FGadvancer
-scripts/lib/* @openimsdk/openim @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
-scripts/make-rules/* @openimsdk/openim @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
+scripts/template/* @openimsdk/openim @skiffer-git @FGadvancer
+scripts/enterprise/* @openimsdk/openim @FGadvancer @skiffer-git @openimsdk/bot
+scripts/githooks/* @openimsdk/openim @skiffer-git @FGadvancer
+scripts/lib/* @openimsdk/openim @FGadvancer @skiffer-git @openimsdk/bot
+scripts/make-rules/* @openimsdk/openim @FGadvancer @skiffer-git @openimsdk/bot
# test directory
-test/mongo @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
-test/mysql @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
+test/mongo @FGadvancer @skiffer-git @openimsdk/bot
+test/mysql @FGadvancer @skiffer-git @openimsdk/bot
From cc42fa35eb30d40fc6a58c4ad56c0dbb614ffe4a Mon Sep 17 00:00:00 2001
From: skiffer-git <44203734@qq.com>
Date: Fri, 26 Apr 2024 09:18:09 +0800
Subject: [PATCH 4/7] use openim/openim-admin openim/openim-web image
---
.env | 4 ++--
.github/workflows/e2e-test.yml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.env b/.env
index 92c4d5c41..91c730a5c 100644
--- a/.env
+++ b/.env
@@ -6,8 +6,8 @@ KAFKA_IMAGE=bitnami/kafka:3.5.1
MINIO_IMAGE=minio/minio:RELEASE.2024-01-11T07-46-16Z
-OPENIM_WEB_FRONT_IMAGE=ghcr.io/openimsdk/openim-web:v3.5.0-docker
-OPENIM_ADMIN_FRONT_IMAGE=ghcr.io/openimsdk/openim-admin:toc-base-open-docker.35
+OPENIM_WEB_FRONT_IMAGE=openim/openim-web:v3.5.0-docker
+OPENIM_ADMIN_FRONT_IMAGE=openim/openim-admin:toc-base-open-docker.35
DATA_DIR=./
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index 6231697c2..df9c223d3 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -90,7 +90,7 @@ jobs:
- name: Build, Start(make build && make start)
run: |
- sudo ./scripts/install/install.sh -i
+ sudo ./scripts/install/install.sh -i
- name: Exec OpenIM System Status Chack
run: |
From fd0ed00ae15053e0efdbb34d6e5b8f71e270b6f6 Mon Sep 17 00:00:00 2001
From: OpenIM-Gordon <46924906+FGadvancer@users.noreply.github.com>
Date: Mon, 13 May 2024 18:14:38 +0800
Subject: [PATCH 5/7] Update .golangci.yml
---
.golangci.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.golangci.yml b/.golangci.yml
index ae8cea673..4e5128219 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -45,6 +45,8 @@ run:
# - util
# - .*~
# - api/swagger/docs
+
+
# - server/docs
# - components/mnt/config/certs
# - logs
From fde830d844968b8137b37d4a39f43ee1d99b08bf Mon Sep 17 00:00:00 2001
From: skiffer-git <44203734@qq.com>
Date: Wed, 15 May 2024 15:51:09 +0800
Subject: [PATCH 6/7] Add etcd as a service discovery mechanism
---
CONTRIBUTING-zh_CN.md | 46 ++++++++++++++++++++++++++++---------------
1 file changed, 30 insertions(+), 16 deletions(-)
diff --git a/CONTRIBUTING-zh_CN.md b/CONTRIBUTING-zh_CN.md
index c10d7337f..8bb98a8e9 100644
--- a/CONTRIBUTING-zh_CN.md
+++ b/CONTRIBUTING-zh_CN.md
@@ -1,7 +1,9 @@
-# 如何给OpenIM贡献代码(提交pull request)
+
+
+# 如何给 OpenIM 贡献代码(提交 Pull Request)
- Englist ·
+ English ·
中文 ·
Українська ·
Česky ·
@@ -28,55 +30,67 @@
Türkçe
+本指南将以 [openimsdk/open-im-server](https://github.com/openimsdk/open-im-server) 为例,详细说明如何为 OpenIM 项目贡献代码。我们采用“一问题一分支”的策略,确保每个 Issue 都对应一个专门的分支,以便有效管理代码变更。
-本指南将以 [openimsdk/open-im-server](https://github.com/openimsdk/open-im-server)为例详细说明如何为 OpenIM 项目贡献代码。我们采用“一问题一分支”的策略,确保每个 Issue 都对应一个专门的分支,以便有效管理代码变更。
-
-## 1. Fork 仓库
+### 1. Fork 仓库
前往 [openimsdk/open-im-server](https://github.com/openimsdk/open-im-server) GitHub 页面,点击右上角的 "Fork" 按钮,将仓库 Fork 到你的 GitHub 账户下。
-## 2. 克隆仓库
+### 2. 克隆仓库
将你 Fork 的仓库克隆到本地:
```bash
git clone https://github.com/your-username/open-im-server.git
```
-## 3. 设置远程上游
+### 3. 设置远程上游
添加原始仓库为远程上游以便跟踪其更新:
```bash
git remote add upstream https://github.com/openimsdk/open-im-server.git
```
-## 4. 创建 Issue
-在原始仓库中创建一个新的 Issue,详细描述你遇到的问题或希望添加的新功能。
+### 4. 创建 Issue
+在原始仓库中创建一个新的 Issue,详细描述你遇到的问题或希望添加
-## 5. 创建新分支
+的新功能。
+
+### 5. 创建新分支
基于主分支创建一个新分支,并使用描述性的名称与 Issue ID,例如:
```bash
git checkout -b fix-bug-123
```
-## 6. 提交更改
+### 6. 提交更改
在你的本地分支上进行更改后,提交这些更改:
```bash
git add .
git commit -m "Describe your changes in detail"
```
-## 7. 推送分支
+### 7. 推送分支
将你的分支推送回你的 GitHub Fork:
```bash
git push origin fix-bug-123
```
-## 8. 创建 Pull Request
+### 8. 创建 Pull Request
在 GitHub 上转到你的 Fork 仓库,点击 "Pull Request" 按钮。确保 PR 描述清楚,并链接到相关的 Issue。
-## 9. 签署 CLA
+### 9. 签署 CLA
如果这是你第一次提交 PR,你需要在 PR 的评论中回复:
```
I have read the CLA Document and I hereby sign the CLA
```
-## 其他说明
-如果需要将同一修改提交到两个不同的分支(例如 `main` 和 `release-v3.7`),应从对应的远程分支分别创建两个新分支。首先在一个分支上完成修改,然后使用 `cherry-pick` 命令将这些更改应用到另一个分支。之后,为每个分支独立提交 Pull Request。
+### 编程规范
+请参考以下文档以了解关于 Go 语言编程规范的详细信息:
+- [Go 编码规范](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/go-code.md)
+- [代码约定](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/code-conventions.md)
+
+### 日志规范
+- **禁止使用标准的 `log` 包**。
+- 应使用 `"github.com/openimsdk/tools/log"` 包来打印日志,该包支持多种日志级别:`debug`、`info`、`warn`、`error`。
+- **错误日志应仅在首次调用的函数中打印**,以防止日志重复,并确保错误的上下文清晰。
+### 异常及错误处理
+- **禁止使用 `panic`**:程序中不应使用 `panic`,以避免在遇到不可恢复的错误时突然终止。
+- **错误包裹**:使用 `"github.com/openimsdk/tools/errs"` 来包裹错误,保持错误信息的完整性并增加调试便利。
+- **错误传递**:如果函数本身不能处理错误,应将错误返回给调用者,而不是隐藏或忽略这些错误。
\ No newline at end of file
From 73a2a0fe5890de784339d578aae2086e937d066e Mon Sep 17 00:00:00 2001
From: skiffer-git <44203734@qq.com>
Date: Wed, 15 May 2024 15:55:04 +0800
Subject: [PATCH 7/7] Add etcd as a service discovery mechanism
---
CONTRIBUTING.md | 41 +++++++++++++++++++++++++++--------------
1 file changed, 27 insertions(+), 14 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a85ba891f..26c800063 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,7 +1,7 @@
-# How do I contribute code to OpenIM
+# How to Contribute to OpenIM (Submitting Pull Requests)
- Englist ·
+ English ·
中文 ·
Українська ·
Česky ·
@@ -27,13 +27,14 @@
Ελληνικά ·
Türkçe
-This guide will explain in detail how to contribute code to the OpenIM project, using `openimsdk/open-im-server` as an example. We adopt a "one issue, one branch" strategy to ensure each issue corresponds to a dedicated branch, allowing for effective management of code changes.
+
+This guide will use [openimsdk/open-im-server](https://github.com/openimsdk/open-im-server) as an example to explain in detail how to contribute code to the OpenIM project. We adopt a "one issue, one branch" strategy to ensure each issue corresponds to a dedicated branch for effective code change management.
### 1. Fork the Repository
-Go to the `openimsdk/open-im-server` GitHub page, click the "Fork" button in the upper right corner to fork the repository to your GitHub account.
+Go to the [openimsdk/open-im-server](https://github.com/openimsdk/open-im-server) GitHub page, click the "Fork" button in the upper right corner to fork the repository to your GitHub account.
### 2. Clone the Repository
-Clone the forked repository to your local machine:
+Clone the repository you forked to your local machine:
```bash
git clone https://github.com/your-username/open-im-server.git
```
@@ -45,19 +46,21 @@ git remote add upstream https://github.com/openimsdk/open-im-server.git
```
### 4. Create an Issue
-Create a new issue in the original repository describing the problem you are facing or the new feature you want to add. For significant feature adjustments, propose an RFC issue to facilitate broad discussion and participation from community members.
+Create a new issue in the original repository detailing the problem you encountered or the new feature you wish to add.
### 5. Create a New Branch
-Create a new branch based on the main branch and name it descriptively, including the Issue ID, for example:
+Create a new branch off the main branch with a descriptive name and Issue ID, for example:
```bash
git checkout -b fix-bug-123
```
### 6. Commit Changes
-After making changes on your local branch, commit them:
+After making changes on your local branch, commit these changes:
```bash
git add .
-git commit -m "Describe your changes in detail"
+git commit -m "Describe your changes
+
+ in detail"
```
### 7. Push the Branch
@@ -67,15 +70,25 @@ git push origin fix-bug-123
```
### 8. Create a Pull Request
-Go to your fork on GitHub, click the "Pull Request" button. Make sure the PR description is clear and links to the related Issue.
-#### 🅰 Fixed issue #issueID
+Go to your fork on GitHub and click the "Pull Request" button. Ensure the PR description is clear and links to the related issue.
### 9. Sign the CLA
-If this is your first time submitting a PR, you need to reply in the PR comments:
+If this is your first time submitting a PR, you will need to reply in the comments of the PR:
```
I have read the CLA Document and I hereby sign the CLA
```
-### Additional Notes
-If the same modification needs to be submitted to two different branches (e.g., main and release-v3.7), create two new branches from the corresponding remote branches. First complete the modification in one branch, then use the `cherry-pick` command to apply these changes to the other branch. After that, submit a separate Pull Request for each branch.
+### Programming Standards
+Please refer to the following documents for detailed information on Go language programming standards:
+- [Go Coding Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/go-code.md)
+- [Code Conventions](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/code-conventions.md)
+
+### Logging Standards
+- **Do not use the standard `log` package**.
+- Use the `"github.com/openimsdk/tools/log"` package for logging, which supports multiple log levels: `debug`, `info`, `warn`, `error`.
+- **Error logs should only be printed in the function where they are first actively called** to prevent log duplication and ensure clear error context.
+### Exception and Error Handling
+- **Prohibit the use of `panic`**: The code should not use `panic` to avoid abrupt termination when encountering unrecoverable errors.
+- **Error Wrapping**: Use `"github.com/openimsdk/tools/errs"` to wrap errors, maintaining the integrity of error information and facilitating debugging.
+- **Error Propagation**: If a function cannot handle an error itself, it should return the error to the caller, rather than hiding or ignoring it.
\ No newline at end of file