-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
[question] (Re)setting password without mail server/via cli? #410
Comments
Oh actually, nevermind. It was quite easy to do: But tbh it would be nice to have some sort of admin cli tools. Or am I missing something out and there's such a thing already? |
Hi @hatkidchan, glad you managed to find a solution yourself! Otherwise, I was gonna suggest the exact same procedure. Currently, there is no such thing as a CLI, but I agree that it would be useful to have. I'll add this as a feature request. See #411. |
Also, I added your solution to https://github.com/muety/wakapi/wiki/FAQs. |
Hello @muety It does not work. Maybe password hashing was changed since this post? |
@gacekssj4 what version you're on? I've tested it on 2.3.8 and it seems to work for me |
@hatkidchan 2.10.2
|
Since 35ef323 they migrated to Argon2, so my "solution" doesn't work anymore. You can try looking up how to rehash password using it, but I myself have no clue |
Thanks for hint! FAQ is outdated then :) |
|
Let me know if that works. If yes, I'll update the FAQs! |
I'm staying on pre-argon2id version for the time being, not sure how smooth migration process is. @muety should be fine to just reinstall it to the latest with the older SQLite database file? I'll wait for @gacekssj4 to share their results with rehashing |
Since version 2.8.0, new users will have Argon2-hashed passwords, but Bcrypt password are still supported. Regardless of this, I'd recommend to update to the latest version (because newer is usually better 😉). You can simply pull the new version and boot it up. It will perform all required database migrations, etc., so (in theory) no need for manual action. However, please still make sure to backup your database before the update - just in case. |
Tried. Can't make it work. Not with argon2id nor with bcrypt Also, in database earlier I had string starting with So maybe it's a matter of parameters. BCrypt created random string, Argon creates same string every time. I also tried I create salt outside of docker. Maybe real salt is created based on it when docker starts and in reality it's different? |
Couldn't make it work with argon2, tried lots of options (argon2, argon2i, argon2id), but my argon2 binary only has support for 13th version max, while wakapi uses v19. Not sure if that's a big problem, but I just couldn't make it work. Maybe since Bcrypt is still supported, you can try using it to log in at first and then reset password within wakapi web UI itself. That did work for me, but not sure if that'll work for everyone. |
|
@hatkidchan It's same. I never pgorammed in go. So either there is some additional hashing or I'm doing something wrong. |
I think I figured it out, you have to append salt to the password AND use it in argon2 |
Yes! |
Yeah, sorry, should have mentioned that. You can find the relevant piece of code here. Terminology is a bit confusing here. What Wakapi refers to as a salt is actually a pepper, while the salt is usually randomly generated for every user and stored in the database alongside the hash. See this post for details. So in Wakapi, pepper is identical for all users, while salt is random and differs for every user. I'd adapt your above command to this: printf "%s%s" "$PASSWORD" "$SALT" | argon2 $(openssl rand -hex 16) -id -e |
Updated the FAQ. |
Just now... i tried logging again and it works. But this time i hit login button instead of "Enter/return" button. No idea, maybe password manager in browser was not working. No idea. Thank you both for your help! |
The user is being cached in memory for a while after once loaded (i.e. after log in). If you change a user attribute in the database manually without restarting the server, the change will not take effect. |
I recently had to migrate my server and forgot to back up password salt which made every account unusable. I found an sqlite database that contains user data, but I'm not sure how to change passwords properly with other salt. I know that you can reset password via email, but that's not gonna work for me because it's a local server without mail server configured. How should I reset my passwords?
The text was updated successfully, but these errors were encountered: