From 850afd74025e5ee1c1296843765d557ccdfdf1ea Mon Sep 17 00:00:00 2001 From: Dave Page Date: Wed, 20 Jan 2021 11:50:05 +0000 Subject: [PATCH] Add a container option (PGADMIN_DISABLE_POSTFIX) to disable the Postfix server. --- docs/en_US/container_deployment.rst | 14 ++++++++++++++ docs/en_US/release_notes_4_30.rst | 1 + pkg/docker/entrypoint.sh | 4 +++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/en_US/container_deployment.rst b/docs/en_US/container_deployment.rst index 57001cf44..6456ef7e2 100644 --- a/docs/en_US/container_deployment.rst +++ b/docs/en_US/container_deployment.rst @@ -41,6 +41,20 @@ to login to pgAdmin. This variable is required and must be set at launch time. This is the password used when setting up the initial administrator account to login to pgAdmin. This variable is required and must be set at launch time. +**PGADMIN_DISABLE_POSTFIX** + +*Default: * + +If left unset, a Postfix server will be started to deliver password reset +emails. + +If set to any value, the Postfix server will not be started, and pgAdmin will +need to be configured to use an external mail server using the *PGADMIN_CONFIG_* +options below. + +This option is useful if you're running in an environment that prevents the use +of sudo to start Postfix, or if you wish to use an external mail server. + **PGADMIN_ENABLE_TLS** *Default: * diff --git a/docs/en_US/release_notes_4_30.rst b/docs/en_US/release_notes_4_30.rst index c31a16c1c..d3bb80b44 100644 --- a/docs/en_US/release_notes_4_30.rst +++ b/docs/en_US/release_notes_4_30.rst @@ -11,6 +11,7 @@ New features | `Issue #1802 `_ - Added ERD Diagram support with basic table fields, primary key, foreign key, and DDL SQL generation. | `Issue #5457 `_ - Added support for Kerberos authentication, using SPNEGO to forward the Kerberos tickets through a browser. +| `Issue #6160 `_ - Add a container option (PGADMIN_DISABLE_POSTFIX) to disable the Postfix server. Housekeeping ************ diff --git a/pkg/docker/entrypoint.sh b/pkg/docker/entrypoint.sh index 93d809f36..2a2bc5c75 100755 --- a/pkg/docker/entrypoint.sh +++ b/pkg/docker/entrypoint.sh @@ -48,7 +48,9 @@ if [ ! -f /var/lib/pgadmin/pgadmin4.db ]; then fi # Start Postfix to handle password resets etc. -sudo /usr/sbin/postfix start +if [ -z ${PGADMIN_DISABLE_POSTFIX} ]; then + sudo /usr/sbin/postfix start +fi # Get the session timeout from the pgAdmin config. We'll use this (in seconds) # to define the Gunicorn worker timeout