Verlasse dich nicht auf compose-Defaults

podman-compose auf Debian 13 reicht ${VAR:-x} wörtlich durch; km bekam
den Platzhalter als Repo-Namen. Jede Variable steht jetzt in der .env
(Vorlage deploy/env.example), und die Konfiguration verwirft Werte, die
wie ein unersetzter Platzhalter aussehen.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-04 18:52:22 +02:00
co-authored by Claude Fable 5.1
parent 6fc1e1a3c6
commit 0a13de7ab1
3 changed files with 42 additions and 13 deletions
+10 -2
View File
@@ -13,8 +13,16 @@ from dataclasses import dataclass, field
from pathlib import Path
def _clean(v: str | None) -> str:
"""podman-compose (Debian 13) ersetzt `${VAR:-x}` nicht, sondern reicht
den Platzhalter woertlich durch -- gesehen auf hive.home am 04.09. Ein
Wert, der so aussieht, ist keiner."""
v = (v or "").strip()
return "" if v.startswith("${") else v
def _list(v: str) -> list[str]:
return [x.strip() for x in v.replace(";", ",").split(",") if x.strip()]
return [x.strip() for x in _clean(v).replace(";", ",").split(",") if x.strip()]
@dataclass
@@ -50,7 +58,7 @@ class Config:
@classmethod
def from_env(cls) -> "Config":
e = os.environ.get
e = lambda k, d="": _clean(os.environ.get(k)) or d # noqa: E731
cfg = cls(
ablage=Path(e("KM_ABLAGE", "/data/ablage")),
namespace=e("KM_NAMESPACE", ""),