Files
beige/docs/ops/fernet.md
yangqianqian df1856d793 上线版: 产品表单统一+form嵌套修复+用户管理+部署+三套叙事
- 产品编辑入口统一走 ProductFormFull(卖点/风格/人群/品牌词全字段);
  修复开任务页 <form> 套 <form> 致"编辑产品"报错、改不了、跳回首个产品
- dashboard 入口卡片对齐实际路由: 系统管理(/config) 与 工作配置(/settings) 分开;
  settings ?tab=products 直达改用挂载后读 URL, 消除 hydration mismatch
- 新增用户管理(users API/admin service/改密页) + alembic 022/023/024
- 上线部署: Dockerfile / docker-compose.prod+https / nginx https / .env.example
- A8 三套正交叙事(痛点/场景/成分背书) + beige 调色去AI化 + 飞轮 text_import 高权重信号

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 18:08:13 +08:00

35 lines
892 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# FERNET_KEY 管理
`FERNET_KEY` 用于加密客户在工作台录入的 API Key。它不是普通配置必须单独备份。
## 规则
- 每个生产环境生成唯一 `FERNET_KEY`
- 不要复用本地测试环境的 key。
- 不要提交到 git。
- 不要发在聊天记录里。
- 备份时和数据库备份分开放置。
## 丢失后果
如果 `FERNET_KEY` 丢失,数据库里的客户 API Key 密文无法解密,客户需要重新录入 key。
## 生成方式
```bash
python3 - <<'PY'
from cryptography.fernet import Fernet
print(Fernet.generate_key().decode())
PY
```
## 轮换方式
一期不做密文在线重加密。需要轮换时:
1. 通知客户暂停生成。
2. 清空 `user_api_keys` 中旧密文,或让客户在设置页逐个覆盖录入。
3. 更新服务器 `.env``FERNET_KEY`
4. 重启 api/worker。
5. 让客户重新录入 API Key。