diff --git a/README.md b/README.md index 11a0be12..271b115d 100644 --- a/README.md +++ b/README.md @@ -353,9 +353,9 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r |`LoggerFile` | 日志 | 稳定 | 使用文件写日志 | |`LoggerZinc` | 日志 | 稳定(推荐) | 使用[Zinc](https://github.com/zinclabs/zinc)写日志 | |`LoggerMeili` | 日志 | 内测 | 使用[Meilisearch](https://github.com/meilisearch/meilisearch)写日志 | -|`Friendship` | 关系模式 | 内测(默认) | 弱关系好友模式,类似微信朋友圈 | +|`Friendship` | 关系模式 | 内测 | 弱关系好友模式,类似微信朋友圈 | |`Followship` | 关系模式 | WIP | 关注者模式,类似Twitter的Follow模式 | -|`Lightship` | 关系模式 | 内测 | 开放模式,所有推文都公开可见 | +|`Lightship` | 关系模式 | 内测(默认) | 开放模式,所有推文都公开可见 | |`Alipay` | 支付 | 稳定 | 开启基于[支付宝开放平台](https://open.alipay.com/)的钱包功能 | |`Sms` | 短信验证 | 稳定 | 开启短信验证码功能,用于手机绑定验证手机是否注册者的;功能如果没有开启,手机绑定时任意短信验证码都可以绑定手机 | |`Docs:OpenAPI` | 开发文档 | 稳定 | 开启openapi文档功能,提供web api文档说明(visit http://127.0.0.1:8008/docs/openapi) | diff --git a/docs/deploy/core/001-配置文件说明.md b/docs/deploy/core/001-配置文件说明.md index b1af7e2b..42bcc9bb 100644 --- a/docs/deploy/core/001-配置文件说明.md +++ b/docs/deploy/core/001-配置文件说明.md @@ -56,13 +56,15 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r 目前支持的功能集合: | 功能项 | 类别 | 状态 | 备注 | | ----- | ----- | ----- | ----- | -|`OldWeb` | 子服务 | 稳定(默认) | 开启旧的Web服务 | -|`Web` | 子服务 | WIP | 开启Web服务| +|`Web` | 子服务 | 内测 | 开启Web服务| |`Admin` | 子服务 | WIP | 开启Admin后台运维服务| |`SpaceX` | 子服务 | WIP | 开启SpaceX服务| |`Bot` | 子服务 | WIP | 开启Bot服务| |`NativeOBS` | 子服务 | WIP | 开启NativeOBS服务| -|`Deprecated:Web` | 子服务 | 稳定 | Deprecated(关闭) OldWeb服务| +|`Docs` | 子服务 | WIP | 开启开发者文档服务| +|`Frontend:Web` | 子服务 | 稳定 | 开启独立前端服务| +|`Frontend:EmbedWeb` | 子服务 | 稳定 | 开启内嵌于后端Web API服务中的前端服务| +|`Deprecated:Web` | 子服务 | 稳定 | 开启旧的Web服务| |`Gorm` | 数据库 | 稳定(默认) | 使用[gorm](https://github.com/go-gorm/gorm)作为数据库的ORM,默认使用 `Gorm` + `MySQL`组合| |`Sqlx`| 数据库 | WIP | 使用[sqlx](https://github.com/jmoiron/sqlx)作为数据库的ORM| |`MySQL`| 数据库 | 稳定(默认) | 使用MySQL作为数据库| @@ -77,7 +79,7 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r |`OSS:Retention` | 对象存储 | 内测 |基于对象存储系统的对象过期自动删除特性实现 先创建临时对象再持久化的功能| |`OSS:TempDir` | 对象存储 | 内测 |基于对象存储系统的对象拷贝/移动特性实现 先创建临时对象再持久化的功能| |`Redis` | 缓存 | 稳定 | Redis缓存功能 | -|`SimpleCacheIndex` | 缓存 | 稳定 | 提供简单的 广场推文列表 的缓存功能 | +|`SimpleCacheIndex` | 缓存 | Deprecated | 提供简单的 广场推文列表 的缓存功能 | |`BigCacheIndex` | 缓存 | 稳定(推荐) | 使用[BigCache](https://github.com/allegro/bigcache)缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 | |`Zinc` | 搜索 | 稳定(推荐) | 基于[Zinc](https://github.com/zinclabs/zinc)搜索引擎提供推文搜索服务 | |`Meili` | 搜索 | 稳定(推荐) | 基于[Meilisearch](https://github.com/meilisearch/meilisearch)搜索引擎提供推文搜索服务 | @@ -85,11 +87,64 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r |`LoggerFile` | 日志 | 稳定 | 使用文件写日志 | |`LoggerZinc` | 日志 | 稳定(推荐) | 使用[Zinc](https://github.com/zinclabs/zinc)写日志 | |`LoggerMeili` | 日志 | 内测 | 使用[Meilisearch](https://github.com/meilisearch/meilisearch)写日志 | -|`Friendship` | 关系模式 | 内测(默认) | 弱关系好友模式,类似微信朋友圈 | +|`Friendship` | 关系模式 | 内测 | 弱关系好友模式,类似微信朋友圈 | |`Followship` | 关系模式 | WIP | 关注者模式,类似Twitter的Follow模式 | +|`Lightship` | 关系模式 | 内测(默认) | 开放模式,所有推文都公开可见 | |`Alipay` | 支付 | 稳定 | 开启基于[支付宝开放平台](https://open.alipay.com/)的钱包功能 | |`Sms` | 短信验证 | 稳定 | 开启短信验证码功能,用于手机绑定验证手机是否注册者的;功能如果没有开启,手机绑定时任意短信验证码都可以绑定手机 | |`Docs:OpenAPI` | 开发文档 | 稳定 | 开启openapi文档功能,提供web api文档说明(visit http://127.0.0.1:8008/docs/openapi) | |`PhoneBind` | 其他 | 稳定 | 手机绑定功能 | > 功能项状态详情参考 [features-status](../../../features-status.md). + +### 按需添加自定义配置 +paopao-ce提供了按需添加配置的机制,paopao-ce在internal/conf/config.yaml中内嵌了一份完整的默认配置,内嵌的默认配置与自定义配置config.yaml在paopao-ce启动时自动进行了配置项合并,自定义的配置(./config.yaml或者./custom/config.yaml)中只需要自定义 运行时 声明Features 的相应配置即可。比如只运行Web 子服务,config.yaml可以只包含如下配置(其他配置使用默认值): +```yaml +# file: config.yaml + +Features: + Default: ["Sqlite3", "Zinc", "LocalOSS", "BigCacheIndex", "Web"] +WebServer: # Web服务 + HttpIp: 0.0.0.0 + HttpPort: 8010 + ReadTimeout: 60 + WriteTimeout: 60 +LocalOSS: # 本地文件OSS存储配置 + SavePath: data/paopao-ce/oss + Secure: True + Bucket: paopao + Domain: api.paopao.info +Zinc: # Zinc搜索配置 + Host: 127.0.0.1:4080 + Index: paopao-data + User: admin + Password: admin + Secure: False +``` +部署paopao-ce实例时,可以按需自定义配置运行时所需的配置项, 多个实例部署可以使用不同配置项组合,运行不同的子服务,再通过一个统一的 Proxy(Nginx或云端proxy) 将请求桥接到具体的paopao-ce部署实例。 + +### 多服务同端口运行 +paopao-ce提供的机制是各个子服务(gRPC/RESTful API服务)可以在一个独立端口提供业务服务,也可以多个同类型的子服务(RESTful API服务 或者 gRPC 服务)共享同一个端口提供服务,比如 Web/Admin/Bot 三个子服务在8010端口提供服务, 只需要配置三个子服务的HttpIp/HttpPort为相同值即可: +```yaml +# file: config.yaml + +Features: + Default: ["Sqlite3", "Zinc", "LocalOSS", "BigCacheIndex", "Web", "Admin", "Bot"] +WebServer: # Web服务 + HttpIp: 0.0.0.0 + HttpPort: 8010 + ReadTimeout: 60 + WriteTimeout: 60 +AdminServer: # Admin后台运维服务 + HttpIp: 0.0.0.0 + HttpPort: 8010 + ReadTimeout: 60 + WriteTimeout: 60 +BotServer: # Bot服务 + HttpIp: 0.0.0.0 + HttpPort: 8010 + ReadTimeout: 60 + WriteTimeout: 60 + +... +``` diff --git a/features-status.md b/features-status.md index c2ac559b..e2ece4f6 100644 --- a/features-status.md +++ b/features-status.md @@ -134,7 +134,7 @@ * [x] 业务逻辑实现 #### 关系模式: -* `Friendship` 弱关系好友模式,类似微信朋友圈(目前状态: 开发阶段); +* `Friendship` 弱关系好友模式,类似微信朋友圈(目前状态: 内测); * [x] 提按文档 * [x] 接口定义 * [x] 业务逻辑实现 @@ -142,7 +142,7 @@ * [ ] 提按文档 * [ ] 接口定义 * [ ] 业务逻辑实现 -* `Lightship` 开放模式,所有推文都公开可见(目前状态: WIP); +* `Lightship` 开放模式,所有推文都公开可见(目前状态: 内测、默认); * [x] 提按文档 * [x] 接口定义 * [x] 业务逻辑实现