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'
@ -62,4 +63,4 @@ markdown_extensions:
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.details # https://facelessuser.github.io/pymdown-extensions/extensions/details/
- pymdownx.details # https://facelessuser.github.io/pymdown-extensions/extensions/details/