docs: add API-OPS-001 missing production env keys issue
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 45s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 45s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
161018dcb5
commit
1ed86b3ab3
42
docs/issues/API-OPS-001-missing-production-env-keys.md
Normal file
42
docs/issues/API-OPS-001-missing-production-env-keys.md
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# API-OPS-001: 生产环境缺少 INTERNAL_API_KEY 和 CREDENTIAL_ENCRYPTION_KEY
|
||||||
|
|
||||||
|
## 基本信息
|
||||||
|
|
||||||
|
| 字段 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| Issue ID | API-OPS-001 |
|
||||||
|
| 类型 | Ops / 配置遗漏 |
|
||||||
|
| 仓库 | api-server + devops-projects |
|
||||||
|
| 优先级 | P1 - 阻塞 Heavy Runtime 部署 |
|
||||||
|
| 发现日期 | 2026-06-18 |
|
||||||
|
|
||||||
|
## 问题描述
|
||||||
|
|
||||||
|
8C32G 生产服务器(120.53.227.155)的 `/opt/zhixi/env/.env.production` 缺少两个必需环境变量:
|
||||||
|
|
||||||
|
| 缺失变量 | 用途 | 当前回退 |
|
||||||
|
|----------|------|----------|
|
||||||
|
| `INTERNAL_API_KEY` | Heavy Runtime 调用 Internal API 的鉴权 token | 回退到 `RAG_WORKER_SECRET`(安全边界模糊) |
|
||||||
|
| `CREDENTIAL_ENCRYPTION_KEY` | AES-256-GCM 用户 API Key 加密 | 未配置会导致加密/解密失败 |
|
||||||
|
|
||||||
|
## 后果
|
||||||
|
|
||||||
|
1. **INTERNAL_API_KEY**:当前 InternalAuthGuard 回退到 RAG_WORKER_SECRET,但这是设计缺陷——RAG Worker 和 Heavy Runtime 应使用独立 token
|
||||||
|
2. **CREDENTIAL_ENCRYPTION_KEY**:用户绑定 DeepSeek Key 时,加密会失败(getEncryptionKey() 抛 "CREDENTIAL_ENCRYPTION_KEY not configured")
|
||||||
|
|
||||||
|
## 修复方案
|
||||||
|
|
||||||
|
在 `.env.production` 中添加:
|
||||||
|
|
||||||
|
```env
|
||||||
|
INTERNAL_API_KEY=<生成32位随机字符串>
|
||||||
|
CREDENTIAL_ENCRYPTION_KEY=<生成32字节密钥>
|
||||||
|
```
|
||||||
|
|
||||||
|
并同步更新 docker-compose.yml 中 heavy-runtime 服务的 `RUNTIME_SERVICE_TOKEN` 指向 `INTERNAL_API_KEY`。
|
||||||
|
|
||||||
|
## 相关文件
|
||||||
|
|
||||||
|
- `devops-projects/凭据配置/蜂驰云服务器凭据.md` — 更新环境变量清单
|
||||||
|
- `api-server/docker-compose.yml` — 已正确定义(需同步到生产 env)
|
||||||
|
- `zhixi-heavy-runtime/docs/operations-manual.md` — 已文档化 `RUNTIME_SERVICE_TOKEN`
|
||||||
Loading…
x
Reference in New Issue
Block a user