l4rm4nd / VoucherVault

Django web application to store and manage vouchers, coupons, loyalty and gift cards digitally. Supports expiry notifications, transaction histories, file uploads and OIDC SSO.
https://github.com/l4rm4nd/VoucherVault/wiki
GNU General Public License v3.0
162 stars 3 forks source link

Admin password retrieval #11

Closed superdingo101 closed 3 months ago

superdingo101 commented 3 months ago

Describe the bug Is there a way to recover the admin password?

Affected version 0.1.6, but really the docs should be updated to include the method of password retrieval.

To Reproduce Steps to reproduce the behavior:

  1. Spin up instance through "docker compose up" using docker-compose.yml
  2. Restart server later with "docker compose down && docker compose up"

Expected behavior A method called out in the docs to recover the admin password at a later date.

l4rm4nd commented 3 months ago

Hey @superdingo101 ,

the README outlines it quite clearly.

The admin password is auto-generated and displayed once in the container logs. You have to retrieve the admin password at the first time spinning up the container. Otherwise, the password is lost.

docker compose logs -f

If password is lost, you can remove the ./volume-data/database/db.sqlite3 database file and start freshly. Ensure to note down the admin password this time. You will loose all your previously configured data.

Alternatively, if you already have started using VoucherVault but did not note down the admin password, you can still recover. VoucherVault is developed with the Django framework. Therefore, you can use native Django tooling to create a new superuser or reset a user's password.

To do so, follow these steps:

# exec into the docker container
docker exec -it vouchervault bash

# reset the password
python manage.py changepassword admin

Afterwards, you can authenticate with the newly set password.

l4rm4nd commented 3 months ago

May read the wiki too.

Just created it now and will add new entries over the next days.

https://github.com/l4rm4nd/VoucherVault/wiki/02-%E2%80%90-Authentication#change-user-passwords