Spaces:
Running
Running
File size: 1,198 Bytes
3806142 dbc2744 3806142 dbc2744 3806142 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | """Application configuration — no secrets logged."""
from __future__ import annotations
import os
from pathlib import Path
_DATA = Path("/data")
BUILDS_ROOT = (_DATA / "builds") if _DATA.exists() and os.access(_DATA, os.W_OK) else Path("/tmp/spaceforge/builds")
BUILDS_ROOT.mkdir(parents=True, exist_ok=True)
BUILD_TTL_SECONDS = int(os.environ.get("SPACEFORGE_TTL", "3600"))
MAX_DOWNLOAD_BYTES = int(os.environ.get("SPACEFORGE_MAX_DOWNLOAD", str(100 * 1024 * 1024)))
ANALYZE_TIMEOUT = float(os.environ.get("SPACEFORGE_ANALYZE_TIMEOUT", "30"))
BUILD_TIMEOUT = float(os.environ.get("SPACEFORGE_BUILD_TIMEOUT", "120"))
ANDROID_BUILD_TIMEOUT = float(os.environ.get("SPACEFORGE_ANDROID_BUILD_TIMEOUT", "900"))
MAX_CONCURRENT_BUILDS = int(os.environ.get("SPACEFORGE_MAX_BUILDS", "4"))
STATIC_DIR = Path(os.environ.get("SPACEFORGE_STATIC", "/app/frontend/dist"))
TEMPLATES_DIR = Path(os.environ.get("SPACEFORGE_TEMPLATES", "/app/templates"))
if not TEMPLATES_DIR.exists():
_local = Path(__file__).resolve().parents[2] / "templates"
if _local.exists():
TEMPLATES_DIR = _local
HF_API = "https://huggingface.co/api"
HF_SPACE_HOST = "https://huggingface.co"
ERSATZ_KEY = "[ERSATZ_KEY]"
|