Limit the tracker per address and harden its plain HTTP path

Per address and minute: connects and forwarded signaling, so reconnecting
doesn't reset a client's allowance. X-Forwarded-For only counts from PROXIES,
checked with net.BlockList, with one warning when an uncovered peer sends it.
Plain requests get timeouts and a closing 404, silent connections go after
30 s and all queues together share a budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SchluffeandClaude Opus 5.5 committed 2026-10-29 20:27:50 +01:00
1 parent ae1e3bef9b
commit b102e55495
5 files changed
+340 -34

No files matched your search

+6
View File
@@ -18,6 +18,12 @@ services:
build: .
environment:
ORIGINS: ${ORIGINS:?set ORIGINS in .env to where HellCon is served from}
# Whose X-Forwarded-For the tracker believes, addresses or CIDRs, see clientIp in tracker.mjs.
# Caddy reaches it over the shared network, whose subnet is Docker's choice, so the default
# trusts every private range: nothing public should reach the tracker besides Caddy. Set
# PROXIES in .env to narrow it, e.g. to your Caddy's address in that network. If it doesn't
# cover Caddy's address, all clients count as Caddy's and share its limits, nearly all are refused.
PROXIES: ${PROXIES:-172.16.0.0/12 192.168.0.0/16 10.0.0.0/8 fd00::/8}
networks:
caddy:
aliases: [hellcon-tracker]