From 246faa4dcc9f4660dd75862d0b59c42b43483497 Mon Sep 17 00:00:00 2001 From: Vitaliy Tverdokhlib Date: Mon, 2 Jul 2018 20:11:52 +0300 Subject: [PATCH] add server mode --- README.md | 1 + config_distro.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5555aba..9c1c694 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ This image can be configured at runtime, by setting environment variables; - `PG_ADMIN_PORT` port to listen on (defaults to `5050`) - `PG_ADMIN_SESSION_DIR` directory to use for storing server-side sessions (defaults to `/dev/shm/pgAdmin4_session`) - `DEBUG` enable debug mode (detaults to `False`) +- `SERVER_MODE` enable server mode (detaults to `False` - docker run -d -p 5050:5050 -e PGADMIN_SETUP_EMAIL=pgadmin4@pgadmin.org -e PGADMIN_SETUP_PASSWORD=admin -e SERVER_MODE=true thajeztah/pgadmin4) More information on pgAdmin 4 development can be found here; diff --git a/config_distro.py b/config_distro.py index b848168..1548eef 100644 --- a/config_distro.py +++ b/config_distro.py @@ -33,7 +33,10 @@ # Server settings ########################################################################## -SERVER_MODE = False +if strtobool(os.getenv('SERVER_MODE', "false")) and "PGADMIN_SETUP_EMAIL" in os.environ and "PGADMIN_SETUP_PASSWORD" in os.environ: + SERVER_MODE = True +else: + SERVER_MODE = False DEFAULT_SERVER = '0.0.0.0' DEFAULT_SERVER_PORT = int(os.getenv('PG_ADMIN_PORT', 5050))