From f3b9feba2a16340c4753e39d98ae10aa21b8dfeb Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 27 Mar 2026 16:00:30 +0100 Subject: [PATCH] fix(ente): use TCP connection for psql in ente-setup Peer authentication fails when running as root but connecting as user 'ente'. Use PGPASSWORD with -h 127.0.0.1 to force TCP/password authentication instead of Unix socket peer auth. --- install/ente-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/ente-install.sh b/install/ente-install.sh index 968c6b1b..a2211ba4 100644 --- a/install/ente-install.sh +++ b/install/ente-install.sh @@ -356,8 +356,8 @@ if [ -z "$EMAIL" ]; then fi DB_NAME="$(grep -A4 '^db:' /opt/ente/server/museum.yaml | awk '/name:/{print $2}')" -DB_USER="$(grep -A4 '^db:' /opt/ente/server/museum.yaml | awk '/user:/{print $2}')" -USER_ID=$(psql -U "$DB_USER" -d "$DB_NAME" -tAc "SELECT user_id FROM users WHERE email='$EMAIL' LIMIT 1;") +DB_PASS="$(grep -A5 '^db:' /opt/ente/server/museum.yaml | awk '/password:/{print $2}')" +USER_ID=$(PGPASSWORD="$DB_PASS" psql -h 127.0.0.1 -U ente -d "$DB_NAME" -tAc "SELECT user_id FROM users WHERE email='$EMAIL' LIMIT 1;") if [ -z "$USER_ID" ]; then echo "Error: No user found with email $EMAIL" echo "Make sure you created and verified the account via the web UI first."