Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ services:
restart: unless-stopped
env_file: .env
environment:
POSTGRES_PASSWORD: ${DB_PASSWD:-postgres}
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_DB: ${DB_NAME:-authentik}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-authentik}
POSTGRES_USER: ${POSTGRES_USER:-romm}
POSTGRES_DB: ${POSTGRES_DB:-authentik}
Comment on lines +64 to +66
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

While these changes correctly align the environment variables for the PostgreSQL service and its consumers, there's a critical issue regarding the password handling that could prevent the service from starting for new users.

The env.template file specifies POSTGRES_PASSWORD=. When a user copies this to a .env file, the POSTGRES_PASSWORD variable is set to an empty string. Docker Compose's variable substitution will then use this empty string for ${POSTGRES_PASSWORD:-authentik}, instead of the default value authentik.

The official PostgreSQL Docker image requires a non-empty password and will fail to initialize if POSTGRES_PASSWORD is empty. This will cause the romm-postgres-dev container to fail on startup.

To ensure an out-of-the-box working experience, this needs to be addressed. A simple fix would be to provide a default password in env.template, for example: POSTGRES_PASSWORD=authentik. Since that file is not part of this PR, another solution should be considered to make the setup more resilient.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

volumes:
- postgres-db:/var/lib/postgresql/data
ports:
Expand All @@ -78,9 +78,9 @@ services:
environment:
AUTHENTIK_REDIS__HOST: romm-valkey-dev
AUTHENTIK_POSTGRESQL__HOST: romm-postgres-dev
AUTHENTIK_POSTGRESQL__USER: ${POSTGRES_USER:-postgres}
AUTHENTIK_POSTGRESQL__USER: ${POSTGRES_USER:-romm}
AUTHENTIK_POSTGRESQL__NAME: ${POSTGRES_DB:-authentik}
AUTHENTIK_POSTGRESQL__PASSWORD: ${POSTGRES_PASSWORD:-postgres}
AUTHENTIK_POSTGRESQL__PASSWORD: ${POSTGRES_PASSWORD:-authentik}
AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:-secret-key-default}
AUTHENTIK_BOOTSTRAP_PASSWORD: ${AUTHENTIK_BOOTSTRAP_PASSWORD:-password}
volumes:
Expand All @@ -102,9 +102,9 @@ services:
environment:
AUTHENTIK_REDIS__HOST: romm-valkey-dev
AUTHENTIK_POSTGRESQL__HOST: romm-postgres-dev
AUTHENTIK_POSTGRESQL__USER: ${POSTGRES_USER:-postgres}
AUTHENTIK_POSTGRESQL__USER: ${POSTGRES_USER:-romm}
AUTHENTIK_POSTGRESQL__NAME: ${POSTGRES_DB:-authentik}
AUTHENTIK_POSTGRESQL__PASSWORD: ${POSTGRES_PASSWORD:-postgres}
AUTHENTIK_POSTGRESQL__PASSWORD: ${POSTGRES_PASSWORD:-authentik}
AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:-secret-key-default}
AUTHENTIK_BOOTSTRAP_PASSWORD: ${AUTHENTIK_BOOTSTRAP_PASSWORD:-password}
volumes:
Expand Down
2 changes: 1 addition & 1 deletion env.template
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ REDIS_PORT=6379
# Authentik
POSTGRES_DB=authentik
POSTGRES_USER=authentik
POSTGRES_PASSWORD=
POSTGRES_PASSWORD=authentik
AUTHENTIK_SECRET_KEY=
AUTHENTIK_BOOTSTRAP_PASSWORD=

Expand Down
Loading