From 10f85659570a6fe019cdeb1c785122cceffd0eb5 Mon Sep 17 00:00:00 2001 From: Julien Gautier Date: Fri, 8 May 2026 22:58:21 +0200 Subject: [PATCH] fix(infra): rename pgweb DATABASE_URL to PGWEB_DATABASE_URL (#62) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary pgweb 0.16 deprecated `DATABASE_URL` in favour of `PGWEB_DATABASE_URL`. With the old name, the container starts up, emits a `[DEPRECATION]` warning, then crashes: ``` [DEPRECATION] Usage of DATABASE_URL env var is deprecated, please use PGWEB_DATABASE_URL variable instead Pgweb v0.16.2 ... Error: Invalid URL. Valid format: postgres://user:password@host:port/db?sslmode=mode ``` — because the new code path reads `PGWEB_DATABASE_URL` (empty) and the URL parser rejects an empty string. Rename the env key in the compose file. Same value, just the new name. ## Test plan - [ ] After merge: `docker compose -f infra/local/dev.compose.yml --profile dbtools up -d` → pgweb stays running (not in `Restarting` loop). - [ ] http://localhost:8081 loads pgweb's UI; click through to the `audit` schema and the four `audit_*` roles to confirm DB connection. --------- Co-authored-by: Julien Gautier Reviewed-on: https://git.unespace.com/julien/apf_portal/pulls/62 --- infra/local/dev.compose.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infra/local/dev.compose.yml b/infra/local/dev.compose.yml index 8e0f841..f281c23 100644 --- a/infra/local/dev.compose.yml +++ b/infra/local/dev.compose.yml @@ -103,7 +103,10 @@ services: restart: unless-stopped profiles: [dbtools] environment: - DATABASE_URL: postgres://${POSTGRES_USER:-portal}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-portal_dev}?sslmode=disable + # `PGWEB_DATABASE_URL` (formerly `DATABASE_URL`) — pgweb 0.16 + # deprecated the old name, ignores it, and starts up empty, + # crashing with "Invalid URL". + PGWEB_DATABASE_URL: postgres://${POSTGRES_USER:-portal}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-portal_dev}?sslmode=disable ports: - '${PGWEB_PORT:-8081}:8081' depends_on: