Skip to content

v1.8.0

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Nov 09:54
· 5 commits to main since this release
9d40d5a

An answer about a server could describe the wrong machine, come back in another shape, or not come back at all, and answering n to trust --reset left a server with no host key, so the next connection trusted whatever answered; an answer now describes the machine it names or says why it cannot, comes in the shape it has for this machine, and --reset keeps the old key until the new one is accepted.

Four things to check before upgrading. On the container image, a local: true server is refused wherever its readings would have been the container's: the dashboard routes that read this machine answer 501, and --all and --server exit 1 for status, alerts, ports, processes, report, doctor and network scan, so a Homepage widget pointed at /api/report or a cron job running status --all over such a config gets an error where it got the container's numbers. A script that read a server's answer in its remote shape gets the local one: open_ports with a server and /api/ports?server=<name> answer {"ports": […]}, /api/processes?server=<name> answers the bare list, and watch add, watch remove and a watch check with nothing to check print JSON under --json. watch_add with a unit fails against a server on 1.7.0 or older instead of watching the wrong name, so upgrade the servers or leave unit out. And under --server, a command that printed its result and then failed, such as backup drill or doctor --strict, now prints that result on stdout before it exits 1, and the server's stderr goes to stderr instead of into stdout; over MCP, backup_drill and notify_test answer with the failed result instead of an error. The trust fix needs only the machine trust runs on upgraded, and a @cert-authority line that holds a server's old key is still neither removed nor reported.

