33 lines
824 B
Python
33 lines
824 B
Python
"""应用配置 - 通过环境变量读取"""
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# 数据库
|
|
DATABASE_URL: str = "postgresql+asyncpg://qingye:qingye_secret@postgres:5432/qingye"
|
|
|
|
# Redis
|
|
REDIS_URL: str = "redis://redis:6379/0"
|
|
|
|
# JWT
|
|
JWT_SECRET_KEY: str = "qingye-jwt-secret-change-in-production"
|
|
JWT_REFRESH_SECRET_KEY: str = "qingye-refresh-secret-change-in-production"
|
|
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
|
JWT_REFRESH_TOKEN_EXPIRE_DAYS: int = 7
|
|
|
|
# CORS
|
|
CORS_ORIGINS: str = "http://localhost:5173"
|
|
|
|
# 管理员默认密码
|
|
ADMIN_PASSWORD: str = "admin123"
|
|
|
|
# 上传
|
|
MAX_UPLOAD_SIZE_MB: int = 10
|
|
UPLOAD_DIR: str = "/app/uploads"
|
|
|
|
model_config = {"env_file": ".env", "extra": "ignore"}
|
|
|
|
|
|
settings = Settings()
|