4 Bridge setup
Tulir Asokan edited this page 2020-08-25 14:45:11 +03:00

Requirements

  • Python 3.7 or higher with pip and virtualenv
  • A Matrix homeserver that supports application services (e.g. Synapse)

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-hangouts
    • If you want the master branch instead of a release, use pip install --upgrade https://github.com/tulir/mautrix-hangouts/tarball/master#egg=mautrix-hangouts.
  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. You also need to add your homeserver in the permissions section and the auth server.
  6. Generate the appservice registration with python -m mautrix_hangouts -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. Create the database with alembic upgrade head. If you have a custom config path, use alembic -x config=/path/to/config.yaml upgrade head
  9. Run the bridge python -m mautrix_hangouts.

Upgrading

  1. Run the bridge install command again (install step #2).
  2. Update the database with the command in install step #7.

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
  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
  3. Update the database with the command in install step #7.