7 Bridge setup
Jostein Kjønigsen edited this page 2021-01-13 09:28:24 +01:00

Requirements

  • Python 3.7 or higher with pip and virtualenv
  • A Matrix homeserver that supports application services (e.g. Synapse)
  • A PostgreSQL server (which you should already have for Synapse)
  • An instance of signald (Existing users: please note signald has caused breaking changes by moving the repo and renaming the master branch! If you've setup signald in the past, you may have to manually fix your environment.)

Production setup

  1. Create a directory for the bridge.
  2. Set up a virtual environment.
    1. Create with virtualenv -p /usr/bin/python3 .
    2. Activate with source ./bin/activate
  3. Install the bridge with pip install --upgrade mautrix-signal[all] (there are no releases yet)
    • If you want the master branch instead of a release, use pip install --upgrade 'git+https://github.com/tulir/mautrix-signal.git#egg=mautrix-signal[all]'.
    • [all] at the end will install all optional dependencies. You can also specify only some optional dependencies (comma-separated), like [metrics,qrcode]. See optional-requirements.txt for existing optional dependencies.
  4. Copy example-config.yaml to config.yaml.
  5. Update the config to your liking. You'll at least need to change the homeserver settings and add yourself to the permissions section.
  6. Generate the appservice registration with python -m mautrix_signal -g. You can use the -c and -r flags to change the location of the config and registration files. They default to config.yaml and registration.yaml respectively.
  7. Add the path to the registration file to your Synapse's homeserver.yaml under app_service_config_files. Restart Synapse to apply changes.
  8. Run the bridge python -m mautrix_signal.

Upgrading

  1. Run the bridge install command again (install step #2).

Development setup

  1. Clone the repository.
  2. Optional, but strongly recommended: Set up a virtual environment.
    1. Create with virtualenv -p /usr/bin/python3 .venv
    2. Activate with source .venv/bin/activate
  3. Install dependencies with pip install -r requirements.txt
    • Optionally, add -r optional-requirements.txt to install optional dependencies.
  4. Continue from step #3 of production setup.

Upgrading

  1. Pull changes from Git.
  2. Update dependencies with pip install --upgrade -r requirements.txt.
    • If you installed optional dependencies, run the same pip command as when installing them, but with --upgrade