E2EE aware proxy daemon for matrix clients.
Go to file
2019-07-26 13:16:00 +02:00
contrib config: Make the OS keyring optional. 2019-05-23 13:34:59 +02:00
docs config: Make the delay between room history fetching configurable. 2019-06-18 16:30:38 +02:00
pantalaimon ui: Don't add deleted devices to the devices dict. 2019-07-26 13:16:00 +02:00
tests client: Add support for the Sqlite Queue database from peewee. 2019-07-22 16:21:54 +02:00
.flake8 pantalaimon: Format the source tree using black. 2019-06-19 12:37:44 +02:00
.gitignore pantalaimon: Update the gitignore. 2019-07-12 16:08:53 +02:00
.isort.cfg pantalaimon: Format the source tree using black. 2019-06-19 12:37:44 +02:00
.travis.yml travis: Install aioresponses before running the tests. 2019-07-12 14:54:20 +02:00
LICENSE pantalaimon: Add a license file. 2019-03-25 09:34:31 +01:00
Makefile pantalaimon: Format the source tree using black. 2019-06-19 12:37:44 +02:00
MANIFEST.in pantalaimon: Add the manifest file. 2019-07-12 16:29:29 +02:00
README.md README: Describe the E2E search feature. 2019-07-03 17:46:04 +02:00
setup.py setup.py: Bump the nio version requirement. 2019-07-13 13:58:34 +02:00
test-requirements.txt tests: Add aioresponses and friends to the test requirements. 2019-07-12 15:35:54 +02:00
tox.ini tox: Install pytest-cov for the coverage reporting. 2019-04-10 15:08:08 +02:00

pantalaimon

Pantalaimon is an end-to-end encryption aware Matrix reverse proxy daemon. Pantalaimon acts as a good man in the middle that handles the encryption for you.

Messages are transparently encrypted and decrypted for clients inside of pantalaimon.

Pantalaimon in action

Installation

The Olm C library is required to be installed before installing pantalaimon.

If your distribution provides packages for libolm it is best to use those, note that a recent version of libolm is required (3.1+). If your distribution doesn't provide a package building from source is required. Please refer to the Olm readme to see how to build the C library from source.

Installing pantalaimon works like usually with python packages:

python setup.py install

Pantalaimon can also be found on pypi:

pip install pantalaimon

Do note that man pages can't be installed with pip.

macOS installation

For instance, on macOS, this means:

brew install dbus
perl -pi -e's#(<auth>EXTERNAL</auth>)#<!--$1-->#' $(brew --prefix dbus)/share/dbus-1/session.conf
brew services start dbus
# it may be necessary to restart now to get the whole OS to pick up the
# existence of the dbus daemon

git clone https://gitlab.matrix.org/matrix-org/olm
(cd olm; make)
git clone https://github.com/matrix-org/pantalaimon
(cd pantalaimon; CFLAGS=-I../olm/include LDFLAGS=-L../olm/build/ python3 setup.py install)

export DBUS_SESSION_BUS_ADDRESS=unix:path=$(launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET)
cd pantalaimon
DYLD_LIBRARY_PATH=../olm/build/ pantalaimon -c contrib/pantalaimon.conf

# for notification center:
git clone https://github.com/fakechris/notification-daemon-mac-py
# if you have django's `foundation` library installed and your filesystem
# is case insensitive (the default) then you will need to `pip uninstall foundation`
# or install PyObjC in a venv...
pip install PyObjC daemon glib dbus-python
cd notification-daemon-mac-py
./notify.py

Experimental E2E search support.

Pantalaimon can handle the search endpoint of a Matrix server as well, providing search support for E2E encrypted rooms.

For this to work tantivy is needed. Tantivy is a full text search engine written in rust.

The python bindings for tantivy are needed for pantalaimon. The bindings are not yet merged upstream, instead they can be found here.

Note that rust nightly (tested version was: 1.36.0-nightly (50a0defd5 2019-05-21)) and setuptools-rust are required before the tantivy python bindings can be installed.

Usage

While pantalaimon is a daemon, it is mean to be run as your own user. It won't verify devices for you automatically, unless configured to do so, and requires user interaction to verify, ignore or blacklist devices.

Pantalaimon requires a configuration file to run. The configuration file specifies one or more homeservers for pantalaimon to connect to.

A minimal pantalaimon configuration looks like this:

[local-matrix]
Homeserver = https://localhost:8448
ListenAddress = localhost
ListenPort = 8009

The configuration file should be placed in ~/.config/pantalaimon/pantalaimon.conf.

The full documentation for the pantalaimons configuration can be found in the man page pantalaimon(5).

Now that pantalaimon is configured it can be run:

pantalaimon --log-level debug

After running the daemon, configure your client to connect to the daemon instead of your homeserver. The daemon listens by default on localhost and port 8009.

Note that logging in to the daemon is required to start a sync loop for a user. After that clients can connect using any valid access token for the user that logged in. Multiple users per homeserver are supported.

For convenience a systemd service file is provided.

To control the daemon an interactive utility is provided in the form of panctl.

panctl can be used to verify, blacklist or ignore devices, import or export session keys, or to introspect devices of users that we share encrypted rooms with.