From da3b3de39773733ed4438e159cdc966eb861dffb Mon Sep 17 00:00:00 2001 From: Diego Augusto Molina Date: Thu, 31 Jan 2019 14:26:35 +0100 Subject: [PATCH] Expose the bind address in the Docker container via PGADMIN_BIND_ADDRESS. Fixes #3955 --- docs/en_US/container_deployment.rst | 8 ++++++++ docs/en_US/release_notes_4_2.rst | 3 ++- pkg/docker/entrypoint.sh | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/en_US/container_deployment.rst b/docs/en_US/container_deployment.rst index 46853c216..46b882cd4 100644 --- a/docs/en_US/container_deployment.rst +++ b/docs/en_US/container_deployment.rst @@ -35,6 +35,14 @@ When TLS is enabled, a certificate and key must be provided. Typically these should be stored on the host file system and mounted from the container. The expected paths are /certs/server.crt and /certs/server.key +*PGADMIN_LISTEN_ADDRESS* + +Default: [::] + +Specify the local address that the servers listens on. The default should work +for most users - in IPv4-only environments, this may need to be set to +127.0.0.1. + *PGADMIN_LISTEN_PORT* Default: 80 or 443 (if TLS is enabled) diff --git a/docs/en_US/release_notes_4_2.rst b/docs/en_US/release_notes_4_2.rst index 2d9a577b9..adb4576ad 100644 --- a/docs/en_US/release_notes_4_2.rst +++ b/docs/en_US/release_notes_4_2.rst @@ -47,4 +47,5 @@ Bug fixes | `Bug #3927 `_ - Fixed debugger issue for procedure inside package for EPAS servers. | `Bug #3929 `_ - Fix alignment of help messages in properties panels. | `Bug #3935 `_ - Ensure that grant wizard should list down functions for EPAS server running with no-redwood-compat mode. -| `Bug #3954 `_ - Remove Python 2.6 code that's now obsolete. \ No newline at end of file +| `Bug #3954 `_ - Remove Python 2.6 code that's now obsolete. +| `Bug #3955 `_ - Expose the bind address in the Docker container via PGADMIN_BIND_ADDRESS. \ No newline at end of file diff --git a/pkg/docker/entrypoint.sh b/pkg/docker/entrypoint.sh index 3d11ddab4..497eead4d 100755 --- a/pkg/docker/entrypoint.sh +++ b/pkg/docker/entrypoint.sh @@ -28,7 +28,7 @@ fi # Using --threads to have multi-threaded single-process worker if [ ! -z ${PGADMIN_ENABLE_TLS} ]; then - exec gunicorn --bind [::]:${PGADMIN_LISTEN_PORT:-443} -w 1 --threads ${GUNICORN_THREADS:-25} --access-logfile - --keyfile /certs/server.key --certfile /certs/server.cert run_pgadmin:app + exec gunicorn --bind ${PGADMIN_LISTEN_ADDRESS:-[::]}:${PGADMIN_LISTEN_PORT:-443} -w 1 --threads ${GUNICORN_THREADS:-25} --access-logfile - --keyfile /certs/server.key --certfile /certs/server.cert run_pgadmin:app else - exec gunicorn --bind [::]:${PGADMIN_LISTEN_PORT:-80} -w 1 --threads ${GUNICORN_THREADS:-25} --access-logfile - run_pgadmin:app + exec gunicorn --bind ${PGADMIN_LISTEN_ADDRESS:-[::]}:${PGADMIN_LISTEN_PORT:-80} -w 1 --threads ${GUNICORN_THREADS:-25} --access-logfile - run_pgadmin:app fi