25 lines
866 B
Python
25 lines
866 B
Python
import os
|
|
|
|
|
|
def _bool_env(name: str, default: bool) -> bool:
|
|
raw = os.environ.get(name)
|
|
if raw is None:
|
|
return default
|
|
return raw.strip().lower() in ("1", "true", "yes", "on")
|
|
|
|
|
|
class Config:
|
|
# Beispiel: postgresql://pbt_app:PASSWORT@10.10.10.x/pbt
|
|
SQLALCHEMY_DATABASE_URI = os.environ.get(
|
|
"PBT_DATABASE_URL",
|
|
"postgresql://pbt_app:changeme@postgres/pbt",
|
|
)
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|
SECRET_KEY = os.environ.get("PBT_SECRET_KEY", "bitte-in-produktion-aendern")
|
|
|
|
# Route preview map (Leaflet/OSM) on the trip form and "Meine Fahrten".
|
|
# Off by default: without real route geometry it only draws a straight
|
|
# line between stops, which isn't worth the extra page weight/CDN calls
|
|
# for most setups. Set PBT_SHOW_MAP=true to turn it on.
|
|
SHOW_MAP = _bool_env("PBT_SHOW_MAP", True)
|