It shows what ORIGINS has to look like: exactly what browsers send as Origin, so scheme, host and a non-default port, without path or trailing slash. Anything else locks out every client. CADDY_NETWORK is there too, commented out with its default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
# HellCon's own servers: a tracker behind Caddy and a STUN server. Neither is needed, the client works
|
|
# with any WebTorrent tracker and STUN server. Copy .env.example to .env and set ORIGINS there, then
|
|
# `docker compose up -d --build`. Caddy, in its own compose
|
|
# project, proxies to the tracker over its network (CADDY_NETWORK, "caddy" unless set):
|
|
#
|
|
# tracker.example.org {
|
|
# reverse_proxy hellcon-tracker:8000
|
|
# }
|
|
|
|
name: hellcon
|
|
|
|
x-logging: &logging
|
|
driver: json-file
|
|
options: { max-size: 10m, max-file: '2' }
|
|
|
|
services:
|
|
tracker:
|
|
build: .
|
|
environment:
|
|
ORIGINS: ${ORIGINS:?set ORIGINS in .env to where HellCon is served from}
|
|
networks:
|
|
caddy:
|
|
aliases: [hellcon-tracker]
|
|
init: true
|
|
read_only: true
|
|
cap_drop: [ALL]
|
|
security_opt: [no-new-privileges:true]
|
|
cpus: 0.5
|
|
mem_limit: 96m
|
|
memswap_limit: 96m
|
|
pids_limit: 32
|
|
logging: *logging
|
|
restart: unless-stopped
|
|
|
|
# On the host network, so Docker's NAT can't change the source address clients get back. UDP 3478
|
|
# on IPv4 only, stun.example.org needs an A record and no AAAA.
|
|
coturn:
|
|
image: coturn/coturn:4.18.0
|
|
network_mode: host
|
|
# Off by default since 4.18, their --no- options are gone: DTLS, the admin CLI, the software
|
|
# attribute, the RFC 3489 MAPPED-ADDRESS and logging each binding request. The image has no config
|
|
# file, -n would only fail with "Unknown argument".
|
|
command:
|
|
- --log-file=stdout
|
|
- --listening-ip=0.0.0.0
|
|
- --listening-port=3478
|
|
- --stun-only
|
|
- --no-tcp
|
|
- --no-tls
|
|
# One per CPU core otherwise, more than cpus allows.
|
|
- --relay-threads=1
|
|
# The pid file lands in /var/tmp, coturn can't write /var/run. The image declares /var/lib/coturn
|
|
# a volume, the tmpfs keeps an anonymous one from piling up.
|
|
tmpfs: [/var/lib/coturn, /var/tmp]
|
|
read_only: true
|
|
cap_drop: [ALL]
|
|
# turnserver has it as file capability, without it the kernel refuses to run it. 3478 doesn't need
|
|
# it, no-new-privileges keeps it from being granted.
|
|
cap_add: [NET_BIND_SERVICE]
|
|
security_opt: [no-new-privileges:true]
|
|
cpus: 1
|
|
mem_limit: 128m
|
|
memswap_limit: 128m
|
|
pids_limit: 64
|
|
logging: *logging
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
caddy:
|
|
external: true
|
|
name: ${CADDY_NETWORK:-caddy}
|