refactor: rename platform_domain → main_domain to avoid confusion with platform.domain
Some checks failed
CI / ruff (push) Successful in 10s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has started running

The setting `settings.platform_domain` (the global/main domain like "wizard.lu")
was easily confused with `platform.domain` (per-platform domain like "rewardflow.lu").
Renamed to `settings.main_domain` / `MAIN_DOMAIN` env var across the entire codebase.

Also updated docs to reflect the refactored store detection logic with
`is_platform_domain` / `is_subdomain_of_platform` guards.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-14 04:45:28 +01:00
parent 4a1f71a312
commit c2c0e3c740
26 changed files with 152 additions and 113 deletions

View File

@@ -390,14 +390,14 @@ def create_admin_settings(db: Session) -> int:
},
{
"key": "platform_url",
"value": f"https://{settings.platform_domain}",
"value": f"https://{settings.main_domain}",
"value_type": "string",
"description": "Main platform URL",
"is_public": True,
},
{
"key": "support_email",
"value": f"support@{settings.platform_domain}",
"value": f"support@{settings.main_domain}",
"value_type": "string",
"description": "Platform support email",
"is_public": True,

View File

@@ -339,7 +339,7 @@ def validate_configuration(env_vars: dict) -> dict:
# -------------------------------------------------------------------------
# Platform Domain
# -------------------------------------------------------------------------
domain = env_vars.get("PLATFORM_DOMAIN", "orion.lu")
domain = env_vars.get("MAIN_DOMAIN", "orion.lu")
if domain != "orion.lu":
results["domain"] = {
"status": "ok",
@@ -350,7 +350,7 @@ def validate_configuration(env_vars: dict) -> dict:
results["domain"] = {
"status": "warning",
"message": "Using default domain",
"items": ["Set PLATFORM_DOMAIN for your deployment"]
"items": ["Set MAIN_DOMAIN for your deployment"]
}
# -------------------------------------------------------------------------

View File

@@ -1445,7 +1445,7 @@ def print_summary(db: Session):
print("\n🏪 Demo Stores:")
for store in stores:
print(f"\n {store.name} ({store.store_code})")
print(f" Subdomain: {store.subdomain}.{settings.platform_domain}")
print(f" Subdomain: {store.subdomain}.{settings.main_domain}")
# Show per-platform custom subdomains
from app.modules.tenancy.models import Platform