Dependencies beyond servers, web push, inventory auto-fill with QR labels, Windows agent health
- Dependencies: servers and integrations can depend on each other; alerts are folded under the root cause, and a failure explained by something down isn't announced - Web push: hand-written VAPID and RFC 8291 encryption, per-device subscriptions, a fifth notification channel, service worker handlers - Inventory: maker/model/serial from the agents fill blank fields, "Refresh from agent", QR label printing and ?asset= deep links - Windows agent (v4) reports failed services, disk health, Storage Spaces pools and hardware identity; Linux agent (v5) reports hardware identity Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5cc51c57de
commit
ec9c2f73f0
55 files changed
+12553
-65
No files matched your search
@@ -7,6 +7,7 @@ import {
|
||||
type NtfySettings,
|
||||
type SmtpSettings,
|
||||
type WebhookSettings,
|
||||
type WebPushSettings,
|
||||
type NotificationEvents,
|
||||
type DigestSettings,
|
||||
type QuietHoursSettings,
|
||||
@@ -15,6 +16,7 @@ import {
|
||||
import { readableError } from "../../utils/errors";
|
||||
import { ErrorNotice } from "../../components/Notice";
|
||||
import { PageSkeleton } from "../../components/Skeleton";
|
||||
import PushDevices from "../../components/PushDevices";
|
||||
|
||||
const TIMEZONES = [
|
||||
"UTC",
|
||||
@@ -43,6 +45,7 @@ const DEFAULT_GOTIFY: GotifySettings = { enabled: false, url: "", token: "", pri
|
||||
const DEFAULT_NTFY: NtfySettings = { enabled: false, url: "https://ntfy.sh", topic: "", token: "", priority: 3 };
|
||||
const DEFAULT_SMTP: SmtpSettings = { enabled: false, host: "", port: 587, secure: false, username: "", password: "", from: "", to: "" };
|
||||
const DEFAULT_WEBHOOK: WebhookSettings = { enabled: false, url: "", secret: "" };
|
||||
const DEFAULT_WEBPUSH: WebPushSettings = { enabled: false, contact: "" };
|
||||
const DEFAULT_NOTIFICATIONS: NotificationEvents = {
|
||||
dnsAdd: true,
|
||||
dnsUpdate: true,
|
||||
@@ -219,6 +222,9 @@ export default function NotificationSettings() {
|
||||
const [ntfy, setNtfy] = useState<NtfySettings>(DEFAULT_NTFY);
|
||||
const [smtp, setSmtp] = useState<SmtpSettings>(DEFAULT_SMTP);
|
||||
const [webhook, setWebhook] = useState<WebhookSettings>(DEFAULT_WEBHOOK);
|
||||
const [webPush, setWebPush] = useState<WebPushSettings>(DEFAULT_WEBPUSH);
|
||||
// Whether push is on as saved: people can only add their browsers once the server knows it is on.
|
||||
const [webPushSaved, setWebPushSaved] = useState(false);
|
||||
const [notifications, setNotifications] = useState<NotificationEvents>(DEFAULT_NOTIFICATIONS);
|
||||
const [quietHours, setQuietHours] = useState<QuietHoursSettings>(DEFAULT_QUIET_HOURS);
|
||||
const [healthChecks, setHealthChecks] = useState<HealthCheckSettings>(DEFAULT_HEALTH_CHECKS);
|
||||
@@ -239,7 +245,7 @@ export default function NotificationSettings() {
|
||||
const [testingWebhook, setTestingWebhook] = useState(false);
|
||||
const [testWebhookResult, setTestWebhookResult] = useState<TestResult>(null);
|
||||
|
||||
const snapshot = JSON.stringify({ gotify, ntfy, smtp, webhook, notifications, quietHours, healthChecks, digest });
|
||||
const snapshot = JSON.stringify({ gotify, ntfy, smtp, webhook, webPush, notifications, quietHours, healthChecks, digest });
|
||||
const dirty = baseline !== null && snapshot !== baseline;
|
||||
|
||||
useEffect(() => {
|
||||
@@ -251,12 +257,15 @@ export default function NotificationSettings() {
|
||||
setNtfy(s.ntfy);
|
||||
setSmtp(s.smtp);
|
||||
setWebhook(s.webhook);
|
||||
const wp = s.webPush ?? DEFAULT_WEBPUSH;
|
||||
setWebPush(wp);
|
||||
setWebPushSaved(wp.enabled);
|
||||
setNotifications(s.notifications);
|
||||
setQuietHours(s.quietHours);
|
||||
setHealthChecks(s.healthChecks);
|
||||
const d = s.digest ?? DEFAULT_DIGEST;
|
||||
setDigest(d);
|
||||
setBaseline(JSON.stringify({ gotify: s.gotify, ntfy: s.ntfy, smtp: s.smtp, webhook: s.webhook, notifications: s.notifications, quietHours: s.quietHours, healthChecks: s.healthChecks, digest: d }));
|
||||
setBaseline(JSON.stringify({ gotify: s.gotify, ntfy: s.ntfy, smtp: s.smtp, webhook: s.webhook, webPush: wp, notifications: s.notifications, quietHours: s.quietHours, healthChecks: s.healthChecks, digest: d }));
|
||||
})
|
||||
.catch((err) => setLoadError(err instanceof Error ? err.message : String(err)))
|
||||
.finally(() => setLoading(false));
|
||||
@@ -303,8 +312,9 @@ export default function NotificationSettings() {
|
||||
setSaveError(null);
|
||||
setSaved(false);
|
||||
try {
|
||||
await api.settings.update({ gotify, ntfy, smtp, webhook, notifications, quietHours, healthChecks, digest });
|
||||
await api.settings.update({ gotify, ntfy, smtp, webhook, webPush, notifications, quietHours, healthChecks, digest });
|
||||
setBaseline(snapshot);
|
||||
setWebPushSaved(webPush.enabled);
|
||||
setSaved(true);
|
||||
setTimeout(() => setSaved(false), 3000);
|
||||
} catch (err) {
|
||||
@@ -412,7 +422,7 @@ export default function NotificationSettings() {
|
||||
const ntfyComplete = !!(ntfy.url && ntfy.topic);
|
||||
const smtpComplete = !!(smtp.host && smtp.from && smtp.to);
|
||||
const webhookComplete = !!webhook.url;
|
||||
const channelsOn = [gotify.enabled && gotifyComplete, ntfy.enabled && ntfyComplete, smtp.enabled && smtpComplete, webhook.enabled && webhookComplete].filter(Boolean).length;
|
||||
const channelsOn = [gotify.enabled && gotifyComplete, ntfy.enabled && ntfyComplete, smtp.enabled && smtpComplete, webhook.enabled && webhookComplete, webPush.enabled].filter(Boolean).length;
|
||||
|
||||
const toggle = (key: EventKey, label: string) => <EventToggle key={key} label={label} checked={notifications[key]} onChange={(on) => setNotifications((n) => ({ ...n, [key]: on }))} />;
|
||||
const dailyChecksEnabled = notifications.secretCheck || notifications.tailscaleKeyCheck || notifications.dockerUpdateCheck || notifications.proxmoxBackupCheck || notifications.pbsVerificationCheck || notifications.domainExpiryCheck;
|
||||
@@ -614,6 +624,30 @@ export default function NotificationSettings() {
|
||||
</button>
|
||||
<TestBadge result={testWebhookResult} />
|
||||
</ChannelRow>
|
||||
|
||||
<ChannelRow
|
||||
name="Phone and browser"
|
||||
description={<>Push notifications to a phone or browser that asks for them, with no app or account. They need this page to be opened over https.</>}
|
||||
enabled={webPush.enabled}
|
||||
onToggle={(on) => setWebPush((w) => ({ ...w, enabled: on }))}
|
||||
complete
|
||||
summary="Web push"
|
||||
open={openChannel === "webpush"}
|
||||
onOpen={() => setOpenChannel(openChannel === "webpush" ? null : "webpush")}
|
||||
>
|
||||
<div className="mb-3">
|
||||
<label className="form-label">Contact (optional)</label>
|
||||
<input
|
||||
className="form-control"
|
||||
maxLength={200}
|
||||
placeholder="you@example.com"
|
||||
value={webPush.contact}
|
||||
onChange={(e) => setWebPush((w) => ({ ...w, contact: e.target.value }))}
|
||||
/>
|
||||
<div className="form-hint text-secondary small">Given to the browsers’ push services (Google, Mozilla, Apple) so they can reach you if this misbehaves. An email address or an https address.</div>
|
||||
</div>
|
||||
<PushDevices serverEnabled={webPushSaved} />
|
||||
</ChannelRow>
|
||||
</div>
|
||||
|
||||
{/* ── What to send ── */}
|
||||
|
||||
Reference in new issue
Block a user