From 2a86c7e54edbe2d4097e311b6b899bf2c217cb06 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Sat, 16 May 2026 23:32:05 +0200 Subject: [PATCH] Homelable: replace passlib with bcrypt for password hashing (#14530) --- install/homelable-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/homelable-install.sh b/install/homelable-install.sh index e356ab5c8..28e020f81 100644 --- a/install/homelable-install.sh +++ b/install/homelable-install.sh @@ -33,7 +33,7 @@ msg_ok "Set up Python Backend" msg_info "Configuring Homelable" mkdir -p /opt/homelable/data SECRET_KEY=$(openssl rand -hex 32) -BCRYPT_HASH=$(/opt/homelable/backend/.venv/bin/python -c "from passlib.context import CryptContext; print(CryptContext(schemes=['bcrypt']).hash('admin'))") +BCRYPT_HASH=$(/opt/homelable/backend/.venv/bin/python -c "import bcrypt; print(bcrypt.hashpw(b'admin', bcrypt.gensalt()).decode())") cat </opt/homelable/backend/.env SECRET_KEY=${SECRET_KEY} SQLITE_PATH=/opt/homelable/data/homelab.db @@ -59,7 +59,7 @@ while [[ -z "$NEW_PASS" ]]; do fi done -HASH=$(/opt/homelable/backend/.venv/bin/python -c "from passlib.context import CryptContext; print(CryptContext(schemes=['bcrypt']).hash('${NEW_PASS}'))") +HASH=$(/opt/homelable/backend/.venv/bin/python -c "import bcrypt; print(bcrypt.hashpw('${NEW_PASS}'.encode(), bcrypt.gensalt()).decode())") sed -i "s|^AUTH_PASSWORD_HASH=.*|AUTH_PASSWORD_HASH='${HASH}'|" /opt/homelable/backend/.env