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:
bobbanandClaude Sonnet 5.5 committed 2026-10-27 20:04:55 +01:00
1 parent 9a3d5c466a
commit d9083adb5b
38 files changed
+18374 -42

No files matched your search

+24
View File
@@ -564,6 +564,9 @@ export const integrationTypes = [
"hetzner",
"speedtest",
"fragnet",
"sonarr",
"radarr",
"prowlarr",
] as const;
export type IntegrationType = (typeof integrationTypes)[number];
@@ -1270,6 +1273,9 @@ export const hetznerState = sqliteTable("hetzner_state", {
servers: text("servers").notNull().default("[]"), // JSON: each server as read, plus when it was last seen running, since when it has had this status and since when rescue mode has been on
volumes: text("volumes"), // JSON; null: could not be asked
images: text("images"), // JSON: snapshots and backups; null: could not be asked
loadBalancers: text("load_balancers"), // JSON: each load balancer with the health of its targets; null: could not be asked
floatingIps: text("floating_ips"), // JSON; null: could not be asked
certificates: text("certificates"), // JSON: each certificate with when it ends; null: could not be asked
cost: text("cost"), // JSON: the monthly estimate (currency, servers, backups, volumes, snapshots, IPs, total); null: could not be worked out (no price list)
updatedAt: text("updated_at").notNull(), // ISO
});
@@ -1286,6 +1292,24 @@ export const fragnetState = sqliteTable("fragnet_state", {
updatedAt: text("updated_at").notNull(), // ISO
});
// ─── Sonarr, Radarr, Prowlarr ──────────────────────────────────────────────
// How a Sonarr, Radarr or Prowlarr (an integration of type "sonarr", "radarr" or "prowlarr") is right now, one row each, replaced at every read: what it says is wrong with itself, its download
// queue (the first page, and how many there are), its disks, how many wanted items are missing and — Prowlarr — its indexers. A column that is null could not be read, which is not the same as
// none. Read by services/arrSync.ts.
export const arrState = sqliteTable("arr_state", {
integrationId: integer("integration_id")
.primaryKey()
.references(() => integrations.id, { onDelete: "cascade" }),
version: text("version"),
health: text("health").notNull().default("[]"), // JSON: what its own checks found
queue: text("queue"), // JSON { total, items }; null: could not be read (and always null for Prowlarr)
disks: text("disks"), // JSON; null: could not be read
missing: integer("missing"), // null: not read (Prowlarr has none)
indexers: text("indexers"), // JSON, Prowlarr only; null otherwise or when it could not be read
updatedAt: text("updated_at").notNull(), // ISO
});
// ─── NetBox ─────────────────────────────────────────────────────────────────
// How a NetBox (an integration of type "netbox") is right now, one row each, replaced at every read: its version, how many background workers are running, the counts and the IP