114 lines
3.7 KiB
Markdown
114 lines
3.7 KiB
Markdown
# Synapse Docker Bridges
|
|
|
|
A simple way to set up Synapse with bridges for WhatsApp, Telegram, and Discord.
|
|
|
|
<p align="center">
|
|
<img src="https://gitlab.com/uploads/-/system/project/avatar/66695339/logo.png" alt="dendrite-docker-bridges"/>
|
|
</p>
|
|
|
|
## Before Starting
|
|
|
|
1. Make sure you set up your domain by following this documentation: [Dendrite Domain Name Setup](https://element-hq.github.io/dendrite/installation/domainname).
|
|
|
|
2. Ensure you have `docker` and `docker compose` installed on your server.
|
|
|
|
3. All commands will be executed in the project root, i.e., the directory where the repository was cloned.
|
|
|
|
## Features
|
|
|
|
- Integrated bridges for WhatsApp, Telegram, and Discord
|
|
- Simple setup process with provided scripts
|
|
- Docker-based deployment for easy maintenance
|
|
|
|
## Installation
|
|
|
|
1. Clone this repository and enter the directory:
|
|
|
|
```sh
|
|
git clone https://gitlab.com/rogs/synapse-docker-bridges.git
|
|
cd synapse-docker-bridges
|
|
```
|
|
|
|
2. Run `setup.sh`:
|
|
|
|
```sh
|
|
./setup.sh
|
|
```
|
|
|
|
This script will:
|
|
- Prompt you for your domain (the one you configured in "Before Starting")
|
|
- Generate a secure database password
|
|
- Create your private key and config in the `./config/synapse` directory
|
|
- Display the Database configuration info
|
|
|
|
**Important**: Make sure to save the Database information in a secure location. The Database URI will be needed later when configuring the bridges for WhatsApp, Telegram, and Discord.
|
|
|
|
3. Open your configuration file located at `./config/synapse/homeserver.yaml`. **You may need `sudo` to edit this file.** Search for `database` and replace it with the following:
|
|
|
|
```yaml
|
|
database:
|
|
name: psycopg2
|
|
args:
|
|
user: synapse
|
|
password: YourBigPassword # Replace with your DB password here!
|
|
dbname: synapse
|
|
host: postgres
|
|
cp_min: 5
|
|
cp_max: 10
|
|
```
|
|
|
|
4. Start the core services:
|
|
|
|
```sh
|
|
docker compose up -d postgres synapse
|
|
```
|
|
|
|
5. Once PostgreSQL is up, create the bridge databases:
|
|
|
|
```sh
|
|
./setup-db.sh
|
|
```
|
|
|
|
This script will create three new databases: `whatsapp`, `telegram`, and `discord`. These will be used by the bridges.
|
|
|
|
6. Verify the Synapse setup by navigating to `http://your-ip-address:8008` in your browser.
|
|

|
|
|
|
7. Create your first user using the provided script:
|
|
|
|
```sh
|
|
./create-user.sh
|
|
```
|
|
|
|
The script will:
|
|
- Prompt you for a username.
|
|
- Prompt you for a password.
|
|
- Ask if the user should be an admin.
|
|
- Create the account in your Synapse server.
|
|
- Display an access token.
|
|
|
|
**Important**: Save the access token displayed after user creation! You'll need it to enable double puppeting in the WhatsApp, Telegram, and Discord bridges. Double puppeting allows messages you send through the original apps to appear as coming from your Matrix account.
|
|
|
|
You can run this script multiple times to create additional users as needed.
|
|
|
|
For information about adding additional bridges to your setup:
|
|
- [Adding New Bridges](./ADDING_BRIDGES.md)
|
|
|
|
## Bridge Setup
|
|
|
|
Each bridge starts in a stopped state and will only run once properly configured. You can configure the bridges in any order:
|
|
|
|
1. Configure the bridge(s) you want to use:
|
|
- [WhatsApp Bridge Setup](./config/mautrix-whatsapp/README.md)
|
|
- [Telegram Bridge Setup](./config/mautrix-telegram/README.md)
|
|
- [Discord Bridge Setup](./config/mautrix-discord/README.md)
|
|
|
|
2. Start configured bridges:
|
|
```sh
|
|
docker compose up -d
|
|
```
|
|
|
|
Each bridge will only start if its configuration files exist. Bridges without configuration will remain stopped, which is normal.
|
|
|
|
**Note**: When configuring each bridge, you'll need to use the Database URI that was displayed during the setup process. Make sure you have saved it somewhere secure!
|