Skip to content

BookStorage v5.7.0 — PostgreSQL, migration admin, and DB-safe maintenance

Choose a tag to compare

@LGARRABOS LGARRABOS released this 17 Apr 06:51
· 193 commits to main since this release

This minor release focuses on optional PostgreSQL as a production database, a safer SQLite → PostgreSQL migration path from the admin UI, and clearer behaviour when the database is temporarily unreachable.

Database & migration

  • PostgreSQL support alongside SQLite: schema, FTS, CI integration, and BOOKSTORAGE_POSTGRES_URL configuration.
  • Admin → PostgreSQL migration wizard (superadmin): test connection, copy data, verify row counts, then write .env only after a successful copy (avoids locking users out if migration or .env write fails). API errors include a detail field where applicable.
  • lib/pq compatibility: normalize or default sslmode (e.g. prefer → disable on LAN); documentation for pg_hba / hostnossl when using sslmode=disable.
  • SQLite migration 9 runs outside a transaction where required for foreign keys.

Operations & deploy

  • deploy/setup-postgres-vm.sh: more reliable apt (timeouts, optional IPv4, HTTP watchdog, optional verbose HTTP), better handling when PostgreSQL runs as postgresql@version-cluster, LAN IP hints in generated URLs, English operator messages.
  • deploy/README-postgres-vm.md: English self-hosting guide for the Postgres VM flow.
  • deploy/install.sh: .env ownership set to the service user (nobody by default) so the migration step can update BOOKSTORAGE_POSTGRES_URL without permission errors.
  • Docs (docs/self-hosting.md, docs/fr/hebergement.md, .env.example): Postgres migration, .env permissions troubleshooting, BSCTL_UPDATE_TAG examples updated to v5.7.0.

Product & resilience

  • Google OAuth sign-in and account linking (when BOOKSTORAGE_PUBLIC_ORIGIN and Google client env vars are set).
  • 503 maintenance page when the app cannot reach the database; /api/* returns JSON service_unavailable with reason: database. /healthz, /metrics, and /static/ stay available for probes and assets.
  • Browser-side: wrap fetch on DB-related 503 responses and poll /healthz so open tabs react without a manual full refresh; server-side DB probe runs on every request (no stale “DB OK” cache after an outage).

Admin UI

  • PostgreSQL migration tab on all admin pages (when eligible); custom confirm modal for migration instead of the native confirm() dialog.

Release workflow

The push-release Cursor skill in this repo can bump APP_VERSION, run local checks, create an annotated tag, push, and publish a GitHub release with structured notes—use it for the next release without filling the web form by hand.

Full changelog: v5.6.2...v5.7.0