very minor bugfixes, really nothing too important

This commit is contained in:
Micha R. Albert 2025-07-03 11:52:02 -04:00
parent 62da10b69c
commit f2fd4c8d7c
Signed by: mra
SSH key fingerprint: SHA256:2JB0fGfy7m2HQXAzvSXXKm7wPTj9Z60MOjFOQGM2Y/E
20 changed files with 2099 additions and 170 deletions

View file

@ -0,0 +1,33 @@
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8', extra='ignore')
airtable_pat: str
airtable_base: str
slack_signing_secret: str
slack_client_id: str
slack_client_secret: str
app_base_url: str
game_id_salt: str
# Security settings
environment: str = "development" # development, staging, production
max_request_size: int = 1048576 # 1MB default
rate_limit_requests: int = 20 # requests per minute per IP
allowed_origins: str = "*" # Comma-separated list or "*" for development
# Session security
session_ttl_hours: int = 24 # Session expires after 24 hours
@property
def is_production(self) -> bool:
return self.environment == "production"
@property
def origins_list(self) -> list[str]:
if self.allowed_origins == "*":
return ["*"]
return [origin.strip() for origin in self.allowed_origins.split(",")]
settings = Settings() # type: ignore