Sonarr/Radarr/Prowlarr, Hetzner load balancers/floating IPs/certificates, traffic forecast
New integration kinds sonarr, radarr and prowlarr (shared adapter and sync, page under Apps -> Media managers): own health findings, stuck downloads, nearly full disks. Hetzner now reads load balancers (target health), floating IPs and certificates, includes them in the cost estimate, and forecasts the month's traffic against the quota. Migrations 0072 and 0073; docs, metrics and tests included. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9a3d5c466a
commit
d9083adb5b
38 files changed
+18374
-42
No files matched your search
+84
-2
@@ -1285,6 +1285,55 @@ export interface HetznerServerInfo {
|
||||
lastRunningAt: string | null;
|
||||
statusSince: string;
|
||||
rescueSince: string | null;
|
||||
/** How the month's traffic is forecast to end; null when there is too little to say. */
|
||||
forecast?: HetznerTrafficForecast | null;
|
||||
}
|
||||
|
||||
export interface HetznerTrafficForecast {
|
||||
/** Bytes a day, the way it has been going. */
|
||||
perDay: number;
|
||||
/** What the month will have come to by its end at that rate. */
|
||||
projectedMonth: number;
|
||||
/** When the quota is passed, if that is before the month ends. */
|
||||
exhaustedAt: string | null;
|
||||
basis: "recent" | "month";
|
||||
}
|
||||
|
||||
export interface HetznerLoadBalancerInfo {
|
||||
id: number;
|
||||
name: string;
|
||||
type: string | null;
|
||||
location: string | null;
|
||||
ipv4: string | null;
|
||||
algorithm: string | null;
|
||||
services: number;
|
||||
targets: { kind: "server" | "label_selector" | "ip"; serverId: number | null; serverName: string | null; label: string | null; health: "healthy" | "unhealthy" | "unknown" }[];
|
||||
includedTraffic: number | null;
|
||||
outgoingTraffic: number | null;
|
||||
monthlyPrice: number | null;
|
||||
}
|
||||
|
||||
export interface HetznerFloatingIpInfo {
|
||||
id: number;
|
||||
name: string | null;
|
||||
ip: string;
|
||||
type: "ipv4" | "ipv6";
|
||||
serverId: number | null;
|
||||
serverName: string | null;
|
||||
location: string | null;
|
||||
description: string | null;
|
||||
}
|
||||
|
||||
export interface HetznerCertificateInfo {
|
||||
id: number;
|
||||
name: string;
|
||||
type: string;
|
||||
domains: string[];
|
||||
notValidAfter: string | null;
|
||||
issuance: string | null;
|
||||
renewal: string | null;
|
||||
error: string | null;
|
||||
usedBy: number;
|
||||
}
|
||||
|
||||
export interface HetznerProblemInfo {
|
||||
@@ -1307,7 +1356,11 @@ export interface HetznerProject {
|
||||
/** 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;
|
||||
cost: { currency: string; servers: number; backups: number; volumes: number; snapshots: number; ips: number; loadBalancers?: number; floatingIps?: number; total: number; unassignedIps: number; unpriced: number } | null;
|
||||
/** Each of these is null when it could not be listed, which is not the same as none. */
|
||||
loadBalancers: HetznerLoadBalancerInfo[] | null;
|
||||
floatingIps: HetznerFloatingIpInfo[] | null;
|
||||
certificates: HetznerCertificateInfo[] | null;
|
||||
updatedAt: string;
|
||||
} | null;
|
||||
problems: HetznerProblemInfo[];
|
||||
@@ -1323,6 +1376,7 @@ export interface HetznerForServer {
|
||||
newestBackup: string | null;
|
||||
snapshots: number;
|
||||
problems: HetznerProblemInfo[];
|
||||
forecast: HetznerTrafficForecast | null;
|
||||
} | null;
|
||||
}
|
||||
|
||||
@@ -1375,6 +1429,31 @@ export interface FragnetAccount {
|
||||
problems: { key: string; serverId: string; message: string; severity: "warning" | "critical" }[];
|
||||
}
|
||||
|
||||
/** One Sonarr, Radarr or Prowlarr (an integration of that type), as the media page shows it. */
|
||||
export interface ArrApp {
|
||||
id: number;
|
||||
kind: "sonarr" | "radarr" | "prowlarr";
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
url: string;
|
||||
status: { at: string; ok: boolean; error: string | null } | null;
|
||||
fresh: boolean;
|
||||
state: {
|
||||
version: string | null;
|
||||
/** What its own checks found: type is ok, notice, warning or error. */
|
||||
health: { source: string; type: string; message: string }[];
|
||||
/** Null when it could not be read (and always for Prowlarr, which has none). */
|
||||
queue: { total: number; items: { id: number; title: string; status: string; tracked: "ok" | "warning" | "error" | null; state: string | null; messages: string[]; size: number | null; sizeLeft: number | null; added: string | null; etaAt: string | null; protocol: string | null; client: string | null; indexer: string | null }[] } | null;
|
||||
disks: { path: string; label: string | null; free: number; total: number }[] | null;
|
||||
missing: number | null;
|
||||
indexers: { id: number; name: string; enabled: boolean; protocol: string | null; disabledTill: string | null; lastFailure: string | null }[] | null;
|
||||
updatedAt: string;
|
||||
/** The ids of the queue items that are stuck. */
|
||||
stuck: number[];
|
||||
} | null;
|
||||
problems: { key: string; message: string; severity: "warning" | "critical" }[];
|
||||
}
|
||||
|
||||
export type FragnetSignal = "start" | "stop" | "restart" | "kill";
|
||||
|
||||
export interface CostItem {
|
||||
@@ -2495,7 +2574,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" | "hetzner" | "speedtest" | "fragnet";
|
||||
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" | "speedtest" | "fragnet" | "sonarr" | "radarr" | "prowlarr";
|
||||
|
||||
export interface IntegrationField {
|
||||
key: string;
|
||||
@@ -3090,6 +3169,9 @@ export const api = {
|
||||
list: () => request<{ speedtests: SpeedtestInfo[] }>("/api/speedtest"),
|
||||
history: (id: number, days: number) => request<SpeedtestHistory>(`/api/speedtest/${id}/history?days=${days}`),
|
||||
},
|
||||
arr: {
|
||||
list: () => request<{ apps: ArrApp[] }>("/api/arr"),
|
||||
},
|
||||
fragnet: {
|
||||
list: () => request<{ accounts: FragnetAccount[] }>("/api/fragnet"),
|
||||
power: (integrationId: number, serverId: string, signal: FragnetSignal) => request<void>(`/api/fragnet/${integrationId}/servers/${serverId}/power`, { method: "POST", body: JSON.stringify({ signal }) }),
|
||||
|
||||
Reference in new issue
Block a user