Ensure PGADMIN_DEFAULT_EMAIL looks sane when initialising a container deployment. Fixes #6227

This commit is contained in:
Dave Page 2021-02-26 16:57:03 +00:00
parent 544483ae1f
commit cafd2af96d
2 changed files with 8 additions and 1 deletions

View File

@ -23,3 +23,4 @@ Bug fixes
| `Issue #5628 <https://redmine.postgresql.org/issues/5628>`_ - Remove the "launch now" option in the Windows installer, as UAC could cause it to run as an elevated user.
| `Issue #6018 <https://redmine.postgresql.org/issues/6018>`_ - Fixed encoding issue when database encoding set to SQL_ASCII and name of the column is in ASCII character.
| `Issue #6159 <https://redmine.postgresql.org/issues/6159>`_ - Ensure that the user should be able to kill the session from Dashboard if the user has a 'pg_signal_backend' role.
| `Issue #6227 <https://redmine.postgresql.org/issues/6227>`_ - Ensure PGADMIN_DEFAULT_EMAIL looks sane when initialising a container deployment.

View File

@ -23,7 +23,13 @@ fi
if [ ! -f /var/lib/pgadmin/pgadmin4.db ]; then
if [ -z "${PGADMIN_DEFAULT_EMAIL}" -o -z "${PGADMIN_DEFAULT_PASSWORD}" ]; then
echo 'You need to specify PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD environment variables'
echo 'You need to define the PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD environment variables.'
exit 1
fi
echo ${PGADMIN_DEFAULT_EMAIL} | grep -E "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$" > /dev/null
if [ $? -ne 0 ]; then
echo "'${PGADMIN_DEFAULT_EMAIL}' does not appear to be a valid email address. Please reset the PGADMIN_DEFAULT_EMAIL environment variable and try again."
exit 1
fi