Skip to content

Commit d881f1e

Browse files
committed
fix(docker): keep internal Postgres creds fixed to avoid URL-encoding bug
Cubic flagged that interpolating POSTGRES_PASSWORD into DATABASE_URL breaks connections when the password contains URI-reserved characters (@ : / # ?). The compose-internal Postgres is never exposed on the host, so exposing POSTGRES_PASSWORD as an overridable variable was more risk than reward. Revert compose to fixed manifest/manifest credentials for the bundled Postgres, drop POSTGRES_PASSWORD from .env.example and install.sh, and document that users who need a custom DB password should use Option 2 (docker run with an external Postgres) where they control the full DATABASE_URL end-to-end and can URL-encode as needed.
1 parent a756073 commit d881f1e

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

docker/.env.example

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@
77
# openssl rand -hex 32
88
# 3. Set SEED_DATA=false and change the seeded admin password
99
# (admin@manifest.build / manifest) after first login.
10-
# 4. Pick a strong POSTGRES_PASSWORD.
11-
# 5. Update BETTER_AUTH_URL to match the public origin you serve on.
10+
# 4. Update BETTER_AUTH_URL to match the public origin you serve on.
1211
#
1312
# Docker Compose reads .env automatically from the same directory as the
1413
# compose file. Variables below are all optional — compose falls back to
1514
# the localhost-safe defaults baked into docker-compose.yml if unset.
15+
#
16+
# The bundled Postgres credentials are internal to the compose network and
17+
# intentionally not overridable here: changing them requires updating the
18+
# full DATABASE_URL consistently (and URL-encoding any special characters
19+
# in the password). If you need a custom DB password or an external
20+
# Postgres, use Option 2 from DOCKER_README.md and supply your own
21+
# DATABASE_URL end-to-end.
1622

1723
# Required for any non-localhost deployment. Minimum 32 characters.
1824
BETTER_AUTH_SECRET=change-me-to-a-random-32-char-string!!
1925

2026
# Public URL Manifest is served on. Must match host + port the browser uses.
2127
BETTER_AUTH_URL=http://localhost:3001
2228

23-
# PostgreSQL password. Stays inside the compose internal network, but still
24-
# worth changing for any real deployment.
25-
POSTGRES_PASSWORD=manifest
26-
2729
# Seeds a demo admin user (admin@manifest.build / manifest) and sample data
2830
# on first boot. Set to false before exposing publicly.
2931
SEED_DATA=true

docker/docker-compose.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
# secret. Generate one with: openssl rand -hex 32
55
# - Set SEED_DATA=false to stop seeding the demo agent on every boot.
66
# - Change the seeded admin password (admin@manifest.build / manifest).
7-
# - Pick a strong POSTGRES_PASSWORD.
7+
#
8+
# The Postgres credentials below are internal to the compose network and
9+
# never exposed on the host — there is no published port for postgres. If
10+
# you need a custom DB password (or an external Postgres), use Option 2
11+
# from DOCKER_README.md and supply your own DATABASE_URL end-to-end.
812
#
913
# All `${VAR:-default}` values below fall back to localhost-safe defaults
1014
# when no .env file is present, so `docker compose up -d` works out of the
@@ -16,7 +20,7 @@ services:
1620
ports:
1721
- "3001:3001"
1822
environment:
19-
- DATABASE_URL=postgresql://manifest:${POSTGRES_PASSWORD:-manifest}@postgres:5432/manifest
23+
- DATABASE_URL=postgresql://manifest:manifest@postgres:5432/manifest
2024
# ⚠ Default is a placeholder. Replace via .env before any non-localhost use.
2125
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET:-change-me-to-a-random-32-char-string!!}
2226
- BETTER_AUTH_URL=${BETTER_AUTH_URL:-http://localhost:3001}
@@ -49,7 +53,7 @@ services:
4953
image: postgres:16-alpine@sha256:20edbde7749f822887a1a022ad526fde0a47d6b2be9a8364433605cf65099416
5054
environment:
5155
- POSTGRES_USER=manifest
52-
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-manifest}
56+
- POSTGRES_PASSWORD=manifest
5357
- POSTGRES_DB=manifest
5458
volumes:
5559
- pgdata:/var/lib/postgresql/data

docker/install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ else
117117
# Regenerate BETTER_AUTH_SECRET before exposing beyond localhost.
118118
BETTER_AUTH_SECRET=$SECRET
119119
BETTER_AUTH_URL=http://localhost:3001
120-
POSTGRES_PASSWORD=manifest
121120
SEED_DATA=true
122121
EOF
123122
fi

0 commit comments

Comments
 (0)