addon-bookstack icon indicating copy to clipboard operation
addon-bookstack copied to clipboard

Forgot email and password, what to do?

Open RyansSohn opened this issue 2 years ago • 9 comments

Problem/Motivation

Hi, I forgot my email and my password. I did some research about how to change the admin password in bookstack, but there is no solution for bookstack as an add-on in homeassistant. There is an official post of bookstack, where they explain, that you can create a new admin account with a command, but you can't use this command in the homeassistant terminal. (https://www.bookstackapp.com/docs/admin/commands/) Can somebody help me? Maybe you just need to convert the command to use it in the homeassistant terminal, but I don't know how.

Maybe this helps? https://www.reddit.com/r/BookStack/comments/15au2ru/forgot_email_and_password/

(Why the issue was filed)

Expected behavior

you now the password and email

(What you expected to happen)

Actual behavior

you forgot password and email

(What actually happened)

Steps to reproduce

nothing

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix, describe the rationale behind it)

RyansSohn avatar Jan 02 '24 21:01 RyansSohn

I have the same problem. This is a bit basic, I am sure there must be a way.

Any help appreciated - including instruction on how to wipe out bookstack and start fresh.

pgorod avatar Jan 26 '24 13:01 pgorod

Partially answering myself:

from HASS shell, you can get into the Bookstack add-on container:

List containers:

docker ps | grep bookstack

Grab the id from that list and use it in this next command:

docker exec -it 9515ff3014a0 bash

From inside that new shell, you can go ahead and

php artisan bookstack:create-admin --email="[email protected]" --name="Admin" --password="password"

That did not work for me, but I am not sure why, and maybe it's specific to my installation, so for you, at least it's worth a try...

Back outside the docker container, in the main HASS shell, you can also...

Enter the database:

mysql

And use SQL commands like

use bookstack; show tables; select user, password from users;

Passwords will be hashed, of course. You can also use an SQL UPDATE to add your own password, get the hash from here: https://bcrypt-generator.com/

pgorod avatar Jan 26 '24 16:01 pgorod

same problem here, no chance to get it fixed, reinstalling bookstack didn't help. So thanks for that plugin but without a chance to easily set/reset users/passwords from within the config page in HA it is useless...

bhofmann avatar Feb 15 '24 01:02 bhofmann

@bhofmann are you aware that there is a default user name and password, did you try those?

I find it strange that you wrote that reinstalling bookstack didn't help...

pgorod avatar Feb 15 '24 07:02 pgorod

Sure, I have tried this first and I expected that at least with deleting the add-on or integration and reinstall might fix this all, so I could start from scratch, but no, it seems that some things, maybe the mysql tables for book stack didn't get deleted and will be reused after a complete new install.

bhofmann avatar Feb 15 '24 08:02 bhofmann

Ah ok.

And did you try the solution going through docker that I posted above?

pgorod avatar Feb 15 '24 10:02 pgorod

Partially answering myself:

from HASS shell, you can get into the Bookstack add-on container:

List containers:

docker ps | grep bookstack

Grab the id from that list and use it in this next command:

docker exec -it 9515ff3014a0 bash

From inside that new shell, you can go ahead and

php artisan bookstack:create-admin --email="[email protected]" --name="Admin" --password="password"

That did not work for me, but I am not sure why, and maybe it's specific to my installation, so for you, at least it's worth a try...

Back outside the docker container, in the main HASS shell, you can also...

Enter the database:

mysql

And use SQL commands like

use bookstack; show tables; select user, password from users;

Passwords will be hashed, of course. You can also use an SQL UPDATE to add your own password, get the hash from here: https://bcrypt-generator.com/

Thank you! the sql edit worked for me!

ArneSioen avatar Mar 29 '24 11:03 ArneSioen

reinstalling bookstack didn't help

It will not help because bookstack uses the MariaDB database to store username/ password information. If you want to start from scratch you need to fully remove and reinstall MariaDB as well (beware if Maria DB is also your DB engine for Home Assistant).

illuzn avatar Jul 02 '24 13:07 illuzn

From inside that new shell, you can go ahead and

php artisan bookstack:create-admin --email="[email protected]" --name="Admin" --password="password"

That did not work for me, but I am not sure why, and maybe it's specific to my installation, so for you, at least it's worth a try...

This needs to be run from /var/www/bookstack which is where the artisan application is mapped to in this instance.

illuzn avatar Jul 02 '24 13:07 illuzn