Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 11 Sep 16:11
· 41 commits to master since this release
v0.3.0
4153f56

Added

  • doctor now opens the newest archive with the --identity key on hand and says whether it still opens. An archive encrypted to a key nobody has any more was reported as a working backup. One sealed with a passphrase is judged from its header and never opened, because a health check that prompts is one people stop running.
  • --identity-passphrase-file, RAD_BACKUP_IDENTITY_PASSPHRASE_FILE and RAD_BACKUP_IDENTITY_PASSPHRASE, so an unattended run can open an archive encrypted to an ssh key that has a passphrase on it. It is a different secret from the archive's own passphrase, and --help says which is which.
  • A --recipient run now names the key the archive will need to be opened. Until now only the note beside the archive said so, and that note is read in the middle of a recovery.

Changed

  • restore now asks other nodes what they hold of your signed refs, instead of reading back the refs it had just written. Every restore used to report every repository "in step with the network", which is the one answer that means safe to write, because a fetch over a repository already in storage ignores your own key: the archive was being compared with itself. It now fetches, waits twenty seconds for other nodes to answer, and reports another node holds signed refs this copy does not have at exit 3.

  • A restore that meant to compare and could not, now exits 3 instead of 0. No rad on PATH, a node that would not start and a fetch that did not work all leave the fork hazard unexamined, and a scheduled restore reporting success over that was the last anyone heard of it. The home is fully restored either way: 3 says the fork check did not run, not that anything is missing. --no-reconcile still exits 0, because a check you declined is not a check that failed.

  • restore's verdicts and --json fields changed with that comparison, so anything matching on them needs updating:

    Was Is now
    in step with the network no other node has reported holding anything else
    diverged from the network another node holds signed refs this copy does not have
    holds work the network has not seen holds work no node that answered has, or holds work no node had when the archive was taken
    the network was ahead, and has been taken gone: a pull cannot establish it
    not checked could not be compared, or nothing to compare it with
    "diverged", the list "atRisk"
    "notChecked", a count "notChecked", the list of repositories it used to count
    new: "ahead", "aheadOfAStaleRecord", "nothingToCompare"
  • restore now compares repositories it used to skip: any repository you first wrote in after the backup was taken, and a private one another delegate or an allowed peer can hold. Only a repository announced to nobody, delegated to you alone and allowed to nobody is left uncompared. The report names up to five of those and --json carries them all.

  • doctor exits 3 when every check came back "could not be checked", instead of 0. A run with no rad, no readable node database and no archive to open established nothing, and the exit code a monitoring probe reads called that clean. A report mixing "could not be checked" with real answers still exits 0.

  • doctor --backup-dir is now doctor --dir, matching ls and prune, and the checks look in it rather than only naming it in a remedy. --backup-dir keeps working and is not going away.

  • rad backup man at a terminal now exits 1 with the ways to read the manual, instead of printing the man page file's markup, which is unreadable there. Redirected to a file or a pipe, it still prints the page.

  • --help now puts the options that work with every command, such as --home and --json, under a heading of their own, Global options.

