How big the app's data is, and a webhook delivery log with Send again

Settings -> Data -> Storage measures the database, backups and sessions and every
table (size, rows, growth, how long it is kept, how far back it reaches), and flags
histories that are not being trimmed or have no limit.

Event webhooks now keep a delivery log (last 100 per webhook, 14 days): what was
sent, how it went, the message itself, and Send again, which resends it exactly as it
was (same id and signature). Resends are audited and in the Change log.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-21 20:58:57 +02:00
1 parent aebf3c6ce1
commit e114567d64
22 files changed
+6833 -19

No files matched your search

+26 -5
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` … `0051`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
| **Tables** | 61 application tables, plus drizzle's own `__drizzle_migrations`. |
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0052`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
| **Tables** | 62 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`.
@@ -84,11 +84,12 @@ erDiagram
servers ||--o{ update_runs : "cascade"
patch_plans ||--o{ patch_plan_runs : "cascade"
endpoint_checks ||--o{ endpoint_daily : "cascade"
event_webhooks ||--o{ webhook_deliveries : "cascade"
```
These 22 tables are without a foreign key to another table, and — but for `integration_credentials`, which `integrations` and `dns_providers` point at — with none from another table to them; where they refer to something else it is by id or name, see
These 21 tables are without a foreign key to another table, and — but for `integration_credentials`, which `integrations` and `dns_providers` point at — with none from another table to them; where they refer to something else it is by id or name, see
[soft references](#soft-references-not-foreign-keys): `settings`, `secrets`, `ipam_entries`, `domains`, `diag_log`, `notification_queue`, `consistency_ignores`, `tag_definitions`,
`maintenance_windows`, `maintenance_aliases`, `maintenance_schedules`, `metrics_tokens`, `event_webhooks`, `restore_tests`, `dependencies`, `runbooks`, `renewals`, `assets`, `notes`,
`maintenance_windows`, `maintenance_aliases`, `maintenance_schedules`, `metrics_tokens`, `restore_tests`, `dependencies`, `runbooks`, `renewals`, `assets`, `notes`,
`alert_rules`, `alert_snoozes` and `integration_credentials`.
## Tables
@@ -994,6 +995,23 @@ URLs sent a signed JSON message when an alert begins or ends or maintenance star
| `created_at` | text NOT NULL | |
| `last_attempt_at`, `last_result` | text | When it was last sent to and what came back (`200`, or what went wrong). |
#### `webhook_deliveries`
The log of what was sent to each event webhook (Settings → API and webhooks → Sent): one row per message, with its second try counted in. Trimmed to the newest 100 per webhook and 14 days each time one is added.
| Column | Type | Notes |
|---|---|---|
| `id` | integer PK | |
| `webhook_id` | integer NOT NULL | FK → `event_webhooks.id`, cascade. Indexed with `created_at`. |
| `event` | text NOT NULL | `alert.opened` … |
| `delivery_id` | text NOT NULL | The message's `id` and `X-HLM-Delivery`; a resend keeps it. |
| `attempts` | integer NOT NULL, default 1 | 2 when the first try failed. |
| `ok` | bool NOT NULL | Whether a `2xx` came back. |
| `result` | text NOT NULL | `200`, or what went wrong. |
| `body` | text NOT NULL | The JSON that was sent, cut at 16 001 characters (longer than 16 000 means it cannot be sent again). |
| `retry_of` | integer | The `id` of the delivery this one sent again by hand. |
| `created_at` | text NOT NULL | ISO. |
#### `share_links`
Addresses that open a read-only page without signing in (Settings → Share
@@ -1109,7 +1127,7 @@ settings, and aren't part of the app's settings object:
| a **server** | Its `scheduled_tasks`, `server_links`, `server_ports`, `server_metrics`, `server_metrics_rollup`, `update_runs` and `network_server_links` are deleted with it. Port forwards that pointed at it stay, with `server_id` cleared. Things that refer to it by id only (notes, to-do items, endpoint checks, heartbeats, alert rules, dependencies, runbooks, maintenance windows) stay, pointing at nothing — see below. |
| a **DNS provider** | Its cached zones and records are deleted. |
| an **integration** | What was read from it is deleted with it: UniFi devices, networks and server links, Home Assistant watched entities and readings, and the history of its storage pools (`storage_series`, `storage_samples`). |
| an **endpoint check**, a **heartbeat**, an **incident**, a **patch plan**, a **share link** | Their results and summaries (`endpoint_results`, `_hourly`, `_daily`), pings, notes, runs and status-page items. |
| an **endpoint check**, a **heartbeat**, an **incident**, a **patch plan**, a **share link**, an **event webhook** | Their results and summaries (`endpoint_results`, `_hourly`, `_daily`), pings, notes, runs, status-page items and delivery log (`webhook_deliveries`). |
| an **integration** or **DNS provider** | The credential row it used is deleted by the app (not by the database). |
| an **integration** used for alert tickets | `alert_tickets.integration_id` is cleared; the history stays. |
| an **integration credential** | The integration / provider using it keeps existing, with `credential_id` cleared. |
@@ -1167,6 +1185,9 @@ are deleted), and `notification_queue` is emptied each time the quiet-hours dige
| `ha_readings` | 35 days |
| `heartbeat_pings` | 14 days |
| `alert_incidents`, `incident_notes` | 400 days after the incident resolved |
| `webhook_deliveries` | the newest 100 per webhook, and 14 days |
Settings → Data → Storage shows how big each of these is and whether it is being trimmed as listed here.
Everything else stays until someone deletes it.