Commit Graph
100 Commits
Author SHA1 Message Date
bobbanandClaude Sonnet 5.5 0fa50c2d5a Broken Docker containers are alerts
From Dockhand, on the health pass: a container that keeps restarting (critical, with
its exit code), one whose own health check fails, one that stopped unexpectedly, one
created and never started for an hour, and a Docker host Dockhand cannot reach. A stop
is only news when it was seen happen, so stacks switched off long ago stay quiet.
A Leave alone button on the Docker page and a list in Settings; on by default.

Also fixes a date-dependent storage-forecast test that pinned its clock while the code
under test reads the real one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 21:03:56 +02:00
bobbanandClaude Sonnet 5.5 16b24f5436 Away mode, and critical alerts through quiet hours
For a one-person homelab, "on call" is when you can be reached. Settings ->
Notifications -> When -> Away holds notifications while you are away (a banner on
every page says so) and sends one digest when it ends, at its time or when you say
you are back. Critical alerts can still come through. Quiet hours get the same
"still send critical alerts" option. Escalation steps marked to send in quiet hours
are sent while away too. What is held for one reason is not released while the
other still holds it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22 19:14:29 +02:00
bobbanandClaude Sonnet 5.5 3b31b16796 Service-level targets with error budgets, and quarterly and annual reports
Monitoring -> Service levels: a target (99.9 %) on an endpoint check, a server or an
integration, measured over calendar months. Shows the figure, downtime used, the
error budget left, and how the last six months went. 80 % of the budget used is a
warning and an overspent budget a critical alert. Endpoints are measured day by day,
servers and integrations to the minute from the audit log.

The report page gains Quarter and Year (same figures, with a Service levels section),
and two settings send the quarterly and annual report after the month that ends them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 22:20:07 +02:00
bobbanandClaude Sonnet 5.5 31044b2b64 What is normal for the time: baselines per hour of the week
Each server's CPU load and memory use get a baseline for every hour of the week
(median and robust spread over up to ten weeks, four needed). A clearly high last
hour that never dropped back toward normal is a warning; everything else stays
quiet. Server History -> Trends draws a usual line and band. Setting under
Notifications, on by default.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 21:57:57 +02:00
bobbanandClaude Sonnet 5.5 232a5661ab A UPS in the map: read over NUT or SNMP, alerts, shutdown order
New UPS integration (NUT or SNMP v2c, read only). Monitoring -> UPS shows charge,
runtime, load and mains voltage with history and the times mains power was lost.
Mains lost and a nearly empty battery are critical alerts; battery to be replaced
and a heavy load are warnings. The UPS is a node in the dependency map and counts
as down while on battery, so servers that go offline with it are folded under its
alert; the page lists what is on it in the order to shut it down. /metrics series
and docs added.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 21:47:31 +02:00
bobbanandClaude Sonnet 5.5 3cb3e4988f Check a value, not just "is it up": JSON value checks on web endpoints
A web check can read a value out of a JSON answer (power.now, state,
data.result[0].value[1]) and judge it: below, above, equal to, contains, is there.
The value read is shown on the Endpoints page, charted under History, exported as
homelab_endpoint_value and in the read API. A check can also send one header (a
token), stored encrypted, never returned, and not forwarded to another host on a
redirect.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 21:13:44 +02:00
bobbanandClaude Sonnet 5.5 e114567d64 How big the app's data is, and a webhook delivery log with Send again
Settings -> Data -> Storage measures the database, backups and sessions and every
table (size, rows, growth, how long it is kept, how far back it reaches), and flags
histories that are not being trimmed or have no limit.

