Endpoint checks, restore tests, and a change log

- Endpoints: HTTP, TCP and TLS checks with answer time, uptime and certificate expiry; failures and expiring certificates become alerts and notifications; linked to a server for maintenance and tags
- Restore tests: record when a backup was restored and how it went; failed tests always alert, overdue ones with a limit set; shown on the Backup coverage page
- Change log: one filterable timeline made from the audit log and the incident record

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-18 23:03:56 +02:00
1 parent c3bc6bbf72
commit 92726568b7
37 files changed
+6918 -21

No files matched your search

+53
View File
@@ -9,6 +9,7 @@ import {
api,
type CurrentUser,
type DomainList,
type EndpointCheck,
type IntegrationSummary,
type IntegrationType,
type OsTicketTicketsResponse,
@@ -362,9 +363,14 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
const [serverSummary, setServerSummary] = useState<ServerSummary | null>(null);
const [serverError, setServerError] = useState<string | null>(null);
const [domainList, setDomainList] = useState<DomainList | null>(null);
const [endpointChecks, setEndpointChecks] = useState<EndpointCheck[] | null>(null);
const [domainError, setDomainError] = useState<string | null>(null);
useEffect(() => {
api.endpoints
.list()
.then((res) => setEndpointChecks(res.checks))
.catch(() => setEndpointChecks([]));
api.domains
.list()
.then(setDomainList)
@@ -604,11 +610,16 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
{ id: "people", title: "Let someone else in (optional)", description: "Others sign in with Authentik and appear under Users; you decide their role.", to: "/users", action: "Open Users", done: (userCount ?? 0) > 1 },
];
// What the endpoint checks say: the ones that keep failing, and the certificates that are running out.
const endpointsDown = (endpointChecks ?? []).filter((c) => c.enabled && c.lastOk === false && c.consecutiveFailures >= c.failuresBeforeAlert);
const endpointCerts = (endpointChecks ?? []).filter((c) => c.enabled && c.certExpiresAt && Math.floor((Date.parse(c.certExpiresAt) - Date.now()) / 86_400_000) <= c.warnDays).length;
// What has nothing set up yet. These get one list at the bottom instead of a grey "Not configured" card each.
const notSetUp: { label: string; to: string; what: string }[] = [];
if (dnsStats?.totalProviders === 0) notSetUp.push({ label: "DNS", to: "/dns", what: "connect a DNS provider to see zones and records" });
if (secrets !== null && totalSecrets === 0) notSetUp.push({ label: "Secrets", to: "/secrets", what: "track when a token, certificate or password expires" });
if (serverSummary?.total === 0) notSetUp.push({ label: "Servers", to: "/servers", what: "add a server and install its agent" });
if (endpointChecks !== null && endpointChecks.length === 0) notSetUp.push({ label: "Endpoints", to: "/endpoints", what: "ask a web address, a port or a certificate whether it is fine" });
if (domainList !== null && domains.length === 0) notSetUp.push({ label: "Domains", to: "/domains", what: "appear after a DNS zone is added and the daily check has run" });
if (integrations !== null) {
for (const { type, label } of WIDGETS) {
@@ -931,6 +942,48 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
</>
)}
</WidgetCard>
<WidgetCard
label="Endpoints"
hide={endpointChecks !== null && endpointChecks.length === 0}
badge={
!endpointChecks ? undefined : endpointsDown.length > 0 ? (
<span className="badge bg-red-lt text-red">{endpointsDown.length} not answering</span>
) : endpointCerts > 0 ? (
<span className="badge bg-yellow-lt text-yellow">
{endpointCerts} certificate{endpointCerts === 1 ? "" : "s"} to renew
</span>
) : (
<span className="badge bg-green-lt text-green">All answering</span>
)
}
>
{!endpointChecks ? (
<WidgetSkeleton />
) : (
<>
<div className="row g-2 mb-3">
<div className="col-4">
<MiniStat label="Checks" value={endpointChecks.filter((c) => c.enabled).length} />
</div>
<div className="col-4">
<MiniStat label="Up" value={endpointChecks.filter((c) => c.enabled && c.lastOk === true).length} />
</div>
<div className="col-4">
<MiniStat label="Down" value={endpointsDown.length} accent={endpointsDown.length > 0 ? "#ef4444" : undefined} />
</div>
</div>
{endpointsDown.slice(0, 3).map((c) => (
<div key={c.id} className="text-red small">
{c.name} — {c.lastMessage}
</div>
))}
<div className="text-secondary small mt-2">
<Link to="/endpoints">All checks</Link>
</div>
</>
)}
</WidgetCard>
</div>
<SectionHeader