"""Runtime configuration. All paths overridable via environment variables so the same image runs locally (repo root) and on Unraid (/data volume).""" import os from pathlib import Path # Repo root = two levels up from backend/app/config.py ROOT = Path(__file__).resolve().parents[2] # The CAD skill source (loader, bom, renderer, query_engine, external_diagram, ...) SKILL_SRC = Path(os.environ.get("SKILL_SRC", ROOT / "skill.src")) # Where uploads, per-model output dirs, and the SQLite DB live. DATA_DIR = Path(os.environ.get("DATA_DIR", ROOT / "_data")) DB_PATH = Path(os.environ.get("DB_PATH", DATA_DIR / "step_parser.db")) # CAD jobs are heavy and largely CPU-bound — serialize by default (one at a time). MAX_WORKERS = int(os.environ.get("MAX_WORKERS", "1")) # Accepted upload extensions. ALLOWED_SUFFIXES = {".step", ".stp"} MODELS_DIR = DATA_DIR / "models"