Files
crm_project/server/app/core/config.py
T
hankin 423baff73b v0.1.0: CRM/ERP 系统内测版本 - 安全加固完成
- Docker bridge 网络隔离(8000 端口封死)
- Gunicorn 4 Worker 多进程
- Alembic 数据库迁移基线
- 日志轮转 20m×3
- JWT 密钥 + DB 密码 + CORS 收紧
- 3-2-1 备份链路(NAS + R740-B 冷备)
- 连接池 pool_pre_ping + pool_recycle=3600
2026-03-16 07:31:37 +00:00

44 lines
1.4 KiB
Python

"""
应用全局配置 - 从 .env 读取环境变量
"""
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
case_sensitive=False,
)
# Database
DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres@localhost:5432/crm_erp"
# JWT
JWT_SECRET_KEY: str = "super-secret-key-change-in-production-please"
JWT_ALGORITHM: str = "HS256"
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: int = 1440 # 24h
# App
APP_NAME: str = "润滑油CRM/ERP系统"
APP_VERSION: str = "0.1.0"
DEBUG: bool = True
# Dify AI 中枢配置
DIFY_API_BASE_URL: str = "" # 例如 http://192.168.1.88
DIFY_API_KEY: str = ""
DIFY_APP_ID: str = ""
DIFY_TIMEOUT_MS: int = 30000 # 30s
DIFY_WORKFLOW_PERSONA_KEY: str = "" # 销售日志→客户画像 Workflow
DIFY_WORKFLOW_REPORT_KEY: str = "" # 周报自动生成 Workflow
# Ollama / vLLM 算力节点
OLLAMA_4060_BASE_URL: str = "http://192.168.1.88:11435" # 4060: Qwen3.5-4B + BGE-M3
OLLAMA_4060_MODEL: str = "qwen3.5:4b" # 意图分类用
OLLAMA_3090_BASE_URL: str = "http://192.168.1.88:11434" # 3090: Qwen3.5-27B (with vision)
OLLAMA_3090_MODEL: str = "qwen3.5:27b" # OCR / 视觉理解用
settings = Settings()