add instructions for resetting password (#374)
This commit is contained in:
parent
d9af00b09d
commit
15eef0af6f
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
|
@ -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/
|
||||
|
|
Loading…
Reference in New Issue