Commit graph

5 commits

Author SHA1 Message Date
Sam
c6db0ab569 refactor: replace GraphQL/REST with MQTT-only for Unraid server data
All server stats (CPU, RAM, Docker, shares, disks, array) now come
directly from MQTT topics published by the Unraid MQTT Agent. This
eliminates the need for API keys, HTTP polling, and the GraphQL/REST
fallback chain.

- Rewrote unraid_service.py to read from MQTT store (no httpx needed)
- Simplified servers router (no cache, no enrichment hack)
- Added mqtt_prefix field to UnraidServer config
- Updated DB: both Daddelolymp and Adriahub with mqtt_prefix, no api_key
- Data is always fresh (MQTT pushes every ~15s)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 23:25:57 +01:00
Sam
5d3d4f4015 MQTT-based live CPU/RAM metrics + remove auth from HA control
- Enrich server data with MQTT system topics (cpu_usage_percent,
  ram_usage_percent, temp, model etc.) published by Unraid MQTT Agent
- Works for both Daddelolymp and Adriahub topics
- MQTT overlay runs on every request (even cached) for fresh metrics
- Remove JWT auth from /api/ha/control — local dashboard doesn't need it
- Add cpu brand field to GraphQL query

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 22:41:16 +01:00
Sam
94727ebe70 Add Unraid GraphQL API support (6.12+) for server monitoring
The Unraid built-in API uses GraphQL at /graphql with x-api-key auth
instead of REST endpoints. Service now tries GraphQL first, then falls
back to legacy REST, then connectivity check.

Fetches: hostname, uptime, CPU cores/threads, RAM total, Docker
containers with status, array state, and share free space.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 22:30:05 +01:00
Sam
d3305a243c Weather: Replace wttr.in with Open-Meteo + structured logging
- Replace wttr.in (unreachable from Docker) with Open-Meteo API
  (free, no API key, reliable) with geocoding cache
- WMO weather codes mapped to German descriptions + emoji icons
- Add [WEATHER], [NEWS], [UNRAID], [DASHBOARD] log prefixes
- Structured integration status table on startup
- Suppress noisy httpx INFO logs (services log their own summaries)
- Add logging to unraid_service (was completely silent on errors)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:45:23 +01:00
Sam
9f7330e217 refactor: complete rewrite as React+FastAPI dashboard
Replace monolithic Jinja2 template with modern stack:

Backend (FastAPI):
- Modular router/service architecture
- Async PostgreSQL (asyncpg) for news from n8n pipeline
- Live Unraid server stats (2 servers via API)
- Home Assistant, Vikunja tasks, weather (wttr.in)
- WebSocket broadcast for real-time updates (15s)
- TTL cache per endpoint, all config via ENV vars

Frontend (React + Vite + TypeScript):
- Glassmorphism dark theme with Tailwind CSS
- Responsive grid: mobile/tablet/desktop/ultrawide
- Weather cards, hourly forecast, news with category tabs
- Server stats (CPU ring, RAM bar, Docker list)
- Home Assistant controls, task management
- Live clock, WebSocket connection indicator

Infrastructure:
- Multi-stage Dockerfile (node:22-alpine + python:3.11-slim)
- docker-compose with full ENV configuration
- Kaniko CI/CD pipeline for GitLab registry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 01:48:51 +01:00