loomio/abra.sh
stevensting 112a1f6d3a
Some checks failed
continuous-integration/drone/pr Build is failing
add redis password and increase version. does not work yet
2025-02-16 11:49:16 +01:00

17 lines
671 B
Bash

export LOOMIO_ENTRYPOINT_VERSION=v5
export REDIS_ENTRYPOINT_VERSION=v1
# cannot be integrated into entrypoint.sh as it requires the operator to create a user first
function make_last_user_admin()
{
export DATABASE_URL="postgresql://${POSTGRES_USER}:$(cat /run/secrets/db_password)@db/${POSTGRES_DB}"
SECRET_KEY_BASE=$(rake secret) rails runner "User.last.update(is_admin: true)"
}
# only run when upgrading from 0.6.0+v2.25.2 and earlier to 1.0.0+v2.25.2 and later
function set_new_db_password()
{
echo "setting new password for db user..."
psql -U $POSTGRES_USER -c "ALTER USER $POSTGRES_USER PASSWORD '$(cat /run/secrets/db_password)';"
echo "done"
}