network-monitor/compose.probe.yml
neil 54a765510a Network monitor: hub, probes, Docker and native installers
Hub (FastAPI + no-build web UI):
- Network health: live probe/target matrix, status strips, incidents
- Probes: add (with install command), rename, remove, latency and throughput charts
- Clients merged from AdGuard, DHCP, query log and probe ARP tables; names,
  categories, suspicious flag, notes, per-client DNS requests
- Query log, domain detail (clients, related subdomains), blocked domains via
  the AdGuard Home /control API

Probe: tests peers (ping, HTTP, throughput), gateway, LAN and public DNS,
internet URLs and an optional VPS; buffers results while the hub is down.
Gateway and ARP from /proc/net on Linux, route/arp on macOS.

Install: install.sh (hub) and install-probe.sh (generated from it), each in
docker mode (compose; default on Linux hosts) or native mode (venv + systemd
or launchd; default on macOS and in LXC). Both modes deploy with an update
command that checks the new commit and rolls back on failure.

CLAUDE.md carries shared context for Claude Code sessions on each machine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 18:10:29 -08:00

40 lines
1.2 KiB
YAML

# A probe. install-probe.sh sets this up on each machine (see README); by hand it is:
# clone into /opt/network-probe, write .env from .env.probe.example,
# docker compose -f compose.probe.yml up -d --build
# Deploys after that: docker exec network-probe update
#
# Host networking on purpose: the probe must measure the machine's real link (not Docker's
# bridge), serve its test endpoint on the LAN, and read the host's ARP table and gateway.
name: network-probe
services:
probe:
build:
context: .
dockerfile: container/Dockerfile
image: network-monitor:latest
container_name: network-probe
restart: unless-stopped
network_mode: host
environment:
ROLE: probe
CONTAINER_NAME: network-probe
PORT: ${PROBE_PORT:-8765}
volumes:
- runtime:/srv # source checkout, venv, update state
- data:/data # last config from the hub, so it keeps testing while the hub is down
- ./.env:/run/config/app.env:ro
read_only: true
tmpfs:
- /tmp
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
mem_limit: 192m
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"
volumes:
runtime:
data: