Dockerfile
- Replaces hard-coded uvicorn CMD with /bin/sh /app/start.sh
- Sets ownership correctly before switching to non-root user
start.sh (new)
- Reads BACKEND_URL env var → writes it into dashboard/js/config.js
- Reads SERVE_DASHBOARD_ONLY env var:
0 / unset → full stack via dashboard_server.py (Trainer Space)
1 → static-only via serve_demo.py (Demo Space)
serve_demo.py (new)
- Minimal FastAPI + StaticFiles server for the Demo space
- Serves dashboard/ on port 7860 with CORS enabled
dashboard/js/config.js (new)
- Sets window.CYBERSOC_BACKEND_URL = '' by default
- Overwritten at container startup by start.sh when BACKEND_URL is set
dashboard/js/api.js
- Reads window.CYBERSOC_BACKEND_URL set by config.js
- _wsUrl() and _httpBase() use the override URL when set,
fall back to same-origin auto-detection when empty
dashboard/index.html
- Loads js/config.js before api.js so the override is available
HF Space setup:
CyberSOC-trainer → no extra env vars …
Fix HuggingFace Space dashboard deployment (aiofiles, mount root)
Ajayyy00
eb1ddd0
Initial commit of CyberSOC upgraded RLVR environment