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:
7
base.yml
7
base.yml
@@ -1,4 +1,11 @@
|
|||||||
networks:
|
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:
|
chains:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
ipam:
|
ipam:
|
||||||
|
|||||||
1
rpc.yml
1
rpc.yml
@@ -38,6 +38,7 @@ services:
|
|||||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||||
networks:
|
networks:
|
||||||
- chains
|
- chains
|
||||||
|
- extra
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.middlewares.ipallowlist.ipallowlist.sourcerange=$WHITELIST"
|
- "traefik.http.middlewares.ipallowlist.ipallowlist.sourcerange=$WHITELIST"
|
||||||
|
|||||||
Reference in New Issue
Block a user