-
-
Notifications
You must be signed in to change notification settings - Fork 165
FAQs
Ferdinand Mütsch edited this page Jan 3, 2024
·
2 revisions
- Generate a new, random salt (any random string) and note it down
SALT="$(cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w ${1:-32} | head -n 1)"
echo $SALT
- Configure Wakapi to use that salt (by either passing it as an environment variable or via the config file
- Choose a password and hash it together with the salt (which, in fact, is actually a pepper, see here)
printf "%s%s" "$PASSWORD" "$SALT" | argon2 $(openssl rand -hex 16) -id -e
Note: This requires the argon2
pacakge to be installed (available via apt
or dnf
). Instead of the openssl
part, you can also use any other random string of at least 16 characters.
- Set the new password hash in your database via SQL
UPDATE users SET password = "<value-from-previous-step>" WHERE id = "your-username";
Also see this discussion for details.