File tree Expand file tree Collapse file tree
root/ppg/devel/pgadmin/containers/percona-pgadmin4/obs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,12 +94,26 @@ if [ ! -e "${SQLITE_PATH}" ] && [ "${external_config_db_exists}" = "False" ]; th
9494 /usr/bin/pgadmin4-cli set-prefs " ${PGADMIN_DEFAULT_EMAIL} " --input-file " ${prefs_json} "
9595 fi
9696elif [ " ${PGADMIN_REPLACE_SERVERS_ON_STARTUP:- } " = " True" ]; then
97+ if [ -z " ${PGADMIN_DEFAULT_EMAIL:- } " ]; then
98+ echo ' PGADMIN_REPLACE_SERVERS_ON_STARTUP=True requires PGADMIN_DEFAULT_EMAIL to be set.' >&2
99+ exit 1
100+ fi
97101 server_json=" ${PGADMIN_SERVER_JSON_FILE:-/ pgadmin4/ servers.json} "
98102 if [ -f " ${server_json} " ]; then
99103 /usr/bin/pgadmin4-cli load-servers " ${server_json} " --user " ${PGADMIN_DEFAULT_EMAIL} " --replace
100104 fi
101105fi
102106
107+ # --- External-config-DB mode: prevent launcher double-init -----------------
108+ # The launcher's own first-run branch fires whenever its sqlite path is
109+ # absent and DEFAULT_EMAIL/DEFAULT_PASSWORD are set, with no knowledge of an
110+ # external config DB. We already decided above (external_config_db_exists)
111+ # that setup must not run; clear these so the launcher can't re-decide to
112+ # run setup-db against the external DB.
113+ if [ " ${external_config_db_exists} " = " True" ]; then
114+ unset PGADMIN_DEFAULT_EMAIL PGADMIN_DEFAULT_PASSWORD
115+ fi
116+
103117# --- TLS pre-flight ---------------------------------------------------------
104118# The launcher wires the certs; fail early and clearly when they are missing.
105119if [ " ${PGADMIN_ENABLE_TLS:- } " = " true" ]; then
You can’t perform that action at this time.
0 commit comments