Files
service-finder/backend/app/core/config.py

54 lines
1.5 KiB
Python
Executable File

from typing import Optional
from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic import computed_field
class Settings(BaseSettings):
# --- General ---
PROJECT_NAME: str = "Traffic Ecosystem SuperApp"
VERSION: str = "2.0.0"
API_V1_STR: str = "/api/v1"
DEBUG: bool = False
# --- Security / JWT ---
SECRET_KEY: str
ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60
# --- Password policy (TEST -> laza, PROD -> szigorú) ---
PASSWORD_MIN_LENGTH: int = 4 # TESZT: 4, ÉLES: 10-12
# --- Database ---
DATABASE_URL: str # már nálad compose-ban meg van adva
# --- Redis ---
REDIS_URL: str = "redis://service_finder_redis:6379/0"
# --- Email sending ---
# auto = ha van SENDGRID_API_KEY -> sendgrid api, különben smtp
EMAIL_PROVIDER: str = "auto" # auto | sendgrid | smtp | disabled
EMAILS_FROM_EMAIL: str = "info@profibot.hu"
EMAILS_FROM_NAME: str = "Profibot"
# SendGrid API
SENDGRID_API_KEY: Optional[str] = None
# SMTP fallback (pl. Gmail App Password vagy más szolgáltató)
SMTP_HOST: Optional[str] = None
SMTP_PORT: int = 587
SMTP_USER: Optional[str] = None
SMTP_PASSWORD: Optional[str] = None
SMTP_USE_TLS: bool = True
# Frontend base URL a linkekhez (később NPM/domain)
FRONTEND_BASE_URL: str = "http://192.168.100.43:3000"
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
case_sensitive=True,
extra="ignore"
)
settings = Settings()