feat: secure frontend and provider ingress

This commit is contained in:
Codex
2026-05-04 11:40:56 +00:00
parent caa80ee5e7
commit 8726611b6f
25 changed files with 1491 additions and 450 deletions
+8 -4
View File
@@ -6,14 +6,18 @@
TypeScript 运行时固定为 Bun。根目录 CLI、backend-core、frontend 和 provider-gateway 都直接运行 `.ts` 入口;Docker 镜像使用 `oven/bun` 基础镜像,本机命令使用 `bun scripts/cli.ts`
## Fixed Ports
## Network Ports
`config.json`固定三个对外端口:backend-core、frontend、database`network.publicHost` 必须是浏览器和外部客户端可访问的主 server 地址;公网 E2E 不允许把它保留为 `127.0.0.1``server start` 会在启动前检查这些端口,避免因端口冲突产生多个版本混乱的服务实例
`config.json`保留 core、frontend、database 和 providerIngress 的端口字段,但只有 frontend 与 providerIngress 允许映射到宿主机公网端口。core 和 database 的 `port` 字段用于测试公网阻断和历史兼容,实际服务只使用 Docker 内网 `containerPort`
## Auth
`auth.username``auth.password` 是 frontend 登录凭据,默认值分别为 `admin``Liang6516.``auth.sessionSecret` 用于签名 frontend HttpOnly Cookie`auth.sessionTtlSeconds` 控制登录会话有效期;修改后必须重新启动 Docker 栈以刷新派生环境变量。
## Compose Env Generation
Docker Compose 本身不读取 JSON,因此 CLI 会从 `config.json` 生成 `.state/docker-compose.env`。该文件是派生状态,不应手写;如需改端口、token、provider 标签或主机名,应修改 `config.json` 后重新运行 CLI。
Docker Compose 本身不读取 JSON,因此 CLI 会从 `config.json` 生成 `.state/docker-compose.env`。该文件是派生状态,不应手写;如需改端口、token、provider 标签、登录凭据或主机名,应修改 `config.json` 后重新运行 CLI。CLI 会在保留当前日志前缀的同时刷新新增配置键,避免旧 env 文件遗漏字段。
## Secrets
当前配置面向主 server 开发部署,包含开发用数据库密码provider token。公网暴露前必须在 `config.json` 中修改这些值,并重新启动栈以刷新派生环境文件。
当前配置面向主 server 开发部署,包含开发用数据库密码provider token 和默认登录密码。公网长期运行前必须在 `config.json` 中修改这些值,并重新启动栈以刷新派生环境文件。