chore(infra): wire POSTHOG_API_KEY/POSTHOG_HOST into api+worker compose env
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled

Server-side PostHog was disabled in prod (POSTHOG_API_KEY never reached the
container — it wasn't referenced in the compose environment blocks, and per
prior Coolify experience env only injects when referenced as ${VAR}). So all
server-side events (payment_success/failed/refunded, subscription_activated)
silently no-op'd. Reference the vars in both api and worker environment blocks
so a Coolify-set value reaches the container. POSTHOG_HOST defaults to the EU
ingestion host; empty key keeps it disabled (e.g. on dev, to avoid polluting
the prod project).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 16:10:21 +03:00
parent 3bfefe6196
commit b56ea7c0fb

View File

@@ -65,6 +65,10 @@ services:
- NOVU_API_KEY=${NOVU_API_KEY:-}
- APP_PUBLIC_URL=${APP_PUBLIC_URL:-https://sase.tr}
- MAILTRACK_SECRET=${MAILTRACK_SECRET:-}
# PostHog server-side analytics (payments, subscription lifecycle, $revenue).
# Empty key → PostHogService no-ops (server-side analytics disabled).
- POSTHOG_API_KEY=${POSTHOG_API_KEY:-}
- POSTHOG_HOST=${POSTHOG_HOST:-https://eu.i.posthog.com}
- OTEL_ENABLED=${OTEL_ENABLED:-false}
- OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-}
- OTEL_EXPORTER_OTLP_HEADERS=${OTEL_EXPORTER_OTLP_HEADERS:-}
@@ -144,6 +148,10 @@ services:
- NOVU_API_KEY=${NOVU_API_KEY:-}
- APP_PUBLIC_URL=${APP_PUBLIC_URL:-https://sase.tr}
- MAILTRACK_SECRET=${MAILTRACK_SECRET:-}
# PostHog server-side analytics (payments, subscription lifecycle, $revenue).
# Empty key → PostHogService no-ops (server-side analytics disabled).
- POSTHOG_API_KEY=${POSTHOG_API_KEY:-}
- POSTHOG_HOST=${POSTHOG_HOST:-https://eu.i.posthog.com}
- OTEL_ENABLED=${OTEL_ENABLED:-false}
- OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-}
- OTEL_EXPORTER_OTLP_HEADERS=${OTEL_EXPORTER_OTLP_HEADERS:-}