Add Hetzner Robot: dedicated servers and storage boxes, with shutting-down, locked and rescue-left-on alerts

Read every 15 minutes (Robot allows 200 requests an hour; read-only): each server's product, addresses, status, rescue system and paid-until, and the storage boxes. Adapter, sync service, hetzner_robot_state table, /api/hetzner-robot, Infrastructure → Hetzner Robot page, metrics and docs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-04 23:26:26 +01:00
1 parent 7618bf0f0a
commit 01acbaf831
31 files changed
+10105 -10

No files matched your search

+4
View File
@@ -45,6 +45,7 @@ import { ARR_KINDS } from "../integrations/arr/adapter.js";
import { forgetAdguard, syncAdguard } from "../services/adguardSync.js";
import { forgetDownload, syncDownload } from "../services/downloadsSync.js";
import { DOWNLOAD_KINDS } from "../integrations/downloads/adapter.js";
import { forgetRobot, syncRobot } from "../services/hetznerRobotSync.js";
import { forgetTechnitium, syncTechnitium } from "../services/technitiumSync.js";
import { forgetGrafana, syncGrafana } from "../services/grafanaSync.js";
import { forgetNextcloud, syncNextcloud } from "../services/nextcloudSync.js";
@@ -163,6 +164,7 @@ integrationsRouter.post("/", requireRole("admin"), asyncHandler(async (req, res)
if (type === "fragnet") void syncFragnet(created.id).then(() => invalidateAlertsCache());
if ((ARR_KINDS as string[]).includes(type)) void syncArr(created.id).then(() => invalidateAlertsCache());
if ((DOWNLOAD_KINDS as string[]).includes(type)) void syncDownload(created.id).then(() => invalidateAlertsCache());
if (type === "hetznerrobot") void syncRobot(created.id).then(() => invalidateAlertsCache());
if (type === "adguard") void syncAdguard(created.id).then(() => invalidateAlertsCache());
if (type === "technitium") void syncTechnitium(created.id).then(() => invalidateAlertsCache());
if (type === "grafana") void syncGrafana(created.id).then(() => invalidateAlertsCache());
@@ -283,6 +285,7 @@ integrationsRouter.patch("/:id", requireRole("admin"), asyncHandler(async (req,
if (updated.type === "fragnet" && updated.enabled && (parsed.data.config || parsed.data.enabled === true)) void syncFragnet(updated.id).then(() => invalidateAlertsCache());
if ((ARR_KINDS as string[]).includes(updated.type) && updated.enabled && (parsed.data.config || parsed.data.enabled === true)) void syncArr(updated.id).then(() => invalidateAlertsCache());
if ((DOWNLOAD_KINDS as string[]).includes(updated.type) && updated.enabled && (parsed.data.config || parsed.data.enabled === true)) void syncDownload(updated.id).then(() => invalidateAlertsCache());
if (updated.type === "hetznerrobot" && updated.enabled && (parsed.data.config || parsed.data.enabled === true)) void syncRobot(updated.id).then(() => invalidateAlertsCache());
if (updated.type === "adguard" && updated.enabled && (parsed.data.config || parsed.data.enabled === true)) void syncAdguard(updated.id).then(() => invalidateAlertsCache());
if (updated.type === "technitium" && updated.enabled && (parsed.data.config || parsed.data.enabled === true)) void syncTechnitium(updated.id).then(() => invalidateAlertsCache());
if (updated.type === "grafana" && updated.enabled && (parsed.data.config || parsed.data.enabled === true)) void syncGrafana(updated.id).then(() => invalidateAlertsCache());
@@ -410,6 +413,7 @@ integrationsRouter.delete("/:id", requireRole("admin"), asyncHandler(async (req,
if (existing.type === "fragnet") await forgetFragnet(id);
if ((ARR_KINDS as string[]).includes(existing.type)) await forgetArr(id);
if ((DOWNLOAD_KINDS as string[]).includes(existing.type)) await forgetDownload(id);
if (existing.type === "hetznerrobot") await forgetRobot(id);
if (existing.type === "adguard") await forgetAdguard(id);
if (existing.type === "technitium") await forgetTechnitium(id);
if (existing.type === "grafana") await forgetGrafana(id);