⚠️ Behavior changes

  • Inside a container, every dashboard route that reads this machine refuses as GET /api/status does (#400). GET /api/servers/<name>/status for a server marked local: true answered 200 with the container's own CPU, memory and disks as that server's, while /api/status refused the same reading. /api/processes, /api/alerts, /api/ports, GET /api/report, POST /api/report/snapshot and /api/doctor, with no server or with one marked local: true, did the same, and report and doctor put the server's name on them. Each now answers 501 with {"error":"homebutler is running in a container, which cannot see the machine it is on. …"}, the body /api/status gives. A Homepage widget or script pointed at /api/report on the container image gets that error instead of a report about the container; point it at ?server=<name> for a server reached over SSH, which works as before. The docker routes, which reach whatever daemon the mounted socket leads to, are unchanged. Nothing changes outside a container
  • The dashboard opens on a server it can read, and the Report tab follows the server picker (#400). In the image, a config with only SSH servers left the picker empty, so the Dashboard tab showed the refusal in four cards, and the Report tab asked about the container and showed nothing but the refusal, Doctor and Save a snapshot included. The dashboard now opens on the local server when it can be read and otherwise on the first one that can; a local: true server in the image is still listed, as (local, not visible from this container). The picker shows on the Report tab too, and the report, the doctor findings and Save a snapshot are for the server it names, so saving from the Report tab with an SSH server picked saves the snapshot on that server. A report or doctor reading that fails is shown in its own section and the rest of the tab stays. GET /api/servers gives each server a visible field, false only for a local: true server inside a container
  • Inside a container, --all and --server refuse a local: true server for status, alerts, ports, processes, report, doctor and network scan (#400). status --all printed the container's readings on that server's line and status --server <name> printed them as its own. The --all line is now ❌ with the same sentence, and so the run exits 1 as any failed server does; --server exits 1 with it. The SSH servers in the same run are still asked. docker list, docker stats and backup list are unchanged, and so is a command run with neither flag
  • /api/processes?server=<name> and /api/ports?server=<name> answer in the shape the same route gives for this machine (#402, #403). /api/processes for an SSH server was processes --json's {"processes": […], "total": n} where the local route is the list on its own, and /api/ports for one was ports --json's bare list where the local route is {"ports": […]}. A script that read either the remote way gets the local shape now, and a remote answer in neither shape is a 502 rather than passed on. processes --json and ports --json are unchanged, and so are both routes for this machine
  • The MCP tool open_ports answers {"ports": […]} when given a server, as it does without one (#403). For a server it passed on ports --json's bare list, in every release since the MCP server was added, while the answer docs/compatibility.md freezes for the tool is ports.Result. This is a fix toward that documented contract: a client that read the bare list for a server gets the object now, the same one it gets for this machine. The MCP tool processes, given a server running a homebutler older than 0.12.0, which printed the list without a total, refuses it with a request to upgrade instead of passing it on in another shape; the dashboard's /api/processes?server=<name> still reads that list
  • watch add --json and watch remove --json print {"container", "kind", "added"} and {"container", "removed"}, and watch check --json prints {"checked": 0} when nothing is watched (#403). Each printed a sentence even under --json. A script that matched on that sentence under --json gets JSON now; without --json the sentences are unchanged
  • The MCP tool watch_add with a unit, pointed at a server on 1.7.0 or older, fails instead of adding the target under the wrong name (#404). The unit is now sent as watch add --unit, which those releases do not have, so the server refuses the flag before touching its watch list and the error names the server's version and the flag it lacks. Upgrade the server, or leave unit out, which works as before against any release. backup_create with exclude does the same against a server older than 0.40.0, where it archived the paths it was told to leave out
  • watch add and the MCP tool watch_add refuse a name or unit that starts with -, and watch_add without a server refuses the names watch add already did (#404). Both are passed to docker, systemctl, journalctl and pm2 as an argument, where a leading - is an option: a unit of --help became systemctl restart --help, which exits 0 and was counted as a restart. watch_add for this machine stored any container and unit it was given, spaces, slashes and ; included, while the same call naming a server was refused there; it now refuses them with invalid name or invalid unit, as watch add does. Only adding is checked: a target already on a watch list keeps working, and watch remove still takes it off
  • The MCP tools backup_drill and notify_test given a server answer with the DrillResult or the per-channel results when a drill fails or a channel does not send, as they do without one (#405). The server's command exits 1 in both cases, and that made the call an error whose message had the JSON pasted into it, so an agent was told the call failed instead of which step broke or which channel. An agent that took that error to mean the drill failed should read passed, or each sent, as it already does for this machine. A failing exit is an answer only for these two tools, and only when the document says the same failure; anything else, a connection that failed, a missing binary, output that is not JSON, stays an error with the server's stderr in it
  • --server passes on what the command printed before it failed, and keeps the server's stderr on stderr (#405). backup drill <app> --server <name> --json, notify test and doctor --strict printed nothing on stdout when the result was a failure, and exited 1 with the result inside a remote command failed … homebutler deploy message. They now print the result and exit 1 with the server's own sentence, such as [rpi5] vaultwarden did not come back from the backup, as running the command there does, with any warning it printed before that sentence on its own line above it; a server that printed its answer and no sentence exits 1 with [rpi5] exited with status N. What a server printed on stderr beside a successful answer, such as a deprecation warning, used to be printed into stdout ahead of the JSON; it now goes to stderr

🔐 Security

  • trust <server> --reset deleted the server's known_hosts entry before it showed the new fingerprint, so answering n left no key at all (#401). --reset is what the host-key-changed error tells you to run, and answering no is how you say the new fingerprint is not the one you expected; the next key-authenticated connection then found nothing recorded and trusted whatever answered, which is exactly what the old key was there to stop. A host that could not be reached lost its entry the same way. The old entries are now replaced only after a y, in one write that swaps the file whole; answering n, giving no answer, pressing Ctrl-C at the prompt, or failing to connect leaves known_hosts byte for byte as it was. The prompt under --reset now says it will replace the keys, and the command reports host key for <server> replaced in known_hosts. There is no non-interactive way to reset trust: trust has no --yes, and neither MCP nor the dashboard exposes it
  • trust <server> --reset said replaced while the old key was still trusted beside the new one (#401). Only entries written exactly as host or [host]:port were removed, so the hashed names OpenSSH records by default on Debian and Ubuntu (|1|…, from HashKnownHosts yes) and [host]:22 kept the old key, and a connection went on accepting either. Those are now removed too, matched the way a connection matches them. A wildcard line such as 192.168.0.* ssh-ed25519 … that still accepts the old key is someone's own rule for many hosts, so it is left as it was: the new key is recorded, and the command names the line and exits 1 instead of reporting the key replaced. @revoked lines are never removed. A @cert-authority line that holds the server's old host key is neither rewritten nor detected: it goes on accepting that key, and the command still reports it replaced. A known_hosts with a line that cannot be parsed is left as it was, and the error names the file and the line. A known_hosts that is a symlink to a file that does not exist yet is written through to where it points, where it was replaced by a regular file; if the directory it points into is missing, or the chain is longer than 40 links, the command fails and leaves the link alone

🐛 Fixes

  • the dashboard's Top Processes card showed only its header for an SSH server, and its Network Ports card showed nothing for this machine, not even "No open ports detected" (#402). Each card read one shape and its route answered the other for one kind of server, which the demo did not, so nothing caught it. The ports card has been blank for this machine since 0.11.2
  • the MCP tools watch_add and watch_remove failed with invalid JSON from remote for every server, after the remote had already changed its watch list, and watch_check failed the same way for a server watching nothing (#403). The remote's --json printed a sentence. They now answer as they do locally, from a remote on this release or on an older one, whose sentences are read as the outcome they report
  • the MCP tools watch_add and backup_create, given a server, dropped unit and exclude and reported success (#404). A systemd unit or PM2 app added as web with unit: nginx.service was watched as web, a unit that is not there, and a backup told to leave out /mnt/media archived it. Both are now sent, and watch add takes the unit as --unit, which it did not have. Every other argument of the 26 tools that take a server already reached it, and a test now fails for an argument that does not, unless it is marked local-only with a reason. An exclude path with a comma in it arrives as one path
  • a server's stderr was read as part of its answer, so a warning printed beside the JSON broke it (#405). A server that still had ~/.homebutler/alerts.yaml made notify_test fail with invalid JSON from remote, after the test message had gone out, and a drill whose record could not be saved did the same to backup_drill. The MCP server, the dashboard, --all and the TUI now read only stdout as the answer, and stderr is still in the error when the command fails

📚 Documentation

  • docs/docker.md lists the dashboard routes and the --all and --server commands that refuse a local: true server inside a container, and says the image's dashboard opens on a server it can read; docs/web-dashboard.md says the Report tab and Save a snapshot are for the server picked in the header (#400)
  • the README shows watch add --kind systemd web --unit nginx.service, a target listed under one name and checked under another (#404)