Fixed

  • A restore into a home that holds repositories but no key now refuses (exit 4) instead of going ahead. A home counted as empty when its key had been retired by an earlier move, deleted, or merely could not be read, and the restore then rewound every repository's refs, other peers' namespaces included. --force still overwrites, and names what it is about to write over.
  • A home whose keys directory could not be listed all the way through is no longer read as one holding no key an earlier move retired, which is the answer that let a restore go ahead over somebody's displaced key.
  • restore no longer says your peer history has forked because git could not answer. An object git cannot read produced the same verdict as a real divergence, which is the most alarming thing this tool says. Such a repository is reported as uncompared now, and a comparison that fails no longer costs the list of which repositories did not come back at all.
  • A passphrase-protected ssh key now opens an archive encrypted to it. No prompt appeared and the run said the key did not open the archive, which is false and is the worst thing to tell somebody mid-recovery. A key of a type age does not support, such as an ecdsa key sitting next to the right ed25519 one, is now named and skipped rather than ending the run.
  • Whether a node is running is answered from the socket rad itself would use, and a socket that could not be asked is no longer read as a stopped node. RAD_SOCKET was ignored, so a node started under it was invisible, and a permission error answered "stopped" about a node that was up. restore and move refuse rather than guess, and a backup that cannot tell says so in the archive.
  • A relative --output is recorded as the path it resolves to, not as it was typed. rad backup --output backups/nightly.tar.zst left doctor, ls and diff looking for it under whatever directory they were run from, and reporting the archive missing.
  • doctor judges the newest archive by looking at it, rather than by its own record of the last run. Machines with working nightly backups were told "no archive has ever been taken for this identity", because the timer runs as another user or the home came back through restore.sh, and an archive written with --plaintext was called encrypted.
  • schedule --status recognises a timer that systemd reports as enabled-runtime. It was compared against the exact word enabled, so the owner of a live timer was told no backup was scheduled on the machine.
  • ls reads whether an archive is encrypted from the file rather than from its name. rad backup --stdout > name.tar.zst writes an encrypted archive under a name that says otherwise, and the listing told its owner it could be read by anyone. An archive whose first bytes could not be read says so, and ls --json can report "encrypted": null.
  • rad backup no longer fails outright when heartwood renames a table in the node database. Two of its three readers aborted the run with an sqlite error; every reader answers "not known" now and names the table that has moved on, in the run's output and in the archive's warnings.
  • A node database that will not open no longer ends the whole doctor report before a single check has printed. The three checks that read it say so and name the error, and none of them turns a file it could not open into a finding: private repositories used to be the one that could, calling a repository "on no other node" off a routing table nobody had read.
  • doctor no longer sends you to start a node that is already running when the node database is there and will not open, or holds a table this build cannot read. Both arrived at the check as the same empty answer as a node that has never run.
  • doctor's key copies check no longer passes a home it knows nothing about. sudo rad-backup restore writes its record into root's state directory and restore.sh writes none at all, so the two people most likely to be holding a second copy of their key were the ones told they were not.
  • doctor no longer tells you to rad sync --announce repositories that may be private. With no rad on PATH nothing looks private, and two checks counted every undescribed repository as public; both say when they could not describe them all now.
  • doctor no longer reports a private repository somebody else delegates as being in no archive and on no other node. A second delegate holds it by definition.
  • doctor's private repositories check says that it is going by this tool's own record of the last run. It printed "all N of them are in the newest archive" as a pass in the same report whose freshness line said that archive was missing.
  • doctor no longer reports work as stranded on this disk because the node's own record spells a commit id in uppercase.
  • A state file that is there and cannot be read is no longer reported as one that was never written, and a permission error on it no longer ends the whole doctor report.
  • A restore no longer reports seeding and following policies an identity-tier archive never carried. The numbers came from the manifest rather than from the database that was installed, and the next diff blamed the difference as drift.
  • restore --replay-policies on a machine without rad now refuses before anything is written. It used to exit 4, the code that means nothing was written, over a home it had already rewritten, and skip the record of where the home came from on the way out.
  • A restore that cannot tell whether a node is running because the home's path is too long now says which path it is, how long a control socket may be, and what to do about it. It printed path must be shorter than SUN_LEN and stopped, naming none of the three. On macOS the system temp directory alone spends half the budget, so a home a couple of directories deeper than usual runs out of it.
  • A repository whose packed-refs cannot be read is named in the run's output rather than passed over as somebody else's. With rad also unavailable, --repos mine wrote an archive missing it and said nothing.
  • A dry run says when part of storage could not be measured. The estimate is meant to run high, and an unreadable directory silently counted as zero was the one thing making it run low. --json says so too.
  • A home displaced twice keeps both notes about it. DISPLACED.txt was overwritten, so a second restore --force over another identity left two retired keys and one paragraph naming only the newer, and the older key was the one nobody could place. The note is also written at 0644, like a home's other documents, rather than at whatever the umask gave.
  • The note a move leaves behind names the key that move actually retired, and no longer destroys the note the move before it left. A second move puts its key at radicle.retired.2 while the note still said radicle.retired, sending the one person who reads that file to the wrong key.
  • A move no longer fails over that note. The key is renamed first, so a note that could not be read or written ended the run saying the move had failed, over a machine whose key was already retired, and withheld the line naming where the key went. Both failures are said out loud now and the move finishes; a note that is there and unreadable is left exactly as it is.
  • rad backup move --keep-source no longer writes an archive claiming the source machine retires its key. A home restored from it was told the machine it came from was safe.
  • The RESTORE.md inside every archive said rad-backup restore "refuses to continue" when the histories have diverged. It does not: it compares after restoring, names those repositories and exits 3, which is what it says now.
  • The note written beside a recipient-encrypted archive gave a command that cannot open it: age -d <file> asks for a passphrase such an archive does not have, and the rad-backup lines beside it left out --identity. It names the keys the archive was encrypted to now, and how to give one.
  • schedule no longer overwrites a unit file it cannot read. A hand-written unit saved unreadable, or holding bytes that are not UTF-8, was the one file the "not written by this tool" check could not see.
  • prune and rad backup --keep say when the note beside an archive they deleted would not go. The archive went, the note describing it stayed, and the error saying why was dropped.
  • ls, prune, --keep and the default archive see an archive that is a symlink, and refuse to act on a directory holding an archive of this identity they could not examine, instead of listing it as 0 B or leaving it out.
  • prune --dir and doctor --dir say in --help that they read RAD_BACKUP_DIR. They always did, but only ls --dir said so.
  • The man page now documents every command and its options, such as restore --force and restore --no-reconcile, which were in --help only. It sent readers to a rad-backup-<command>(1) page per command that no package installs.
  • verify says "2 problems" rather than "2 problem(s)".

