ToM Bridge - Matrix Application Service for Twake Workplace
506
docker build -t tom-bridge .
The build uses a two stage process. The first stage installs the dependencies
and compiles the TypeScript source with tsc. The second stage, on
node:24-trixie-slim, holds only the compiled code and the production
dependencies, and runs as the unprivileged node user.
docker run --rm \
-v /path/to/config.yaml:/data/config.yaml:ro \
-v /path/to/registration.yaml:/data/registration.yaml:ro \
tom-bridge
The entrypoint runs node dist/index.js -c /data/config.yaml. The container
expects two YAML files mounted into /data:
/data/registration.yaml via the
REGISTRATION_FILE environment variable. If your config file already points
to the registration file through registrationPath, you may omit the separate
-f mount.The image runs as the node user (uid 1000): the mounted config.yaml and
registration.yaml must be readable by it.
The bridge accepts all flags from matrix-appservice-bridge. You can append
them after the image name:
docker run --rm \
-v /path/to/config.yaml:/data/config.yaml:ro \
tom-bridge \
-c /data/config.yaml \
-f /data/registration.yaml \
-p 8008
If you mount the registration file to a non default location, set the
REGISTRATION_FILE environment variable:
docker run --rm \
-v /path/to/config.yaml:/data/config.yaml:ro \
-v /path/to/registration.yaml:/etc/tom-bridge/registration.yaml:ro \
-e REGISTRATION_FILE=/etc/tom-bridge/registration.yaml \
tom-bridge
The bridge configuration requires the following sections:
homeserverUrl: 'http://synapse:8008'
domain: 'your.homeserver.com'
registrationPath: '/data/registration.yaml'
synapse:
adminRetryMode: 'fallback'
database:
engine: 'pg'
host: 'postgres'
name: 'tom_db'
user: 'twake'
password: 'twake_password'
ssl: false
vacuumDelay: 3600
rabbitmq:
host: 'rabbitmq'
port: 5672
username: 'guest'
password: 'guest'
vhost: '/'
tls: false
queue: 'chat.settings.updated.queue'
exchange: 'settings.exchange'
routingKey: 'user.settings.updated'
See config.example.yaml in the repository root for the full annotated
version.
The registration file declares the bridge as a Synapse Application Service.
Generate secure tokens with openssl rand -hex 32 before use:
id: common-settings-bridge
url: null
as_token: <GENERATE_SECURE_TOKEN_HERE>
hs_token: <GENERATE_SECURE_TOKEN_HERE>
sender_localpart: twp_bot
namespaces:
users:
- exclusive: false
regex: '@.*'
rooms: []
aliases: []
rate_limited: false
See registration.example.yaml in the repository root for the full annotated
version.
The bridge connects to three external services. When running in Docker, ensure the container can reach them:
homeserverUrldatabaserabbitmqUse Docker networking (--network, --add-host) or container orchestration
tools to make these services available to the bridge container.
REGISTRATION_FILE (default /data/registration.yaml): path to the Synapse
registration file inside the container.Content type
Image
Digest
sha256:eba0bb30c…
Size
98.6 MB
Last updated
5 days ago
docker pull linagora/tom-bridge