diff --git a/docs/index.md b/docs/index.md index 93c65d4..32a2c93 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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 diff --git a/docs/reset-pass.md b/docs/reset-pass.md new file mode 100644 index 0000000..541ee1b --- /dev/null +++ b/docs/reset-pass.md @@ -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"", 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. diff --git a/mkdocs.yml b/mkdocs.yml index f552c99..1f0c737 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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/ \ No newline at end of file + - pymdownx.details # https://facelessuser.github.io/pymdown-extensions/extensions/details/