Skip to content

WhyGraph 2.1.0

Unreleased draft

2.1.0 is not released yet. This page describes the change on its way and may move until the release is tagged.

2.1.0 moves the portal's own database - the project list, settings, encrypted keys and scan history - from a SQLite file to Postgres, so that the production mode on the roadmap runs on the same database as your laptop. Nothing you do in the portal changes: the same pages, the same projects, the same MCP endpoints. Your repositories are not touched; each project's .whygraph/whygraph.db and .codegraph/ stay SQLite, in the repository.

Upgrade note

Re-run the installer, then whygraph up. On that first start:

  • whygraph up starts a second container, whygraph-portal-postgres, beside the portal and waits for it to be ready.

What's new

  • A database container. whygraph-portal-postgres publishes no port; only the portal reaches it, over its private Docker network. Its files are in postgres/ in the data directory, owned by you, and its password is a generated 0600 file there, never an environment value. whygraph down stops both containers, and whygraph status reports both (and exits non-zero unless both run).
  • whygraph backup. Dumps the portal database into backups/ in the data directory, keeping the newest 10. whygraph up makes the same dump automatically before it recreates a running database container (WHYGRAPH_SKIP_BACKUP=1 skips it). See Backup and restore, and back up secret.key with the dumps.
  • One portal per database. Beside the existing lock on its data directory, the portal holds a lock on its database, so a second portal pointed at the same database starts degraded instead of running alongside the first.
  • Safer start order. whygraph up waits for the database's health check before starting the portal, and a portal that cannot reach its database within a minute exits so Docker retries it.
  • WHYGRAPH_POSTGRES_IMAGE overrides the pinned Postgres image for a registry mirror; see Configuration.

Footprint

The database container uses about 30 MiB of RAM when idle, and the first whygraph up pulls the postgres image from Docker Hub once. On a network that blocks Docker Hub, point WHYGRAPH_POSTGRES_IMAGE at a mirror of the same image.

For developers

  • uv run pytest needs Docker (it starts a throwaway Postgres) or WHYGRAPH_TEST_DATABASE_URL.
  • make dev-local runs against make dev-db, a dev Postgres on 127.0.0.1:55432.

See Developing WhyGraph.