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:
parent
e25d055ba2
commit
6651bfaf60
9 changed files with 1042 additions and 34 deletions
|
|
@ -112,8 +112,9 @@ app.add_middleware(
|
|||
)
|
||||
|
||||
# --- Register Routers ---
|
||||
from server.routers import admin, auth, dashboard, homeassistant, mqtt, news, servers, tasks, weather # noqa: E402
|
||||
from server.routers import admin, auth, dashboard, homeassistant, mqtt, news, servers, setup, tasks, weather # noqa: E402
|
||||
|
||||
app.include_router(setup.router)
|
||||
app.include_router(auth.router)
|
||||
app.include_router(admin.router)
|
||||
app.include_router(weather.router)
|
||||
|
|
@ -128,6 +129,13 @@ app.include_router(dashboard.router)
|
|||
static_dir = Path(__file__).parent.parent / "static"
|
||||
if static_dir.is_dir():
|
||||
# SPA fallback: serve index.html for any non-API path
|
||||
@app.get("/setup{full_path:path}")
|
||||
async def setup_spa_fallback(full_path: str = ""):
|
||||
index = static_dir / "index.html"
|
||||
if index.exists():
|
||||
return FileResponse(str(index))
|
||||
return {"error": "Frontend not built"}
|
||||
|
||||
@app.get("/admin/{full_path:path}")
|
||||
async def admin_spa_fallback(full_path: str):
|
||||
index = static_dir / "index.html"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue