Hetzner Cloud integration: servers, traffic quota, backups, volumes and cost

One integration per project (read-only API token, read every 5 minutes).
Alerts for a server that was running and is off, stuck statuses, traffic
at 80%/100% of the monthly quota, rescue mode left on, and late backups.
The Hetzner page lists servers, volumes, snapshots and a cost estimate; a
server the app knows by its agent gets a Hetzner card on its own page.
/metrics and docs updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-25 22:51:17 +01:00
1 parent 5a2b320175
commit 24b708abbe
35 files changed
+9430 -7

No files matched your search

+73 -1
View File
@@ -1258,6 +1258,74 @@ export interface NextcloudInfo {
problems: { key: string; message: string; severity: "warning" | "critical" }[];
}
export interface HetznerServerInfo {
id: number;
name: string;
status: string;
created: string | null;
type: string | null;
cores: number | null;
memoryGb: number | null;
diskGb: number | null;
location: string | null;
city: string | null;
os: string | null;
ipv4: string | null;
ipv6: string | null;
privateIps: string[];
locked: boolean;
rescueEnabled: boolean;
/** The hour backups are taken in; null when they are not enabled. */
backupWindow: string | null;
/** This month's traffic, in bytes. */
includedTraffic: number | null;
outgoingTraffic: number | null;
ingoingTraffic: number | null;
monthlyPrice: number | null;
lastRunningAt: string | null;
statusSince: string;
rescueSince: string | null;
}
export interface HetznerProblemInfo {
key: string;
serverId: number;
message: string;
severity: "warning" | "critical";
}
/** One Hetzner Cloud project (an integration of type hetzner), as its page shows it. */
export interface HetznerProject {
id: number;
name: string;
enabled: boolean;
status: { at: string; ok: boolean; error: string | null } | null;
fresh: boolean;
state: {
/** linked: the server the app knows by its agent that this is; null when there is none. */
servers: (HetznerServerInfo & { linked: { id: number; name: string } | null })[];
/** Null when the volumes could not be listed, which is not the same as none. */
volumes: { id: number; name: string; size: number; serverId: number | null; serverName: string | null; location: string | null; status: string }[] | null;
images: { id: number; type: "snapshot" | "backup"; description: string | null; created: string | null; sizeGb: number | null; serverId: number | null; serverName: string | null }[] | null;
cost: { currency: string; servers: number; backups: number; volumes: number; snapshots: number; ips: number; total: number; unassignedIps: number; unpriced: number } | null;
updatedAt: string;
} | null;
problems: HetznerProblemInfo[];
}
export interface HetznerForServer {
match: {
integrationId: number;
integrationName: string;
fresh: boolean;
updatedAt: string;
server: HetznerServerInfo;
newestBackup: string | null;
snapshots: number;
problems: HetznerProblemInfo[];
} | null;
}
/** One NetBox, as its page shows it. */
export interface NetBoxInfo {
id: number;
@@ -2315,7 +2383,7 @@ export interface ManualTaskInput {
enabled?: boolean;
}
export type IntegrationType = "proxmox" | "synology" | "semaphore" | "tailscale" | "gitea" | "dockhand" | "uptimekuma" | "phpipam" | "pbs" | "osticket" | "unifi" | "npm" | "homeassistant" | "ups" | "jellyfin" | "authentik" | "prometheus" | "immich" | "paperless" | "nextcloud" | "netbox" | "n8n";
export type IntegrationType = "proxmox" | "synology" | "semaphore" | "tailscale" | "gitea" | "dockhand" | "uptimekuma" | "phpipam" | "pbs" | "osticket" | "unifi" | "npm" | "homeassistant" | "ups" | "jellyfin" | "authentik" | "prometheus" | "immich" | "paperless" | "nextcloud" | "netbox" | "n8n" | "hetzner";
export interface IntegrationField {
key: string;
@@ -2900,6 +2968,10 @@ export const api = {
netbox: {
list: () => request<{ netboxes: NetBoxInfo[] }>("/api/netbox"),
},
hetzner: {
list: () => request<{ projects: HetznerProject[] }>("/api/hetzner"),
forServer: (serverId: number) => request<HetznerForServer>(`/api/hetzner/for-server/${serverId}`),
},
n8n: {
list: () => request<{ n8ns: N8nInfo[] }>("/api/n8n"),
},