2025-12-12 13:30:09 +03:00
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
from functools import lru_cache
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
|
|
|
# Database
|
|
|
|
|
database_url: str = "postgresql://postgres:postgres@localhost:5432/enigfm"
|
|
|
|
|
|
|
|
|
|
# JWT
|
|
|
|
|
secret_key: str = "your-secret-key-change-in-production"
|
|
|
|
|
algorithm: str = "HS256"
|
|
|
|
|
access_token_expire_minutes: int = 60 * 24 * 7 # 7 days
|
|
|
|
|
|
|
|
|
|
# S3 (FirstVDS)
|
|
|
|
|
s3_endpoint_url: str = ""
|
|
|
|
|
s3_access_key: str = ""
|
|
|
|
|
s3_secret_key: str = ""
|
|
|
|
|
s3_bucket_name: str = "enigfm"
|
|
|
|
|
s3_region: str = "ru-1"
|
|
|
|
|
|
|
|
|
|
# Limits
|
|
|
|
|
max_file_size_mb: int = 10
|
|
|
|
|
max_storage_gb: int = 90
|
|
|
|
|
max_room_participants: int = 50
|
|
|
|
|
|
|
|
|
|
class Config:
|
2025-12-19 20:17:52 +03:00
|
|
|
# env_file не нужен - переменные передаются через docker-compose
|
2025-12-12 16:53:56 +03:00
|
|
|
extra = "ignore"
|
2025-12-12 13:30:09 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@lru_cache()
|
|
|
|
|
def get_settings() -> Settings:
|
|
|
|
|
return Settings()
|