feat(deploy): restrict the public perimeter and resolve the client address

This commit is contained in:
shira committed 2026-10-06 21:32:03 +03:00
1 parent e52ffe7bcb
commit 57174dffba
25 files changed
+1224 -25

No files matched your search

+17
View File
@@ -229,6 +229,12 @@ services:
SMTP_TLS_MODE: ${SMTP_TLS_MODE:-}
# Argon2id derivations that may run at once, 64 MiB each (1 to 4).
PASSWORD_HASH_CONCURRENCY: ${PASSWORD_HASH_CONCURRENCY:-1}
# Proxies whose X-Forwarded-For is believed: only the frontend container,
# which has a fixed address on the pinned app network below. Other
# containers of that network (Prometheus, exporters, Alloy) are not
# trusted. The frontend Nginx already replaces the header with the
# client address it resolved behind the edge.
TRUSTED_PROXY_CIDRS: ${TRUSTED_PROXY_CIDRS:-${APP_FRONTEND_IP:-172.29.79.10}/32}
# Soft Go heap limit at about 78% of the 768M container limit below; the
# rest covers goroutine stacks, runtime metadata, and non-heap memory.
# Change both together.
@@ -275,6 +281,9 @@ services:
depends_on:
backend:
condition: service_started
networks:
default:
ipv4_address: ${APP_FRONTEND_IP:-172.29.79.10}
ports:
# Loopback by default. On the app host behind the edge proxy,
# APP_HTTP_BIND is the tunnel address (see docs/en/DEPLOY.md); never
@@ -309,6 +318,14 @@ volumes:
networks:
default:
name: ${APP_NETWORK:-app_default}
# Pinned so that the frontend container, the only trusted proxy of the
# backend, has a known address. Change APP_SUBNET and APP_FRONTEND_IP
# together when the range collides with a route or another Docker network;
# a network that already exists with another subnet must be recreated
# (make -C deploy down, then up).
ipam:
config:
- subnet: ${APP_SUBNET:-172.29.79.0/24}
# Only SeaweedFS, the backend, and the monitoring Prometheus join it.
storage:
name: ${APP_STORAGE_NETWORK:-${APP_PROJECT:-app}_storage}