diff --git a/arakava-news/reddit_trends.py b/arakava-news/reddit_trends.py index 198c1cea..4de890eb 100644 --- a/arakava-news/reddit_trends.py +++ b/arakava-news/reddit_trends.py @@ -11,13 +11,30 @@ import logging import os import re from datetime import datetime, timedelta, timezone +from pathlib import Path + +def _load_homelab_conf(): + """Liest Schluessel-Wert-Paare aus homelab.conf.""" + conf = {} + for path in ["/opt/homelab-brain/homelab.conf", "/opt/homelab-ai-bot/../homelab.conf"]: + p = Path(path) + if p.exists(): + for line in p.read_text().splitlines(): + line = line.strip() + if "=" in line and not line.startswith("#"): + k, _, v = line.partition("=") + conf[k.strip()] = v.strip().strip('"') + break + return conf + +_CONF = _load_homelab_conf() # ── Konfiguration ────────────────────────────────────────────── WP_URL = "https://arakava-news-2.orbitalo.net" WP_USER = "admin" -WP_PASS = "eJIyhW0p5PFacjvvKGufKeXS" -OPENROUTER_KEY = "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" -TELEGRAM_TOKEN = "8551565940:AAHIUpZND-tCNGv9yEoNPRyPt4GxEPYBJdE" +WP_PASS = _CONF.get("PW_WP_ADMIN", "") +OPENROUTER_KEY = _CONF.get("OPENROUTER_KEY", "") +TELEGRAM_TOKEN = _CONF.get("TG_MUTTER_TOKEN", "") TELEGRAM_CHAT = "674951792" LOG_FILE = "/opt/rss-manager/logs/reddit_trends.log" WP_CATEGORY = "Tech-Trends"