Add address aliases for the Uptime Kuma maintenance sync, and ignore Kuma's "null"
Uptime Kuma often watches a host by another address than the one it was added with here (a Proxmox host monitored over Tailscale, say). Address aliases on the Maintenance page say that an address belongs to a server, integration or DNS provider, so the sync puts the window there; matching stays exact. Migration 0018 adds maintenance_aliases. Also fixes monitors whose empty hostname/URL/port arrive from Kuma's metrics as the text "null": they were taken as an address, hiding the real URL. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3e6404371b
commit
44cc9d1cf2
12 files changed
+2239
-14
No files matched your search
+18
-2
@@ -24,7 +24,7 @@ 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` … `0014`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
|
||||
| **Tables** | 22 application tables, plus drizzle's own `__drizzle_migrations`. |
|
||||
| **Tables** | 23 application tables, plus drizzle's own `__drizzle_migrations`. |
|
||||
|
||||
**Not in the database:**
|
||||
|
||||
@@ -63,7 +63,7 @@ erDiagram
|
||||
|
||||
Eight tables stand alone, with no foreign keys: `settings`, `secrets`,
|
||||
`ipam_entries`, `domains`, `diag_log`, `notification_queue`,
|
||||
`consistency_ignores`, `tag_definitions`. `maintenance_windows` also has no
|
||||
`consistency_ignores`, `tag_definitions`. `maintenance_windows` and `maintenance_aliases` also have no
|
||||
foreign key — see [soft references](#soft-references-not-foreign-keys).
|
||||
|
||||
## Tables
|
||||
@@ -143,6 +143,21 @@ required, so a forgotten window can't silence real problems forever.
|
||||
| `created_by` | text | Name of the person who opened it. `Uptime Kuma sync` for mirrored ones. |
|
||||
| `source` | text | `kuma:<integration id>:<maintenance id>` on windows mirrored from Uptime Kuma's schedule, so a later sync can find them again; NULL for ones started by hand. A window whose `started_at` is still in the future is *scheduled*: it silences nothing until it begins. A scheduled one that is cancelled has `ends_at` set equal to `started_at`. |
|
||||
|
||||
#### `maintenance_aliases`
|
||||
|
||||
An address that Uptime Kuma's monitors use for something this app knows by another address, so the Uptime Kuma
|
||||
maintenance sync can find it. Added on the Maintenance page.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `id` | integer PK | |
|
||||
| `address` | text NOT NULL | A bare lowercase host: a name or an IP. |
|
||||
| `target_type` | text NOT NULL | `server` | `integration` | `dns_provider`. |
|
||||
| `target_id` | integer NOT NULL | The ID in the table `target_type` names. **Not a foreign key**; an alias whose target was deleted is ignored. |
|
||||
| `created_at` | text NOT NULL | |
|
||||
|
||||
Unique on (`address`, `target_type`, `target_id`).
|
||||
|
||||
### Servers
|
||||
|
||||
#### `servers`
|
||||
@@ -498,6 +513,7 @@ These point at other rows by ID or name without the database enforcing it, so
|
||||
a stale value is possible and the app treats it as "nothing there":
|
||||
|
||||
- `maintenance_windows.target_id` (→ a server, integration or DNS provider, by `target_type`)
|
||||
- `maintenance_aliases.target_id` (the same, by `target_type`)
|
||||
- `audit_log.target_id`
|
||||
- `dns_records_cache.zone_id` (→ `dns_zones_cache.zone_id`, same provider)
|
||||
- `servers.tags` (→ `tag_definitions.name`)
|
||||
|
||||
Reference in new issue
Block a user