Allow the path to /pgadmin4/servers.json to be overridden in the container distribution. Fixes #4400

This commit is contained in:
Andrew Coleman 2019-06-27 10:56:37 -04:00 committed by Dave Page
parent da8cf14047
commit d397959f6a
3 changed files with 11 additions and 2 deletions

View File

@ -68,6 +68,13 @@ Default: 80 or 443 (if TLS is enabled)
Allows the port that the server listens on to be set to a specific value rather
than using the default.
*PGADMIN_SERVER_JSON_FILE*
Default: /pgadmin4/servers.json
Override the default file path for the server definition list. See the
/pgadmin4/servers.json mapped file below for more information.
*GUNICORN_THREADS*
Default: 25

View File

@ -10,6 +10,7 @@ New features
************
| `Feature #4139 <https://redmine.postgresql.org/issues/4139>`_ - Allow some objects to be dragged/dropped into the Query Tool to insert their signature into the query text.
| `Feature #4400 <https://redmine.postgresql.org/issues/4400>`_ - Allow the path to /pgadmin4/servers.json to be overridden in the container distribution.
Bug fixes
*********

View File

@ -15,9 +15,10 @@ if [ ! -f /var/lib/pgadmin/pgadmin4.db ]; then
# Importing pgadmin4 (from this script) is enough
python run_pgadmin.py
export PGADMIN_SERVER_JSON_FILE=${PGADMIN_SERVER_JSON:-/pgadmin4/servers.json}
# Pre-load any required servers
if [ -f /pgadmin4/servers.json ]; then
/usr/local/bin/python /pgadmin4/setup.py --load-servers /pgadmin4/servers.json --user ${PGADMIN_DEFAULT_EMAIL}
if [ -f "${PGADMIN_SERVER_JSON_FILE}" ]; then
/usr/local/bin/python /pgadmin4/setup.py --load-servers "${PGADMIN_SERVER_JSON_FILE}" --user ${PGADMIN_DEFAULT_EMAIL}
fi
fi