SPB Git forge
15commits 1branches 0releases
29.7 MBsize
maindefault branch
10 days agolast push
TypeScript 36.3% Python 31.8% Go 18% JavaScript 9.8% Shell 1.9% SQL 1.4% CSS 0.5%
3.6 KB · 55 lines markdown
Rendered Raw Blame History
1# InternetPressure.io — repository guide23**The real-time pressure gauge for the Internet.** Full product spec: `docs/SPEC.md` (authoritative). Architecture4decisions: `docs/ARCHITECTURE.md`. Contracts: `docs/API.md` (public + admin API), `docs/PROBE-PROTOCOL.md`5(probe ↔ ingestion). Deployment: `docs/DEPLOY.md`.67## Layout89```10apps/web                Next 16 + React 19 + Tailwind 4 + MapLibre + ECharts  (port 8351)11apps/api                Python 3.12 package `internetpressure` — FastAPI API/ingest, pressure engine, event engine,12                        BGP ingestor, scheduler, corroboration connectors (api on port 8352)13services/probe-agent    Go probe agent (single static binary, darwin/arm64 + linux/amd64)14packages/config         pressure.yaml — weights, levels, engine/scheduler parameters (hot-reloaded, editable in /admin)15data/regions.yaml       region model · data/targets/targets.yaml  target registry seed · data/seed/*.yaml services, probes16infra/                  Docker Compose (compose.yml), edge Caddy, ClickHouse/Postgres init, systemd/launchd units for probes17deploy/bin              deploy.sh (BHS64b), probes.sh (build + push probe binaries), lib.sh18docs/                   SPEC, ARCHITECTURE, API, PROBE-PROTOCOL, DEPLOY, RUNBOOK19tests/                  pytest (scoring, normalisation, events, ingest, api)20```2122## Non-negotiable rules (from the spec)23241. **No fake real-time.** Never animate random numbers, never synthesise events. If a value did not change, the UI does25   not move. Every visible movement originates from a real measurement or BGP message.262. **Self-exclusion.** Our own outage must never inflate the index: the engine freezes and flags `internal_status`27   when probes/BGP/stores are unhealthy. See `internetpressure/engine/health.py`.283. **Explainable.** Every score decomposes into components → signals → (scope, current, baseline, robust z, contribution).294. **Config-driven weights.** Weights/levels/thresholds live in `packages/config/pressure.yaml` (or the Postgres30   `config` override) — never in code.315. **Baseline-relative.** Robust z = (x − rolling median) / MAD, clipped. Absolute thresholds only where unavoidable32   (documented in `docs/ARCHITECTURE.md`).336. **Ethical measurement.** Ordinary lightweight client traffic only: no scanning, no auth bypass, no bursts.347. **UTC everywhere** in storage and APIs; the browser localises.358. **No secrets in Git.** `.env` files are ignored; `deploy/.env.example` documents every variable.3637## Dev quick start3839```bash40docker compose -f infra/compose.yml --profile dev up -d clickhouse postgres redis   # stores only41cd apps/api && uv sync && uv run ip migrate && uv run ip seed && uv run ip api      # :835242uv run ip engine   # pressure engine loop   · uv run ip bgp   # RIS Live ingestor43cd apps/web && pnpm install && pnpm dev    # :8351 (rewrites /api → :8352)44cd services/probe-agent && make build && ./dist/ip-probe-darwin-arm64 --config probe.dev.yaml45pytest -q                                   # from apps/api46```4748## Production4950**BHS128b** (OVH Beauharnois, ubuntu@51.161.112.85, since 2026-09-14) runs `infra/compose.yml` (project `ip`, edge Caddy :835051bound to WireGuard 10.67.0.62). Public route: BHS64 gateway `https://www.internetpressure.io → 10.67.0.62:8350`. Probes run as52launchd (macOS) / systemd (Linux) services on cluster nodes. `deploy/bin/deploy.sh` and `deploy/bin/probes.sh` (defaults in53`deploy/bin/lib.sh`: `IP_SERVER=BHS128b`, `IP_WG_IP=10.67.0.62`). Nightly backup cron (04:10 UTC) → BHS128:/srv/backups/internetpressure.54Until 2026-09-14 production was BHS64b (10.67.0.61); its stack is stopped (`docker compose down`, volumes `ip_*` kept as a cold copy).55