fix: invidious password

This commit is contained in:
2025-11-03 01:38:16 +01:00
parent b57342f53e
commit 63dad8c626
3 changed files with 39 additions and 35 deletions

View File

@@ -36,8 +36,11 @@ in
if [ "$USER_EXISTS" -eq "0" ]; then
echo "Creating admin user..."
# Read password from credential
PASSWORD=$(cat $CREDENTIALS_DIRECTORY/admin_password)
# Read password from credential and trim whitespace
PASSWORD=$(cat $CREDENTIALS_DIRECTORY/admin_password | tr -d '\n\r')
# Truncate to 55 characters (Invidious password limit)
PASSWORD="''${PASSWORD:0:55}"
# Generate bcrypt hash
HASH=$(${pythonWithBcrypt}/bin/python3 -c "import bcrypt; import sys; print(bcrypt.hashpw('$PASSWORD'.encode(), bcrypt.gensalt(rounds=10)).decode())")