This commit is contained in:
2026-05-05 16:52:40 +02:00
commit bdb523d4b8
58 changed files with 8880 additions and 0 deletions

View File

View File

@@ -0,0 +1,24 @@
from typing import List
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
PROJECT_NAME: str = "Smash or Pass"
VERSION: str = "0.1.0"
ALLOWED_ORIGINS: List[str] = ["*"]
ADMIN_ENABLED: bool = False
DATABASE_URL: str = "sqlite:///./data/sop.db"
S3_ENDPOINT_URL: str = "http://localhost:9000"
S3_PUBLIC_URL: str = "http://localhost:9000"
S3_ACCESS_KEY: str = "minioadmin"
S3_SECRET_KEY: str = "minioadmin"
S3_BUCKET: str = "sop"
S3_REGION: str = "us-east-1"
settings = Settings()

10
sop-back/app/core/deps.py Normal file
View File

@@ -0,0 +1,10 @@
from fastapi import HTTPException, status
from app.core.config import settings
def require_admin() -> None:
if not settings.ADMIN_ENABLED:
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail="Admin module is disabled",
)