1. Admin → Geheimnisse sub-tab lets you edit ANTHROPIC_API_KEY + BERLIN_WOHNEN_USERNAME/PASSWORD at runtime. Migration v7 adds a secrets(key,value,updated_at) table; startup seeds missing keys from env (idempotent). web reads secrets DB-first (env fallback) via llm._api_key(); alert fetches them from web /internal/secrets on each scan, passes them into Scraper(). Rotating creds no longer needs a redeploy. Masked display: 6 leading + 4 trailing chars, "…" in the middle. Blank form fields leave the stored value untouched. 2. Drop the max_morning_commute filter from UI + server + FILTER_KEYS + filter summary (the underlying Maps.calculate_score code stays for potential future re-enable). 3. /static/didi.webp wired as favicon via <link rel="icon"> in base.html. 4. apply.open_page wraps page.goto in try/except so a failed load still produces a "goto.failed" step + screenshot instead of returning an empty forensics blob. networkidle + post-submission sleep are also made best-effort. The error ZIP export already writes screenshot+HTML per step and final_html — with this change every apply run leaves a reconstructable trail even when the listing is already offline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28 lines
902 B
Python
28 lines
902 B
Python
import sys
|
|
from os import getenv
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
|
|
def _required(key: str) -> str:
|
|
val = getenv(key)
|
|
if not val:
|
|
print(f"missing required env var: {key}", file=sys.stderr)
|
|
sys.exit(1)
|
|
return val
|
|
|
|
|
|
LANGUAGE: str = getenv("LANGUAGE", "en")
|
|
TIME_INTERVALL: int = int(getenv("SLEEP_INTERVALL", "60"))
|
|
|
|
# web backend: alert POSTs discovered flats here
|
|
WEB_URL: str = getenv("WEB_URL", "http://web:8000")
|
|
INTERNAL_API_KEY: str = _required("INTERNAL_API_KEY")
|
|
|
|
# secrets — BERLIN_WOHNEN_* env acts as bootstrap only; the web service
|
|
# owns the live creds in its DB (admin UI), alert fetches them on each
|
|
# scan via /internal/secrets. GMAPS_API_KEY is still env-only.
|
|
GMAPS_API_KEY: str = _required("GMAPS_API_KEY")
|
|
BERLIN_WOHNEN_USERNAME: str = getenv("BERLIN_WOHNEN_USERNAME", "")
|
|
BERLIN_WOHNEN_PASSWORD: str = getenv("BERLIN_WOHNEN_PASSWORD", "")
|