add instructions for resetting password (#374)

This commit is contained in:
Arya K 2023-04-14 20:54:50 +05:30 committed by GitHub
parent d9af00b09d
commit 15eef0af6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 1 deletions

View file

@ -19,6 +19,7 @@
- [Database Information and Maintenance](./db-maintenance.md)
- [Issues with CAPTCHA](./captcha-bug.md)
- [How to setup Anti-Captcha](./anti-captcha.md)
- [How to reset a user's password](./reset-pass.md)
## For Developers

25
docs/reset-pass.md Normal file
View file

@ -0,0 +1,25 @@
# How to reset a user's password
Resetting a user's invidious password needs you to edit the database.
Firstly, generate a bcrypt-encrypted hash for the new password you want to set for the user.
This can be done with the `bcrypt` python module, though there are other ways of doing the same.
```
python3 -c 'import bcrypt; print(bcrypt.hashpw(b"<INSERT PASSWORD HERE>", bcrypt.gensalt(rounds=10)).decode("ascii"))'
```
To do so, first attach to the database:
```
# su - postgres
$ psql
postgres=# \c invidious
```
Now, run the following SQL query:
```
UPDATE users SET password = 'HASH' WHERE email = 'USERNAME';
```
After that, the password should be reset.

View file

@ -31,6 +31,7 @@ nav:
- 'anti-captcha.md'
- 'takedown.md'
- 'hide-instance-behind-proxy-server.md'
- 'reset-pass.md'
- 'For Developers':
- 'api.md'
- 'api/common_types.md'