Skip to content

Instantly share code, notes, and snippets.

@storopoli
Last active June 15, 2025 10:58
Show Gist options
  • Save storopoli/77c5bd0b01e84f2007aa86def5d76e79 to your computer and use it in GitHub Desktop.
Save storopoli/77c5bd0b01e84f2007aa86def5d76e79 to your computer and use it in GitHub Desktop.
continuwuity matrix home server with bridges
CONDUWUIT_REGISTRATION_TOKEN="foo"
.env
conduwuit-data
heisenbridge-data
mautrix-discord-data
mautrix-telegram-data
services:
homeserver:
# continuwuity:v0.5.0-rc.6
image: forgejo.ellis.link/continuwuation/continuwuity@sha256:4faba7a3764ffda4d578a1b229832169f2a6ef47264ea6f60c18b94f7db3eeaa
restart: unless-stopped
container_name: homeserver
hostname: homeserver
volumes:
- ./conduwuit-data:/var/lib/conduwuit
# - /etc/resolv.conf:/etc/resolv.conf:ro # Use the host's DNS resolver rather than Docker's.
# - ./conduwuit.toml:/etc/conduwuit.toml
environment:
CONDUWUIT_SERVER_NAME: storopoli.com # EDIT THIS
CONDUWUIT_DATABASE_PATH: /var/lib/conduwuit
CONDUWUIT_PORT: 6167
CONDUWUIT_MAX_REQUEST_SIZE: 20000000 # in bytes, ~20 MB
CONDUWUIT_ALLOW_REGISTRATION: "false"
CONDUWUIT_REGISTRATION_TOKEN: ${CONDUWUIT_REGISTRATION_TOKEN} # A registration token is required when registration is allowed.
#CONDUWUIT_YES_I_AM_VERY_VERY_SURE_I_WANT_AN_OPEN_REGISTRATION_SERVER_PRONE_TO_ABUSE: 'true'
CONDUWUIT_ALLOW_FEDERATION: "true"
CONDUWUIT_ALLOW_CHECK_FOR_UPDATES: "true"
CONDUWUIT_TRUSTED_SERVERS: '["matrix.org"]'
#CONDUWUIT_LOG: warn,state_res=warn
CONDUWUIT_ADDRESS: 0.0.0.0
#CONDUWUIT_CONFIG: '/etc/conduwuit.toml' # Uncomment if you mapped config toml above
ports:
- "6167:6167"
- "8008:6167"
- "8448:6167"
networks:
matrix:
aliases:
- homeserver
#entrypoint: conduwuit --execute "users create_user jose"
mautrix-discord:
# mautrix-discord:v0.7.3
image: dock.mau.dev/mautrix/discord@sha256:852f900a2d326de1894ed8f1f6b22dbc2cc328e4e01ba1065ba32170e63e0ae8
restart: unless-stopped
container_name: mautrix-discord
hostname: mautrix-discord
volumes:
- ./mautrix-discord-data:/data
ports:
- "29334:29334"
depends_on:
- homeserver
networks:
matrix:
aliases:
- mautrix-discord
mautrix-telegram:
# mautrix-telegram:v0.15.2
image: dock.mau.dev/mautrix/telegram@sha256:a4682b4e87eb7efc1d3f8541d860a2db5fbe37ed3a2c4c20dc4c59d138d61a08
restart: unless-stopped
container_name: mautrix-telegram
hostname: mautrix-telegram
volumes:
- ./mautrix-telegram-data:/data
depends_on:
- homeserver
ports:
- "29335:29335"
networks:
matrix:
aliases:
- mautrix-telegram
heisenbridge:
# heisenbridge:1.15.3
image: hif1/heisenbridge@sha256:53dce310a09cebaa684fd1f1ebeb3c78874f98679622e166ea41e7cde774f611
container_name: heisenbridge
hostname: heisenbridge
volumes:
- ./heisenbridge-init.sh:/heisenbridge-init.sh:ro
- ./heisenbridge-data:/data
entrypoint: /heisenbridge-init.sh
depends_on:
- homeserver
ports:
- "9898:9898"
networks:
matrix:
aliases:
- heisenbridge
networks:
matrix:
driver: bridge
#!/bin/sh
if [ ! -f /data/heisenbridge.yaml ]; then
echo "Generating registration file for Heisenbridge..."
python -m heisenbridge -c /data/heisenbridge.yaml --generate-compat --listen-address heisenbridge
echo "Registration file generated"
fi
echo "Starting Heisenbridge..."
python -m heisenbridge -c /data/heisenbridge.yaml --verbose --listen-address 0.0.0.0 --listen-port 9898 http://homeserver:6167
@storopoli
Copy link
Author

Telegram Mautrix Bridge

As of 2025-05-11 you need to manually create the user in continuwuity:

curl -X POST -H "Content-Type: application/json" -d '{"inhibit_login":true,"type":"m.login.application_service","username":"telegrambot"}' "http://<MATRIX_CONTAINER_NAME_HERE>:6167/_matrix/client/v3/register?user_id=%40telegrambot%3A<YOUR_DOMAIN_HERE>&access_token=<as_token FROM REGISTRATION FILE HERE>"

to confirm it worked:

curl "http://<MATRIX_CONTAINER_NAME_HERE>:6167/_matrix/client/v3/account/whoami?user_id=%40telegrambot:<YOUR_DOMAIN_HERE>&access_token=<as_token FROM REGISTRATION FILE HERE>"

A successful response should look like this:

{"user_id":"@telegrambot:<YOUR_DOMAIN_HERE>"}

Ref: mautrix/telegram#999

@storopoli
Copy link
Author

storopoli commented May 11, 2025

First run with continuwuity

You need to add to your docker-compose.yml:

services:
  homeserver:
    entrypoint: conduwuit --execute "users create_user <USER>"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment