mirror of
https://github.com/CyberMind-FR/secubox-deb.git
synced 2026-07-29 13:59:40 +00:00
* fix(metrics): Make sibling imports work under uvicorn (api.main:app) The aggregator imports `from visitor_origin import VisitorOriginAggregator` worked in pytest (conftest puts api/ on sys.path) but crashed at module load under `uvicorn api.main:app` with ModuleNotFoundError. The service entered a restart loop; the new live-panel endpoints were unreachable. Fix: insert os.path.dirname(__file__) at the top of sys.path before the sibling imports, mirroring the test conftest. Verified live on gk2: secubox-metrics now starts cleanly, all three new endpoints (visitor-origin / live-hosts / cert-status) respond 200 with the documented disabled payload. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(nginx): Strip upstream CORS headers in /api/v1/* snippet (ref #92) Several FastAPI services in this repo (including secubox-metrics, with the new live-panel endpoints from #98) ship their own CORSMiddleware emitting Access-Control-Allow-Origin: *. The nginx snippet for /api/v1/* also adds the same header. Browsers receiving both fold them into "Access-Control-Allow-Origin: *, *" and reject all cross-origin requests, which broke health-banner.js v1.3.0 when injected on any vhost other than admin.<host>.secubox.in. Fix: declare nginx as the sole CORS authority by stripping the upstream copies with proxy_hide_header before nginx's own add_header fires. The project standard already had nginx own CORS at the edge; this just plugs the leak introduced when individual services started emitting their own. Verified live on gk2: single Access-Control-Allow-Origin: * header now returned by /api/v1/metrics/* through HAProxy + mitmproxy + nginx. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: CyberMind-FR <gandalf@Gk2.net> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| modules.d | ||
| secubox-proxy.conf | ||
| secubox.conf | ||
| webui.conf | ||