v0.5.0: An environment ledger
Upgrading
Apply the new migration to each deployment’s D1 before deploying 0.5.0, as for 0.4.0 (see
Deploying your own). 0.5 records environments in the new table, so it fails
exchanges for PORTONA_ACCESS environments on a database without it. The migration only adds a
table, so 0.4 keeps working on the migrated database and you can roll back without undoing it.
The ledger records the ID your configuration gives each environment the first time it’s used. Check that the configuration you deploy with 0.5.0 is the one you mean to keep.
The environment ledger
Secrets are still stored by environment name. Until now, a configuration that renamed an environment, or deleted one and created another with the same name under a new ID, would hand the old name’s secrets to whatever held the name next.
0.5 records the first ID it sees for each name, at its first exchange, admin change or daily cron, and refuses exchanges and admin changes for an environment that disagrees with that record:
- Renamed: an ID now has another name.
- Recreated: a name now has a new ID.
- Retired: an ID was retired and is used again.
The daily cron fails and names each conflict, so a mistaken deploy shows within a day even if nothing
uses the environment. PORTONA_POLICIES environments have no ID and aren’t recorded.
To give a name a new ID on purpose, retire it with the new portona-ledger command. In one audited
transaction it deletes the name’s secrets and federations and frees the name. Backups now include the
ledger, and a restore never brings back a retired name’s secrets. See
Environments and Retiring a name.

