52 lines
1.3 KiB
Python
52 lines
1.3 KiB
Python
"""Application configuration using pydantic-settings."""
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings loaded from environment variables."""
|
|
|
|
# Application
|
|
APP_NAME: str = "Rentman Clone"
|
|
APP_ENV: str = "development"
|
|
APP_DEBUG: bool = True
|
|
API_V1_PREFIX: str = "/api/v1"
|
|
|
|
# Database
|
|
DATABASE_URL: str = "sqlite+aiosqlite:///./data/rentman.db"
|
|
|
|
# JWT Authentication
|
|
JWT_SECRET_KEY: str = "change-me-to-a-random-secret-at-least-32-chars"
|
|
JWT_ALGORITHM: str = "HS256"
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
|
REFRESH_TOKEN_EXPIRE_MINUTES: int = 1440
|
|
|
|
# Redis
|
|
REDIS_URL: str = "redis://localhost:6379/0"
|
|
|
|
# MinIO
|
|
MINIO_ENDPOINT: str = "localhost:9000"
|
|
MINIO_ACCESS_KEY: str = "minioadmin"
|
|
MINIO_SECRET_KEY: str = "minioadmin"
|
|
MINIO_BUCKET_NAME: str = "rentman-files"
|
|
MINIO_SECURE: bool = False
|
|
|
|
# CORS
|
|
CORS_ORIGINS: str = "http://localhost:5173,http://localhost:3000"
|
|
|
|
@property
|
|
def cors_origin_list(self) -> list[str]:
|
|
"""Return CORS origins as a list."""
|
|
return [
|
|
origin.strip() for origin in self.CORS_ORIGINS.split(",") if origin.strip()
|
|
]
|
|
|
|
model_config = {
|
|
"env_file": ".env",
|
|
"env_file_encoding": "utf-8",
|
|
"case_sensitive": True,
|
|
}
|
|
|
|
|
|
settings = Settings()
|