Skip to content

Commit e1f27e8

Browse files
committed
[deploy] Fixed password authentication failure #562
Prevents credential mismatch when reinstalling without clearing volumes. The script now detects existing postgres_data volumes and aborts with a clear warning instead of silently generating new credentials that break database connectivity. Fixes #562
1 parent 8f378f3 commit e1f27e8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

deploy/auto-install.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ setup_docker_openwisp() {
103103
echo -ne ${GRN}"Do you have .env file? Enter filepath (leave blank for ad-hoc configuration): "${NON}
104104
read env_path
105105
if [[ ! -f "$env_path" ]]; then
106+
if [[ ! -f "$INSTALL_PATH/.env" ]] && [[ ! -f "$ENV_BACKUP" ]]; then
107+
if docker volume inspect "docker-openwisp_postgres_data" &>/dev/null; then
108+
echo -e "${RED}CRITICAL: Existing database data detected!${NON}"
109+
echo -e "New credentials will break your connection to existing volumes."
110+
echo -e "\nTo fix, either restore your .env or run:"
111+
echo -e "${YLW}cd ${INSTALL_PATH} && docker compose down --volumes${NON}"
112+
echo -e "\nAborting to prevent authentication failure."
113+
exit 1
114+
fi
115+
fi
106116
# Dashboard Domain
107117
echo -ne ${GRN}"(1/5) Enter dashboard domain: "${NON}
108118
read dashboard_domain

0 commit comments

Comments
 (0)