forked from 0xWheatyz/SPARC
Move database credentials out of docker-compose.yml into .env file #1096
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
docker-compose.ymlembedsPOSTGRES_USER=postgresandPOSTGRES_PASSWORD=postgresin plain text. This means credentials are committed to version control and anyone with repo access has the database password.What to do
.env.examplefile (if not present) listingPOSTGRES_USER,POSTGRES_PASSWORD, andPOSTGRES_DBwith placeholder values.docker-compose.ymlto reference these via${POSTGRES_USER}/${POSTGRES_PASSWORD}or use anenv_file:directive pointing to.env..envto.gitignore(ensure it is not already tracked)..env.exampleto.envbefore runningdocker compose up.Acceptance criteria
.envis listed in.gitignore.docker-compose.ymlcontains no hardcoded credentials..env.exampleexists with documented placeholder values.docker compose configresolves correctly when.envis present.Roadmap reference: P1 - Security hardening
This issue has been verified as already implemented in the current codebase. The acceptance criteria are met based on code review. Closing as completed.