From 93015c3b5501015bcb32b5481c0e05c52586eda3 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 27 Mar 2026 16:02:02 +0100 Subject: [PATCH] fix(ente): emails are encrypted in DB, query first user_id instead Museum encrypts emails before storing (encrypted_email column). Cannot query by plaintext email. Instead select the first user_id which is the admin user created during first-start setup. --- 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 a2211ba4..f21dbdd0 100644 --- a/install/ente-install.sh +++ b/install/ente-install.sh @@ -357,9 +357,9 @@ fi DB_NAME="$(grep -A4 '^db:' /opt/ente/server/museum.yaml | awk '/name:/{print $2}')" 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;") +USER_ID=$(PGPASSWORD="$DB_PASS" psql -h 127.0.0.1 -U ente -d "$DB_NAME" -tAc "SELECT user_id FROM users ORDER BY user_id LIMIT 1;") if [ -z "$USER_ID" ]; then - echo "Error: No user found with email $EMAIL" + echo "Error: No users found in database." echo "Make sure you created and verified the account via the web UI first." exit 1 fi