mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-09-14 18:56:52 +00:00
ProxMenux modifies the host: it rewrites configuration files, installs packages, enables services. Until now nobody could say afterwards what had changed, and showing the script does not answer that question — a four-hundred-line function may alter two values, and the reader has no way to know which two. This adds the two halves of an answer. The change journal records what ProxMenux does as it does it. Eleven bash primitives capture the previous state, apply the change and record it in the same step, writing to a spool that the Monitor reads back. One hundred and thirteen functions across twenty-five scripts are instrumented, covering post-install, shared storage, security tooling, container conversions, disk operations and the PVE 8 to 9 upgrade path. The page shows the difference — rotate 7 becoming rotate 14 — and never the script. Restore and backup scripts are deliberately left out: a restore puts the host back to a state some other script already recorded. The Audit and reports page answers the other half: what state is this host in, regardless of who put it there. Forty-three checks across seven areas read the host and classify each result as critical, warning, observation, conformant, unverified or not applicable, with the evidence they read attached to each one. A declared policy lets the reader say what this particular host is expected to do — which guests must have a backup, which storages are essential — so the report judges the host against its own intent rather than a generic template. An inventory records the hardware, network and guest topology behind those readings, a comparison shows what moved between two runs, and six report profiles produce a printable document scoped to what the reader needs. Everything is available in the eight supported languages. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
114 lines
3.7 KiB
TypeScript
114 lines
3.7 KiB
TypeScript
"use client"
|
|
|
|
import { parseEvidence, type EvidenceBlock } from "../lib/evidence-format"
|
|
|
|
/**
|
|
* Renders a finding's evidence as tables and labelled values.
|
|
*
|
|
* The evidence exists so a reader can verify the conclusion for
|
|
* themselves. A JSON dump technically contains the same facts but asks
|
|
* the reader to parse it first, which is the part they came here to
|
|
* avoid.
|
|
*/
|
|
export function AuditEvidence({ evidence, locale }: {
|
|
evidence: string | null
|
|
locale: string
|
|
}) {
|
|
const blocks = parseEvidence(evidence, locale)
|
|
if (blocks.length === 0) return null
|
|
|
|
return (
|
|
<div className="space-y-3">
|
|
{blocks.map((block, i) => <Block key={i} block={block} />)}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
function Block({ block }: { block: EvidenceBlock }) {
|
|
const title = block.title
|
|
? <p className="text-xs font-medium text-foreground mb-1">{block.title}</p>
|
|
: null
|
|
|
|
if (block.kind === "table") {
|
|
return (
|
|
<div>
|
|
{title}
|
|
{/* Wide evidence scrolls inside its own box so the page itself
|
|
never scrolls sideways. */}
|
|
{/* Evidence is the widest thing on the page; on a narrow screen
|
|
it stacks like the rest rather than scrolling sideways. */}
|
|
<div className="sm:hidden space-y-2">
|
|
{block.rows.map((row, i) => (
|
|
<div key={i} className="rounded-md border border-border p-2.5 space-y-1">
|
|
{row.map((cell, j) => cell === "—" || cell === "" ? null : (
|
|
<div key={j} className="flex flex-wrap items-baseline gap-x-2 gap-y-0.5">
|
|
<span className="text-xs text-muted-foreground shrink-0">
|
|
{block.columns[j]}</span>
|
|
<span className="text-xs text-foreground tabular-nums break-words min-w-0">
|
|
{cell}</span>
|
|
</div>
|
|
))}
|
|
</div>
|
|
))}
|
|
</div>
|
|
<div className="hidden sm:block overflow-x-auto rounded-md border border-border">
|
|
<table className="w-full text-xs">
|
|
<thead>
|
|
<tr className="bg-muted/50">
|
|
{block.columns.map((c) => (
|
|
<th key={c} className="text-left font-medium px-3 py-1.5
|
|
text-muted-foreground whitespace-nowrap">
|
|
{c}
|
|
</th>
|
|
))}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{block.rows.map((row, i) => (
|
|
<tr key={i} className="border-t border-border">
|
|
{row.map((cell, j) => (
|
|
<td key={j} className="px-3 py-1.5 align-top tabular-nums">
|
|
{cell}
|
|
</td>
|
|
))}
|
|
</tr>
|
|
))}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
if (block.kind === "pairs") {
|
|
return (
|
|
<div>
|
|
{title}
|
|
<dl className="grid grid-cols-[minmax(0,auto)_1fr] gap-x-4 gap-y-1 text-xs
|
|
rounded-md border border-border px-3 py-2">
|
|
{block.entries.map(([label, value]) => (
|
|
<div key={label} className="contents">
|
|
<dt className="text-muted-foreground whitespace-nowrap">{label}</dt>
|
|
<dd className="text-foreground break-words tabular-nums">{value}</dd>
|
|
</div>
|
|
))}
|
|
</dl>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
{title}
|
|
{block.lines.length > 0 && (
|
|
<ul className="text-xs text-muted-foreground space-y-0.5 rounded-md
|
|
border border-border px-3 py-2">
|
|
{block.lines.map((line, i) => (
|
|
<li key={i} className="break-words">{line}</li>
|
|
))}
|
|
</ul>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|