No description
Find a file
2021-09-14 21:10:57 +02:00
config Rename repository 2021-09-01 14:43:55 +02:00
keys Add function to sign event 2021-08-05 13:30:46 +02:00
lib Create custom database type for state sets 2021-09-14 21:10:57 +02:00
priv/repo Create custom database type for state sets 2021-09-14 21:10:57 +02:00
test Add missing fields to events 2021-09-05 16:39:52 +02:00
.dialyzer_ignore.exs Add dialyzer dependency 2021-08-18 23:22:04 +02:00
.formatter.exs Init git repo 2021-06-22 14:09:25 +02:00
.gitignore Rename repository 2021-09-01 14:43:55 +02:00
.tool-versions Add function to sign event 2021-08-05 13:30:46 +02:00
element.sh Rename repository 2021-09-01 14:43:55 +02:00
LICENSE Create LICENSE 2021-07-23 22:18:25 +00:00
mix.exs Rename repository 2021-09-01 14:43:55 +02:00
mix.lock Add dialyzer dependency 2021-08-18 23:22:04 +02:00
psql.sh Rename repository 2021-09-01 14:43:55 +02:00
README.md Update README.md 2021-09-14 13:51:23 +00:00

Architex

A Matrix homeserver written in Elixir. Currently, this project is in a very early stage.

General architecture

For each room that a homeserver is involved in, there is a supervised GenServer (named RoomServer) that holds/manages the room's state. These RoomServers are responsible for state resolution and authorization. Database schemas are located at lib/architex/schema/. Requests from the federation API as well as the client API are validated using Ecto's embedded_schemas, located at lib/architex_web/api_schemas/.

Noteworthy contributions

  • lib/architex/state_resolution.ex: Implementation of version 2 of the Matrix state resolution algorithm.
  • lib/architex/state_resolution/authorization.ex: Implementation of authorization rules for the state resolution algorithm.
  • lib/architex/room_server.ex: A GenServer that holds and manages the state of a room.

Dependencies

  • Elixir 1.12.2 compiled for OTP 24
  • Erlang 24.0.3
  • PostgreSQL
  • Libsodium

Generate the server's ed25519 keys by executing ssh-keygen -t ed25519 -f keys/id_ed25519 -N ""

Progress

Here, implemented and some unimplemented features are listed.

Implemented features

Implemented API endpoints

Client-Server API

  • GET /_matrix/client/r0/register/available
  • GET /_matrix/client/r0/account/whoami
  • POST /_matrix/client/r0/logout
  • POST /_matrix/client/r0/logout/all
  • PUT /_matrix/client/r0/directory/room/{roomAlias}
  • GET /_matrix/client/versions
  • GET /_matrix/client/r0/login
  • POST /_matrix/client/r0/login: Only with password flow.
  • POST /_matrix/client/r0/register: Only with dummy flow.
  • POST /_matrix/client/r0/createRoom: Except with option invite_3pid.
  • GET /_matrix/client/r0/joined_rooms
  • POST /_matrix/client/r0/rooms/{roomId}/invite
  • POST /_matrix/client/r0/rooms/{roomId}/join: Except with third party invite.
  • POST /_matrix/client/r0/rooms/{roomId}/leave
  • POST /_matrix/client/r0/rooms/{roomId}/kick
  • POST /_matrix/client/r0/rooms/{roomId}/ban
  • POST /_matrix/client/r0/rooms/{roomId}/unban
  • PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}
  • PUT /_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}
  • GET /_matrix/client/r0/rooms/{roomId}/messages: Except filtering.
  • GET /_matrix/client/r0/rooms/{roomId}/state
  • GET /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}
  • GET /_matrix/client/r0/directory/list/room/{roomId}
  • PUT /_matrix/client/r0/directory/list/room/{roomId}
  • GET /_matrix/client/r0/capabilities
  • GET /_matrix/client/r0/profile/{userId}
  • GET /_matrix/client/r0/profile/{userId}/avatar_url
  • PUT /_matrix/client/r0/profile/{userId}/avatar_url
  • GET /_matrix/client/r0/profile/{userId}/displayname
  • PUT /_matrix/client/r0/profile/{userId}/displayname

Federation API

  • GET /_matrix/federation/v1/event/{eventId}
  • GET /_matrix/federation/v1/state/{roomId}
  • GET /_matrix/federation/v1/state_ids/{roomId}
  • GET /_matrix/key/v2/server/{keyId}
  • GET /_matrix/federation/v1/query/profile

Major unimplemented features