- FastAPI backend: admin bootstrap with forced credential change, admin-created users with one-time generated passwords, roles as permission sets - Games and versions with content-addressed blob storage; forks copy only the manifest, so mods share assets with the original - Worker: archive/RPA extraction, unrpyc for .rpyc, own .rpy parser, Python subset translated via ast, media converted to WebP/Opus/WebM - React panel (library search, game page, upload, users, roles) and a framework-free web player with saves, history, skip/auto, transitions - docker compose: postgres, backend, worker, nginx on a single HTTP port Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
956 B
Python
37 lines
956 B
Python
from functools import lru_cache
|
|
from pathlib import Path
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
database_url: str = "postgresql+asyncpg://pgames:pgames@db:5432/pgames"
|
|
data_dir: Path = Path("/data")
|
|
secret_key: str = "change-me"
|
|
session_ttl_hours: int = 24 * 14
|
|
cookie_secure: bool = False
|
|
admin_username: str = "admin"
|
|
admin_password: str = "admin"
|
|
worker_poll_seconds: float = 2.0
|
|
worker_threads: int = 4
|
|
unrpyc_path: Path = Path("/opt/unrpyc/unrpyc.py")
|
|
|
|
@property
|
|
def blobs_dir(self) -> Path:
|
|
return self.data_dir / "blobs"
|
|
|
|
@property
|
|
def uploads_dir(self) -> Path:
|
|
return self.data_dir / "uploads"
|
|
|
|
@property
|
|
def work_dir(self) -> Path:
|
|
return self.data_dir / "work"
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|