docker icon indicating copy to clipboard operation
docker copied to clipboard

Add dynamic config for Postgres SSL mode

Open nfk opened this issue 2 months ago • 2 comments

Latest release nextcloud:30.0.16-fpm (see https://github.com/nextcloud/server/pull/55170) brings postgresql SSL support but the docker image does not provide dynamic config.

Example: 30/fpm/config/pgsql_ssl.config.php

<?php
if (getenv('POSTGRES_SSL_MODE')) {
  $CONFIG = array (
    'pgsql_ssl' => array(
      'mode' => getenv('POSTGRES_SSL_MODE'),  // see https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLMODE
      'rootcert' => getenv('POSTGRES_SSL_ROOTCERT') ?: null,
      ...
    ),
  );
}

nfk avatar Oct 06 '25 08:10 nfk

Fine by me. Mind doing a PR for formal review/tweaking as needed?

A quick glance upstream suggests there may be some other additional parameters we should probably try to support too, but I haven't read the details.

joshtrichards avatar Oct 06 '25 13:10 joshtrichards

Fine by me. Mind doing a PR for formal review/tweaking as needed?

A quick glance upstream suggests there may be some other additional parameters we should probably try to support too, but I haven't read the details.

@joshtrichards Actually, I made an issue for tracking the need, I still have issue about the login when using ssl with Postgres and NC (using an hack to solve that). I assume it is because I rely on NC30 and doctrine lib, which is a little bit outdated (https://github.com/nextcloud/3rdparty/pull/2092). Never mind when I will be able to test the full stack I will make a PR with pleasure.

nfk avatar Oct 06 '25 14:10 nfk