Skip to content

Latest commit

 

History

History
132 lines (89 loc) · 4.58 KB

File metadata and controls

132 lines (89 loc) · 4.58 KB

element-docker-demo-apache

This is a fork of element-docker-demo designed to run behind an externally provided host. Normally this would be an apache or nginx server, configured with a reverse proxy.

As such, all mkcert and letsencrypt integrations have been will be eliminated, and the administrator is expected to handle TLS themselves.

A possibility of push notification integration is also on the horizon, potentially with ntfy. This may take some work, and it may be a better idea to change the approach to notifications from inside synapse/element.

TODO

  • Add public facing IP entry to setup script
  • Substitute aliases in sample apache config for actual values and save the config for later access
  • Check if any of the MAS stuff needs to be added to the apache proxy
  • Replace nginx with apache in dockerfile
  • Add setup variables for apache in data templates dir
  • Make sure element is happy with 8080 ports - local apache does not need a cert

Below is the original text of the repository prior to forking.

element-docker-demo

element-docker-demo is a minimal example of how to rapidly stand up a Matrix 2.0 stack on macOS or Linux using Docker, featuring:

  • Element Web
  • Element Call
  • Synapse
  • Matrix Authentication Service
  • LiveKit
  • Postgres
  • nginx + letsencrypt / mkcert for TLS.

This is not intended for serious production usage, but instead as a tool for curious sysadmins to easily experiment with Matrix 2.0 in a simple docker compose environment. As of Nov 2024, it's considered beta.

In particular, this has:

  • No support, security or maintenance guarantees whatsoever
  • No high availability, horizontal scalability, elastic scaling, clustering, backup etc.
  • No admin interface
  • No monitoring
  • No fancy config management (eg ansible), just env vars and templates
  • No fancy secret management (stored in plaintext on disk)
  • No UDP traffic or TURN for LiveKit (all traffic is tunnelled over TCP for simplicity)
  • No push server, integration manager, integrations, or identity lookup server

For production-grade Matrix from Element, please see https://element.io/server-suite (ESS).

To run

  1. Install Docker Compose.
  2. If you're running on your local workstation, then install mkcert to manage TLS.

Then:

./setup.sh

# Point DNS for *.domain at your docker host,
# Or if running on localhost with mkcert:
# source .env; sudo sh -c "echo 127.0.0.1 $DOMAINS >> /etc/hosts"

docker compose up
# go to https://element on your domain.

docker demo

Watch the full video:


For more info, see https://element.io/blog/experimenting-with-matrix-2-0-using-element-docker-demo/

To configure

Check the .env file, or customise the templates in /data-templates and then docker compose down && docker compose up -d.

In particular, you may wish to:

  • Point at your own SMTP server rather than mailhog
  • Use your own reverse proxy rather than the provided nginx
  • Use your own database cluster

Container data gets stored in ./data, and secrets in ./secrets. N.B. that config files in ./data will get overwritten by the templates from ./data-template every time the cluster is launched.

To admin

# To upgrade
docker compose pull
# To register a user
docker compose exec mas mas-cli -c /data/config.yaml manage register-user

Diagnostics

# check that OIDC is working - useful for debugging TLS problems
docker compose exec mas mas-cli -c /data/config.yaml doctor

Other resources

Todo

  • pop up https://element in your browser once synapse has started up successfully for the first time, perhaps
  • test $VOLUME_PATH (or remove it)
  • swap nginx for caddy or traefik to simplify Letsencrypt
  • set up livekit TURN (tcp & udp port 443) for better firewall traversal and voip performance