Check a value, not just "is it up": JSON value checks on web endpoints

A web check can read a value out of a JSON answer (power.now, state,
data.result[0].value[1]) and judge it: below, above, equal to, contains, is there.
The value read is shown on the Endpoints page, charted under History, exported as
homelab_endpoint_value and in the read API. A check can also send one header (a
token), stored encrypted, never returned, and not forwarded to another host on a
redirect.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-21 21:13:44 +02:00
1 parent e114567d64
commit 3cb3e4988f
21 files changed
+6804 -47

No files matched your search

+5 -1
View File
@@ -23,7 +23,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` … `0052`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0053`), 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`.
@@ -899,6 +899,9 @@ A web address, TCP port or TLS certificate the app asks about every few minutes
| `kind` | text NOT NULL | `http`, `tcp` or `tls`. |
| `target`, `port` | text NOT NULL, integer | http: the address. tcp and tls: the host, and the port. |
| `expect_status`, `keyword` | text | http only: the good status codes (`200-204, 401`; null = 200–399) and a word the page must contain. |
| `value_path`, `value_op`, `value_expected`, `value_unit` | text | http only: judge a value in a JSON answer — where it is (`data.result[0].value[1]`), how it must compare (`<` `<=` `>` `>=` `=` `!=` `contains` `exists`), what to, and a unit to show. All null for a check that judges no value. |
| `header_name`, `header_value` | text | http only: a header sent with the request. The value is stored encrypted (`enc:v1:`) when an encryption key is set, and is never returned by the API. |
| `last_value` | text | What a value check read the last time. |
| `insecure` | bool NOT NULL, default 0 | Accept a certificate that isn't trusted (its expiry is still watched). |
| `interval_minutes`, `timeout_seconds`, `failures_before_alert`, `warn_days` | integer NOT NULL | Defaults 5, 10, 2 and 14. |
| `server_id` | integer | The server it is about. A plain reference, **not a foreign key**: maintenance on that server silences the check's alerts; one whose server is gone is just unlinked. |
@@ -920,6 +923,7 @@ One row per answer, kept for two weeks: uptime, average answer time and the run
| `at` | text NOT NULL | ISO. |
| `ok` | bool NOT NULL | |
| `ms`, `message` | integer, text | |
| `value` | real | The number a value check read, when it is one; what the value chart is drawn from. |
#### `heartbeats`