Event webhooks now keep a delivery log (last 100 per webhook, 14 days): what was
sent, how it went, the message itself, and Send again, which resends it exactly as it
was (same id and signature). Resends are audited and in the Change log.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 20:58:57 +02:00
bobbanandClaude Sonnet 5.5 aebf3c6ce1 Buttons on notifications: acknowledge, silence and snooze from the message
- A switch (off by default) under Settings -> Notifications -> Who hears what
- ntfy gets buttons (three for one alert, one link for several); phone push gets two buttons handled by the service worker; Gotify, email and the chat webhook get the link as text; escalation messages carry them too
- Each link is a signed token for the alerts in that one message only, good for 24 hours, for three actions; opening it changes nothing, only a POST acts; everything is audited as "from a notification link"
- Docs updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 20:42:04 +02:00
bobbanandClaude Sonnet 5.5 0277126add What changed before this? on every incident, ranked
- A card on the incident page, and GET /api/incidents/:id/before and /api/v1/incidents/:id/before: what the app knows happened in the 30 min to 24 h before an alert began (audit log, maintenance windows, update runs and patch plans, other alerts, a step in the server's own figures), scored by how related, what kind and how close
- A host going down is shown once; Likely, Possible and Background; at most ten
- Docs and roles updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 20:25:45 +02:00
bobbanandClaude Sonnet 5.5 c2e76262ca Documentation: guides in docs/, and the reference docs brought up to date
- New docs/ folder: SSO, API, Prometheus and Grafana, webhooks, heartbeats and calendar, how monitoring works, and an index; the old root API.md is split across them
- Read API: alerts carry snoozedUntil
- DATABASE.md: table and migration counts, indexes, relations, integration config, settings and internal flags, delete rules, retention
- ROLES.md: the sidebar table rebuilt from the menu
- NOTIFICATIONS.md, INTEGRATIONS.md, BACKUP.md, AGENT_UPDATE.md: what had drifted
- README: links to the guides; accounts cannot be deleted in the app

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 00:09:43 +02:00
bobbanandClaude Sonnet 5.5 24ae8db380 Alert rules of your own, storage forecasts for Proxmox and Synology, and snooze
- Monitoring -> Alert rules: CPU, memory, disk use and disk temperature limits with a time, severity and scope (all, one server, a tag); try before saving; findings are ordinary health conditions
- Proxmox storages and Synology volumes are written down on each health pass (hourly, 400 days) and forecast like server disks: badge and history chart on the pages, alert, digest line, /metrics gauge
- Snooze an alert until a time; held back like maintenance, messages held, announced once again if still there when it ends
- Docs updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 23:38:36 +02:00
bobbanandClaude Sonnet 5.5 788b3e073c A To do card on server pages and in a device's drawer
- The open jobs about a server (or device) are listed on its page, with a line to add another already about it and a box to tick one off with Undo
- GET /api/todos takes ?targetType=&targetId= to list only those about one thing
- README and ROLES updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 22:46:12 +02:00
bobbanandClaude Sonnet 5.5 18ceed62e8 Racks, notes and to-do, OS support, suggested dependencies, Nginx Proxy Manager and Home Assistant
- Racks page and a network diagram (UniFi tree with servers, printable)
- Notes on servers and devices; To do list shown in Coming up and My work
- Agents report the operating system (Linux 7, Windows 6); end-of-life badge and alert
- Suggested dependencies from where a service is reached
- Nginx Proxy Manager integration: proxy hosts page, certificate and host alerts, suggested checks
- Home Assistant integration: watch chosen entities, history chart, limit and unavailable alerts
- TimeChart gets a "value" scale that fits negatives; docs updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 21:47:56 +02:00
bobbanandClaude Sonnet 5.5 68b41b5586 A year of history, one chart, and a read API with personal tokens
History: server load, memory and disks are also kept as hourly (four months) and
daily (over two years) averages with lowest and highest; endpoint answers as
hourly (four months) beside the daily figures. Charts ask for 24 hours to a year
and are drawn from whichever is fine enough. A disk that two weeks call flat is
looked at again over ninety days for the forecast. Built once from what is kept.

One chart: TimeChart replaces the sparkline and the multi-line chart: hover and
arrow-key readout, a lowest/highest band, gaps shown as gaps, the same ranges
everywhere and the choice remembered. Used for server trends, comparing servers,
a check's availability and answer times (Endpoints > History) and a server's
availability.

Read API: /api/v1 (servers, metrics, alerts, incidents, inventory, network,
endpoints and their history, maintenance) with personal read-only tokens made
under the user menu: shown once, hashed, 30/90/365 days or none, ten at most,
removed with their owner. GET only. Documented in API.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 20:22:58 +02:00
bobbanandClaude Sonnet 5.5 5e26e77340 UniFi: servers plugged into switches; server page in sections; My work; settings search and undo
UniFi: the controller's client list is matched to servers by IP address, so a
server is connected through a switch or access point (and port). That is a
dependency made by itself, shown on the server page, the Network devices page
and the Connections map. IP Addresses can sync the devices' addresses.

A server's page is split into Overview, Health, Network, History, Tasks and
Settings, by ?view=; alerts link to the section they are about.

My work lists what has your name on it: alerts you have, maintenance you
started (extend, end with undo) and update runs you started, with a badge.

Settings has a search box (and the command palette lists every setting).
Removing a dependency, admin link, runbook, hand-made IP address, port opening
or restore test is undone from the message instead of asked about first.

Two backup tests used a fixed date and failed as days passed; they follow the
real clock now.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 19:35:45 +02:00
bobbanandClaude Sonnet 5.5 396e074108 UniFi integration: network devices, Wi-Fi and networks, as part of the dependency map
A UniFi controller (API key on Network 9+, or a read-only local login on any
version) is read every five minutes. Its switches, access points and gateways
are kept with state, IP, uptime, firmware and uplink; its networks and Wi-Fi
names beside them (passphrases are never read). Nothing is written to the
controller.

Network > Network devices lists them. Devices are a new node type in the
dependency map: uplinks become dependencies by themselves, others can be
written by hand. A device offline past a limit is an offline alert, folds what
depends on it, can be silenced with maintenance and have runbooks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 00:35:48 +02:00
bobbanandClaude Sonnet 5.5 73a06ebe63 Flapping alerts, a noise report and bulk actions with undo
Flapping: an alert raised three times within an hour is announced once as
flapping, its further raise/clear messages are held until it has been calm
for an hour, and one message then says whether it is still active. Event
webhooks still hear everything. The state survives restarts.

Alerts > Noise lists the alerts that keep coming back (7-180 days): how often,
how long, most in an hour, and a hint on what helps.

Bulk actions on Alerts (acknowledge, remove acknowledgement, silence), Servers
(tag, silence, runs on) and Inventory (location and dates, print labels). Each
reports what it left alone and why, and has an Undo on the toast.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 23:55:09 +02:00
bobbanandClaude Sonnet 5.5 be6c5552bd Patch plans, a monthly report and new-port alerts
Patch plans (Updates -> Patch plans): updates on a schedule, one server at a time, each by an
ordinary update run, stopping at the first failure by default, silencing what depends on a
server while it is updated, with one message at the end.

Monthly report (Operations -> Monthly report, and optionally a message on a day of the month):
availability, incidents, updates, restore tests, backups and renewals for a calendar month,
printable. Backed by daily endpoint figures and a record of renewals.

New ports: the first report with ports is the baseline; a TCP port that begins listening later and
is not noted on the server's Ports card is a warning, cleared by Mark as expected.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 23:16:14 +02:00
bobbanandClaude Sonnet 5.5 ddd0aa622a Settings down to eight tabs; Domains become a tab of DNS
Notifications gains Alert tickets, Display gains Badge colours, and a new Data tab holds Backup,
Logs and Cache. Domains is the 'Domain names' tab of DNS. Old addresses redirect; the docs, the
Privacy page and the links from alerts and the agenda name the new places.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 22:36:24 +02:00
bobbanandClaude Sonnet 5.5 1432b148e9 Fold four pages into the pages they belong to; add a Backups menu group
Dependencies become a view of the Map (graph with the editor under it), Sessions the
'Signed in now' tab of Users, the Audit Log the 'Raw audit log' tab of the Change log, and the
Diagnostic Log the 'Call log' tab of Integrations (admins). Backup coverage and Proxmox Backup
move to a new Backups group. Old addresses redirect; a shared ViewTabs component does the tabs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 22:21:21 +02:00
bobbanandClaude Sonnet 5.5 4e0c6927b2 Heartbeats, Coming up and suggested checks; Operations menu tidied
Heartbeats: a cron job or script calls /api/heartbeat/<token> (and /start, /fail); the app
alerts when the call is late or the job says it failed. Coming up: one agenda of everything
dated (expiries, warranties, end of support, planned and recurring maintenance, restore tests,
waiting updates), with a dashboard card and an iCalendar feed behind a share link. Suggested
checks: web ports and certificates the app already knows about, added with a click.

Menu: Incidents become Alerts -> History (old /incidents links redirect); new Monitoring group
(Endpoints, Heartbeats, Uptime Kuma); osTicket under Automation, Admin Links under
Infrastructure, Generator under Administration. Also makes the restore-test metrics test follow
the real clock.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 21:42:34 +02:00
bobbanandClaude Sonnet 5.5 c05c847d17 Profile pictures from Gravatar or the identity provider, fetched and kept by the server
Both sources are off until switched on under Settings, Sign-in. The server asks only
gravatar.com (by a hash of the email) and the identity provider's own host, accepts only
small PNG/JPEG/WebP/GIF, keeps each picture for a day and serves it from /api/avatars/<id>,
so browsers never contact either. Shown in the user menu and on the Users page, with initials
as the fallback; the Privacy page says when it is on.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 23:47:50 +02:00
bobbanandClaude Sonnet 5.5 9782bd3252 Keep the user menu and the narrow-sidebar button at the bottom of the screen when the menu scrolls
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 23:29:32 +02:00
bobbanandClaude Sonnet 5.5 846af02851 Lifecycle planning, and consistent empty and loading states
- Inventory: end of support and replacement cost per asset; a Lifecycle page showing what ages out year by year and what replacing it will cost; support ending within 90 days in the weekly digest
- Lists: a shared empty state saying what is missing, why, and the one thing to do; "nothing matches" with a clear button; skeleton rows instead of empty-looking lists while loading

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 23:18:42 +02:00
bobbanandClaude Sonnet 5.5 92726568b7 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>
2026-10-18 23:03:56 +02:00
bobbanandClaude Sonnet 5.5 c3bc6bbf72 Agent diagnostics ("what the agent couldn't collect") and services to ignore per server
- Agents (Linux 6, Windows 5) note each check they couldn't make and why; the server page turns that into tips and fixes, including when the agent is behind
- Linux --prepare leaves its notes for the report; a missing prepare step is itself noted
- Services to ignore are set per server from the Host health card (names or * patterns), applied on the server so alerts and /metrics drop them at once; saving alert limits keeps the list

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 22:16:31 +02:00
bobbanandClaude Sonnet 5.5 b5384c1e03 Dashboard status banner, phone-friendly lists, and more command palette actions
- Dashboard: a banner that answers "is it fine?" (headline, root cause, kinds of problem, worst few); cards with a problem come first in their row
- Phone: Alerts, Updates and Inventory rows become compact cards, finger-sized buttons, Alerts drops its figure row; scanned inventory labels get an Edit button
- Command palette: acknowledge alerts, update a server, print a label, open hardware, "What depends on ...?"

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 22:00:19 +02:00
bobbanandClaude Sonnet 5.5 43fc5e0272 Notification routing rules, per-browser push wishes, escalation of unacknowledged alerts
- Routing: rules pick channels by kind, severity and server tags (first match wins, none = nobody); mixed batches split per route; recoveries follow their alert; quiet-hours digest keeps each notification's audience
- Push: each subscribed browser can ask for a minimum severity and some kinds
- Escalation: up to three timed steps re-notify alerts nobody has acknowledged, through chosen channels and an optional extra email; an acknowledgement stops them
- Fix ntfy: titles with an em dash made every ntfy send fail (header not Latin-1); now RFC 2047 encoded

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 19:44:45 +02:00
bobbanandClaude Sonnet 5.5 9caa414829 Dependency map, impact preview in maintenance, and a calmer Alerts page
- Map: a Dependencies view showing what would go down with a picked box and what it relies on
- Maintenance: lists what depends on a target and can silence those too (same time, audited); the recurring form and update drawer show the same note
- Alerts: a headline on where things stand, held-back alerts nested under their cause, severity edge on rows; caused-by now carries the explaining alert's id

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 19:17:09 +02:00
bobbanandClaude Sonnet 5.5 ec9c2f73f0 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>
2026-10-18 18:53:30 +02:00
bobbanandClaude Sonnet 5.5 5cc51c57de Add status pages (a share link kind) and a downloadable Grafana dashboard
- Share links can open a status page: an admin picks servers, integrations and Uptime Kuma
  monitors and names them; the public sees only those names, Working / Not working /
  Being worked on / Can't tell, an optional message and the 30-day figure (share_links.kind/
  title/message and status_items, migration 0033). A status address doesn't open the wall and
  the other way round; Uptime Kuma is asked at most every 30 seconds
- Grafana dashboard built from code (download in Settings -> API and webhooks); a test checks
  it only uses series /metrics serves
- Tests and docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 15:38:08 +02:00
bobbanandClaude Sonnet 5.5 2744a84719 Acknowledge and hand over alerts, incident timelines, and built-in database backups
- Alerts can be acknowledged (note, assignee, duration); acknowledged alerts are left out of what
  needs attention (sidebar, dashboard strip, cards) but stay raised and counted by /metrics
- Incidents: each time an alert is raised and goes away is recorded (alert_acks, alert_incidents,
  incident_notes, migration 0032), with a timeline of acks, maintenance, changes, update runs,
  related alerts and notes; Incidents page and a digest section
- Backups of Homelab Manager's own database: daily checked VACUUM INTO copies, retention, download,
  check, upload, delete, and restore staged and applied at start-up before the database opens
  (pre-restore copy kept); alerts and /metrics for stale or failing backups
- Docs: README, BACKUP, DATABASE, NOTIFICATIONS, ROLES, API; tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:21:08 +02:00
bobbanandClaude Sonnet 5.5 7a5b623444 Stale-backup alerts, per-server alert limits, and update runs from the Updates page
- Backups: a guest whose newest backup is older than its limit is an alert (backup kind),
  in the daily backup message, the digest and /metrics (homelab_backup_guests, ..._last_age_seconds)
- Per-server thresholds (servers.thresholds, migration 0030): offline minutes, disk percent,
  forecast window, backup age, and per-disk limits or "leave alone"; applied everywhere the
  global ones were; saving clears the alerts cache
- Update runs (update_runs, migration 0031): Update... on the Updates page puts the server under
  maintenance, runs a Semaphore playbook limited to it, waits for the host to report, and
  reports what is left and whether a restart is due; poller survives restarts
- Notification toggle for update-run results; tests and docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:25:09 +02:00
bobbanandClaude Sonnet 5.5 5dc6cea69c Host health from the Linux agent, agent self-update, and disk forecast in /metrics
- Linux agent v4: failed systemd services, SMART disk health, ZFS pool state, pacman updates;
  SMART/ZFS and self-update run in the ExecStartPre=-+ step outside the sandbox
- Server: hosts' health stored (servers.host_health, migration 0029), alerts under a new
  "Failing services" kind plus disk/ZFS alerts, Host health card, Prometheus series
- Agent self-update (Linux v4, Windows v3): admin switch on the Servers page, checksum-verified
  download, atomic replace; GET /api/agent/report/update
