Files
cemetery_backend/app/config.py
2026-01-26 13:33:54 +03:00

37 lines
965 B
Python

import os
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
app_name: str = "Cemetery Map API"
environment: str = os.getenv("ENVIRONMENT", "development")
# Security
jwt_secret_key: str = os.getenv("JWT_SECRET_KEY", "CHANGE_ME")
jwt_algorithm: str = "HS256"
access_token_expire_minutes: int = 60 * 24 * 7 # 7 days
# Database
database_url: str = os.getenv(
"DATABASE_URL",
"postgresql+psycopg2://postgres:postgres@db:5432/cemeterymap",
)
# CORS
cors_origins: list[str] = [
os.getenv("ADMIN_ORIGIN", "http://localhost:5173"),
os.getenv("MOBILE_ORIGIN", "http://localhost:3000"),
]
# Uploads
uploads_temp_dir: str = os.getenv("UPLOADS_TEMP_DIR", "/data/uploads/tmp")
uploads_graves_dir: str = os.getenv("UPLOADS_GRAVES_DIR", "/data/uploads/graves")
# FCM
fcm_server_key: str | None = os.getenv("FCM_SERVER_KEY")
settings = Settings()