Add a Proxmox Backup Server integration: datastore/snapshot verification status
Proxmox VE already shows whether the last vzdump push to PBS succeeded, but has no visibility into PBS's own backup verification, GC/prune health, or host status. This adds PBS as its own integration (own adapter, page, nav entry, and Dashboard widget) that reads datastore usage and, for every stored snapshot, its verification state directly from PBS. A new daily check (mirroring the existing Proxmox backup-failure check) notifies when a snapshot has failed verification or a datastore couldn't be read, with its own toggle in Settings -> Notifications and its own maintenance-window silencing. Not verified against a live PBS instance — built from PBS's published API docs and a scratch test against a mocked PBS server exercising the adapter's parsing and auth-header format (PBSAPIToken uses a colon separator, unlike PVE's PVEAPIToken which uses =). See INTEGRATIONS.md for details and the "not verified" caveat. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
70ba60c7da
commit
df2a5ce42b
24 files changed
+897
-13
No files matched your search
@@ -6,6 +6,7 @@ import {
|
||||
type DomainList,
|
||||
type IntegrationSummary,
|
||||
type IntegrationType,
|
||||
type PbsDatastoresResponse,
|
||||
type SecretRecord,
|
||||
type ServerSummary,
|
||||
type TailscaleDevicesResponse,
|
||||
@@ -202,6 +203,7 @@ const WIDGETS: { type: IntegrationType; label: string }[] = [
|
||||
{ type: "gitea", label: "Gitea" },
|
||||
{ type: "dockhand", label: "Dockhand / Docker" },
|
||||
{ type: "uptimekuma", label: "Uptime Kuma" },
|
||||
{ type: "pbs", label: "Proxmox Backup Server" },
|
||||
];
|
||||
|
||||
interface UptimeKumaSummary {
|
||||
@@ -212,6 +214,12 @@ interface UptimeKumaSummary {
|
||||
statusBreakdown: { label: string; count: number }[];
|
||||
}
|
||||
|
||||
interface PbsSummary {
|
||||
datastoreCount: number;
|
||||
failedSnapshotCount: number;
|
||||
unverifiedSnapshotCount: number;
|
||||
}
|
||||
|
||||
interface GiteaSummary {
|
||||
repoCount: number;
|
||||
privateCount: number;
|
||||
@@ -277,6 +285,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
|
||||
const [proxmoxSummary, setProxmoxSummary] = useState<ProxmoxSummary | null>(null);
|
||||
const [synologySummary, setSynologySummary] = useState<SynologySummary | null>(null);
|
||||
const [uptimeKumaSummary, setUptimeKumaSummary] = useState<UptimeKumaSummary | null>(null);
|
||||
const [pbsSummary, setPbsSummary] = useState<PbsSummary | null>(null);
|
||||
|
||||
const [dnsStats, setDnsStats] = useState<Awaited<ReturnType<typeof api.dns.stats>> | null>(null);
|
||||
const [dnsError, setDnsError] = useState<string | null>(null);
|
||||
@@ -460,6 +469,24 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
|
||||
.catch(() => setUptimeKumaSummary(null));
|
||||
}, [integrations]);
|
||||
|
||||
useEffect(() => {
|
||||
const pbs = integrations?.find((i) => i.type === "pbs" && i.enabled);
|
||||
if (!pbs) {
|
||||
setPbsSummary(null);
|
||||
return;
|
||||
}
|
||||
api.integrations.pbs
|
||||
.datastores(pbs.id)
|
||||
.then((res: PbsDatastoresResponse) =>
|
||||
setPbsSummary({
|
||||
datastoreCount: res.summary.datastoreCount,
|
||||
failedSnapshotCount: res.summary.failedSnapshotCount,
|
||||
unverifiedSnapshotCount: res.summary.unverifiedSnapshotCount,
|
||||
}),
|
||||
)
|
||||
.catch(() => setPbsSummary(null));
|
||||
}, [integrations]);
|
||||
|
||||
const domains = domainList?.domains ?? [];
|
||||
const expiredDomains = domains.filter((d) => d.status === "expired");
|
||||
const expiringDomains = domains.filter((d) => d.status === "expiring");
|
||||
@@ -764,7 +791,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
|
||||
|
||||
<SectionHeader
|
||||
title="Integrations"
|
||||
hint="Live status widgets for Proxmox, Synology, Semaphore, Tailscale, Gitea, Dockhand, and Uptime Kuma will appear here as each integration is connected."
|
||||
hint="Live status widgets for Proxmox, Synology, Semaphore, Tailscale, Gitea, Dockhand, Uptime Kuma, and Proxmox Backup Server will appear here as each integration is connected."
|
||||
/>
|
||||
<div className="row row-cards">
|
||||
{WIDGETS.map(({ type, label }) => {
|
||||
@@ -776,8 +803,16 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
|
||||
const isLiveProxmox = type === "proxmox" && integration && proxmoxSummary;
|
||||
const isLiveSynology = type === "synology" && integration && synologySummary;
|
||||
const isLiveUptimeKuma = type === "uptimekuma" && integration && uptimeKumaSummary;
|
||||
const isLivePbs = type === "pbs" && integration && pbsSummary;
|
||||
const isLive =
|
||||
isLiveTailscale || isLiveGitea || isLiveDockhand || isLiveSemaphore || isLiveProxmox || isLiveSynology || isLiveUptimeKuma;
|
||||
isLiveTailscale ||
|
||||
isLiveGitea ||
|
||||
isLiveDockhand ||
|
||||
isLiveSemaphore ||
|
||||
isLiveProxmox ||
|
||||
isLiveSynology ||
|
||||
isLiveUptimeKuma ||
|
||||
isLivePbs;
|
||||
|
||||
return (
|
||||
<WidgetCard
|
||||
@@ -953,6 +988,26 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
|
||||
<BreakdownBar data={uptimeKumaSummary!.statusBreakdown} colors={MONITOR_STATE_COLORS} compact />
|
||||
)}
|
||||
</>
|
||||
) : isLivePbs ? (
|
||||
<div className="row g-2 mb-3">
|
||||
<div className="col-4">
|
||||
<MiniStat label="Datastores" value={pbsSummary!.datastoreCount} />
|
||||
</div>
|
||||
<div className="col-4">
|
||||
<MiniStat
|
||||
label="Failed"
|
||||
value={pbsSummary!.failedSnapshotCount}
|
||||
accent={pbsSummary!.failedSnapshotCount > 0 ? "#ef4444" : undefined}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-4">
|
||||
<MiniStat
|
||||
label="Unverified"
|
||||
value={pbsSummary!.unverifiedSnapshotCount}
|
||||
accent={pbsSummary!.unverifiedSnapshotCount > 0 ? "#f59e0b" : undefined}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-secondary mt-2">
|
||||
{integration ? (
|
||||
|
||||
Reference in new issue
Block a user