chore: 保存笔记本本地未提交改动(源码+新增文件,排除构建缓存/大文件)

This commit is contained in:
renjianbo
2026-07-11 08:58:10 +08:00
parent ad2b899c17
commit 541a08628c
832 changed files with 102878 additions and 1517 deletions

View File

@@ -17,6 +17,7 @@ class Settings(BaseSettings):
# 应用基本信息
APP_NAME: str = "天工智能体平台"
APP_VERSION: str = "1.0.0"
ENVIRONMENT: str = "dev" # dev | staging | prod
DEBUG: bool = False
SQL_ECHO: bool = False # 独立于 DEBUG 的 SQL 日志开关,生产环境必须为 False
SECRET_KEY: str = "dev-secret-key-change-in-production"
@@ -52,6 +53,13 @@ class Settings(BaseSettings):
AGENT_WORKSPACE_CHAT_LOG_ENABLED: bool = True
AGENT_WORKSPACE_CHAT_SUBDIR: str = "agent_workspaces"
# 日志配置
LOG_DIR: str = "logs"
LOG_LEVEL: str = "INFO"
LOG_MAX_BYTES: int = 10 * 1024 * 1024 # 10MB 单文件上限
LOG_BACKUP_COUNT: int = 5 # 保留最近5个轮转文件
LOG_RETENTION_DAYS: int = 30 # 数据库日志保留天数
# CORS配置(支持字符串或列表)
CORS_ORIGINS: str = "http://localhost:3000,http://127.0.0.1:3000,http://localhost:8038,http://101.43.95.130:8038"
@@ -63,6 +71,11 @@ class Settings(BaseSettings):
DEEPSEEK_API_KEY: str = ""
DEEPSEEK_BASE_URL: str = "https://api.deepseek.com"
# 全局 LLM 降级配置(当 Agent/工作流未配置 fallback_llm 时自动启用)
FALLBACK_LLM_MODEL: str = ""
FALLBACK_LLM_API_KEY: str = ""
FALLBACK_LLM_BASE_URL: str = ""
# SiliconFlow配置(Embedding 推荐使用 SiliconFlow)
SILICONFLOW_API_KEY: str = ""
SILICONFLOW_BASE_URL: str = "https://api.siliconflow.cn/v1"
@@ -75,6 +88,7 @@ class Settings(BaseSettings):
JWT_SECRET_KEY: str = "dev-jwt-secret-key-change-in-production"
JWT_ALGORITHM: str = "HS256"
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
JWT_MOBILE_TOKEN_EXPIRE_MINUTES: int = 10080 # 移动端 7 天,Android EncryptedSharedPreferences 安全存储
# Celery 工作流任务:对**非业务节点失败**(非 WorkflowExecutionError)的退避重试次数,0 表示不重试
WORKFLOW_TASK_MAX_RETRIES: int = 0
@@ -96,6 +110,11 @@ class Settings(BaseSettings):
FEISHU_APP_SECRET: str = ""
FEISHU_VERIFICATION_TOKEN: str = ""
# 安全加固 — HSTS(生产环境建议启用,开发环境保持关闭)
HSTS_ENABLED: bool = False
HSTS_MAX_AGE: int = 31536000 # 默认 1 年
HSTS_INCLUDE_SUBDOMAINS: bool = True
# Webhook 全局认证 Token — 所有 webhook 触发请求需要携带此 Token
WEBHOOK_AUTH_TOKEN: str = ""