SplatNet-Backend/config.py

35 lines
855 B
Python
Raw Permalink Normal View History

from pydantic_settings import BaseSettings, SettingsConfigDict
from cryptography.fernet import Fernet
2026-03-28 03:18:41 +01:00
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve().parent
class Settings(BaseSettings):
port: int = 5000
2026-02-22 19:48:25 +01:00
judd_port: int = 4000
db_url: str
fernet_key: str
2026-02-20 04:44:33 +01:00
cookie_httponly: bool = True
2026-02-06 23:06:27 +01:00
frontend_url: str
2026-02-19 06:08:41 +01:00
boss_url: str
boss_aes_key: str
boss_hmac_key: str
twitter_client_id: str
twitter_client_secret: str
twitter_redirect_uri: str
2026-03-28 03:18:41 +01:00
model_config = SettingsConfigDict(
env_file=[
os.path.join(os.getcwd(), ".env"),
#fallback
BASE_DIR / ".env"
],
env_file_encoding='utf-8',
extra="ignore"
)
2026-02-20 04:44:33 +01:00
cookie_secure: bool = True
webhook_url: str
settings = Settings()
cipher = Fernet(settings.fernet_key.encode())