78 lines
3.7 KiB
Python
78 lines
3.7 KiB
Python
# Sentry config overlay.
|
|
#
|
|
# This file replaces the upstream `sentry/sentry.conf.py` (the upstream version
|
|
# is mostly defaults + env-var-wiring; we keep that behaviour and layer our
|
|
# project-specific hardening on top).
|
|
#
|
|
# Loaded by `web`, `worker`, `cron` (and any other Sentry component) at startup.
|
|
#
|
|
# Source of truth for what each setting does: https://develop.sentry.dev/self-hosted/
|
|
# Loaded at: /etc/sentry/sentry.conf.py inside the Sentry containers.
|
|
|
|
from sentry.conf.server import * # noqa: F401,F403
|
|
import os
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Single-organization mode
|
|
# ---------------------------------------------------------------------------
|
|
# We run one tenant ("Boilerplate"). This collapses the org-picker UI and lets
|
|
# the admin see the global dashboard directly.
|
|
SENTRY_SINGLE_ORGANIZATION = True
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Feature flags
|
|
# ---------------------------------------------------------------------------
|
|
# Start from upstream defaults if a SENTRY_FEATURES dict is already exported,
|
|
# otherwise initialise an empty one. Either way the writes below win.
|
|
try:
|
|
SENTRY_FEATURES # type: ignore[name-defined]
|
|
except NameError:
|
|
SENTRY_FEATURES = {}
|
|
|
|
# Public signup OFF — invites only. This is the single most important
|
|
# hardening setting; without it any visitor to sentry.boiler.saas-ctrl.com
|
|
# can create an account and start receiving events.
|
|
SENTRY_FEATURES["auth:register"] = False
|
|
|
|
# Enable Relay for the org. Required for OTLP ingest, performance, and replay
|
|
# to flow through `relay` (rather than directly through `web`).
|
|
SENTRY_FEATURES["organizations:relay"] = True
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Symbolicator: no external sym sources
|
|
# ---------------------------------------------------------------------------
|
|
# Stack traces stay local. We do NOT contact Microsoft / Apple / Mozilla
|
|
# public symbol servers because the leaked metadata would be telemetry-grade
|
|
# (every untranslated frame would betray library + version + ABI to a third
|
|
# party). If we ever need real symbol resolution we provision an internal
|
|
# sym-source against a private bucket.
|
|
SYMBOLICATOR_SYMSOURCES = []
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Admin
|
|
# ---------------------------------------------------------------------------
|
|
# Read from env; install.sh seeds the user on first deploy. Subsequent reads
|
|
# only affect superuser-aware emails (e.g. "from" address on system notes).
|
|
SENTRY_ADMIN_EMAIL = os.environ.get("SENTRY_ADMIN_EMAIL", "")
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Mail
|
|
# ---------------------------------------------------------------------------
|
|
# Upstream's compose ships its own smtp container; we keep that wiring. The
|
|
# admin email above is the From-address for system mails.
|
|
SENTRY_OPTIONS = globals().get("SENTRY_OPTIONS", {})
|
|
SENTRY_OPTIONS.setdefault("mail.from", SENTRY_ADMIN_EMAIL or "sentry@boiler.saas-ctrl.com")
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# URL prefix — must match the Traefik-routed hostname
|
|
# ---------------------------------------------------------------------------
|
|
# Sentry uses this to build absolute URLs in emails, web-hooks, and the auth
|
|
# flow. Mismatch leads to broken magic-links in invite emails.
|
|
SENTRY_OPTIONS["system.url-prefix"] = os.environ.get(
|
|
"SENTRY_BASE_URL", "https://sentry.boiler.saas-ctrl.com"
|
|
)
|
|
|
|
# Trust the X-Forwarded-* headers from Traefik (TLS terminated upstream).
|
|
SENTRY_USE_SSL = bool(int(os.environ.get("SENTRY_USE_SSL", "1")))
|
|
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|