Liu Song’s Projects


~/Projects/mqtt-go

git clone https://code.lsong.org/mqtt-go

Commit

Commit
11e0256959495e9ec8a5514f256cec0002b04f91
Author
werbenhu <[email protected]>
Date
2023-10-04 03:45:34 +0800 +0800
Diffstat
 README-CN.md | 28 ++++++++++++++++++++++------

update README-CN.md (#312)


diff --git a/README-CN.md b/README-CN.md
index 66846c7e2fc01b6ccbd01cb03a481e87a7f72ab9..20db9ac92f7f6679c47afc1dc0043b16c3cf1a19 100644
--- a/README-CN.md
+++ b/README-CN.md
@@ -10,8 +10,10 @@ [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/mochi-mqtt/server/issues)
 
 </p>
 
+<p align="center">
 # Mochi-MQTT Server
-# Mochi-MQTT Server
+[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/mochi-mqtt/server/issues)
+
 
 🎆 **mochi-co/mqtt 现在已经是新的 mochi-mqtt 组织的一部分。** 详细信息请[阅读公告.](https://github.com/orgs/mochi-mqtt/discussions/271)
 
@@ -51,8 +53,8 @@
 ### 兼容性说明(Compatibility Notes)
 由于 v5 规范与 MQTT 的早期版本存在重叠,因此服务器可以接受 v5 和 v3 客户端,但在连接了 v5 和 v3 客户端的情况下,为 v5 客户端提供的属性和功能将会对 v3 客户端进行降级处理(例如用户属性)。
 
-    
 <p align="center">
+    - 主题别名(Topic Aliases)
 
 #### 版本更新时间
 除非涉及关键问题,新版本通常在周末发布。
@@ -74,13 +76,22 @@ ```
 
 ### 使用 Docker
 
+你现在可以从 Docker Hub 仓库中拉取并运行Mochi MQTT[官方镜像](https://hub.docker.com/r/mochimqtt/server):
 ![build status](https://github.com/mochi-mqtt/server/actions/workflows/build.yml/badge.svg) 
-[![Go Reference](https://pkg.go.dev/badge/github.com/mochi-mqtt/server.svg)](https://pkg.go.dev/github.com/mochi-mqtt/server/v2)
+[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/mochi-mqtt/server/issues)
+docker pull mochimqtt/server
+或者
+docker run mochimqtt/server
+```
+
+我们还在积极完善这部分的工作,现在正在实现使用[配置文件的启动](https://github.com/orgs/mochi-mqtt/projects/2)方式。更多关于 Docker 的支持正在[这里](https://github.com/orgs/mochi-mqtt/discussions/281#discussion-5544545)和[这里](https://github.com/orgs/mochi-mqtt/discussions/209)进行讨论。如果你有在这个场景下使用 Mochi-MQTT,也可以参与到讨论中来。
+
+我们提供了一个简单的 Dockerfile,用于运行 cmd/main.go 中的 Websocket(:1882)、TCP(:1883) 和服务端状态信息(:8080)这三个服务监听:
+
 ```sh
 docker build -t mochi:latest .
 docker run -p 1883:1883 -p 1882:1882 -p 8080:8080 mochi:latest
 ```
-[![Coverage Status](https://coveralls.io/repos/github/mochi-mqtt/server/badge.svg?branch=master&v2)](https://coveralls.io/github/mochi-mqtt/server?branch=master)
 
 
 ## 使用 Mochi MQTT 进行开发
@@ -172,6 +183,11 @@ })
 ```
 请参考 mqtt.Options、mqtt.Capabilities 和 mqtt.Compatibilities 结构体,以查看完整的所有服务端选项。ClientNetWriteBufferSize 和 ClientNetReadBufferSize 可以根据你的需求配置调整每个客户端的内存使用状况。
 
+### 默认配置说明(Default Configuration Notes)
+
+关于决定默认配置的值,在这里进行一些说明:
+
+- 默认情况下,server.Options.Capabilities.MaximumMessageExpiryInterval 的值被设置为 86400(24小时),以防止在使用默认配置时网络上暴露服务器而受到恶意DOS攻击(如果不配置到期时间将允许无限数量的保留retained/待发送inflight消息累积)。如果您在一个受信任的环境中运行,或者您有更大的保留期容量,您可以选择覆盖此设置(设置为 0 或 math.MaxInt 以取消到期限制)。
 
 ## 事件钩子(Event Hooks)
 
@@ -267,7 +283,7 @@ })
 ```
 详细信息请参阅 [examples/auth/encoded/main.go](examples/auth/encoded/main.go)。
 
-### 持久化存储
+### 持久化存储(Persistent Storage)
 
 #### Redis
 
@@ -347,7 +363,7 @@ | OnClientExpired        | 在客户端会话已过期并应删除时调用。                                                                                                                                                                                                                                            | 
 | OnRetainedExpired      | 在保留的消息已过期并应删除时调用。|                                                                                                                                                                                                                                         | 
 | StoredClients          | 这个接口需要返回客户端列表,例如从持久化数据库中获取客户端列表。                                                                                                                                                                                          | 
 | StoredSubscriptions    | 返回客户端的所有订阅,例如从持久化数据库中获取客户端的订阅列表。                            | 
-| StoredInflightMessages | 返回正在传输中的消息(inflight messages),例如从持久化数据库中获取到还有哪些消息未完成传输。                                                                                                                                                                                                                                               | 
+| StoredInflightMessages | 返回待发送消息(inflight messages),例如从持久化数据库中获取到还有哪些消息未完成传输。                                                                                                                                                                                                                                               | 
 | StoredRetainedMessages | 返回保留的消息,例如从持久化数据库获取保留的消息。                                                                                                                                                                                                                                                   | 
 | StoredSysInfo          | 返回存储的系统状态信息,例如从持久化数据库获取的系统状态信息。     |