Add self-hosted WebTorrent tracker container and reconnect plan

Build a WebSocket-only tracker from the official Node image and a locked
bittorrent-tracker 11.2.3, run via compose.tracker.yaml and the
tracker:up/tracker:down/test:tracker scripts. A small wrapper disables
scrape and stats and bounds input: frame validation, per-IP connection
and message limits (IPv6 grouped per /64), origin checks, a fixed peer ID
and at most four swarms per socket (tracked synchronously, so pipelined
frames cannot bypass it), swarm and peer caps, idle-socket timeout and
explicit expiry of stale swarm memberships. Forwarded addresses are taken
from the rightmost X-Forwarded-For entry and only from trusted proxies.

Integration tests use only Node built-ins. Document the planned tracker
reconnect design; the app still uses manual connection codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SchluffeandClaude Opus 5.5 committed 2026-10-19 21:03:45 +02:00
1 parent 8665d04f2c
commit e3af2de051
13 files changed
+2003 -2

No files matched your search

+17
View File
@@ -245,6 +245,23 @@ run `bun run preview` and open the printed localhost URL.
## Development
### Local WebTorrent tracker
The repository includes [our tracker Dockerfile](tracker/Dockerfile) and a
separate [Compose service](compose.tracker.yaml), built from the official Node
image and a locked upstream `bittorrent-tracker` release. With Docker running:
```sh
bun run tracker:up # build and start ws://127.0.0.1:8000
bun run test:tracker # integration checks inside the test image
bun run tracker:down
```
See [tracker setup and deployment](tracker/README.md) for configuration and VPS
use. The tracker container is ready for development; automatic reconnect in
the browser is still [planned](docs/webtorrent-reconnect.md). Current app
connections continue to use manual codes.
### Local STUN/TURN environment (Linux)
Keep Vite on the host for hot reload; only coturn runs in Docker. Both bind to