Matrix

What is the Matrix?

Hosting matrix servers for friends and family.

Why e2e encryption

You don’t need it till ya need it. Hard to convince everyone of that though, so it needs to also be as easy as Slack to use it. That is hopefully where this manual comes in.

What is this federation?

The matrix primitives do not map 1:1 with Slack privimites. And since matrix is trying to be decentralized from the ground up, its easier to just toss the Slack stuff out and start fresh.

EMS hosting

Matrix provides a homeserver hosting service, EMS (Element Matrix Services). Ideally I would run the homeservers myself somewhere, but this is pretty minimal trust since the code is open source and private keys remain on the clients.

homeserver settings

Bots

Everyone needs a giphy bot.

Matrix provides a standard bot called neb. The latest itiration is written in go :raised-hands:. neb provides a giphy service!

Matrix bots can run on any VM. They are configured to connect to a homeserver instance and authenticate as a certain user.

install

Matrix provides a docker image which is easy enough to run. I tried running the go artifact directly and ran into issues with the libolm dependency version on Arch linux.

setup

Initializing the bot can be done through configuration files or the API. API configs are persisted on disk. Here is an example attaching a bot to a user and enabling the echo and giphy services.

curl -X POST localhost:4050/admin/configureClient --data-binary '{
"UserID": "@klaus:belafonte.ems.host",
"HomeserverURL": "https://belafonte.ems.host",
"AccessToken": "REPLACE",
"DeviceID": "REPLACE",
"Sync": true,
"AutoJoinRooms": true,
"DisplayName": "klaus"
}'

curl -X POST localhost:4050/admin/configureService --data-binary '{
    "Type": "echo",
    "Id": "echo",
    "UserID": "@klaus:belafonte.ems.host",
    "Config": {}
}'

curl -X POST localhost:4050/admin/configureService --data-binary '{
"Type": "giphy",
"Id": "giphy",
"UserID": "@klaus:belafonte.ems.host",
"Config": { "api_key": "REPLACE" }
}'

Copyright (c) 2021 Nick Johnson