fix #554 - add nested .env vars for PostgreSQL#561
Conversation
derpixler
commented
Apr 2, 2026
| ############################################# | ||
|
|
||
| # RESTART=always | ||
| RESTART=always |
There was a problem hiding this comment.
Why did you uncomment this?
| # POSTGRESQL_DB= | ||
| # POSTGRESQL_HOST= | ||
| # POSTGRESQL_USER= | ||
| # POSTGRESQL_PASS= | ||
| # POSTGRESQL_PORT= | ||
| # POSTGRESQL_OPTIONS= | ||
| # POSTGRESQL_DB_CREATE= |
There was a problem hiding this comment.
Why did you remove the default values from these variables? They show the fallbacks that get used if you don't specify.
| 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}}} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
This is an interesting finding @derpixler. You are right that the postgres image actually recommends the more speaking variant PASSWORD. But since here we are trying to reduce complexity in the Zammad image, I would argue we should not support this variant as well. If we add it, it will kinda be part of the API, which makes it hard to change later. Let's remove this part.
| 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}}} |
There was a problem hiding this comment.
|
On which platforms did you test these changes? |
|
|
The PR was closing by discussion. Standardizing the PostgreSQL variable names would require fallback chains and a breaking change for existing installations – the added complexity outweighs the benefit for now. The internal mapping to POSTGRESQL_* in the x-shared block works transparently. If the need arises in the future, this can be revisited. |