diff --git a/README.md b/README.md index a1c52a5..14d56d4 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,13 @@ AI 摘要默认关闭。Telegram 用户可发送 `/ai on`(1小时)、`临时 > 缺少 `REDIS_URL` 或 `CONFIG_ENCRYPTION_KEY` 时服务进入 configuration-setup 模式,仍提供 SPA、`/api/status` 和探针;SPA 隐藏管理会话授权区,只显示缺少的环境变量与密钥不保存、不回显说明。配置恢复后 `/api/status` ready=true 才显示授权入口。 +### HostStack 原生部署 + +HostStack 使用根目录 `hoststack.yaml` 构建并运行 Rust 服务:执行 +`cargo build --release --locked`,运行 `./target/release/message-weave`,并以 `/healthz` +进行 30 秒间隔、5 秒超时的健康检查。请在 HostStack Secret 中注入 `REDIS_URL` 与 +`CONFIG_ENCRYPTION_KEY`;密钥不写入 YAML、镜像或仓库文件。 + --- ## 启动后怎么看它是否正常 diff --git a/docs/deployment.md b/docs/deployment.md index b4e4341..20d7fc8 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -82,6 +82,14 @@ ## 5. Secret 管理与环境变量 +### 5.1 HostStack 原生 Rust 部署 + +HostStack 使用仓库根目录 `hoststack.yaml`:Rust runtime 执行 +`cargo build --release --locked`,服务命令为 `./target/release/message-weave`,监听单个 +HTTP 端口并以 `/healthz` 做 interval 30 秒、timeout 5 秒的健康检查。`REDIS_URL` 与 +`CONFIG_ENCRYPTION_KEY` 必须配置为 HostStack Secret;不得将密钥值写入 YAML、镜像、日志 +或代码仓库。现有 Dockerfile 部署方式仍受支持。 + > 迁移后生产环境仅需 `REDIS_URL` 与 `CONFIG_ENCRYPTION_KEY`;下表中的业务环境变量是历史阶段说明,不应再注入生产容器。业务密钥通过受保护的 `/api/bootstrap` 或管理员 PUT 写入 Redis,并在成功后热重建客户端。 (保留既有 Secrets 注入约定:禁入镜像、`secrecy` 包裹、日志屏蔽;新增运行模式相关变量) diff --git a/hoststack.yaml b/hoststack.yaml new file mode 100644 index 0000000..a62046f --- /dev/null +++ b/hoststack.yaml @@ -0,0 +1,15 @@ +# HostStack native Rust deployment for MessageWeave. +# Set REDIS_URL and CONFIG_ENCRYPTION_KEY as encrypted HostStack dashboard +# secrets; never put their values in this repository. +services: + web: + type: web_service + runtime: rust + build: + command: cargo build --release --locked + start: + command: ./target/release/message-weave + healthCheck: + path: /healthz + interval: 30 + timeout: 5