gendesign/backend/.env.example
lekss361 8a04af5da3 fix(backend): GlitchTip release fallback + apiKey scrub (#204 review fixes)
- release= now: GIT_SHA or SENTRY_RELEASE or "unknown" (covers existing
  deploy.yml which writes SENTRY_RELEASE=$IMAGE_TAG, not GIT_SHA)
- new module app/observability/sentry_scrub.py: before_send_transaction
  hook that redacts apiKey/token/access_token/secret query params from
  HttpxIntegration spans before they reach GlitchTip
- config.py: model_validator promotes legacy SENTRY_DSN -> glitchtip_dsn
  with DeprecationWarning for backward compat on existing VPS env
- .env.example: added deprecated SENTRY_DSN entry with comment
- tests: 8 new cases covering release fallback + scrub module (11 total)
2026-05-16 18:04:01 +03:00

32 lines
1.8 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Hostname-related defaults assume Docker Compose context (recommended).
# For native dev without Docker, swap "postgres" → "localhost" and "redis" → "localhost".
DATABASE_URL=postgresql+psycopg://gendesign:gendesign@postgres:5432/gendesign
REDIS_URL=redis://redis:6379/0
CORS_ORIGINS=["http://localhost:3000"]
ENVIRONMENT=dev
# DSN для GlitchTip (https://errors.gendsgn.ru). Пустое = SDK no-op.
# Формат: https://<key>@errors.gendsgn.ru/<project_id>
GLITCHTIP_DSN=
GLITCHTIP_TRACES_SAMPLE_RATE=0.05
# DEPRECATED — будет удалён после 1-2 deploy-циклов. Использовать GLITCHTIP_DSN.
# Если задан, а GLITCHTIP_DSN пуст — автоматически продвигается с DeprecationWarning.
SENTRY_DSN=
# External APIs (Stage 2)
ROSREESTR_PKK_BASE_URL=https://pkk.rosreestr.ru/api/features/1
OVERPASS_URL=https://overpass-api.de/api/interpreter
# ── Scraper наш.дом.рф (Celery beat + admin trigger) ──────────────────────
# Расписание автоматических прогонов (5-полевой crontab). По умолчанию пн 04:15 МСК.
SCRAPE_KN_CRON=15 4 * * mon
# Random delay 0..N сек перед стартом scheduled-таска (анти-pattern detection).
SCRAPE_KN_JITTER_SECONDS=1800
# Регионы по умолчанию для scheduled sweep-а (csv).
SCRAPE_KN_DEFAULT_REGIONS=66
# Путь к Playwright storage_state.json (commited в git, обновляется --save-state).
SCRAPE_KN_STATE_PATH=data/playwright_state.json
# Токен для POST /api/v1/admin/scrape/kn (заголовок X-Admin-Token).
# Пустая строка = endpoint disabled (503). Сгенерировать: openssl rand -hex 32
SCRAPE_ADMIN_TOKEN=