Merge pull request 'fix(tradein/devops): wire COOKIE_ENCRYPTION_KEY env to tradein-backend' (#543) from chore/tradein-cookie-encryption-key-env into main
All checks were successful
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-frontend (push) Successful in 22s
Deploy Trade-In / build-backend (push) Successful in 24s
Deploy Trade-In / deploy (push) Successful in 35s

Reviewed-on: #543
This commit is contained in:
lekss361 2026-05-24 16:08:20 +00:00
commit cbe81b7fb7
2 changed files with 21 additions and 0 deletions

View file

@ -56,10 +56,27 @@ TRADEIN_POSTGRES_USER=tradein
TRADEIN_POSTGRES_PASSWORD=<сгенерировать openssl rand -hex 32>
TRADEIN_CONTACT_EMAIL=tradein@gendsgn.ru
YANDEX_GEOCODER_KEY= # пусто пока, Nominatim fallback работает
# Encryption key for Cian session cookies (pgp_sym_encrypt / Stage 9 Calculator).
# Empty = Valuation Calculator scraper disabled + /api/v1/cookies/upload returns 503.
# Generate once on VPS:
# openssl rand -hex 32
COOKIE_ENCRYPTION_KEY=<64-char hex>
```
Файл создаётся вручную при первом деплое.
### Обновление `COOKIE_ENCRYPTION_KEY` на существующем VPS
```bash
# На VPS, если COOKIE_ENCRYPTION_KEY ещё не задан:
echo "COOKIE_ENCRYPTION_KEY=$(openssl rand -hex 32)" >> /opt/gendesign/tradein-mvp/.env.runtime
# Применить без полного рестарта стека:
cd /opt/gendesign/tradein-mvp
docker compose -p gendesign-tradein -f docker-compose.prod.yml up -d --force-recreate --no-deps backend
```
## GitHub Secrets (уже должны быть от gendesign deploy)
- `DEPLOY_HOST` — IP сервера (94.228.121.73)

View file

@ -48,6 +48,10 @@ services:
# GlitchTip DSN — мониторинг ошибок (#396). Пусто = выключено.
GLITCHTIP_DSN: "${GLITCHTIP_DSN:-}"
GENDESIGN_FDW_PASSWORD: "${GENDESIGN_FDW_PASSWORD:-}"
# Encryption key for Cian session cookies (pgp_sym_encrypt). Required for
# Valuation Calculator (Stage 9). Empty = Calculator scraper disabled +
# cookies upload endpoint returns 503. Generate with `openssl rand -hex 32`.
COOKIE_ENCRYPTION_KEY: "${COOKIE_ENCRYPTION_KEY:-}"
depends_on:
postgres:
condition: service_healthy