Let an administrator set a server's hostname by hand
A Change link on the Identity card sets the hostname (a host name or an address, written lower case without the trailing dot). It is then kept even when the agent reports another — marked "set by hand", with what the agent reports shown beside it — until "Use what the agent reports" gives it up. The agent's own hostname is always remembered (reported_hostname). PUT and DELETE /api/servers/:id/hostname, administrators only, audited with from and to. Migration 0082 adds hostname_pinned and reported_hostname and fills the latter for servers that have reported. It changes this app's name for the server, not the machine's. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6f144b4e36
commit
672c7f2f66
14 files changed
+9020
-7
No files matched your search
+4
-2
@@ -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` … `0081`), 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` … `0082`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
|
||||
| **Tables** | 91 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`.
|
||||
@@ -244,7 +244,9 @@ what it last reported.
|
||||
|---|---|---|
|
||||
| `id` | integer PK | |
|
||||
| `name` | text NOT NULL | Not unique. |
|
||||
| `hostname` | text | |
|
||||
| `hostname` | text | What this app calls the machine to the rest of the world: what the agent reports, or what an administrator set by hand (see `hostname_pinned`). |
|
||||
| `hostname_pinned` | integer NOT NULL, default 0 | 1 once the hostname was set by hand: a report from the agent then does not replace it. Given up by clearing it, which puts `reported_hostname` back. |
|
||||
| `reported_hostname` | text | What the agent last said its hostname is (kept even while `hostname` is pinned); null for a server that never reported one. Migration 0082 fills it from `hostname` for servers that have reported. |
|
||||
| `os_type` | text NOT NULL, default `linux` | |
|
||||
| `description` | text | |
|
||||
| `api_token_hash` | text NOT NULL | SHA-256 of the agent's token. |
|
||||
|
||||
Reference in new issue
Block a user