.env.example 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # ShuDao SafeAI 环境变量配置模板
  2. # 复制此文件为 .env 并填写实际值
  3. # ==================== 数据库配置 ====================
  4. DB_HOST=localhost
  5. DB_PORT=3306
  6. DB_USER=root
  7. DB_PASSWORD=your_mysql_password_here
  8. DB_NAME=shudao
  9. # ==================== Redis 配置 ====================
  10. REDIS_HOST=localhost
  11. REDIS_PORT=6379
  12. REDIS_PASSWORD=
  13. REDIS_DB=0
  14. # ==================== JWT 配置 ====================
  15. JWT_SECRET_KEY=your_jwt_secret_key_here_at_least_32_chars
  16. JWT_ALGORITHM=HS256
  17. JWT_EXPIRE_MINUTES=43200
  18. # ==================== API 密钥 ====================
  19. # DeepSeek API
  20. DEEPSEEK_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  21. DEEPSEEK_API_URL=https://api.deepseek.com
  22. # Qwen API
  23. QWEN_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  24. QWEN_API_URL=http://your-qwen-server:port
  25. # ==================== OSS 配置 ====================
  26. OSS_ENDPOINT=your-oss-endpoint.com
  27. OSS_ACCESS_KEY_ID=your_oss_access_key_id
  28. OSS_ACCESS_KEY_SECRET=your_oss_access_key_secret
  29. OSS_BUCKET_NAME=your_bucket_name
  30. # ==================== 外部服务 ====================
  31. # YOLO 识别服务
  32. YOLO_API_URL=http://your-yolo-server:port
  33. # ChromaDB 服务
  34. CHROMADB_API_URL=http://your-chromadb-server:port
  35. # 意图识别服务
  36. INTENT_API_URL=http://your-intent-server:port
  37. # 在线搜索服务
  38. SEARCH_API_URL=http://your-search-server:port
  39. # ==================== 应用配置 ====================
  40. APP_ENV=production
  41. APP_DEBUG=false
  42. APP_HOST=0.0.0.0
  43. APP_PORT=22000
  44. # ==================== 日志配置 ====================
  45. LOG_LEVEL=INFO
  46. LOG_DIR=logs
  47. # ==================== 安全配置 ====================
  48. # 密码加密密钥(用于数据库密码加密存储)
  49. ENCRYPTION_KEY=your_32_byte_encryption_key_here
  50. # CORS 允许的源(多个用逗号分隔)
  51. CORS_ORIGINS=*
  52. # ==================== 其他配置 ====================
  53. # 文件上传大小限制(MB)
  54. MAX_UPLOAD_SIZE=10
  55. # 会话超时时间(分钟)
  56. SESSION_TIMEOUT=30
  57. # 启用性能监控
  58. ENABLE_METRICS=false
  59. # Sentry DSN(可选,用于错误追踪)
  60. SENTRY_DSN=