Files
stevensting 86fd81a825
continuous-integration/drone/push Build is failing
fix postgres backup (#30)
<!--
Thank you for doing recipe maintenance work!
Please mark all checklist items which are relevant for your changes.
Please remove the checklist items which are not relevant for your changes.
Feel free to remove this comment.
-->

* [x] I have deployed and tested my changes
* [x] I have [updated relevant versions in `abra.sh`](https://docs.coopcloud.tech/maintainers/upgrade/#updating-versions-in-the-abrash)
* [x] I have made my environment variable changes [backwards compatible](https://docs.coopcloud.tech/maintainers/upgrade/#backwards-compatible-environment-variable-changes)
* [x] I have added a [release note entry](https://docs.coopcloud.tech/maintainers/upgrade/#creating-new-release-notes)

Info for release notes:

> Up until now the backups only worked sporadically, as they used the database volume and not the dump due to wring path. Upgrading to this version will start produce reliable backups. Older backups cannot be restored with backup bot anymore, and should be copied manually. (In case there is a working one)

Reviewed-on: #30
Reviewed-by: Jackie Makdah <jackiemak22@proton.me>
Co-authored-by: stevensting <stefan@klasse-methode.it>
Co-committed-by: stevensting <stefan@klasse-methode.it>
2026-07-17 11:08:45 +00:00

18 lines
665 B
Bash

export LOOMIO_ENTRYPOINT_VERSION=v8
export PG_BACKUP_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"
}