Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forgot email and password, what to do? #283

Open
RyansSohn opened this issue Jan 2, 2024 · 9 comments
Open

Forgot email and password, what to do? #283

RyansSohn opened this issue Jan 2, 2024 · 9 comments

Comments

@RyansSohn
Copy link

RyansSohn commented Jan 2, 2024

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)

@pgorod
Copy link

pgorod commented Jan 26, 2024

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
Copy link

pgorod commented Jan 26, 2024

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/

@bhofmann
Copy link

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...

@pgorod
Copy link

pgorod commented Feb 15, 2024

@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...

@bhofmann
Copy link

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.

@pgorod
Copy link

pgorod commented Feb 15, 2024

Ah ok.

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

@ArneSioen
Copy link

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!

@illuzn
Copy link

illuzn commented Jul 2, 2024

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
Copy link

illuzn commented Jul 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants