spb/internetpressure
Public
1# InternetPressure.io — repository guide23> ⚠️ **PRODUCTION RETIRÉE LE 2026-10-02.** Le serveur OVH qui hébergeait cette app a été retiré du MacLustr (résiliation OVH ; seule la passerelle BHS64 est conservée). Plus aucune instance ne tourne, le site public ne répond plus et la route MacLustr Tunnel a été supprimée. Code final = ce dépôt (spbgit, branche `main`). Sauvegardes à froid : dumps Postgres + état sur **M3U96b:~/ovh-retired-20261002/**, manifestes/secrets/PM2 sur le laptop `~/Desktop/Cluster/secrets/ovh-retired-20261002/` (0600). Les procédures de déploiement ci-dessous sont historiques.45**The real-time pressure gauge for the Internet.** Full product spec: `docs/SPEC.md` (authoritative). Architecture6decisions: `docs/ARCHITECTURE.md`. Contracts: `docs/API.md` (public + admin API), `docs/PROBE-PROTOCOL.md`7(probe ↔ ingestion). Deployment: `docs/DEPLOY.md`.89## Layout1011```12apps/web Next 16 + React 19 + Tailwind 4 + MapLibre + ECharts (port 8351)13apps/api Python 3.12 package `internetpressure` — FastAPI API/ingest, pressure engine, event engine,14 BGP ingestor, scheduler, corroboration connectors (api on port 8352)15services/probe-agent Go probe agent (single static binary, darwin/arm64 + linux/amd64)16packages/config pressure.yaml — weights, levels, engine/scheduler parameters (hot-reloaded, editable in /admin)17data/regions.yaml region model · data/targets/targets.yaml target registry seed · data/seed/*.yaml services, probes18infra/ Docker Compose (compose.yml), edge Caddy, ClickHouse/Postgres init, systemd/launchd units for probes19deploy/bin deploy.sh (BHS64b), probes.sh (build + push probe binaries), lib.sh20docs/ SPEC, ARCHITECTURE, API, PROBE-PROTOCOL, DEPLOY, RUNBOOK21tests/ pytest (scoring, normalisation, events, ingest, api)22```2324## Non-negotiable rules (from the spec)25261. **No fake real-time.** Never animate random numbers, never synthesise events. If a value did not change, the UI does27 not move. Every visible movement originates from a real measurement or BGP message.282. **Self-exclusion.** Our own outage must never inflate the index: the engine freezes and flags `internal_status`29 when probes/BGP/stores are unhealthy. See `internetpressure/engine/health.py`.303. **Explainable.** Every score decomposes into components → signals → (scope, current, baseline, robust z, contribution).314. **Config-driven weights.** Weights/levels/thresholds live in `packages/config/pressure.yaml` (or the Postgres32 `config` override) — never in code.335. **Baseline-relative.** Robust z = (x − rolling median) / MAD, clipped. Absolute thresholds only where unavoidable34 (documented in `docs/ARCHITECTURE.md`).356. **Ethical measurement.** Ordinary lightweight client traffic only: no scanning, no auth bypass, no bursts.367. **UTC everywhere** in storage and APIs; the browser localises.378. **No secrets in Git.** `.env` files are ignored; `deploy/.env.example` documents every variable.3839## Dev quick start4041```bash42docker compose -f infra/compose.yml --profile dev up -d clickhouse postgres redis # stores only43cd apps/api && uv sync && uv run ip migrate && uv run ip seed && uv run ip api # :835244uv run ip engine # pressure engine loop · uv run ip bgp # RIS Live ingestor45cd apps/web && pnpm install && pnpm dev # :8351 (rewrites /api → :8352)46cd services/probe-agent && make build && ./dist/ip-probe-darwin-arm64 --config probe.dev.yaml47pytest -q # from apps/api48```4950## Production5152**BHS128b** (OVH Beauharnois, ubuntu@51.161.112.85, since 2026-09-14) runs `infra/compose.yml` (project `ip`, edge Caddy :835053bound to WireGuard 10.67.0.62). Public route: BHS64 gateway `https://www.internetpressure.io → 10.67.0.62:8350`. Probes run as54launchd (macOS) / systemd (Linux) services on cluster nodes. `deploy/bin/deploy.sh` and `deploy/bin/probes.sh` (defaults in55`deploy/bin/lib.sh`: `IP_SERVER=BHS128b`, `IP_WG_IP=10.67.0.62`). Nightly backup cron (04:10 UTC) → BHS128:/srv/backups/internetpressure.56Until 2026-09-14 production was BHS64b (10.67.0.61); its stack is stopped (`docker compose down`, volumes `ip_*` kept as a cold copy).57