554de15d

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Move the deployment out of bash and into the tool

deploy-for.nix had grown a password prompt, a staleness comparison, a
confirmation, four steps, a recovery message and a copy of three files
back into the repository, all in shell. It is now a wrapper with no logic
in it: makeWrapper over the tool with the paths already decided, which is
the only part nix knows and rust cannot.

So there is a deploy command, and it does what that script did, plus two
things the script could not.

It waits for the router to settle before reading it back. A router that
has just been reset is still acquiring an address and a prefix delegation,
and RouterOS writes a comment into its own export for every part of the
configuration it cannot resolve yet, so the last deployment recorded
"address pool error: pool not found: v6pool" as though that were the
router's settled state. A settled router is one whose export has no such
comment, which is a question that can be asked without knowing which parts
of a configuration wait on something arriving over the wire.

And the three filenames a check reads are decided in one place now, rather
than in a shell script here and a flake somewhere else.

The output is steps, coloured, and never erases itself: what went wrong
with a deployment is diagnosed from what it had already said.
GitHub
configure