Remove hardcoded database credentials from docker-compose.yml #1620

Closed
opened 2026-04-20 04:24:41 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P1 Security hardening

docker-compose.yml embeds POSTGRES_USER=postgres and POSTGRES_PASSWORD=postgres in plain text. Any developer who commits with these values or copies the file leaks credentials.

What to do

  1. Create a .env.example file (if it does not exist) containing POSTGRES_USER=postgres and POSTGRES_PASSWORD=changeme with clear comments.
  2. Modify docker-compose.yml to reference variables: POSTGRES_PASSWORD=${POSTGRES_PASSWORD} and POSTGRES_USER=${POSTGRES_USER}.
  3. Ensure .env is listed in .gitignore.
  4. Update README.md (or docs/) with a setup step: "Copy .env.example to .env and set secure values before running docker compose up."

Acceptance criteria

  • docker-compose.yml contains no literal credential values.
  • docker compose config resolves correctly when .env is present.
  • .env is gitignored.
  • .env.example exists and documents all required variables.
## Context Roadmap item: P1 Security hardening `docker-compose.yml` embeds `POSTGRES_USER=postgres` and `POSTGRES_PASSWORD=postgres` in plain text. Any developer who commits with these values or copies the file leaks credentials. ## What to do 1. Create a `.env.example` file (if it does not exist) containing `POSTGRES_USER=postgres` and `POSTGRES_PASSWORD=changeme` with clear comments. 2. Modify `docker-compose.yml` to reference variables: `POSTGRES_PASSWORD=${POSTGRES_PASSWORD}` and `POSTGRES_USER=${POSTGRES_USER}`. 3. Ensure `.env` is listed in `.gitignore`. 4. Update `README.md` (or `docs/`) with a setup step: "Copy `.env.example` to `.env` and set secure values before running `docker compose up`." ## Acceptance criteria - `docker-compose.yml` contains no literal credential values. - `docker compose config` resolves correctly when `.env` is present. - `.env` is gitignored. - `.env.example` exists and documents all required variables.
AI-Manager added the P1agent-readysmallsecurity labels 2026-04-20 04:24:41 +00:00
Author
Owner

This issue has been resolved by previously merged PRs. The feature is already implemented in the codebase on main.

Closing as already resolved.

This issue has been resolved by previously merged PRs. The feature is already implemented in the codebase on main. - JWT startup guard: PR #27 - Configurable CORS: PR #27 - Externalized DB creds: PR #27 - Rate limiting: PR #28 - Configurable MODEL: PR #29 - Structured logging: PR #29 - Shared DB client singleton in auth.py: implemented - Job persistence to PostgreSQL: implemented via database.create_job/list_jobs Closing as already resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1620