Skip to content

fix #554 - add nested .env vars for PostgreSQL#561

Open
derpixler wants to merge 2 commits intomasterfrom
fixes-554-merge-prostgress-env-vars
Open

fix #554 - add nested .env vars for PostgreSQL#561
derpixler wants to merge 2 commits intomasterfrom
fixes-554-merge-prostgress-env-vars

Conversation

@derpixler
Copy link
Copy Markdown
Contributor

- Renamed `POSTGRES_*` to `POSTGRESQL_*` in environment variables for the Zammad service
- Implemented nested `.env` variables to support both old and new variable names:

Comment thread .env.dist
#############################################

# RESTART=always
RESTART=always
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why did you uncomment this?

Comment thread .env.dist
Comment on lines +37 to +43
# POSTGRESQL_DB=
# POSTGRESQL_HOST=
# POSTGRESQL_USER=
# POSTGRESQL_PASS=
# POSTGRESQL_PORT=
# POSTGRESQL_OPTIONS=
# POSTGRESQL_DB_CREATE=
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why did you remove the default values from these variables? They show the fallbacks that get used if you don't specify.

Comment thread docker-compose.yml
POSTGRESQL_DB: ${POSTGRESQL_DB:-${POSTGRES_DB:-zammad_production}}
POSTGRESQL_HOST: ${POSTGRESQL_HOST:-${POSTGRES_HOST:-zammad-postgresql}}
POSTGRESQL_USER: ${POSTGRESQL_USER:-${POSTGRES_USER:-zammad}}
POSTGRESQL_PASS: ${POSTGRESQL_PASS:-${POSTGRES_PASS:-${POSTGRES_PASSWORD:-zammad}}}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why did you introduce a new POSTGRES_PASSWORD variable here which was not there before, and only for one variant? I understand _PASS is not the best naming, but should we add more complexity here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I only added POSTGRES_PASSWORD for the password because that’s the name the official Postgres image uses, and some .env templates only define that — Zammad would still pick up the same secret when people don’t use POSTGRES_PASS.

If we want to avoid extra complexity, we can drop the third fallback and only support POSTGRESQL_* and POSTGRES_* (including POSTGRES_PASS); that stays consistent with the other variables and the existing docs.

Comment thread docker-compose.yml
POSTGRES_PASSWORD: ${POSTGRES_PASS:-zammad}
POSTGRES_DB: ${POSTGRESQL_DB:-${POSTGRES_DB:-zammad_production}}
POSTGRES_USER: ${POSTGRESQL_USER:-${POSTGRES_USER:-zammad}}
POSTGRES_PASSWORD: ${POSTGRESQL_PASS:-${POSTGRES_PASS:-${POSTGRES_PASSWORD:-zammad}}}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mgruner
Copy link
Copy Markdown
Collaborator

mgruner commented Apr 16, 2026

On which platforms did you test these changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants