Update README.md

Created an FAQ section and added an example docker compose file entry.
This commit is contained in:
Helikoptermann2 2023-01-29 23:04:14 +01:00 committed by GitHub
parent a8a53c33b2
commit 42a9ed449d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,6 +63,19 @@ docker run -it -v storage:/storage --env-file=./.env --name matrix-chatgpt-bot m
Note: Without -it flags in the command above you won't be able to stop the container using Ctrl-C
You can also simply use a docker-compose file. Either with a self-build image (run `docker build . -t matrix-chatgpt-bot`) or the pre-build package from this repo.
```
version: '3.7'
services:
matrix-chatgpt-bot:
container_name: matrix-chatgpt-bot
image: matrix-chatgpt-bot # change to ghcr.io/matrixgpt/matrix-chatgpt-bot if you want to use the pre-build package
volumes:
- ./storage:/storage
env_file:
- ./.env
````
## without Docker
It is strongly recommended you run this package under Docker.
@ -90,5 +103,37 @@ If you've never set up a Matrix client before you can follow the prompts to get
Please use the search on Github and Matrix before asking for support.
# Good to know
- The "storage"-folder contains all your encryption keys. If you delete it, you will loose access to all your encrypted messages.
- The bot will reply in a thread. If you want to keep the context you need to reply to this thread otherwise the bot will think its a new conversation. "Threads" are still an experimental feature so you would need to activate it in your clients settings (e.g. in Element in the "lab"-section).
# FAQ
## What do I do if a login fails?
- Its strongly suggested to use google as the prefererred login method to avoid being not abled to solve the required captchas
- Make sure that 2FA is deactivated (E.g. use the above mentioned workaroud or create a fresh google account
## How do I handle "[Error: decryption failed because the room key is missing]"
Encryption works great with this package but can sometimes be a bit sensitive. Following steps can help to solve the "encryption" error
- Don't use a `MATRIX_ACCESS_TOKEN` extracted via Element-App, use the generated token from this package based on your `MATRIX_BOT_USERNAME` & `MATRIX_BOT_PASSWORD` set in the env-file. It will be visible in the console at start up. After adding it to your env-file you need to restart the bot.
- If all fails, you can always reset your key storage. It's important to exercise all of the following steps, because any remaining data could lead to the next encryption error. Once everything is working, make sure to not touch the "storage" folder anymore:
1. Stop the Bot
2. Delete the "storage" folder
3. Delete all user data of your matrix bot account (e.g. using Synapse-Admin)
4. Log into your bot account (e.g. via Element) and log out of all sessions
5. Verify your env-file and then run the bot setup again (e.g. via `docker-compose up` if you use docker-compose).
- If you experience this error after adding the bot to a new room but it was working before, you can try to use the command `/discardsession` in the element app to drop the session and trigger a new one. In this error case, the error only appears on a specific device, so using another client should work eitherway.
## What to do if I get an error saying I'm not logged in?
- If the bot can't log into your OpenAI account, your session token might not been valid anymore (e.g. you logged out of your OpenAI-Account through your Browser). Re-login to your OpenAI account using a machine in the same network as the machine your bot is using. Then restart the bot.
## I just want to chat with the bot and don't want to deal with encryption problems
- Set `MATRIX_ENCRYPTION=false` in your env-file and restart the bot. If it previously was running with encryption switched on, you need to create a new room with the bot as encryption can't be switched off once it was activated.
# License
GNU AGPLv3. See LICENSE