- homelab_server_disk_days_to_full in /metrics
- Tests (server, real PowerShell against a fake server) and docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 00:54:24 +02:00
bobbanandClaude Sonnet 5.5 540ab704b7 Export CSV on every table, edit recurring maintenance, runs-on nothing, and run package checks outside the agent sandbox
- Export CSV for the small tables that had none (reads the table as shown)
- Servers page shows a skeleton while loading instead of "No servers registered yet"
- Recurring maintenance schedules can be edited (PUT /schedules/:id)
- A server can be set to run on nothing (servers.no_parent, migration 0028)
- Linux agent v3: package-manager question runs in ExecStartPre=-+ outside the sandbox,
  with --prepare-updates and --check-updates modes
- Docs: README, DATABASE, AGENT_UPDATE

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 22:25:18 +02:00
bobbanandClaude Sonnet 5.5 c17e9aa140 Add runbooks, backup coverage, inventory, roles from groups, Prometheus metrics and event webhooks
- Runbooks: notes per server/integration, shown next to matching alerts
- Backup coverage page across Proxmox and PBS, with a digest section
- Hardware inventory with warranty, power and running cost
- Authentik group to role mapping with preview and safeguards
- /metrics (bearer token) and signed outgoing event webhooks
- Docs: README, DATABASE, NOTIFICATIONS, ROLES and new API.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 20:41:00 +02:00
bobbanandClaude Sonnet 5.5 c36e2092c5 Split the notification settings into Channels, What to send and When tabs
- Channels are compact rows (on/off, status, one-line summary) that open to edit and test.
- Event toggles are grouped by topic with their thresholds beside them.
- Time zone, daily reminder, quiet hours and the weekly digest sit together under When.
- A sticky save bar with an unsaved-changes marker; the tab is kept in the address.
- The time zone is always editable, and a channel can be filled in before it is switched on.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 20:01:54 +02:00
bobbanandClaude Sonnet 5.5 aa94d84f6c Add a weekly digest and report which version of the agent each server runs
- Weekly digest through the notification channels: alerts now, a week of uptime, what happened, disks
  heading for full, expiring secrets and domains, updates waiting, planned maintenance. Off until switched
  on in Settings -> Notifications; Preview and Send it now there. Setting key 'digest'.
- Agents say their version in every report (Linux and Windows scripts are version 2); the server compares
  it with the scripts it serves and marks agents that are behind on the Servers, server and Updates pages.
  servers.agent_version, migration 0026.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 19:49:36 +02:00
bobbanandClaude Sonnet 5.5 3da5c639b1 Document updating the agents, and harden the Windows update check
- AGENT_UPDATE.md: when an agent needs updating, how (reuse the stored token or rotate it), how to do many
  servers, how to check it worked, and why a server can stay 'not reported'.
- Windows agent: the Windows Update search runs in its own process with a 150 s limit (the scheduled task is
  stopped after five minutes), a failed search is not retried for an hour, and the cache is read the same in
  PowerShell 7 and Windows PowerShell 5.1.
- Linux agent: says in the journal when the package manager could not be read.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 02:13:08 +02:00
bobbanandClaude Sonnet 5.5 171511c6db Fold alerts under their host, recurring maintenance, run playbooks from alerts, and an Updates page
- Servers can say what they run on (or it is worked out from the Proxmox node); when the host is
  down the guests' offline alerts fold under it: held back, not counted, not notified, still recorded.
- Recurring maintenance schedules made into ordinary windows a week ahead (maintenance_schedules).
- Run a Semaphore template limited to a server from its page or an alert, and watch the run.
- Agents report pending updates (apt, dnf, zypper, Windows Update); an Updates page lists them.
- Migrations 0024 and 0025.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 01:35:15 +02:00
bobbanandClaude Sonnet 5.5 44e393f172 Add saved filter views, a customisable dashboard, server comparison, row keyboard navigation and share links
- Table search, status, tag and sort live in the address; Save view pins one as a favourite.
- Dashboard cards can be moved and hidden per user (users.dashboard_layout, migration 0022).
- Compare two to four servers' load, memory or disk on one chart.
- j/k move through table rows that open a detail panel.
- Share links open a read-only wall without signing in, numbers only or with names
  (share_links, migration 0023); the wall is split into a shared view over two data sources.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:15:29 +02:00
bobbanandClaude Sonnet 5.5 906220040e Add a since-you-last-looked summary, 30-day uptime ribbons, a maintenance timeline and hover timestamps
- Dashboard card on what changed since the user pressed Got it (users.last_looked_at,
  migration 0021), folding each problem and its recovery into one line.
- Uptime ribbons on servers and integrations, built from the audit log; integrations'
  failing/working-again moments are now recorded.
