AdGuard Home, Grafana, Docker image age, foldable server page cards

New integration kinds adguard (status, statistics, filter lists and a real DNS question
over UDP; alerts for DNS down/not running, protection left off, stale lists) and grafana
(alert rules firing or failing, data-source health). Optional warning for running Docker
images built more than N days ago (off by default). A server's overview cards can be
folded and arranged, kept per user. Migrations 0075-0077; docs, metrics and tests included.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-27 22:13:03 +01:00
1 parent 3d9a2310bb
commit 551eb1597a
53 files changed
+27700 -33

No files matched your search

+38 -2
View File
@@ -23,8 +23,8 @@ what the app actually creates.
|---|---|
| **File** | `DATABASE_PATH`, default `../data/homelab-manager.sqlite` (relative to `server/`; `/app/data/...` in Docker). The folder is created if missing. |
| **Foreign keys** | Switched on for every connection (`PRAGMA foreign_keys = ON`), so the `ON DELETE` rules below are enforced. |
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0074`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
| **Tables** | 85 application tables, plus drizzle's own `__drizzle_migrations`. |
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0077`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
| **Tables** | 87 application tables, plus drizzle's own `__drizzle_migrations`. |
**Not in the database, but beside it in the data folder:** the backups of the database itself (`backups/homelab-manager-….sqlite`, taken daily and on request; see [BACKUP.md](BACKUP.md)), and, only while a restore is waiting or has just happened, `restore-pending.sqlite` / `restore-pending.json` and `restore-result.json`.
@@ -77,6 +77,8 @@ erDiagram
integrations ||--o| hetzner_state : "cascade"
integrations ||--o| fragnet_state : "cascade"
integrations ||--o| arr_state : "cascade"
integrations ||--o| adguard_state : "cascade"
integrations ||--o| grafana_state : "cascade"
integrations ||--o{ speedtest_results : "cascade"
integrations ||--o| netbox_state : "cascade"
integrations ||--o| n8n_state : "cascade"
@@ -132,6 +134,7 @@ Everyone who has signed in through Authentik. The first one becomes admin.
| `favorites` | text | JSON array of the page paths this person pinned to the top of their menu (`["/servers","/alerts"]`), up to 24. A path may carry a short query for a saved view of a page (`"/servers?status=offline"`). Follows them to any browser. |
| `picture_url` | text | The `picture` claim the identity provider gave at the last sign-in. Only an address; nothing is fetched from it unless Settings → Sign-in → Profile pictures allows it (and then only Gravatar or the provider's own host). Pictures themselves are kept in the server's memory for a day, not in the database. |
| `dashboard_layout` | text | JSON object `{"hidden":["Gitea"],"order":{"Secrets":0,"DNS":1}}`: the dashboard cards this person hid and the order of the rest (lower first; a card with no entry goes last). Null = the default layout. Follows them to any browser. |
| `server_page_layout` | text | JSON object `{"folded":["admin-links"],"order":{"notes":10}}`: the cards of a server's overview page this person folded and the order of the blocks (lower first). The same for every server. Null is the page as drawn. |
| `groups` | text | JSON array of the groups the identity provider reported at this person's last sign-in (null until they have signed in with groups available) — shown on the Users page, and what "roles from groups" works from. |
| `last_looked_at` | text | ISO time this person last pressed "Got it" on the dashboard's "Since you last looked" card; the next summary starts there (null = never: the last day is shown). |
@@ -919,6 +922,7 @@ What Dockhand's own stored vulnerability scans add up to for each of its Docker
| `critical`, `high`, `medium`, `low` | integer | The counts across the host's scanned images. **Null when the count could not be read** (an older Dockhand, a host it cannot reach) — which is not the same as 0. |
| `images_scanned`, `total_images` | integer | How many of the host's images have a scan; the rest are not known to be clean. |
| `findings` | text NOT NULL, default `[]` | JSON: the critical findings (CVE, package, installed and fixed version, image, the containers that use it), at most 100. |
| `images`, `images_at` | text | JSON: the images this host's running containers use, each with when it was built (`image`, `created`, `containers`), and when that was read (migration `0076`). Null: never read, or could not be. |
| `updated_at` | text NOT NULL | ISO. |
How the last read went is kept in `settings`, key `_internal:dockerVulnSync`.
@@ -1009,6 +1013,38 @@ How a Sonarr, Radarr or Prowlarr (an integration of type `sonarr`, `radarr` or `
How the last read went is kept in `settings`, key `_internal:arrSync`.
#### `adguard_state`
How an AdGuard Home (an integration of type `adguard`) is right now, one row each, replaced at every read (every two minutes). `integration_id` is the primary key and a foreign key with **cascade**. No history: what is stored is the last good read, plus two clocks only this app can keep.
| Column | Type | Notes |
|---|---|---|
| `integration_id` | integer PK | |
| `version` | text | |
| `running`, `protection_enabled` | integer NOT NULL, default 1 | Whether its DNS server runs; whether protection is on. |
| `protection_off_since` | text | ISO: the first read that showed protection off; null while it is on. |
| `dns_port` | integer NOT NULL, default 53 | |
| `stats`, `filters` | text | JSON: the statistics (queries, blocked, average time, top names and clients) and the filter lists (name, on or off, rules, when updated). **Null when they could not be read.** |
| `probe` | text | JSON: the real DNS question — `{ ok, ms, error, name, host }`. |
| `probe_fail_since` | text | ISO: the first read in which the question went unanswered; null while it is answered. |
| `updated_at` | text NOT NULL | ISO. |
How the last read went is kept in `settings`, key `_internal:adguardSync`.
#### `grafana_state`
How a Grafana (an integration of type `grafana`) is right now, one row each, replaced at every read (every five minutes). `integration_id` is the primary key and a foreign key with **cascade**. No history.
| Column | Type | Notes |
|---|---|---|
| `integration_id` | integer PK | |
| `version` | text | |
| `rules` | text | JSON `{ total, items }`: how many alert rules there are, and those firing, pending or in error (name, folder, group, state, health, error, severity, summary, since when). **Null when they could not be read.** |
| `datasources` | text | JSON: each data source with Grafana's health check of it (`ok` is true, false, or null when its type has none). Null when they could not be listed. |
| `updated_at` | text NOT NULL | ISO. |
How the last read went is kept in `settings`, key `_internal:grafanaSync`.
#### `n8n_state`
How an n8n (an integration of type `n8n`) is right now, one row each, replaced at every read (every five minutes). `integration_id` is the primary key and a foreign key with **cascade**.