prelaunch env var prevents the site from being operational

This commit is contained in:
2026-11-09 20:49:25 +01:00
parent 9d3dd426db
commit 79782dc778
23 changed files with 510 additions and 98 deletions
+5
View File
@@ -17,6 +17,11 @@ config :chesstrainer, :branding,
support_email: "support@innersquare.app",
mail_from: "no-reply@innersquare.app"
# Prelaunch gating. Production sets these from PRELAUNCH and
# MAILING_LIST_ENABLED; dev and test use these defaults.
config :chesstrainer, :prelaunch, false
config :chesstrainer, :mailing_list_enabled, true
config :chesstrainer, :scopes,
user: [
default: true,
+5 -1
View File
@@ -15,11 +15,15 @@ config :chesstrainer, ChesstrainerWeb.Endpoint,
force_ssl: [
rewrite_on: [:x_forwarded_proto],
exclude: [
# paths: ["/health"],
paths: ["/health"],
hosts: ["localhost", "127.0.0.1"]
]
]
# Fail closed in production: the mailing list stays off until SES production
# access is granted and MAILING_LIST_ENABLED is set explicitly.
config :chesstrainer, :mailing_list_enabled, false
# Configure Swoosh API Client
config :swoosh, api_client: Swoosh.ApiClient.Req
+8
View File
@@ -20,6 +20,14 @@ if System.get_env("PHX_SERVER") do
config :chesstrainer, ChesstrainerWeb.Endpoint, server: true
end
if prelaunch = System.get_env("PRELAUNCH") do
config :chesstrainer, :prelaunch, prelaunch in ~w(true 1)
end
if mailing_list_enabled = System.get_env("MAILING_LIST_ENABLED") do
config :chesstrainer, :mailing_list_enabled, mailing_list_enabled in ~w(true 1)
end
# Local Syzygy tablebases: set TABLEBASE_PATH to the directory holding the
# .rtbw/.rtbz files. When unset, the local backend stays disabled and lookups
# fall back to Lichess.