Broken Docker containers are alerts

From Dockhand, on the health pass: a container that keeps restarting (critical, with
its exit code), one whose own health check fails, one that stopped unexpectedly, one
created and never started for an hour, and a Docker host Dockhand cannot reach. A stop
is only news when it was seen happen, so stacks switched off long ago stay quiet.
A Leave alone button on the Docker page and a list in Settings; on by default.

Also fixes a date-dependent storage-forecast test that pinned its clock while the code
under test reads the real one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-24 21:03:56 +02:00
1 parent 16b24f5436
commit 0fa50c2d5a
20 files changed
+659 -17

No files matched your search

+14
View File
@@ -537,6 +537,10 @@ export interface HealthCheckSettings {
osSupportWarnDays: number;
/** A server whose CPU or memory over the last hour is clearly higher than is normal for this hour of the week is a warning. */
baselineAlerts: boolean;
/** A container that keeps restarting, is unhealthy, stopped unexpectedly or never started, and a Docker host that cannot be reached, is an alert. */
containerAlerts: boolean;
/** Containers to leave alone: a name, or "host/name"; * stands for anything. */
containerIgnore: string[];
}
/** The monthly report: last month's availability, incidents, updates and renewals, in one message on a day of the month. */
@@ -2243,9 +2247,17 @@ export interface DockhandContainer {
updateAvailable: boolean | null;
newerVersion: string | null;
checkedAt: string | null;
/** What is wrong with it, as the health pass would say it; null when nothing is. */
problem?: { kind: "restarting" | "unhealthy" | "stopped" | "created"; text: string; severity: "critical" | "warning" } | null;
/** It is on the list of containers to leave alone, so nothing is alerted about it. */
leftAlone?: boolean;
}
export interface DockhandContainersResponse {
/** Docker hosts Dockhand could not read this time. */
unreachable?: { environmentId: number; environmentName: string; error: string }[];
/** Container alerts are switched on. */
alerts?: boolean;
containers: DockhandContainer[];
summary: { total: number; running: number };
}
@@ -3120,6 +3132,8 @@ export const api = {
dockhand: {
containers: (integrationId: number) =>
request<DockhandContainersResponse>(`/api/integrations/${integrationId}/dockhand/containers`),
leaveAlone: (integrationId: number, environmentName: string, name: string, leaveAlone: boolean) =>
request<{ containerIgnore: string[] }>(`/api/integrations/${integrationId}/dockhand/leave-alone`, { method: "PUT", body: JSON.stringify({ environmentName, name, leaveAlone }) }),
start: (integrationId: number, envId: number, containerId: string) =>
request<void>(
`/api/integrations/${integrationId}/dockhand/environments/${envId}/containers/${encodeURIComponent(containerId)}/start`,