346e7f2e22
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
20 lines
829 B
Python
20 lines
829 B
Python
"""Configuration surface — the single place deployment/environment config is read.
|
|
|
|
INV-8: no deployment shape is baked into framework code. Every URL, credential, or
|
|
relay coordinate arrives through here from the environment (resolved from Secret
|
|
Manager in deployed environments). The localhost defaults match compose.yaml so a
|
|
clean `scripts/dev.sh` checkout needs no env setup.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
# Dev default points at the single Postgres container compose.yaml brings up. In
|
|
# PPE/Prod the deployment supplies ECOMM_DATABASE_URL from Secret Manager (INV-8).
|
|
_DEFAULT_DATABASE_URL = "postgresql://ecomm:ecomm@localhost:5432/ecomm"
|
|
|
|
|
|
def database_url() -> str:
|
|
"""The psycopg DSN for the application database."""
|
|
return os.environ.get("ECOMM_DATABASE_URL") or _DEFAULT_DATABASE_URL
|