fix: harden the vault before release

Require a private passphrase and loopback-or-token admin auth. New vaults use Argon2id; existing PBKDF2 vaults still open, and new snapshot metadata is encrypted. Wormhole tokens survive restart, offset uploads seal into the vault, and client-certificate uploads are real. Reject the command provider and keep Postgres passwords off the process arguments. Keep the interruptible canvas motion.
This commit is contained in:
2026-11-10 09:53:06 +07:00
parent 60ba8fed88
commit 95778d54e4
46 changed files with 2311 additions and 415 deletions

View File

@@ -1,6 +1,9 @@
import { AnimatePresence, motion } from "motion/react";
import type { KeyboardEvent, ReactNode } from "react";
import type { Orbit, Snapshot } from "../../api";
import { useReducedMotion } from "../../hooks/useReducedMotion";
import { formatBytes, formatWhen, orbitStatus, schedulePhrase } from "../../lib/format";
import { SpringPane } from "../ui/SpringPane";
export function TelemetryStrip({
orbitCount, failedCount, snapCount, totalBytes,
@@ -29,6 +32,7 @@ export function OrbitRegister({
onSelect: (id: string) => void;
onManage: () => void;
}) {
const reducedMotion = useReducedMotion();
const active = orbits.some(({ id }) => id === selected) ? selected : orbits[0]?.id;
function moveFocus(event: KeyboardEvent<HTMLButtonElement>, index: number) {
@@ -47,11 +51,11 @@ export function OrbitRegister({
<h2 id="register-title">Orbits</h2>
</header>
{message && <p className="console-empty" role="status">{message}</p>}
<ul className="register-list">
<motion.ul className="register-list" layoutScroll>
{orbits.map((orbit, index) => {
const status = orbitStatus(orbit.last_status);
return (
<li key={orbit.id}>
<motion.li key={orbit.id} layout={reducedMotion ? false : "position"}>
<button
type="button"
id={`register-${orbit.id}`}
@@ -68,10 +72,10 @@ export function OrbitRegister({
</span>
<span className={`register-state tone-${status.tone}`}>{status.label}</span>
</button>
</li>
</motion.li>
);
})}
</ul>
</motion.ul>
<div className="console-bottom">
<button type="button" className="console-control" onClick={onManage}>
{orbits.length ? "Manage orbits" : "Set up an orbit"} <span aria-hidden="true">↗</span>
@@ -98,35 +102,41 @@ export function OrbitInspector({
<h2 id="inspector-title">{orbit?.name ?? "Select an orbit"}</h2>
{orbit && <p className={`inspector-state tone-${status.tone}`}><span className={`register-signal signal-${status.tone}`} />{status.label}</p>}
</header>
{orbit ? (
<>
<p className="inspector-schedule">{schedulePhrase(orbit.schedule, orbit.dry_run)}</p>
<div className="inspector-capture">{capture}</div>
<section className="inspector-history" aria-labelledby="history-title">
<header>
<h3 id="history-title">Snapshot history</h3>
<span>{snapshots.length.toString().padStart(2, "0")}</span>
</header>
{snapshotMessage && <p className="console-empty" role="status">{snapshotMessage}</p>}
<ul>
{snapshots.map((snapshot, index) => (
<li key={snapshot.id}>
<button id={`snapshot-${snapshot.id}`} type="button" className="snapshot-row" onClick={() => onSelectSnapshot(snapshot.id)}>
<span className="snapshot-glyph" aria-hidden="true">◇</span>
<span>
<strong>{formatWhen(snapshot.taken_at)}</strong>
<small>{formatBytes(snapshot.size_bytes)}{index === 0 ? " · Latest" : ""}</small>
</span>
<span className="snapshot-arrow" aria-hidden="true">›</span>
</button>
</li>
))}
</ul>
</section>
</>
) : (
<p className="console-empty">Choose a star on the map or an orbit in the register to inspect its status and recovery points.</p>
)}
<div className="spring-stack inspector-stack">
<AnimatePresence initial={false}>
{orbit ? (
<SpringPane key={orbit.id}>
<p className="inspector-schedule">{schedulePhrase(orbit.schedule, orbit.dry_run)}</p>
<div className="inspector-capture">{capture}</div>
<section className="inspector-history" aria-label="Snapshot history">
<header>
<h3>Snapshot history</h3>
<span>{snapshots.length.toString().padStart(2, "0")}</span>
</header>
{snapshotMessage && <p className="console-empty" role="status">{snapshotMessage}</p>}
<ul>
{snapshots.map((snapshot, index) => (
<li key={snapshot.id}>
<button id={`snapshot-${snapshot.id}`} type="button" className="snapshot-row" onClick={() => onSelectSnapshot(snapshot.id)}>
<span className="snapshot-glyph" aria-hidden="true">◇</span>
<span>
<strong>{formatWhen(snapshot.taken_at)}</strong>
<small>{formatBytes(snapshot.size_bytes)}{index === 0 ? " · Latest" : ""}</small>
</span>
<span className="snapshot-arrow" aria-hidden="true">›</span>
</button>
</li>
))}
</ul>
</section>
</SpringPane>
) : (
<SpringPane key="empty">
<p className="console-empty">Choose a star on the map or an orbit in the register to inspect its status and recovery points.</p>
</SpringPane>
)}
</AnimatePresence>
</div>
</section>
);
}