hookshot/docs/advanced/workers.md

36 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

Workers
=======
Hookshot supports running in a worker configuration, using Redis as the middleman process to handle traffic between processes.
<section class="warning">
This feature is <b>experimental</b> and should only be used when you are reaching natural limits in the monolith process.
</section>
## Running in multi-process mode
You must first have a working Redis instance somewhere which can talk between processes. For example, in Docker you can run:
`docker run --name redis-host -p 6379:6379 -d redis`.
The processes should all share the same config, which should contain the correct config to enable Redis:
```yaml
queue:
redisUri: "redis://redis-host:6379"
cache:
redisUri: "redis://redis-host:6379"
```
Note that if [encryption](./encryption.md) is enabled, you MUST enable the `cache` config but NOT the `queue` config. Workers require persistent
storage in Redis, but cannot make use of worker-mode queues.
Add support for native e2ee (#299) * Add support for native e2ee * Various temps to coax it into working * Formatting nitpicks * Include stable registration config key for msc2409 * Update default config with encryption options * Manage admin rooms with bot-sdk DMs This also enables encryption for new admin rooms when appropriate. * Update config comments for encryption settings - Add comment to clarify Redis (the `queue` section) must be configured in order for encryption to work - Mention that the `encryption` section is optional, and omitting it will disable encryption support * Update docs for encryption support * Add changelog * Add to docs some notes about encryption state * Move all post-join logic to onRoomJoin * Block post-join actions on crypto setup Requires https://github.com/turt2live/matrix-bot-sdk/pull/269 * Fix linter error * Update encryption docs and changelog - Mention that worker mode isn't supported with encryption yet - Mention removal of Pantalaimon-based encryption * Update worker docs with encryption config notice * Share main appservice config with feed bots This is required to safely enable encryption for the bots that post GenericHook messages. * Make slight clarification for queue config * Minor fixes * Block post-join actions on feed bot crypto setup Same as a9e6e11d but for the sub-bots that post GenericHook messages. * Get joined rooms from intent instead of bot This refreshes the list of known rooms for crypto events. * Use Element fork of bot-sdk for crypto fixes Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
2022-12-09 15:25:36 +00:00
Once that is done, you can simply start the processes by name using yarn:
```
yarn start:webhooks
yarn start:matrixsender
yarn start:app
```
Be aware that you will need to start all worker types when running in worker mode, as the service does not allow a hybrid worker approach.