better authenticarion

This commit is contained in:
2026-08-30 11:33:13 +02:00
parent fcae3569fc
commit ea591fc8fb
10 changed files with 299 additions and 16 deletions
+11
View File
@@ -9,8 +9,19 @@ def _bool(name: str, default: bool) -> bool:
return default if value is None else value.lower() in {"1", "true", "yes", "on"}
def _prefix(value: str) -> str:
value = value.strip()
if not value or value == "/":
return ""
return "/" + value.strip("/")
class Config:
URL_PREFIX = _prefix(os.getenv("URL_PREFIX", ""))
RRD_FOLDER = Path(os.getenv("RRD_FOLDER", "./rrd")).expanduser().resolve()
NETATMO_TOKEN_FILE = Path(
os.getenv("NETATMO_TOKEN_FILE", str(RRD_FOLDER / "netatmo_tokens.json"))
).expanduser().resolve()
GRAPH_WIDTH = int(os.getenv("GRAPH_WIDTH", "900"))
GRAPH_HEIGHT = int(os.getenv("GRAPH_HEIGHT", "240"))
POLL_INTERVAL = int(os.getenv("POLL_INTERVAL", "600"))