Skip to content

Invidious App

About

Invidious is an open source alternative front-end to YouTube.

Periodic Restart

The upstream docs recommends restarting Invidious often, at least once a day, ideally every hour because of various issues.

If you hit issues, you can set up a cron job to restart it periodically:

# restart every hour
0 * * * * echo "==> Restarting invidious periodically" && supervisorctl restart invidious

Password Reset

Note

From the official documentation Reset user password abridged to fit Cloudron needs.

The following script can be copy and pasted into your Web Terminal of the Invidious app and will create a new admin password.

You will need the user id of which user your want to reset the password for.

To list all users you can run:

PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} -c "SELECT email FROM users;"

Copy and paste this into your Web Terminal

#!/bin/sh
set -e
clear

printf 'User ID: '
read -r ID
if [ "$(PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} -c "SELECT email FROM users WHERE email = '$ID';" | tail -n 2 | head -n 1)" != '(1 row)' ]; then
    echo 'Error: User ID does not exist'
    exit 1
fi
PASSWORD=$(openssl rand -hex 16)
printf "New password is: $PASSWORD\n"
HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw(b\"$PASSWORD\", bcrypt.gensalt(rounds=10)).decode(\"ascii\"))")
PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} -c "UPDATE users SET password = '$HASH' WHERE email = '$ID';" &> /dev/null