Skip to content

v1.4.0 — Encrypted, verified backups & flexible roles

Choose a tag to compare

@garyhooi garyhooi released this 13 Nov 06:45
· 14 commits to main since this release

What's new

Encrypted, verified backups

  • Backup passphrase. Configuration → Security → Backup encryption can now set a passphrase used automatically for every new backup, regardless of which admin creates it. The passphrase is stored encrypted with APP_ENCRYPTION_KEY and is never returned by the API.
  • Self-contained encrypted archives. New backups are written as authenticated .sql.gz.enc files using scrypt + ChaCha20-Poly1305. A downloaded file plus the passphrase is sufficient to recover it; the passphrase is not embedded in the file.
  • Passphrase changes do not strand old backups. Up to 10 previous passphrases are retained encrypted, so archives made before a change (or before encryption was disabled) remain restorable. Existing plain .sql.gz backups continue to restore normally.
  • Automatic restore verification. Every new backup is restored into a temporary database before it is reported as successful. Failures keep the archive but mark it Unverified with a visible warning, rather than treating an unusable dump as a good backup.
  • Backup list improvements. The page now shows Size, Protection (encrypted/plain), and Verification columns, with a dedicated staged loading animation while the backup is dumped, encrypted, and verified.
  • Upload/download/restore support. Encrypted archives can be downloaded, uploaded back, and restored through the same MFA-gated flows.

More flexible roles

  • Only super_admin remains a locked system role. admin and auditor are now ordinary seeded roles: they can be edited, renamed, and deleted once no admin is assigned to them.
  • Deleted defaults stay deleted. Role seeding runs once behind a migration marker (migration 033), so restarting or upgrading the console will not recreate Admin/Auditor after deletion.
  • Sensitive capabilities are assignable. Access-control, security-policy, audit-purge, and maintenance permissions can now be granted to custom roles. The * wildcard remains reserved for super_admin.
  • Capability-aware access screens. A roles.manage-only role sees the roles workspace without the admin list; admins.view is read-only; security.manage can edit security policy. Role and group controls are hidden or disabled when the acting admin lacks the corresponding capability.
  • Invite fallback. If the Admin role has been deleted, an invite that omits a role now falls back to the first remaining non-super role instead of failing.

Upgrade notes

  • Migrations 031, 032, and 033 apply automatically on the next API start. They add the encrypted backup-passphrase columns, make Admin/Auditor non-system roles, and seed the two default roles only once. No manual SQL is required.
  • Existing backups are untouched. Plain archives remain restorable; encryption applies to newly created backups after enabling the setting.
  • To delete Admin or Auditor while it still has admins assigned, reassign those admins first; the console intentionally refuses an in-use role deletion.
  • Automatic verification requires the database user to be able to create/drop databases (CREATEDB). The default Docker PostgreSQL superuser has this. Without it, backups are still created but shown as unverified with an explanatory warning.
  • Keep the backup passphrase somewhere safe. If both the server and its database are lost, the passphrase is the only way to open an encrypted archive.

Verification

  • Backend: go test ./... and go vet ./... green.
  • Full E2E against a temporary PostgreSQL 18 cluster: backup creation/verification, plain and encrypted download, restore, upload restore, passphrase enable/disable, and restore with a retained passphrase after disabling.
  • Frontend: 36 test files / 272 tests green; tsc -b clean; production Vite build clean.
  • Migrations re-applied twice in a scratch database to confirm idempotency and that deleted Admin/Auditor roles are not recreated.