zammad / zammad-docker-compose

Zammad Docker images for docker-compose
https://hub.docker.com/r/zammad/zammad-docker-compose/
GNU Affero General Public License v3.0
273 stars 223 forks source link

Added postgres env data #357

Closed Finnlife closed 1 year ago

Finnlife commented 1 year ago

Added missing Postgresql connection data in docker-compose.yml

Resolves #356, Resolves #355

t3easy commented 1 year ago

Please also add the Database name

ggruening commented 1 year ago

Maybe we're missing a few other environment-variables, too? See #358 and the answers. There seems to be a problem with elasticsearch and/or rake.

Finnlife commented 1 year ago

@ggruening Maybe there are. But what did change that causes this? When we know that, we will be able to find all missing env variables.

@t3easy I tried to add the DB Name as an Env var, but that didn't work for me. I'm currently not able to test this because I only have access to a prod Instance of zammad. I might be able to test this in a couple of days. I just wanted to fix this issue for all of the users.

t3easy commented 1 year ago

I just added this vars a few commits back but they are gone now with the commit for v6 without a comprehensible reason.

This commit for v6 seems very breaking to me.

Finnlife commented 1 year ago

Thank you, @t3easy, for your feedback. I added the DB-Name in the envs. I know that I added the DB Envs as Containers that did not have them in versions prior to 6, but I think I got problems at some containers because of missing DB-Envs. Maybe there was a Change in v6.

I will look into this after this is being fixed / merged.

AnXh3L0 commented 1 year ago

@Finnlife I am trying to setup Zammad via Docker, and I tried to add the vars, just like you did, but I still get the postgres auth error. Do you know if there's anything else that has to be changed in order for this to work?

kamilkobak commented 1 year ago

You probably need to change the authentication in postgres which is in the file pg_hba.conf This file is in docker postgres volume: postgresql-data
In my case: vim /var/lib/docker/volumes/zammad-docker-compose_postgresql-data/_data/pg_hba.conf

change last line to: host all all 172.0.0.1/8 trust (Include your docker network address here)

Finnlife commented 1 year ago

@AnXh3L0 yeah I had this issue too. Check if you 100% wrote the vars correct. Its POSTGRESQL_DB not POSTGRES_DB as in the Postgres Container env. If this doesn't help, send me your full docker-compose file

fleverest commented 1 year ago

This issue is not specific to this repository. As such, I have created PR 4735 on the zammad/zammad repo.

ggruening commented 1 year ago

@fleverest Thanks for finding that out! 😃 Let's hope your PR gets merged quickly. 😅

t3easy commented 1 year ago

This issue is not specific to this repository. As such, I have created PR 4735 on the zammad/zammad repo.

I would like to see them set in docker-compose.yml + .env because services like the backup override the entrypoint. And it is much clearer how to adjust them.

fleverest commented 1 year ago

This issue is not specific to this repository. As such, I have created PR 4735 on the zammad/zammad repo.

I would like to see them set in docker-compose.yml + .env because services like the backup override the entrypoint. And it is much clearer how to adjust them.

You're right, I misunderstood the main issue for this PR

thmo commented 1 year ago

Please add POSTGRESQL_HOST in addition. It might not be absolutely necessary in the case of (vanilla) docker-compose as the db container is automatically named zammad-postgres, similar to what the entrypoint script expects. However, in some cases, where the docker-compose.yml only serves as a blueprint (in my case, a script setting up a podman pod), the hostname might in fact be different. Adding POSTGRESQL_HOST would makes things more explicit and thus clearer, especially as POSTGRESQL_HOST is mentioned in .env.

As a side note, speaking of .env, it would probably be easier to simply use env_file with .env instead of listing variables individually.

pgassmann commented 1 year ago

with the most recent update, also zammad-nginx requires the postgres credentials https://github.com/zammad/zammad/pull/4684

mgruner commented 1 year ago

@Finnlife please see #366 for a more complete version and let me know if this works for you. Thanks!

mgruner commented 1 year ago

Actually everyone is invited to test and give feedback, of course!