Hi, Dave

On 1/22/19, Dave Page <dp...@pgadmin.org> wrote:
> Hi
>
> On Wed, Jan 16, 2019 at 12:41 PM Diego Augusto Molina
> <diegoaugustomol...@gmail.com> wrote:
>>
>> Here's the patch, sorry for the bad manners.
>
> That effectively reverts the fix committed to resolve this doesn't it?
> https://redmine.postgresql.org/issues/3392

Yeah, it really does.

>
> Maybe the way to go is to expose the bind address (or some options to
> control it) in variables that can be set at launch time, leaving the
> default as-is.
>
> Thoughts?

Sounds like the way to go. There goes the new humble patch for the
"/entrypoint.sh", which runs just fine. The new environment variable
is named PGADMIN_LISTEN_ADDRESS and defaults to "[::]". Tested with
the following Dockerfile:

$Dockerfile$
FROM dpage/pgadmin4:latest

RUN sed -i 's/\[::\]/${PGADMIN_BIND_ADDRESS:-[::]}/' /entrypoint.sh

# This is just candy but could be added for ease of use in debugging:
SHELL ["/bin/sh"]

$Dockerfile$



Thanks a lot!

>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
--- entrypoint.sh.orig	2019-01-29 02:03:30.325716765 -0300
+++ entrypoint.sh	2019-01-29 02:04:53.345658290 -0300
@@ -28,7 +28,7 @@
 # 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

Reply via email to