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:
1 parent
c3bc6bbf72
commit
92726568b7
37 files changed
+6918
-21
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { Router } from "express";
|
||||
import { requireAuth, requireRole } from "../auth/middleware.js";
|
||||
import { CHANGE_KINDS, KIND_LABELS, getChangeLog, type ChangeKind } from "../services/changeLog.js";
|
||||
import { asyncHandler } from "../utils/asyncHandler.js";
|
||||
|
||||
export const changesRouter = Router();
|
||||
|
||||
// Like the audit log it is made from: operators and administrators.
|
||||
changesRouter.use(requireAuth, requireRole("operator"));
|
||||
|
||||
// ?days=7 &kind=settings &serverId=3 &q=word &before=ISO (the next page) &limit=200
|
||||
changesRouter.get("/", asyncHandler(async (req, res) => {
|
||||
const days = Number(req.query.days);
|
||||
const serverId = typeof req.query.serverId === "string" && /^\d+$/.test(req.query.serverId) ? Number(req.query.serverId) : undefined;
|
||||
const kind = CHANGE_KINDS.find((k) => k === req.query.kind) as ChangeKind | undefined;
|
||||
const before = typeof req.query.before === "string" && !Number.isNaN(Date.parse(req.query.before)) ? req.query.before : undefined;
|
||||
const limit = Number(req.query.limit);
|
||||
const result = await getChangeLog({
|
||||
days: Number.isFinite(days) && days >= 1 ? days : 7,
|
||||
kind,
|
||||
serverId,
|
||||
q: typeof req.query.q === "string" ? req.query.q.slice(0, 100) : undefined,
|
||||
before,
|
||||
limit: Number.isFinite(limit) && limit >= 1 ? limit : 200,
|
||||
});
|
||||
res.json({ ...result, kinds: CHANGE_KINDS.map((k) => ({ id: k, label: KIND_LABELS[k] })) });
|
||||
}));
|
||||
Reference in new issue
Block a user