feat: Setup Wizard for first-run configuration

Container starts with only DB credentials. On first visit, a step-by-step
wizard guides through admin password, weather, HA, Vikunja, Unraid, MQTT,
n8n and news configuration. Backward-compat: ADMIN_PASSWORD env skips wizard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sam 2026-03-02 16:06:10 +01:00
parent e25d055ba2
commit 6651bfaf60
9 changed files with 1042 additions and 34 deletions

View file

@ -136,6 +136,27 @@ async def test_news_db(config: Dict[str, Any]) -> Dict[str, Any]:
return {"success": False, "message": str(exc)}
async def test_n8n(config: Dict[str, Any]) -> Dict[str, Any]:
"""Test n8n connection by fetching workflows."""
url = config.get("url", "")
api_key = config.get("api_key", "")
if not url or not api_key:
return {"success": False, "message": "URL und API Key sind erforderlich"}
try:
base = url.rstrip("/")
async with httpx.AsyncClient(timeout=TIMEOUT) as client:
r = await client.get(
f"{base}/api/v1/workflows",
headers={"X-N8N-API-KEY": api_key},
)
r.raise_for_status()
data = r.json()
count = len(data.get("data", []))
return {"success": True, "message": f"Verbunden — {count} Workflows gefunden"}
except Exception as exc:
return {"success": False, "message": str(exc)}
# Map integration type → test function
TEST_FUNCTIONS = {
"weather": test_weather,
@ -144,4 +165,5 @@ TEST_FUNCTIONS = {
"unraid": test_unraid,
"mqtt": test_mqtt,
"news": test_news_db,
"n8n": test_n8n,
}