Redis without a password was the root cause of the security incident
(cron miner via unauthenticated replication RCE, see
.forcc/deploy/SESSION2-FINDINGS.md). Loopback binding alone doesn't
protect against a compromised container inside the same compose
network, so wire REDIS_PASSWORD as a required secret everywhere redis
is used: backend/worker/worker-transcriber(-gpu), redis-exporter,
livekit and egress (via rendered templates). docker compose now
refuses to start without it instead of silently running unauthenticated.
Close host-published ports that don't need to be reachable from outside
the docker network: nginx already proxies backend/livekit by service
name, and admin UIs (prometheus/grafana) and llm servers should only be
reachable via SSH tunnel. Only 80/443/7881 + the WebRTC UDP range stay
open to the internet.
Both are only used inside the compose network (services reach them by name,
postgres:5432 / redis:6379). Publishing on 0.0.0.0 exposed them to the
internet — Docker's DNAT rules bypass ufw, so the ports were reachable
despite the firewall having no allow rule for them. Bind the published
ports to 127.0.0.1 so external access requires an SSH tunnel.
Переносит рабочие правки продакшен-сервера в репозиторий воспроизводимо:
- nginx: HTTPS-блок на 443 (TLS1.2/1.3, http->https redirect, ACME
webroot, X-Forwarded-Proto) добавлен в nginx.conf.template. Список
доменов и имя каталога сертификата — параметры (NGINX_SERVER_NAMES,
NGINX_CERT_NAME), не хардкод. Рендерится штатным entrypoint'ом образа
nginx (envsubst-on-templates).
- Самоподписанный dev-сертификат генерируется на старте контейнера
(docker-entrypoint-certs.sh), если реальный Let's Encrypt не смонтирован
— иначе `docker compose up` без профиля ломался бы локально без
реальных сертификатов.
- healthcheck nginx переключён на /healthz (без TLS-редиректа), иначе
http://127.0.0.1:80/ после добавления 443-редиректа всегда unhealthy.
- coturn/turnserver.conf и livekit/livekit.yaml переведены в *.template —
оба образа не читают env для статических полей (static-auth-secret,
use_external_ip/node_ip, webhook.api_key), поэтому реальные файлы
генерируются перед стартом стека скриптом deploy/render-templates.sh
(вызывается install.sh). Секреты/IP — только в .env, не в git.
- docker-compose.yml: LIVEKIT_API_KEY/SECRET везде (backend, livekit,
egress) через ${VAR:?} без небезопасных дефолтов; порт 443 + монтирование
/etc/letsencrypt (ro) и certbot-webroot у nginx; build-args
VITE_LIVEKIT_URL/NEXT_PUBLIC_LIVEKIT_URL для frontend (сейчас не
используются кодом, оставлены про запас).