Include sslmode, prepared_statements and advisory_locks in database.yml


hope, i’m using the right category for this so please excuse me, if not.

  • Used Zammad version: zammad/zammad-docker-compose:5.3.0-2 (used by helm chart)
  • Used Zammad installation type: docker-compose (used by helm chart)
  • Operating system: k8s-1.24.8 with helm-chart zammad 7.1.1
  • Browser + version: n/a

Expected behavior:

  • Specify additional postgres connection parameters in contrib/ for
    • sslmode
    • prepared_statements
    • advisory_locks
      needed for some (managed) database services to successfully connect to postgres service.

Actual behavior:

  • Unable to specify those connection parameters. Connection to postgres service failed due to sslmode is mandatory (require)

Steps to reproduce the behavior:

  • When using a managed postgres database e.g. DigitalOcean where sslmode: require is mandatory.

A quick workaround is to override the contrib/ in zammad/zammad-docker-compose:5.3.0-2 image modifying the init-container:
in ConfigMap: service-zammad-init

  postgresql-init: >-

    set -e

    cat <<EOF > 'contrib/'

      adapter: postgresql
      database: zammad_production
      pool: 50
      timeout: 5000
      encoding: utf8
      username: zammad
      sslmode: require
      prepared_statements: false
      advisory_locks: false

    sed -e "s#.*adapter:.*#  adapter: postgresql#g" -e "s#.*database:.*# 
    database: mydatabase#g" -e "s#.*username:.*#  username:
    myusername#g" -e "s#.*password:.*#  password: ${POSTGRESQL_PASS}\\n 
    port: 25061#g" < contrib/ > config/database.yml

This works for managed database at digitalocean.

Next steps:

  • Add new params to docker-compose / helm-chart but using default values if not specified
  • Update Documentation

This topic was automatically closed 360 days after the last reply. New replies are no longer allowed.