chore: add sensitive field encryption key support

Add ENCRYPTION_KEY env config and document its usage, also pass it to docker compose environment variables
This commit is contained in:
Kris 2026-06-20 22:21:54 +08:00
parent f2b21c27b6
commit 9294413d57
2 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,11 @@ YUXI_ENV=development
JWT_SECRET_KEY=
YUXI_INSTANCE_ID=
# 敏感字段加密密钥:用于加密配置中的 password/token/api_key 等敏感字段
# 生产环境必须设置;留空时敏感字段将以明文存储(仅开发环境兼容)
# 生成方式python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
ENCRYPTION_KEY=
# # 其余可选配置
# OPENAI_API_KEY=
# OPENAI_API_BASE=

View File

@ -29,6 +29,8 @@ x-api-worker-env: &api-worker-env
# Agent run
RUN_CANCEL_KEY_TTL_SECONDS: ${RUN_CANCEL_KEY_TTL_SECONDS:-1800}
RUN_EVENTS_STREAM_TTL_SECONDS: ${RUN_EVENTS_STREAM_TTL_SECONDS:-7200}
# 敏感字段加密密钥
ENCRYPTION_KEY: ${ENCRYPTION_KEY:-}
# 其他环境变量
NO_PROXY: localhost,127.0.0.1,milvus,graph,minio,milvus-etcd-dev,etcd,mineru,paddlex,sandbox-provisioner,api.siliconflow.cn
no_proxy: localhost,127.0.0.1,milvus,graph,minio,milvus-etcd-dev,etcd,mineru,paddlex,sandbox-provisioner,api.siliconflow.cn