traefik: second, env-named network so non-RPC services can be routed off chains

Traefik now also listens on `extra`, whose name comes from TRAEFIK_EXTRA_NETWORK
and defaults to rpc_extra (matching the rpc_chains convention). It is not
`external: true`, so compose creates it; hosts that never use it just get an
empty bridge.

Why: anything that wants a traefik route currently has to sit on `chains`, which
on a typical host means 26 containers including unauthenticated redis:6379,
traefik:8080 (--api.insecure=true) and several unauthenticated :8545 endpoints.
A public site accepting anonymous uploads does not belong there. With this it
can be routed from an isolated network that only traefik bridges into.

Validated with `docker compose config` against a real host .env: unset ->
rpc_extra, TRAEFIK_EXTRA_NETWORK=vientiane_net -> vientiane_net, traefik on
[chains, extra] in both.

Operational note: changing traefik's network list means the NEXT rpc-update on a
host recreates the traefik container, briefly interrupting all HTTP/HTTPS routing
on that host, RPC endpoints included. Nothing pulls /root/rpc on its own, so this
lands host by host and should ride the serving gate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjqejYycVyVvrxV9aTDhgX
This commit is contained in:
rob
2026-09-13 13:23:26 +00:00
parent 997a039c78
commit b6bbe77dff
2 changed files with 8 additions and 0 deletions

View File

@@ -1,4 +1,11 @@
networks:
# Second network Traefik also listens on, so a service can be routed WITHOUT
# sitting on `chains` next to the RPC nodes, Redis and the Traefik API (a
# public-facing site next to unauthenticated :8545 endpoints is a foothold we
# do not want to hand out). Overridable per host via TRAEFIK_EXTRA_NETWORK;
# the default is an empty bridge, so hosts that do not use it are unaffected.
extra:
name: ${TRAEFIK_EXTRA_NETWORK:-rpc_extra}
chains:
driver: bridge
ipam:

View File

@@ -38,6 +38,7 @@ services:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- chains
- extra
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.ipallowlist.ipallowlist.sourcerange=$WHITELIST"