docker icon indicating copy to clipboard operation
docker copied to clipboard

Lost APP_KEY

Open garfieldairlines opened this issue 2 years ago • 4 comments

Hello, I migrated the docker container and to be honest I forgot that the APPP_KEY setting was a thing. So I can't connect to Monica.

Is there a way to hard reset the user password ? I am the admin of MariaDB after all…

garfieldairlines avatar Feb 16 '24 15:02 garfieldairlines

Hawoof @garfieldairlines,

In Theorie yes

in my case i would firstly setup a new Monica with the new Secret After that i would create a new user, go to the Database->Table:users and then copy the password Then i would start the Old Monica with the new Secret and go again to Database->Table:users and then replace the old password string with the new Password String ^^

And then in theory it should work

i'm right @djaiss ?

NewtTheWolf avatar Mar 03 '24 12:03 NewtTheWolf

Nope, getting "The MAC is invalid."

garfieldairlines avatar Mar 18 '24 18:03 garfieldairlines

So in theory, this is how you should do:

  • generate a new APP_KEY in your project with php artisan key:generate in the console
  • get the encrypted password by invoking Tinker (php artisan tinker) and typing Hash::make('YOUR_NEW_PASSWORD') as shown below
  • update the password of your user in the database manually.

This will update the system with the new password.

image

djaiss avatar Mar 18 '24 18:03 djaiss

In that time I went the "long" route and made dumps after dumps of each relevant table, changed Monica to use the second table and it works (except for WebAuthn). Wasn't easy but for the future I'm documenting it (…and keeping the APP_key, totally forgot that one when migrating docker)

garfieldairlines avatar Mar 18 '24 19:03 garfieldairlines

You can reset the password with the reset password form.

asbiin avatar May 09 '24 12:05 asbiin