No description
  • C 91.1%
  • Shell 5.2%
  • CSS 1.7%
  • JavaScript 0.8%
  • Python 0.7%
  • Other 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Brian fcb87a2cd8
All checks were successful
Build and Deploy / test (push) Successful in 28s
Build and Deploy / build (push) Successful in 17s
Build and Deploy / deploy (push) Successful in 3s
Show CPU and graphics cards in host details
The collector reports the CPU model, thread count and each display
adapter from lspci; the dashboard shows them under Kernel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eq42w9YsCgzUXRJSqYxyVA
2026-11-12 11:20:45 -07:00
.forgejo/workflows Remove the Python version 2026-10-02 10:00:38 -06:00
c Show CPU and graphics cards in host details 2026-11-12 11:20:45 -07:00
.gitignore Remove the Python version 2026-10-02 10:00:38 -06:00
docker-compose.portainer.yml Remove the Python version 2026-10-02 10:00:38 -06:00
README.md Run package upgrades with sudo on the package manager, not on sh 2026-11-11 17:04:13 -07:00

UpdateMonitor

One page that tells you what in the homelab needs attention:

  • Software & services: Proxmox VE, TrueNAS (system and apps), OPNsense, Pi-hole, Docker container images, and any app with GitHub releases (Caddy, Pterodactyl panel/wings, Tailscale, …). It shows how many releases behind each one is, plus major-version upgrades.
  • Servers: whether each host is up, pending OS and security updates, reboot required, disk and memory pressure, OS end-of-life. For Proxmox it also shows each VM/LXC's memory and disk against its own limits, and storage usage. For TrueNAS it shows pool health and capacity plus TrueNAS's own alerts.
  • End-user computers: OS and Flatpak/Snap updates and EOL. Being asleep or offline isn't treated as a problem; the page shows the last known state.

EOL dates come from endoflife.date. All times are stored in UTC and shown in your browser's timezone.

It's a single C binary with an embedded web server and scheduler; the code is in c/.

Run it

cd c && docker compose up -d --build

Open http://<docker-host>:8090 (set UM_PORT to change it), create the admin account, then:

  1. SSH keys: generate a key and add its public key to authorized_keys on your hosts.
  2. Hosts: add servers and desktops (see below for which collection method to use).
  3. Services: add Proxmox, TrueNAS, OPNsense, Pi-hole and apps.
  4. Settings: set thresholds, intervals, an optional GitHub token, and the public URL.

All configuration lives in the database and is edited in the GUI; there are no environment variables to set. The /data volume holds the SQLite database, the encrypted secrets, and secret.key, which decrypts them. Back up the whole volume together; the database is useless without the key.

Run a single process only (the default). The scheduler runs inside the web process.

Collecting from Linux machines

Method Use it for How
SSH Servers, VMs The monitor logs in and pipes a read-only POSIX sh script (c/assets/collect.sh) to sh -s. Nothing is installed on the host.
pct Proxmox LXCs Add the Proxmox node as an SSH host (as root), open it, and click Discover Proxmox LXCs. Each container is then collected with pct exec, with no SSH or keys inside the containers.
Push agent Desktops/laptops that sleep Installs the same script plus a systemd timer that reports hourly, 2 minutes after boot and 30 seconds after resume, and a listener that lets the dashboard's Update button reach it while it's awake. The install command is shown when you create the host. Agents update themselves when the monitor's agent changes (see Security notes).
Reachability only Anything else Ping, falling back to a TCP connect.

For SSH, the host key is pinned on first connect. If a host is reinstalled, use Reset pinned host key on its page.

Least privilege: root is not required (except on Proxmox nodes used for pct). With an unprivileged monitor user everything is read-only. Refreshing stale apt lists and reading Docker need either root or a narrow sudoers rule; the SSH keys page shows an example. Without either, apt data is only as fresh as the host's own daily refresh (unattended-upgrades does this by default).

Package managers supported: apt, dnf/dnf5, pacman, zypper and apk, plus Flatpak, Snap, and reboot-required detection.

When a sleeping SSH desktop wakes up, the ping job notices and collects from it right away.

Services

Proxmox VE: Datacenter → Permissions → API Tokens → create a token (e.g. monitor@pve!updatemonitor) and give it the PVEAuditor role on /. Proxmox only lists pending node updates to tokens with Sys.Modify on /nodes/<node>; without it, versions and resources still work but pending updates show as unreadable. For VM disk usage, run qemu-guest-agent in the VMs. LXC disk usage is always available.

TrueNAS: create an API key (user menu → API Keys). Use an https:// URL: TrueNAS revokes keys that are sent over plain HTTP. On 25.04+ it uses the JSON-RPC websocket API and falls back to REST on older versions.

OPNsense: System → Access → Users: create a user with the System: Firmware privilege and generate an API key. Each check triggers a firmware check, just like clicking "Check for updates".

