configuration/secrets things
diff --git a/fly.toml b/fly.toml
index b9a0f70..7307970 100644
--- a/fly.toml
+++ b/fly.toml
@@ -5,8 +5,8 @@ primary_region = "sea"
image = "ghcr.io/kejadlen/go-ji:fly"
[env]
- GO_JI_SENTRY_ENVIRONMENT = "production"
TAILSCALE_HOSTNAME = "go"
+ GO_JI_SENTRY__ENVIRONMENT = "production"
[http_service]
internal_port = 8000
diff --git a/go_ji/__init__.py b/go_ji/__init__.py
index eaf2d57..4944e83 100644
--- a/go_ji/__init__.py
+++ b/go_ji/__init__.py
@@ -24,6 +24,8 @@ VALID_SLUG = re.compile(r"^\w[-\w]*$", re.ASCII)
CONFIG = Config("")
CONFIG["DB_URL"] = "sqlite:///go-ji.db"
+CONFIG["TESTING"] = False
+CONFIG["SENTRY"] = {}
CONFIG.from_prefixed_env("GO_JI")
@@ -33,10 +35,10 @@ def create_app(config_override: dict[str, Any] = {}) -> Flask:
app.config.from_mapping(CONFIG)
app.config.from_mapping(config_override)
- if not app.config.get("TESTING", False): # pragma: no cover
+ if sentry_config := app.config["SENTRY"]:
sentry_sdk.init(
- dsn=app.config["SENTRY_DSN"],
- environment=app.config["SENTRY_ENVIRONMENT"],
+ dsn=sentry_config["DSN"],
+ environment=sentry_config["ENVIRONMENT"],
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,