- Timeline of running and scheduled maintenance windows on the Maintenance page.
- TimeAgo component: relative times with the exact time in the chosen format on hover.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 21:55:04 +02:00
bobbanandClaude Sonnet 5.5 3945c60681 Make the wall display and Proxmox dates follow the date and time settings
The wall clock, date line and 'Updated' footer used the browser locale, and the
Proxmox backup tasks and PBS page used toLocaleString. They now use the display
settings via new formatDate/formatTime helpers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 21:02:41 +02:00
bobbanandClaude Sonnet 5.5 bff0c2169e Start maintenance on everything, all servers or all integrations at once
The Start maintenance list gets a "Many at once" group: Everything, All
servers, All integrations, All DNS providers (enabled ones only). Each target
still gets its own window, existing ones are extended, and the action is one
audit entry. "Everything" asks for confirmation first, and "End all" on the
Active list ends every running window together. The top banner and the wall
display summarise long lists instead of printing every name.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 20:58:01 +02:00
bobbanandClaude Sonnet 5.5 65263a64e3 Favourite pages that follow the user, and a narrow icon-only sidebar
A star beside each page in the sidebar pins it under "Favourites" at the top of
the menu; the list is saved with the user (users.favorites, migration 0020), so
it follows them to any browser, is offered first in the search box, and can be
changed from there too. A button at the foot of the sidebar, or the [ key,
narrows it to a strip of icons, where a group's pages open in a small menu
beside its icon and the alert and maintenance counts stay visible; the choice
is kept per browser and applies only on wide screens. Menu text on a coloured
(environment) sidebar is full strength for contrast, and menu badges sit in
line on a phone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 22:38:48 +02:00
bobbanandClaude Sonnet 5.5 57fd4f8c52 Accessibility pass, command palette actions, row detail panel, server activity, map, wall display and setup guide
Accessibility: skip link, labelled landmarks, visible focus, page-change
announcements, sortable headings as real buttons, every label tied to its
field, named row checkboxes, and text contrast raised to 4.5:1 in both themes.
Command palette: also runs actions (silence/end maintenance, theme, density,
wall display, sign out) and is a proper dialog; g-then-letter shortcuts, "/" and
"?". Row detail panel for six tables. Server Activity card, with the health
check now recording offline/back-online and disk events in the audit log. Map
page of hosts, servers, DNS names and monitors. Full-screen wall display. A
getting-started checklist on the admin dashboard.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 21:10:56 +02:00
bobbanandClaude Sonnet 5.5 f7f5e1cd41 Disk fill forecasts, skeleton loaders, and a Silence button on alerts
A disk that is on course to be full within 14 days (setting: 0 turns it off) is
flagged on the Alerts page and dashboard, from the server's own history: needs
three days of steady growth, skips erratic disks and ones the ordinary disk
alert covers. Skeleton placeholders replace "Fetching status…" and "Loading…".
Alerts that a maintenance window can silence get a Silence button (1, 4 or 24
hours) that starts one, and the alert list is refreshed at once when a window
starts or ends.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 00:12:33 +02:00
bobbanandClaude Sonnet 5.5 82974b98d0 Make the trend lines on a server's page taller
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 00:00:12 +02:00
bobbanandClaude Sonnet 5.5 9965d94036 Phone card layout, status symbols, breadcrumbs, integration cards and server trends
Tables stack into labelled cards on a phone. Green, red and amber badges carry
a check, cross or triangle as well as their colour. Pages inside a menu group
show a breadcrumb, with the thing's name on a server's page. Integrations are
cards with an Open button and a live status (working, failing, not checked yet,
disabled). Agent-reported servers keep a short history of load, memory and disk
use (migration 0019, one sample per ten minutes for 35 days) and show it as a
Trends card with a days-until-full forecast for a filling disk.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 23:56:05 +02:00
bobbanandClaude Sonnet 5.5 617dc1ea2f Toasts, logo icons, shared table toolbar with search, and a density toggle
Feedback: toasts confirm common actions, and a page's error or success message
that appears out of view is also shown as a toast. Icons: the tab, app and
home-screen icons are the house from the logo; a dev instance gets a coloured dot
on its tab icon. Tables: Secrets, Admin Links, IP Addresses and Alerts share one
toolbar (search, filters, row count, actions, Export CSV); twelve more tables get
a multi-word search box; long tables keep their column headings in view on wide
screens. Density: Compact / Normal / Roomy in the user menu, remembered per
browser.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 23:39:19 +02:00
bobbanandClaude Sonnet 5.5 7d56ad18b7 Dashboard status strip, "Not set up yet" list, sidebar badges and user menu
The dashboard opens with one line saying whether anything needs attention
(from the same alert report as the Alerts page) and never claims "all clear"
when some checks couldn't run. Widgets with nothing configured are listed once
under "Not set up yet" instead of one grey card each. The sidebar shows the
active alert count and open maintenance windows next to their pages (and on a
closed group), and the foot of the sidebar is one user menu holding theme,
privacy and sign-out. One shared alert poll serves the strip and the badge.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 23:18:31 +02:00
bobbanandClaude Sonnet 5.5 aab2f8cb4a Show the Homelab Manager logo on the sign-in page and in the sidebar
The logo replaces the plain-text title on the sign-in card and in the sidebar
(and the top bar on phones). The picture's empty margin is trimmed with CSS so
the logo fills the space; an environment badge, when set, sits beside or under
it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 22:59:57 +02:00
bobbanandClaude Sonnet 5.5 7e196be56d Let an installation look different via ENVIRONMENT_NAME and ENVIRONMENT_COLOR
Setting ENVIRONMENT_NAME (and optionally ENVIRONMENT_COLOR, a name or hex
value) gives the sidebar that colour, adds a name badge next to the title and
on the sign-in page, and prefixes the browser tab title, so a dev copy can't
be taken for production. Unset, nothing changes. The colour is validated to a
plain #rrggbb before it reaches the page's styles. A public
GET /api/environment lets the sign-in page use it too.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 20:59:25 +02:00
bobbanandClaude Sonnet 5.5 44cc9d1cf2 Add address aliases for the Uptime Kuma maintenance sync, and ignore Kuma's "null"
Uptime Kuma often watches a host by another address than the one it was added
with here (a Proxmox host monitored over Tailscale, say). Address aliases on
the Maintenance page say that an address belongs to a server, integration or
DNS provider, so the sync puts the window there; matching stays exact.
Migration 0018 adds maintenance_aliases.

Also fixes monitors whose empty hostname/URL/port arrive from Kuma's metrics as
the text "null": they were taken as an address, hiding the real URL.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 20:25:57 +02:00
bobbanandClaude Sonnet 5.5 3e6404371b Match Uptime Kuma monitors to integrations and DNS providers as well as servers
A monitor whose address is the host of an integration's or DNS provider's own
address now gets a maintenance window there, alongside the existing match
against servers. Matching stays exact (no inference through DNS), and monitors
that match nothing are listed with their address in the sync result.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 00:13:04 +02:00
bobbanandClaude Sonnet 5.5 27a191b54c Show what Uptime Kuma reported for each maintenance window in the sync result
Each window in the "Sync schedule" result now lists how many monitors it
covers and the time slots Kuma sent for it, so an empty result can be traced
to missing monitors, missing slots or monitors that match no server.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 00:04:46 +02:00
bobbanandClaude Sonnet 5.5 9e483f2163 Mirror Uptime Kuma's maintenance schedule as maintenance windows
Uptime Kuma shares its maintenance windows only over its dashboard Socket.IO
connection, which takes a login. With a login username and password on the
integration, "Sync schedule" on the Maintenance page (and a 15-minute
background pass when switched on) reads each window's running and next time
slot and the monitors it covers, and makes a maintenance window on every
server those monitors match. Windows that haven't started are listed as
Scheduled and silence nothing until they begin; ones ended or cancelled by
hand stay ended, and ones removed in Kuma are removed here.

maintenance_windows gets a source column (migration 0017) and active windows
now require their start to have passed. Adds socket.io-client, and tests
against a stand-in Uptime Kuma speaking the same protocol.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 23:43:47 +02:00
bobbanandClaude Sonnet 5.5 5e416b0273 Make the Uptime Kuma maintenance import say what it found
The import route returned its errors as {error} while the page reads
{message}, so a wrong API key or an unreachable Uptime Kuma showed as raw
JSON. Every failure now carries a readable message. An empty result now
says how many monitors were read and that only maintenance active right
now can be imported, and a disabled integration is explained instead of
leaving a greyed-out button. Adds route tests against a stand-in Uptime Kuma.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 23:26:32 +02:00
bobbanandClaude Sonnet 5.5 3daec601fd Let a secret be marked as never expiring
The expiry date is now optional: no date means the secret never expires,
gets the status "no expiry" and never raises an alert or reminder. The
Secrets form has a "Never expires" checkbox. Certificates checked against a
host keep their live expiry and can't be set to never expire. Migration
0016 makes secrets.expiry_date nullable.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 01:44:40 +02:00
bobbanandClaude Sonnet 5.5 75f0a3d881 Add an "Open admin" button to the integration pages
Each integration page now has a button next to its title that opens the
product's own admin panel in a new tab, using the address entered on the
integration. Tailscale links to its admin console. Only http(s) addresses
become links.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 01:44:38 +02:00
bobbanandClaude Sonnet 5.5 51ad309e35 Document the backup and restore procedure in BACKUP.md
What to back up (the database file, and CREDENTIALS_ENCRYPTION_KEY kept apart from it), two ways to take a
backup (stop and copy, or a VACUUM INTO snapshot while the app runs, using only Node and the app's own database
library since the container has no sqlite3), checking a backup, taking one before every upgrade, keeping
backups safe, a nightly script with rotation, step-by-step restore (an older backup restores into a newer
version, not the reverse; what a wrong key looks like), and how the encrypted export in Settings -> Backup
differs from a real backup.

The commands were run against a scratch database made with the real migrations: a snapshot taken while the
app was writing, an older version's database upgrading itself when the current version started, the wrong-key
error, and the rotation line. They were not run through docker compose exec in the real container.

DATABASE.md pointed at SQLite's .backup command, which the container doesn't have; it now points here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-08 00:28:58 +02:00
bobbanandClaude Sonnet 5.5 c693600780 Say in INTEGRATIONS.md what has been checked against a real osTicket
The ticket API was first verified with a test ticket (key and IP restriction, creation, message text arriving
as written), then with a ticket opened for a real alert. A summary ticket (many problems at once) has not been
seen on a real osTicket yet. Also records the two mistakes the real osTicket showed that the stand-in server
had hidden: percent-encoded text, then base64.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-08 00:22:39 +02:00
bobbanandClaude Sonnet 5.5 5386c1abe7 Send the osTicket ticket text raw after the data: prefix, with no encoding
Percent-encoding put "%20" in every space of a real ticket, and the base64 that replaced it arrived
as base64. osTicket (Format::parseRfc2397, via ApiJsonDataParser::fixup) takes the message's type from the
"data:" prefix and uses everything after the first comma exactly as it is, decoding nothing; its own
documented example is plain text after the comma. The text is now sent raw (JSON takes care of quotes and
line breaks; later commas are fine, since only the first one splits).

The test now mimics that parsing -- split at the first comma, decode nothing -- and requires the text to
arrive exactly as written; it fails if percent-encoding or base64 comes back. The stand-in server in the
earlier test had decoded the encoding, which is why neither mistake was caught. INTEGRATIONS.md says what
happened and that it hasn't been re-checked against a real osTicket.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-08 00:11:27 +02:00
bobbanandClaude Sonnet 5.5 5072cee519 Send the osTicket ticket text as base64, not percent-encoded
A test ticket sent to a real osTicket arrived with every space shown as %20. osTicket takes the
message's type from an RFC 2397 data URL and strips the "data:" part, but leaves percent-encoded text
as it is. The message is now sent as base64 (data:text/plain;charset=utf-8;base64,...), which osTicket
decodes (it is how it takes attachments), and which works whether or not a given osTicket version
decodes percent-encoding.

The stand-in osTicket in the test had decoded the percent-encoding, which is why this wasn't caught:
the test now requires base64 and fails if any percent-encoding is in the message. INTEGRATIONS.md says
the ticket API is only partly verified against a real osTicket, and what that first test showed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-08 00:05:18 +02:00
bobbanandClaude Sonnet 5.5 aec553f122 Document alert tickets
README, INTEGRATIONS (the osTicket ticket API: fields, making the key, what is sent, what it can't do,
what wasn't verified), NOTIFICATIONS (the rules, in one table), ROLES, DATABASE (the new table, the
settings key, the internal flags, what deleting an integration does), and the Privacy page (the one new
thing that leaves the app: an alert's text, to your osTicket).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-07 23:41:47 +02:00
bobbanandClaude Sonnet 5.5 96c93ef924 Add the Alert tickets settings page, and show each alert's ticket on the Alerts page
Settings -> Alert tickets: switch it on, choose the osTicket integration (only ones with a ticket API
set up can be chosen), who the tickets come from, help topic and priority, which severities and kinds,
how long a problem must last, when many become one summary ticket, how long a return counts as the
same problem, and what to do about problems already there. Buttons to send a test ticket and to check
now, and a line saying what the last check did. Server messages (a missing integration, a refused key)
are shown as they are.

The Alerts page shows "Ticket #123" on an alert that has one, linking to it in osTicket, and a Ticket
column in the CSV export.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-07 23:41:46 +02:00
bobbanandClaude Sonnet 5.5 467d1a1a06 Open an osTicket ticket for an alert that lasts
With Settings -> Alert tickets switched on (off by default), every 15 minutes the problems on the
Alerts page are looked at and one that is new and has lasted gets one ticket in osTicket, through
its API (POST api/tickets.json, key in X-API-Key). One problem opens one ticket however many checks
see it; the app remembers what it has seen in a new alert_tickets table (migration 0015).

- Which: critical and warning by default, every kind; severities and kinds are settings.
- A problem must be seen in 2 checks in a row first (1-4, a setting), so a blip that fixes itself,
  like one failed call to an integration, never opens a ticket.
- One ticket per occurrence; a problem that clears and returns within 60 minutes is the same one.
- More than 5 new problems in one check become a single summary ticket.
- Never for alerts under a maintenance window, nor about osTicket itself or its overdue tickets.
- Problems already there when it is switched on are left alone by default (the first check records
  them as a baseline); can be set to ticket them too.
- If osTicket can't be reached nothing is recorded, so the next check retries; if a source couldn't
  be read, a problem isn't treated as gone. Every ticket is audited.

The ticket API address, key (stored encrypted) and self-signed option are optional fields on the
osTicket integration, which otherwise still only reads the database. The settings page can send a
test ticket and run a check now; the Alerts page shows each alert's ticket number, linked to osTicket.

osTicket's API can't close or update a ticket, so a ticket opened here is the end of this app's part
in it. Tested against a stand-in osTicket, not a real one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-07 23:41:44 +02:00
bobbanandClaude Sonnet 5.5 f71756b119 Fix editing and deleting DNS records from the cached list
The records endpoint returned raw cache rows, whose `id` is this app's own row number
(12, 13, ...). The DNS page sends `r.id` back when a record is edited or deleted, so the
provider was handed a row number instead of its record id. That only worked straight after
a manual Sync, whose response carries the provider's ids; after any save or delete the page
reloads from the cache and the problem came back. The ID check added for connected systems
now refuses such an id with "That isn't a valid record ID".

The list now returns records shaped like a sync's: `id` is the provider's record id. Editing
and deleting work from the cached list for every DNS provider.

The test checks the list hands out the provider's id, and that deleting with it reaches
Cloudflare at the right address; with the old shape it fails.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 23:45:06 +02:00
bobbanandClaude Sonnet 5.5 2dac273b1d Harden the login flow: new session at sign-in, signed ID tokens, same-origin requests, headers
From an audit of the Authentik login, run against a fake OIDC provider:

- Session fixation: the session id wasn't changed at sign-in, so one planted beforehand
  (from another page on the domain) became signed in as the victim. It is regenerated now.
- Requests from another origin: SameSite=Lax doesn't stop another app on the same parent
  domain, and a body-less POST (stop a guest, rotate a token) needs no preflight. Every
  POST/PUT/PATCH/DELETE, and GET /auth/logout, is refused when Sec-Fetch-Site (or, for older
  browsers, Origin) says it came from elsewhere. The agent endpoint is exempt: it uses a token.
- ID token signature: openid-client checks a token's claims but, as OIDC allows for a token
  from the token endpoint, not its signature, so the login rested on HTTPS to Authentik
  alone. The signature is now verified against the provider's published keys (jose, now a
  declared dependency).
- SESSION_SECRET: production refuses to start without one (the fallback is in the source
  code) and warns when it is the .env.example placeholder or short.
- Response headers: frame-ancestors 'none', X-Frame-Options, nosniff, Referrer-Policy; the
  framework name is no longer sent.
- A failed sign-in shows a plain page and is audited (session / login_failed, with address
  and reason, no tokens); sign-in is limited to 20 attempts a minute per address so the
  audit log and session store can't be flooded.
- A failed OIDC discovery (provider down at the first sign-in) was remembered until restart;
  it is retried now.

Tests run the real app against the fake provider; switching each fix off in turn makes
the matching tests fail.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 23:35:34 +02:00
bobbanandClaude Sonnet 5.5 73b86d88de Move the web application into createApp() so tests can run the real middleware order
index.ts builds the app, runs migrations and starts the schedulers in one go, so nothing
could exercise the app without also starting all that. The app itself (middleware order,
session store, routers) is now createApp() in app.ts; index.ts keeps the startup work and
calls it. No change in behaviour. The test that checks the agent endpoint is mounted ahead
of the 100 KB JSON parser reads app.ts instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 23:35:33 +02:00
bobbanandClaude Sonnet 5.5 5c70956f78 Linux agent unit: keep only the root powers it uses; make unit files readable
The systemd unit now bounds the agent's capabilities to the three jobs it does as root --
reading every user's crontab (DAC_OVERRIDE, DAC_READ_SEARCH), running "crontab -l -u"
(SETUID, SETGID) and naming the program behind each socket (SYS_PTRACE) -- and adds
ProtectClock, ProtectHostname, MemoryDenyWriteExecute and DevicePolicy=closed. It does not
use PrivateDevices, which would hide /dev/log (crontab logs each read there), nor anything
that hides other processes or users, since the agent needs both.

The installer's umask 077 (for the token file) also left the unit files readable by root only;
they now get chmod 644, so "systemctl cat" works for any user.

The test renders the unit through the installer's own heredoc, so a stray backtick or $ would
show up, and pins the capability list: tightening it silently drops tasks or process names.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 22:48:50 +02:00
bobbanandClaude Sonnet 5.5 b85e70344b Document the agent and outgoing-connection protections
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 22:05:19 +02:00
bobbanandClaude Sonnet 5.5 dbbe4180e0 Refuse loopback and metadata targets; check the agent's token before reading its report
Certificate check, WHOIS lookup and port scanner connect to hosts that are typed in
or named by a plain-text reply. utils/networkGuard.ts now refuses loopback, link-local
(cloud metadata) and similar addresses for all three -- and a WHOIS server on a private
network -- and the connection goes to the address that was checked rather than looking
the name up again (no DNS rebinding). LAN hosts remain fine for certificate checks and
scans.

Agent endpoint: the token is checked before the body is read, the route is mounted ahead
of the 100 KB JSON parser so a real agent can send a large report (up to 4 MB), and
overlong text is trimmed instead of costing the host its whole report. An oversized or
malformed body is answered with 413 / 400 instead of a generic 500.

Tests (npm test --workspace server): the guard, the secrets route, the agent endpoint, the
Linux upload run against a fake server (token never on curl's arguments, private temp dir
removed), the systemd unit's directives, and the Windows folder permissions read back by
SID. 19 of the 26 new tests fail against the previous code.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 22:05:18 +02:00
bobbanandClaude Sonnet 5.5 047fcb403e Harden the agents: keep the token off the command line, lock down their files
Linux: the token went to curl as an argument, readable by any local user in the process
list, and the reply was written to a fixed /tmp file that another user could replace with
a symlink (the agent runs as root). The token now goes to curl on stdin, and the payload
and reply live in a private mktemp directory that is removed afterwards. This also lifts
the limit on a report's size that a command-line argument imposed. The systemd unit now
runs with NoNewPrivileges, ProtectSystem=strict, PrivateTmp and similar restrictions
(it still sees every process, which is how it names the program behind a port).

Windows: the SYSTEM task's folder was left to inherit ProgramData's permissions. It now
gets explicit ones: SYSTEM and Administrators only.

Installed agents keep their own copy of the script, so each server needs the install
one-liner re-run to pick this up.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 22:05:17 +02:00
bobbanandClaude Sonnet 5.5 c95d31d2d8 Keep the Docker page's Stop button in view when an image name is very long
A container image pinned by digest (name@sha256:...) has no spaces to wrap at, so a
single one made the whole table wider than the page and pushed the Actions column
off the edge: Restart still fit, Stop did not, and the sideways scrollbar sat at the
bottom of a long list. The container, host and image cells can now wrap.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 21:22:08 +02:00
bobbanandClaude Sonnet 5.5 a641211484 Stop IDs in a request from being turned into other calls to connected systems
The Tailscale device, Proxmox node, Cloudflare zone/record and Azure record/zone IDs
were put into the outgoing request path as typed. An operator could send a crafted ID
("x/../../tailnet/-/keys/k1") and make the app call a different endpoint than the button
meant -- delete an auth key instead of a device, stop every guest on a node, delete a whole
DNS zone -- under the integration's own credential. Gitea and Dockhand encoded their IDs but
still passed "..".

- utils/pathSegment.ts: checks an ID against what a real one looks like, then encodes it
  (encodeURIComponent alone leaves ".." untouched). Used by the Tailscale, Proxmox,
  Cloudflare, Azure, Gitea and Dockhand adapters.
- The routes refuse a bad ID with a 400 before anything is sent, and the DNS routes turn the
  adapters' refusal into a 400. A server's Proxmox node name is validated when saved.
- Azure: a zone ID without "::" is now refused instead of being cut into two bogus pieces.
- Regression tests (npm test --workspace server, Node's built-in runner): the crafted IDs
  are refused for every adapter and route, real IDs still work, viewers are still refused.
  Against the old code 13 of the 22 tests fail.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 21:02:22 +02:00
bobbanandClaude Sonnet 5.5 fae7089448 Document the database schema in DATABASE.md
Every table, column, foreign key and unique index (checked against a database built
from the migrations), the JSON stored in text columns, the settings keys, delete
behaviour, retention and backups, and how to change the schema. Linked from the
README alongside the other documents.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 00:53:08 +02:00
bobbanandClaude Sonnet 5.5 f246410f24 Encrypt the notification channels' credentials at rest
The Gotify and ntfy tokens, the SMTP password and the webhook secret were stored
as plain text in the settings table. They are now encrypted with the same key as
integration credentials (CREDENTIALS_ENCRYPTION_KEY), marked with an "enc:v1:"
prefix. Settings are decrypted when read and encrypted when written, so nothing
else changes; values saved before this are converted at startup.

An edit that doesn't touch a credential keeps its stored ciphertext, so a wrong or
missing key (which reads as empty) can't be made permanent by an unrelated edit.
Without a key new credentials fall back to plain storage, and the startup warning,
.env.example and the Privacy page say so.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 00:53:07 +02:00
bobbanandClaude Sonnet 5.5 86dfa9ae2e Unlink servers before deleting a Proxmox integration
servers.proxmox_integration_id was created (migration 0001) without an ON DELETE
rule, although schema.ts asks for "set null", so with foreign keys on, deleting
an integration that a server was linked to failed with a constraint error.
The delete route now clears the four proxmox_* columns on those servers first
and records how many it unlinked in the audit entry. schema.ts notes the gap.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 00:53:06 +02:00
bobbanandClaude Sonnet 5.5 3035d7fc08 Make the Generator's server-name lists editable, add themes, import names from Skatteverket
Name lists now live in settings instead of the web bundle. Admins edit them under
Settings -> Names (add/remove names, create/rename/delete lists, reset a built-in
list). Names are folded to hostname-safe form (a-z, 0-9, hyphen) and validated on
the server; saves are audited.

Adds Swedish boy names, Pixar, Norse mythology and Astrid Lindgren lists, and
lengthens the Swedish girl and Disney lists. "Mixed" is now every list with each
name counted once.

Admins can preview and import the most common Swedish names from Skatteverket's
open "Namn pa nyfodda" data (girls or boys, latest 1-5 full years); nothing is
stored until the editor is saved. The old comment that credited SCB statistics is
gone: SCB stopped publishing name statistics after 2023.

Privacy page, README and ROLES updated for the new outbound call and page.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-03 01:53:31 +02:00
bobbanandClaude Sonnet 5.5 447f33fff6 Add an Alerts page under Operations listing everything that's wrong now
One list of the current problems across servers and integrations, instead
of waiting for a notification or visiting each page: servers that stopped
reporting, full or nearly full disks and volumes (critical from 95%),
Synology volume/disk problems, failed or uncovered Proxmox backups,
failed Proxmox Backup Server verifications, container image updates,
expired or expiring secrets/domains/Tailscale keys, failed Semaphore and
Gitea runs, Uptime Kuma monitors that are down, overdue osTicket tickets,
and integrations whose calls keep failing. Visible to every role, with
severity and kind filters, search, sorting, CSV export and "Check now".

It runs the same checks that send the notifications rather than a second
copy of them: the detection in the health, automation, Proxmox backup,
PBS, Docker update and Tailscale key checks is pulled out into shared
collectors that both the schedulers and the page call, so the two can't
disagree about what counts as a problem. Notification behaviour is
unchanged, including the scheduled backup checks skipping integrations
under a maintenance window. Unlike the notifications the page ignores the
on/off toggles, and keeps problems under a maintenance window, marked
silenced and counted apart.

It reads live, so a result is reused for a minute (and Refresh can't
re-run everything more than once every ten seconds), and every source has
a 20 s limit so one hung integration can't hang the page. Anything it
couldn't read is called out at the top instead of looking like all clear,
and server checks pause for the same 20 minutes after a restart as the
notifications do, with a note saying so.

Also gives the newer integrations (PBS, osTicket, Uptime Kuma, phpIPAM)
proper names in "integration down" notifications instead of their ids.

Verified through the real routes against a scratch database with fake
backends (offline and full-disk servers, secrets and domains, a silenced
server, a fake PBS with failed verification, a hanging integration, a
refused one, a failing-calls streak, caching, the restart grace period,
auth), and by rendering the real page against that data in a browser:
filters, search, silenced toggle, sorting, Check now, dark mode.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-02 23:07:57 +02:00
bobbanandClaude Sonnet 5.5 ad1fb5338f Replace the browser's confirm() and prompt() pop-ups with in-app dialogs
All 31 native dialogs (27 confirms, 4 text prompts: ignore reason, two
"exclude a range" boxes, tag rename) now use the app's own Tabler-styled
modals, which follow the light/dark theme.

A small promise-based API (utils/dialogs.ts: confirmDialog, promptDialog)
and a single DialogHost mounted once in App mean call sites just await
it in place of the browser call - no hooks or per-page modal state. Every
call site was already in an async function, so each is a one-line swap.

Each dialog now has a title and a main button that names the action
("Delete", "Stop now", "Run now") instead of "OK", with destructive ones
in red. Escape cancels, Enter confirms, Tab stays inside the dialog, the
page behind stops scrolling, and focus returns to the button that was
clicked. Destructive dialogs start with focus on Cancel so a stray Enter
can't delete anything. Text prompts pre-select their default and disable
the main button until something is typed where it's required, and still
tell cancelling (null) apart from confirming an empty box (""). Clicking
the backdrop cancels, but releasing a text selection over it doesn't.
Dialogs asked for together appear one after another.

Verified in a browser on a test page using the real component and the
app's real stylesheet: Escape, Enter, Tab trapping, focus handling,
required and optional prompts, backdrop clicks, queuing, scroll lock and
dark mode. The 31 call sites themselves were checked by search and
typecheck rather than clicked through in the logged-in app.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-02 23:07:43 +02:00
bobbanandClaude Sonnet 5.5 88d9c8e097 Record sign-ins, new accounts, automatic log trimming and what settings changed
A check of every write path found gaps in what the audit log captured:

- Sign-ins and sign-outs are now recorded with the IP they came from
  (sign-out is recorded first and can't block signing out).
- A new account is recorded when it's created on first sign-in, including
  when the very first user becomes admin - so the log shows who gained
  access, not only who changed things.
- The automatic log purge, which deletes audit entries, now records
  itself, attributed to "system". recordAudit() takes an optional actor
  for this. It only records when something was actually deleted.
- Settings updates record what changed (before and after) instead of only
  which sections were touched. The notification channels (Gotify, ntfy,
  SMTP, webhook) record field names only: they hold credentials, and
  webhook URLs and public ntfy topics act as secrets, while the audit log
  is readable by operators and Settings is admin-only.
- Integration edits record renames, enabling/disabling, whether
  credentials were replaced (never the credentials), and which settings
  fields changed (names only).

The Privacy page and README now say sign-ins store an IP in the audit log.

Verified through the real routes against a scratch database: user
creation, the logout route, the automatic purge, settings and
integration edits - including that a secret token and a webhook URL
appear nowhere in the stored entries. The sign-in callback itself needs
a real identity provider and wasn't run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-02 22:40:46 +02:00
bobbanandClaude Sonnet 5.5 22cfdbede0 Fix how the audit log displays entries; record admin-link and domain checks
Entries were stored in UTC without a zone marker and the Audit and
Diagnostic Log pages read them as local time, so every entry showed
shifted by the viewer's UTC offset (two hours early in Sweden). A shared
parseDbTimestamp() now reads them as UTC, and replaces the inline
workaround the Consistency page had.

The Audit Log never displayed an entry's details at all, so adding an
admin link showed only "server #1". Link entries now carry the server
name and the label/URL, and a new Details column shows them, along with
things like a port scan's address and range. Entries made within the
same second are now ordered by id instead of arbitrarily.

A domain's "Check now" was the one user-triggered action that wasn't
audited; it is now.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-02 22:40:35 +02:00
bobbanandClaude Sonnet 5 21054aaa8c Fill an admin link's URL from a server's own known ports
Both places you add an admin link - a server's own Admin Links section
and the Operations > Admin Links summary page - now offer a "fill from
a known port" dropdown once a server is picked, listing its
agent-reported and manually-noted ports (the same data the Ports
page/card shows). Picking one fills in the URL as
http(s)://<hostname-or-IP>:<port>, guessing https for a handful of
common admin-panel ports, and fills the label too if it's still empty.
The URL field stays fully editable either way.

Shared the address/label logic in a small adminLinkUrl.ts helper used
by both pages. No server-side changes needed - built entirely on the
existing per-server ports and detail endpoints.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-30 00:23:52 +02:00
bobbanandClaude Sonnet 5 1ff1c6550c Share the excluded-ranges filter with IP Addresses; add Admin Links page
IP Addresses (IPAM) now reads the same excluded-ranges setting the
Consistency page manages, so "not interesting" addresses - a Docker
bridge network repeating on every host, say - can be hidden there too.
Adds a "Hide excluded addresses" toggle (on by default, with a live
count), an inline ranges editor matching Consistency's, an "excluded"
badge on rows shown anyway, and a per-row "Exclude..." shortcut that
suggests a /24 (or /64 for IPv6) around that address. Editing ranges
from either page updates both, since it's one shared setting.

Also adds Operations > Admin Links: a single page summarizing every
admin bookmark added across all servers (Dockge, Webmin, Cockpit, etc,
previously only visible per-server on each server's own detail page),
sortable and searchable, with the same add/edit/delete capability -
adding one here just asks which server it belongs to.

Verified both with real HTTP-level tests: a genuine Express app, a
scratch SQLite DB, and forged sessions, covering the exclusion
matching, the shared-setting round trip, the links aggregation and
join, and role enforcement - the real dev DB was confirmed untouched
throughout. Both packages build clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-30 00:07:27 +02:00
bobbanandClaude Sonnet 5 236b1da0dc Add a Network > Ports page: agent-reported ports plus manual openings
Summarizes every server's agent-reported listening ports in one
cross-server table (grouped by protocol+port, addresses merged,
loopback-only flagged) - previously this only existed per-server on
each server's own detail page.

Adds a second table for ports this app has no way to see on its own:
manually-recorded openings on a router, edge firewall, or cloud
security group, each with a label, external port/protocol, an optional
link to a tracked server (with its own internal port when NAT changes
it) or a freeform destination, a free-text source, and a comment.
Viewer-readable; adding/editing/deleting needs operator or admin.

The agent-port grouping logic (dedupe by protocol+port, detect
loopback-only sockets) was shared with the existing per-server Ports
card via a new agentPorts.ts service instead of duplicating it.

Verified with a real HTTP-level test: a genuine Express app with the
actual routers, a scratch SQLite DB, and forged admin/viewer sessions,
covering grouping correctness, the server-name join, input validation,
and role enforcement - the real dev DB was confirmed untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 23:48:35 +02:00
bobbanandClaude Sonnet 5 4e48377348 Document every notification this app sends in NOTIFICATIONS.md
Covers all 16 notification types (daily reminders, state-based health/
automation alerts, real-time DNS and integration-down alerts, and the
quiet-hours digest), what triggers each, and what does and doesn't
respect quiet hours and maintenance windows. Every trigger condition
and threshold was cross-checked against the actual scheduler/monitor
code, not just the settings labels.

Also fixes the "Daily reminder time" hint text in NotificationSettings,
which had gone stale — it listed only 4 of the 6 checks that actually
share that schedule (missing domain expiry and PBS verification).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 23:48:19 +02:00
bobbanandClaude Sonnet 5 de5c39dddf Add an osTicket integration: list open tickets from its database
osTicket's own REST API only supports creating tickets, not listing or
reading them, so this reads osTicket's MySQL/MariaDB database directly
with a read-only user instead - the only integration in this app that
isn't a REST API. Joins the ticket, status, priority, department,
staff, team, and user tables, filtered to tickets in the "open" state
(status names are customizable per install, but that state flag isn't).

Surfaces per-ticket subject, priority, department, assignee, requester,
and osTicket's own overdue/awaiting-reply flags, plus a page at
/osticket and a Dashboard widget with open/overdue/awaiting-reply
counts.

Not verified against a live instance: unlike the HTTP-based
integrations, there was no way to fake a MySQL server to test against
in this environment, so the query is built from osTicket's published
schema but has never actually run against a real database. See
INTEGRATIONS.md for the read-only grant needed and further caveats.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 23:09:56 +02:00
bobbanandClaude Sonnet 5 69e9325927 Document role-based menu access in ROLES.md
Adds a reference table of which sidebar items each role (viewer,
operator, admin) can see, plus a summary of which in-page actions on
otherwise-visible pages are held back to operator/admin.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 20:41:26 +02:00
bobbanandClaude Sonnet 5 df2a5ce42b 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>
2026-09-29 20:32:52 +02:00
bobbanandClaude Sonnet 5 70ba60c7da Add a phpIPAM import to the IP Addresses page
New "Sync from phpIPAM" action on IP Addresses, alongside the existing
"Sync from Tailscale" / "Sync from Proxmox" ones and built the same way:
a new integration type (config in-app, URL + API app ID + app token,
credentials encrypted at rest) that this page pulls from on demand.
Deliberately import-only, not a full integration -- no dedicated page,
dashboard widget, or nav entry, since that's all this was asked for.

Auth is phpIPAM's static "App token" method: create an API app under
Administration -> API with its security set to "SSL with App token", and
its one-time code goes straight in as the `token` header (also sent as
`phpipam-token`, in case a given version expects that name instead) --
no login call, no token to renew. The user/password "User token" method
isn't implemented.

Addresses are read the standard way: GET /subnets/, then GET
/subnets/{id}/addresses/ for each, rather than assuming a single
"all addresses" endpoint exists on every version. phpIPAM wraps every
response as {code, success, data} -- including an empty result: a subnet
with nothing in it answers success:false, message:"No addresses found"
rather than success:true, data:[]. That's read as "nothing here", not a
failure; anything else with success:false throws with phpIPAM's own
message. One subnet failing outright (e.g. the app lacks permission on
it) is skipped with a note rather than aborting the whole sync. Every
address field is read defensively -- optional, independently
type-checked -- so a field phpIPAM renames or drops in some version
leaves that value blank instead of breaking the import.

Imported entries: label from hostname or description, "phpIPAM" as
vendor, the subnet's own description (or its CIDR, if it has none) as
location, and description/note/MAC folded into notes. Existing sync
plumbing (upsertSyncedEntry) gained a location parameter so this and any
future sync can set it; the two existing syncs pass null, unchanged.

Endpoints, the token header, and the address/subnet field names are
cross-checked against phpIPAM's own published API documentation. Not
verified against a live instance -- there wasn't one available while
building this, so if a real sync comes back empty or with the wrong
fields, that's the next thing to check.

Verified with 23 backend checks against a fake phpIPAM server matching
that documented shape (the empty-subnet quirk, a subnet that fails
outright, malformed/missing fields, a non-JSON response) and the real
route (added/updated/skipped counts, a manually-entered IP never
overwritten, roles, no-enabled-integration, upstream failure surfaced
per-integration rather than as a 500, audit entries) plus a browser check
of the real IP Addresses page against the real routers: the sync button,
its result message, re-syncing (updates rather than duplicates), the
manual entry staying untouched, and the viewer view.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 19:49:10 +02:00
bobbanandClaude Sonnet 5 bf7f73f6b6 Import maintenance windows from Uptime Kuma
New "Import from Uptime Kuma" action on the Maintenance page (operator):
pick an Uptime Kuma integration and a duration, and it starts (or
extends) a maintenance window here for every server whose address
matches a monitor Uptime Kuma currently reports as being in maintenance,
reusing the existing monitor-to-server matching from the Uptime Kuma
integration itself.

Uptime Kuma's metrics endpoint only exposes a monitor's *current* status,
not its scheduled start/end time (there's no API for that), so this
deliberately doesn't try to mirror Uptime Kuma's own schedule -- it starts
a window for the duration you choose, the same bounded/required-end
window this feature has always used. Running it again while Kuma is
still in maintenance extends the same window rather than stacking a
second one; when Kuma later shows nothing in maintenance, already-active
windows are left alone rather than force-ended, since ending them isn't
something only Uptime Kuma's state should decide. Two Kuma monitors that
match the same server are deduped to one window. Monitors with no
matching server are reported back by name so nothing is silently missed,
and monitors that aren't in maintenance are ignored entirely.

The manual "Start maintenance" endpoint's start-or-extend logic (dedupe,
pruning old rows, the response shape) is now a shared
services/maintenance.ts function instead of living only in that route
handler, so the import path can't drift from how a manual window behaves.
Likewise the server-matching helper gained a small toMatchableServers()
so the existing Uptime Kuma monitors route and this new one build the
same match input the same way instead of each parsing server rows on
their own.

No schema change -- imported windows are ordinary maintenance windows;
their Uptime-Kuma origin is only in the reason text ("Imported from
Uptime Kuma (<integration>): <monitor>"), visible in the Active table and
the audit log like any other window.

Verified with 28 backend checks (the refactored manual start/extend
flow as a regression check; roles; unknown/wrong-type/disabled
integration; validation; nothing-in-maintenance; matching including
same-server dedup and unmatched monitors; re-running extends rather than
duplicating; windows left alone once Kuma exits maintenance; upstream
failure; audit entries) and by driving the real Maintenance page against
the real routers in a browser: import, re-import (extends), the
nothing-in-maintenance state, and the viewer view (no edit card, active
windows still visible). Real dev database mtime untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 19:11:35 +02:00
bobbanandClaude Sonnet 5 26de6cb243 Move Uptime Kuma from Infrastructure to Operations in the sidebar
It watches over things rather than being a machine/platform itself,
closer in spirit to Maintenance than to Proxmox or Tailscale. Also
balances the two groups (6/2 -> 5/3).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 18:52:41 +02:00
bobbanandClaude Sonnet 5 1a2dd19736 Add an Uptime Kuma integration: monitor status and which server each one watches
New integration, following the existing pattern: config in-app (URL +
API key, credentials encrypted at rest), its own Uptime Kuma page, an
Integrations list entry, a Dashboard widget, and diagnostic-log/
integration-down-alert coverage for free via the shared withDiagLogging
wrapper. Read-only -- no start/stop equivalent exists for a monitor.

Uptime Kuma has no conventional REST API (the dashboard talks to it over
Socket.IO); researched before writing any code, since guessing wrong here
would have cost real time. The one machine-readable, authenticated
endpoint that lists every monitor is its Prometheus exporter at
GET /metrics, gated by HTTP Basic auth -- an API key as the password with
the username left blank on current installs, or the real dashboard
login on installs from before the API-key feature existed. This adapter
authenticates the same way and parses that endpoint's text-exposition
format itself (metrics: monitor_status, monitor_response_time,
monitor_cert_days_remaining, monitor_uptime_ratio; labels: monitor_id,
monitor_name, monitor_type, monitor_url, monitor_hostname, monitor_port),
verified against the documented metric/label set and the actual upstream
source (server/prometheus.js). A malformed line is skipped rather than
failing the whole scrape.

"What server is being monitored for what": each monitor's target (an IP
for TCP checks, or the hostname out of the URL for HTTP/keyword checks)
is matched against your servers' own IPs and hostnames -- reusing the
same kind of match already used in the consistency report -- and linked
to that server's page. Monitors with no single network target (groups,
push monitors, DNS/keyword checks with a complex URL) are left unmatched
rather than guessed at. Uptime Kuma's tags aren't read, since the
Prometheus endpoint doesn't reliably distinguish a tag label from any
other label it might add later.

The username field is the first genuinely optional integration config
field this app has had; IntegrationField gained an `optional` flag
(server validation and both the add/edit web forms honor it) rather than
special-casing Uptime Kuma.

Verified with 48 backend checks (Prometheus text parsing including
escaped quotes, decimals, negative numbers, and malformed lines; TCP vs.
HTTP target/port extraction; every documented status code; server
matching by IP, hostname, and short name, including no-match cases; the
route's real HTTP round trip against a fake Uptime Kuma server, wrong
credentials, upstream failures, roles, wrong/disabled/missing
integration, diagnostic-log entries; the optional-field validation rule)
and by driving the real page and the real Dashboard widget in a browser
against the real routers, including CSV export and column sorting. Real
dev database mtime untouched.

Not verified: a real Uptime Kuma instance. Everything here was checked
against Uptime Kuma's documented metric format, its actual upstream
source, and a fake server built to match both -- not against a live
installation. If your instance's /metrics output differs from what's
documented (older version, unusual monitor types), the parser should
degrade to an empty or partial monitor list rather than error, but that
degradation itself hasn't been observed against the real thing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 18:50:27 +02:00
bobbanandClaude Sonnet 5 ada2e648e9 Group the sidebar into collapsible submenus
The flat 22-item menu becomes 7 entries: Dashboard and Secrets as plain
links, and five groups.
- Infrastructure: Servers, Proxmox, Synology, Docker, Tailscale
- Network: DNS, Domains, IP Addresses, Consistency
- Automation: Semaphore, Gitea
- Operations: Maintenance, Generator
- Administration: Integrations, Users, Sessions, Audit Log, Diagnostic
  Log, Settings
Privacy moves to the sidebar footer beside the theme toggle and sign-out,
since it's about the person rather than the homelab.

Behaviour:
- Groups open on demand. The group holding the current page is always
  open (deep routes count: /servers/7 keeps Servers active), and its
  header stays emphasised even if you close it. Which groups you leave
  open is remembered in the browser, and the menu still works if storage
  is blocked.
- Role handling: pages a role can't use are dropped, an emptied group
  disappears, and a group reduced to a single page is drawn as that
  page's own link. A viewer therefore sees a plain Integrations link
  where an admin sees Administration, and an operator sees Administration
  with Integrations and Audit Log.
- Toggling a group on mobile keeps the menu open; choosing a page closes
  it, as before.
- Group headers are real buttons with aria-expanded.

Front end only: one component, plus a small CSS rule tightening submenu
rows so several open groups still fit on one screen. Routes, permissions
and backend are unchanged.

Verified in a browser with the real shell as admin, operator and viewer:
structure per role, open/close and aria state, active highlighting on
direct and deep routes, auto-open of the current page's group, state
surviving a reload, and the mobile toggler behaviour. Not done: the
attention dots on closed groups (deliberately held for a later step).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-27 03:00:22 +02:00
bobbanandClaude Sonnet 5 9229ea2ed6 Add a Domains widget to the dashboard
A Domains card completing the Overview row (DNS, Secrets, Servers,
Domains), shaped like the Secrets card: a status badge (N expired / N
expiring / All OK / No expiry dates / Not configured), tracked, expiring
and expired counts, an OK/expiring/expired/no-date bar, and details --
the expired domains and the soonest-expiring ones (first three, soonest
first), the next one to expire when everything is fine, and a note when
some domains couldn't be refreshed, linking to the Domains page.

Purely front end: the existing /api/domains already carries each domain's
status, days left and last-check error, computed against the warning
window from Settings. A registry that doesn't publish expiry dates (.de,
.eu) shows as "no date" and is not counted as a failed refresh; anything
else that stopped a refresh is.

Verified in a browser against the real domains router across four states:
problems (expired, several expiring, an undated one, a failed refresh),
all healthy, only undated domains, and none tracked. Web build only; no
backend or database changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-27 02:52:05 +02:00
bobbanandClaude Sonnet 5 91796a3c3a Add a Servers widget to the dashboard
A Servers card in the dashboard's Overview row, in the same shape as the
DNS and Secrets cards: a status badge (N offline / N disks nearly full /
All online / No agent data / Not configured), total, online and offline
counts, an online/offline/no-data bar, and the details that matter --
which servers are offline and for how long (the first three, linking to
their pages), which disks are at or above the usage threshold, and a
Linux/Windows split when there are Windows machines.

The numbers come from a new GET /api/servers/summary, computed on the
server with the health monitor's own evaluateHealth. That means "offline"
and "disk full" are decided by exactly the rules the alerts use, so the
widget can't say a server is fine while an alert says it isn't, and it
follows the thresholds set in Settings, which viewers can't read
themselves and so couldn't have applied client-side. Servers under a
maintenance window are marked as such. A server that has never reported
(no agent, or tracked only through Proxmox) counts as "no data" rather
than offline, an offline server's stale disk figure isn't reported, and a
garbled report doesn't blank the widget.

Readable by every signed-in user, like the dashboard itself.

Verified with 23 backend checks (offline/online/no-data classification
including the bare SQLite timestamp format, ordering, colons in Windows
mounts, threshold changes, maintenance flags, agreement with the alert
path's own offline and disk sets, empty and garbled inputs, and the route
as a viewer following Settings) and in a browser against the real router
across five states: problems, disks only, all healthy, no data, and empty.
Real dev database mtime untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-27 02:27:18 +02:00
bobbanandClaude Sonnet 5 fea20456e4 Add a Windows agent (PowerShell)
Reports a Windows machine the way the Linux agent does, replacing the
"planned" stub in agent/windows: scheduled tasks plus hostname, IPv4
addresses, CPU model/cores/current load, memory, every fixed disk, and
TCP/UDP listening ports with the owning process (which feed the Ports
card, localhost-only listeners included).

Scripts (plain ASCII by design -- they are downloaded as text and Windows
PowerShell 5.1 reads BOM-less files as ANSI):
- report-tasks.ps1: collects and POSTs to /api/agent/report. Works in
  Windows PowerShell 5.1 and PowerShell 7. -DryRun prints the JSON.
  Microsoft's own \Microsoft\ tasks (hundreds) are left out unless
  INCLUDE_MICROSOFT_TASKS is set. Triggers are turned into readable text
  ("Weekly on Mon, Wed at 03:00", "At logon", "..., repeating every 15 min").
  Self-signed certificates work via API_INSECURE on both PowerShell
  versions (they need different mechanisms).
- install.ps1: elevated only; downloads the agent to ProgramData, writes
  agent.json with permissions locked to SYSTEM and Administrators *before*
  the token goes in, and registers a SYSTEM scheduled task (every 15 min
  plus at startup with a 2 min delay). Reinstalling replaces the task.
- uninstall.ps1: removes the task and only the files the agent installed.

Server: accepts schedule_type "windows_task"; a server can be registered
as Windows (Add a server has an operating system choice); an agent's
reported os_type ("linux"/"windows", anything else ignored) corrects the
stored one. The Servers page shows the right install and uninstall
command for each OS (Windows PowerShell 5.1 one-liners, with a self-signed
variant and a note about PowerShell 7), and Windows tasks are labelled
"Windows scheduled tasks". The Linux commands are unchanged.

Verified on this Windows machine, in both PowerShell 5.1 and 7:
- Real dry runs found and fixed bugs before anything shipped: tasks and
  ports came out as one nested item (return , $out wrapped twice), integer
  keys in an ordered dictionary index by position (wrong weekday names),
  and generic "Trigger" labels.
- End to end against the real agent-report router: HTTP, self-signed HTTPS
  refused by default and accepted with API_INSECURE, wrong token gives a
  clear one-line error and exit 1, and Swedish letters plus a euro sign
  survive JSON -> UTF-8 -> HTTP -> SQLite.
- 35 checks on trigger/action/duration descriptions, 20 on the installer's
  building blocks (task parts built but not registered, credentials file
  content and ACL, download over HTTP and self-signed HTTPS), 18 on the
  server rules, and the generated one-liners run through PowerShell's
  parser. The documented one-liners were run through iex and stop at the
  administrator check without changing anything.
- Found that PowerShell 7 ignores the ServicePointManager certificate
  override, so the installer's own download now uses -SkipCertificateCheck
  there.

NOT verified: the elevated install itself. Registering a SYSTEM scheduled
task needs elevation and changes the machine, so it was not run: the task
registration, that the repeating trigger really runs indefinitely, and
the agent running as SYSTEM under Task Scheduler have not been exercised.
Windows 10 / Server 2016 or newer is assumed; older is untested.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-27 00:09:00 +02:00
bobbanandClaude Sonnet 5 ae64cb345c Manage server tags in Settings: pre-add tags, recolour, rename, delete
New Settings > Tags tab (admin) listing every tag -- ones servers use and
ones added ahead of time -- with how many servers carry each:
- Add a tag before anything uses it, optionally with a colour. Such tags
  are offered as one-click "Add:" chips (and datalist suggestions) when
  tagging a server, so the same word gets spelled the same way everywhere.
- Give any tag a colour of your choosing, in use or not, or reset it to the
  automatic one. Changes are drafted with Save/Cancel rather than saved as
  the picker drags. Colours show on the Servers page, its tag filter bar,
  the detail page and the editor, and update everywhere without a reload
  through one shared cached colour map.
- Rename a tag; every server that has it is rewritten. Renaming to a name
  that already exists merges the two after a confirmation naming what will
  happen; the target keeps its own colour unless it had none, and a server
  carrying both ends up with one.
- Delete a tag, which removes it from every server that has it, with a
  confirmation stating how many.

Tags still live on the servers (servers.tags); a new tag_definitions table
holds only what a server can't: existence before use, and a colour. A
defined tag stays listed until an admin deletes it, even with no servers.
Rename and delete change the servers and the catalogue in one transaction
so they can't disagree. Only servers that actually carry the tag are
rewritten and counted -- an earlier draft also counted servers whose tags
merely weren't in sorted order, which the tests caught.

Reading the list and colours is open to everyone signed in (needed to draw
tags anywhere); changing the catalogue is admin-only, while tagging a
server stays an operator action. Names go through the same normalisation
as before, colours must be #rrggbb, and every change is audit-logged.

New table tag_definitions (migration 0013).

Verified with 44 backend checks (list/counts, roles, create/adopt/
duplicate/rejects, colour set/reset, rename incl. defined, undefined and
unused tags, merge colour rules and both-sides servers, delete, audit, and
that normal tagging still works afterwards) and in a browser against the
real routers: add with colour, set/reset a colour and see it change on the
Servers page live, merge with confirmation, delete, and the error path.
Not clicked through: the quick-add chips inside the tag editor on a
server's detail page (typechecked; same colour code as the rest).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 21:17:09 +02:00