Pi-hole: v6 needs the web password or an app password (and logs out afterwards so it doesn't use up sessions). v5 needs the API token. Core, Web, FTL and the Docker tag are compared against GitHub to count how many releases behind each is.

Home Assistant: a long-lived access token (Profile → Security; a non-admin user is enough). Reads every update.* entity: Core, OS and Supervisor get their own findings, while add-ons, HACS and device firmware are grouped into one. Updates skipped in Home Assistant's UI are respected. Container installs have no Core update entity, so the running version is compared with GitHub releases instead.

App (GitHub releases): repo plus a way to read the installed version: a command on an SSH/pct host, a URL plus regex, or a version you enter by hand. There are presets for Caddy, Pterodactyl panel and wings, Pelican panel and wings, Tailscale and Jellyfin. Add a GitHub token in Settings if you track many apps (60 → 5000 requests/hour).

Docker images: tick Check Docker containers on a host. Each running container's image digest is compared with the registry (Docker Hub, ghcr.io, lscr.io, private registries). Images pinned by digest and locally built images are skipped.

Severity

  • Critical: server down, OS/product past EOL, disk or memory past the critical threshold, degraded pool.
  • Warning: security updates, app/firmware updates, reboot required, approaching EOL, past the warning threshold, newer container images (configurable).
  • Info: regular package updates (escalated to warning if left for 14 days), a newer OS release available, desktops not seen for a while.

The attention list at the top shows criticals and warnings. Snooze 7d hides an item until it gets worse.

Update buttons

Logged-in users get an Update button on findings the monitor can fix itself. It asks for confirmation, runs in the background, then re-checks the source; a failure shows under the finding.

Finding What runs Needs
TrueNAS app upgrade app.upgrade (latest version) TrueNAS 25.04+, an API key whose user has app write access (e.g. APPS_WRITE)
TrueNAS rebuilt image app.pull_images with redeploy same
Home Assistant Core / OS / Supervisor, and the grouped "other updates" update.install for each pending entity a token from an admin user
OPNsense minor update System → Firmware → Update (major upgrades stay manual) the existing System: Firmware privilege. The firewall may reboot.
Package updates on SSH/pct hosts a non-interactive apt-get upgrade --with-new-pkgs, dnf upgrade, pacman -Syu, zypper update or apk upgrade root, or passwordless sudo for the package manager itself (e.g. monitor ALL=(root) NOPASSWD: /usr/bin/apt-get, plus Defaults:monitor env_keep += "DEBIAN_FRONTEND" for apt; the SSH keys page shows it). Not offered on Nobara or image-based systems.
Newer container image on SSH/pct hosts docker compose pull + up -d --no-deps for that container's service a container started with compose, with its compose files on that host (not a Portainer stack). They're looked for in the directory the container was started from, then in the host's Compose directory setting (<dir>/<project>, then <dir>)
Package, Flatpak, Snap or OS image updates on push-agent hosts that are online the agent's own update script: the package manager's upgrade (as above; skipped on Nobara), rpm-ostree upgrade on image-based systems (applies at the next reboot), flatpak update (system and each user's), snap refresh. Sleep is held off while it runs. The computer is never restarted an agent installed with systemd, from this version or later (older agents get the listener when they next update themselves)

Push agents can't be reached directly, so each one keeps a request open to the monitor (updatemonitor-agent-listen.service); the dashboard marks those agents online, and only they get the button. A section with any online agents that have updates also gets Update N online computers, which tells all of them at once. The update itself runs in updatemonitor-agent-update.service (see journalctl -u updatemonitor-agent-update on the machine), sends a fresh report, then reports success or the tail of its output back. A computer that sleeps mid-update finishes when it wakes; the dashboard says so.

Security notes

  • Secrets (SSH private keys, API tokens, passwords) are Fernet-encrypted in SQLite; secret.key lives beside the database, not in env vars.
  • The session cookie is SameSite=Strict, which blocks cross-site form posts. Put the monitor behind your reverse proxy with TLS if it's reachable beyond your LAN.
  • Agent tokens are stored hashed. When a new monitor version changes the agent scripts, each agent sees the new version in the reply to its next report, then downloads the installer and re-runs it as root. Downloads are signed with that host's token, so over plain HTTP someone on the network can't swap in their own code. Anyone who controls the monitor can, though. To stop this, turn off Push agents update themselves in Settings. Agents installed before auto-update existed need the installer re-run once; the dashboard flags them and shows the command.
  • The monitor holds SSH keys to your machines. Treat it like any other admin box. With the Update buttons, any logged-in user can run package upgrades and redeploy apps on them, and tell push agents to install their updates. Agents only accept that one command, and run their own installed script for it; the monitor never sends them a command line.

Deployment (Portainer)

Pushes to main run .forgejo/workflows/build-deploy.yml: the tests, then build c/ and push git.thenymans.com/brian/updatemonitor:latest (and :<sha>), then redeploy the Portainer stack named updatemonitor from docker-compose.portainer.yml. To roll back, redeploy an earlier :<sha> image.

One-time setup: create the stack in Portainer from docker-compose.portainer.yml (named updatemonitor), and set the repo's Actions secrets REGISTRY_USER, REGISTRY_PASSWORD and PORTAINER_TOKEN. The published port defaults to 8092; override it with a UM_PORT variable on the stack.

Backup and moving to another instance

Backup in the admin menu exports everything (users, hosts, services, SSH/API keys, settings, history, and the key that decrypts stored secrets) as one file encrypted with a passphrase you choose. Restoring it on another instance replaces all of that instance's data and restarts the app to apply it (under Docker's restart policy); the replaced files are kept in pre-restore-<time>/ in the data volume.

Development

See c/README.md for building, running and testing.