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>
4 lines
291 B
SQL
4 lines
291 B
SQL
ALTER TABLE `servers` ADD `hostname_pinned` integer DEFAULT false NOT NULL;--> statement-breakpoint
|
|
ALTER TABLE `servers` ADD `reported_hostname` text;--> statement-breakpoint
|
|
UPDATE `servers` SET `reported_hostname` = `hostname` WHERE `last_seen_at` IS NOT NULL AND `hostname` IS NOT NULL;
|