Security

  • A repository config out of an archive can no longer make git run a command. It was copied into storage/<rid>/config verbatim, where core.pager, core.fsmonitor and remote.<name>.url = ext::sh -c ... are each run on an ordinary operation in that repository. A restore now carries over the node's name and DID and nothing else, because everything else in that file is what git works out about the disk it is running on, and it names what it left behind. A config git cannot parse costs those two settings, not the repository. The shipped restore.sh and the commands in RESTORE.md do the same.
  • The signed-ref oids in a manifest are checked before they reach git, and a manifest whose node id is not the key it carries is refused. A value out of an archive nobody vouched for could be read by git as one of its own flags, and a node id that disagreed with the key made every repository come back with nothing to compare, so a restore exited 0 having compared nothing.
  • A restore now says where keys, node or storage leads when one of them is a symlink, and asks before writing anything. Everything that writes walks through a link standing at a directory, so a keys aimed at a directory somebody else owns took the private key out of the home and left it there, and a storage aimed at one took every repository, private ones included. A run with nobody to ask refuses; --yes answers yes, because an unattended restore into a deliberately relocated storage has to be possible, so --yes is now also the flag that says "write through my home's links". --force is not: it is permission to overwrite what is in the home, never to write outside it. The same three are read again after the archive is unpacked and before the repositories go in, and a link that has changed since the question was answered is refused whatever the flags say. A symlink at a single repository's own name skips that repository and finishes the rest.
  • The restore.sh inside every archive refuses such a home outright, and refuses a symlink at the identity, its public key, config.json or a node database as well: it copies with cp, which writes straight through one, where restore replaces the link instead. A dangling link at the key's own name is not a file, so the guard that refuses an occupied home used to walk straight past it. The blocks RESTORE.md gives somebody to paste refuse such a home too, both the one that puts the identity back and the one that puts the repositories back.
  • restore --words writes the public key the way it writes the key beside it, so a symlink standing at keys/radicle.pub is replaced rather than followed and truncated, and the file lands at 0644 rather than at whatever the umask allowed.
  • The rad seed, rad block and rad follow lines that RESTORE.md builds out of policies.json are quoted. They are printed for somebody to read and then run, and the repository ids, peer ids and scopes in them come out of the archive, so one carrying ; curl ... | sh was a second command on a line that otherwise looked ordinary. Quoted, the worst an archive can do there is hand rad a name it rejects.
  • A restore says when the git it is using checks nothing inside a bundle. It passes fetch.fsckObjects, which is the whole of what stops a bundle writing a tree entry named .git into storage, and git consults it on a bundle only from 2.46: every older git accepted the setting and ignored it. restore and the shipped restore.sh both say so now, and name the git that runs the check. Both also read a release-candidate version such as 2.45-rc1 as one they cannot tell about, which in the script meant printing a shell error at somebody mid-recovery.
  • schedule refuses a home, output path or --passphrase-file with a line break in it, instead of writing it into the file systemd reads a setting at a time. A directory whose name carries a newline is legal, and everything after it became a second setting in a file an unattended timer reads.
  • The keys/ directory a recovery sheet rebuilds, the home it rebuilds it in, and the state directory every run keeps its record in, are owner-only rather than whatever the umask gave. The files inside were already owner-only; the names were the leak, one per DID this machine holds a record for.
  • Setting up a timer no longer leaves a copy of the archive passphrase in freed memory. It asks systemd for its whole environment to find out whether the passphrase is already kept there, and that answer was read into an ordinary buffer.
  • restore --words no longer leaves partial copies of the 24 words in freed memory. The line they are typed into started empty and grew as it was read, and every growth left what had been read so far behind, where the wiping around the finished buffer never reaches.
  • paper no longer leaves plaintext copies of the key in freed memory while escaping it, rendering its QR code, or filling the sheet. The buffer was sized counting each value once, and the sheet names the alias twice, so a long enough alias grew it halfway through and left a copy of the key behind. The sheet it prints is byte for byte the same.

Full Changelog: v0.2.1...v0.3.0