Compare commits
96 Commits
next
...
docs-overh
| Author | SHA1 | Date |
|---|---|---|
|
|
d8b3003273 | 4 years ago |
|
|
edd690c583 | 4 years ago |
|
|
c2068a434e | 4 years ago |
|
|
b981d3d039 | 4 years ago |
|
|
80a2711f45 | 4 years ago |
|
|
2f4885c2a1 | 4 years ago |
|
|
3fec75a7b6 | 4 years ago |
|
|
5094f8e7f1 | 4 years ago |
|
|
cd19f02d3b | 4 years ago |
|
|
dbfe16bdb2 | 4 years ago |
|
|
5bdeb971d8 | 4 years ago |
|
|
a38b23d56d | 4 years ago |
|
|
25a81c480b | 4 years ago |
|
|
1282405f1d | 4 years ago |
|
|
ca4b676b4c | 4 years ago |
|
|
3db558b2f8 | 4 years ago |
|
|
5ea10bbd8e | 4 years ago |
|
|
31b2728551 | 4 years ago |
|
|
d48b96fda6 | 4 years ago |
|
|
fe83c80a65 | 4 years ago |
|
|
98ce5f62d5 | 4 years ago |
|
|
870c178c8b | 4 years ago |
|
|
1b9f56e48c | 4 years ago |
|
|
3143d468c7 | 4 years ago |
|
|
ac594f5502 | 4 years ago |
|
|
75701f75e4 | 4 years ago |
|
|
186722c51f | 4 years ago |
|
|
fc3ff86ad9 | 4 years ago |
|
|
a8d181e00e | 4 years ago |
|
|
61adef8f2c | 4 years ago |
|
|
13c9f2fb50 | 4 years ago |
|
|
5d279159e3 | 4 years ago |
|
|
e14db60b6c | 4 years ago |
|
|
4cba464faf | 4 years ago |
|
|
828611c0e4 | 4 years ago |
|
|
e206b0ca8f | 4 years ago |
|
|
4c971d7695 | 4 years ago |
|
|
8aed9b7711 | 4 years ago |
|
|
3f766d2a13 | 4 years ago |
|
|
6d6ce0f697 | 4 years ago |
|
|
8b4389e0c2 | 4 years ago |
|
|
fc29ad088c | 4 years ago |
|
|
b0aa4fc7f5 | 4 years ago |
|
|
73ae29c0de | 4 years ago |
|
|
8c7ae60518 | 4 years ago |
|
|
4d6af6ee88 | 4 years ago |
|
|
4ede0dc2d9 | 4 years ago |
|
|
4ce02e8ff6 | 4 years ago |
|
|
4ac40dec9a | 4 years ago |
|
|
51b96b3538 | 4 years ago |
|
|
5b904fbef4 | 4 years ago |
|
|
6c0079f2c4 | 4 years ago |
|
|
3a588c4561 | 4 years ago |
|
|
f22ad5dfba | 4 years ago |
|
|
2b50afcc0a | 4 years ago |
|
|
8216abc8c5 | 4 years ago |
|
|
981d054b0c | 4 years ago |
|
|
72e2b643bb | 4 years ago |
|
|
ee4b08c185 | 4 years ago |
|
|
896427b67f | 4 years ago |
|
|
95989241db | 4 years ago |
|
|
10da08e260 | 4 years ago |
|
|
6255406de0 | 4 years ago |
|
|
4c44a7adf5 | 4 years ago |
|
|
48fb8c5d4d | 4 years ago |
|
|
d058f6522e | 4 years ago |
|
|
8784df0d3a | 4 years ago |
|
|
524b4960cd | 4 years ago |
|
|
0176d40347 | 4 years ago |
|
|
b74b8c48ce | 4 years ago |
|
|
8a4b7cf4bd | 4 years ago |
|
|
4a9483c07c | 4 years ago |
|
|
8f1a41dcd2 | 4 years ago |
|
|
6f58af0b99 | 4 years ago |
|
|
ac9dce2bdf | 4 years ago |
|
|
197a111748 | 4 years ago |
|
|
b9f138450c | 4 years ago |
|
|
1aecadf990 | 4 years ago |
|
|
7514aa5d95 | 4 years ago |
|
|
c0c783fdec | 4 years ago |
|
|
b02e4bf46c | 4 years ago |
|
|
87f5f17134 | 4 years ago |
|
|
f1aea98384 | 4 years ago |
|
|
caebb13a98 | 4 years ago |
|
|
0b073c6534 | 4 years ago |
|
|
f29a6d7945 | 4 years ago |
|
|
8696e627b0 | 4 years ago |
|
|
201de77db4 | 4 years ago |
|
|
33e84c74ac | 4 years ago |
|
|
39d1f86050 | 4 years ago |
|
|
afa71756c0 | 4 years ago |
|
|
d0e06b49da | 4 years ago |
|
|
5547c0f579 | 4 years ago |
|
|
66bc3958ff | 4 years ago |
|
|
7e48567d4b | 4 years ago |
|
|
10ee0a53f9 | 4 years ago |
83 changed files with 5327 additions and 2471 deletions
@ -1,48 +0,0 @@
@@ -1,48 +0,0 @@
|
||||
# Setting up Appservices |
||||
|
||||
## Getting help |
||||
|
||||
If you run into any problems while setting up an Appservice, write an email to `timo@koesters.xyz`, ask us in `#conduit:matrix.org` or [open an issue on GitLab](https://gitlab.com/famedly/conduit/-/issues/new). |
||||
|
||||
## Tested appservices |
||||
|
||||
Here are some appservices we tested and that work with Conduit: |
||||
- matrix-appservice-discord |
||||
- mautrix-hangouts |
||||
- mautrix-telegram |
||||
|
||||
## Set up the appservice |
||||
|
||||
Follow whatever instructions are given by the appservice. This usually includes |
||||
downloading, changing its config (setting domain, homeserver url, port etc.) |
||||
and later starting it. |
||||
|
||||
At some point the appservice guide should ask you to add a registration yaml |
||||
file to the homeserver. In Synapse you would do this by adding the path to the |
||||
homeserver.yaml, but in Conduit you can do this from within Matrix: |
||||
|
||||
First, go into the #admins room of your homeserver. The first person that |
||||
registered on the homeserver automatically joins it. Then send a message into |
||||
the room like this: |
||||
|
||||
@conduit:your.server.name: register_appservice |
||||
``` |
||||
paste |
||||
the |
||||
contents |
||||
of |
||||
the |
||||
yaml |
||||
registration |
||||
here |
||||
``` |
||||
|
||||
You can confirm it worked by sending a message like this: |
||||
`@conduit:your.server.name: list_appservices` |
||||
|
||||
The @conduit bot should answer with `Appservices (1): your-bridge` |
||||
|
||||
Then you are done. Conduit will send messages to the appservices and the |
||||
appservice can send requests to the homeserver. You don't need to restart |
||||
Conduit, but if it doesn't work, restarting while the appservice is running |
||||
could help. |
||||
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
Install docker: |
||||
|
||||
``` |
||||
$ sudo apt install docker |
||||
$ sudo usermod -aG docker $USER |
||||
$ exec sudo su -l $USER |
||||
$ sudo systemctl start docker |
||||
$ cargo install cross |
||||
$ cross build --release --target armv7-unknown-linux-musleabihf |
||||
``` |
||||
The cross-compiled binary is at target/armv7-unknown-linux-musleabihf/release/conduit |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
[book] |
||||
title = "Conduit Docs" |
||||
author = "The Conduit contributors" |
||||
description = "Conduit is a simple, fast and reliable chat server for the Matrix protocol" |
||||
language = "en" |
||||
src = "docs" |
||||
|
||||
[rust] |
||||
edition = "2018" |
||||
|
||||
[build] |
||||
build-dir = "public" |
||||
create-missing = true |
||||
|
||||
[output.html.search] |
||||
limit-results = 15 |
||||
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh |
||||
|
||||
# If the port is not specified as env var, take it from the config file |
||||
if [ -z ${CONDUIT_PORT} ]; then |
||||
CONDUIT_PORT=$(grep -m1 -o 'port\s=\s[0-9]*' conduit.toml | grep -m1 -o '[0-9]*') |
||||
fi |
||||
|
||||
# The actual health check. |
||||
# We try to first get a response on HTTP and when that fails on HTTPS and when that fails, we exit with code 1. |
||||
# TODO: Change this to a single curl call. Do we have a config value that we can check for that? |
||||
curl --fail -s "http://localhost:${CONDUIT_PORT}/_matrix/client/versions" || \ |
||||
curl -k --fail -s "https://localhost:${CONDUIT_PORT}/_matrix/client/versions" || \ |
||||
exit 1 |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
# Summary |
||||
|
||||
[Home](index.md) |
||||
|
||||
- [Installation](installation.md) |
||||
- [Prerequisites](installation/prerequisites.md) |
||||
- [From Binaries](installation/manual.md) |
||||
- [From Packages](installation/packages.md) |
||||
- [With Docker](installation/docker.md) |
||||
- [Configuration](configuration.md) |
||||
- [Config options](configuration/configuration.md) |
||||
- [Appservices](configuration/appservices.md) |
||||
- [Contribute](contribute.md) |
||||
- [Basics](development/basics.md) |
||||
- [Cross compilation](development/cross-compilation.md) |
||||
- [Tests & CI](development/tests-ci.md) |
||||
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
# Configuring Conduit |
||||
|
||||
@ -0,0 +1,220 @@
@@ -0,0 +1,220 @@
|
||||
# Configuring Conduit |
||||
|
||||
Conduit can be configured via a config file (conventionally called Conduit.toml) or environment variables. If a config |
||||
file exists and environment variables are set, environment variables overwrite config options. |
||||
|
||||
You absolutely need to set the environment variable `CONDUIT_CONFIG_FILE` to either point to a config file ( |
||||
e.g. `CONDUIT_CONFIG_FILE=/etc/conduit/Conduit.toml`) or to an empty string (`CONDUIT_CONFIG_FILE=''`) if you want to |
||||
configure Conduit with just environment variables. |
||||
|
||||
## Mandatory config options |
||||
|
||||
Mandatory variables must be configured in order for Conduit to run properly. |
||||
|
||||
### Server Name |
||||
|
||||
- Config file key: `server_name` |
||||
- Envirnoment variable: `CONDUIT_SERVER_NAME` |
||||
- Default value: _None, you will need to choose your own._ |
||||
|
||||
The server_name is the name of this server. It is used as a suffix for user and room ids. Example: If you set it |
||||
to `conduit.rs`, your usernames will look like `@somebody:conduit.rs`. |
||||
|
||||
The Conduit server needs to be reachable at https://your.server.name/ on port 443 (client-server) and 8448 ( |
||||
server-server) OR you can create /.well-known files to redirect requests. See |
||||
the [Client-Server specs](https://matrix.org/docs/spec/client_server/latest#get-well-known-matrix-client) and |
||||
the [Server-Server specs](https://matrix.org/docs/spec/server_server/r0.1.4#get-well-known-matrix-server) for more |
||||
information. |
||||
|
||||
### Database Path |
||||
|
||||
- Config file key: `database_path` |
||||
- Envirnoment variable: `CONDUIT_DATABASE_PATH` |
||||
- Default value: _None, but many people like to use `/var/lib/conduit/`_. |
||||
|
||||
A **directory** where Conduit stores its database and media files. This directory must exist, have enough free space and |
||||
be readable and writable by the user Conduit is running as. |
||||
|
||||
What does _enough free space_ mean? It heavily on the amount of messages your Conduit server will see and the amount and |
||||
size of media files users on your Conduit server send. As a rule of thumb, you should have at least 10 GB of free space |
||||
left. You should be comfortable for quite some time with 50 GB. |
||||
|
||||
### TCP Port |
||||
|
||||
- Config file key: `port` |
||||
- Environment variable: `CONDUIT_PORT` |
||||
- Default value: _None, but many people like to use `6167`_. |
||||
|
||||
The TCP port Conduit will listen on for connections. The port needs to be free (no other program is listeing on it). |
||||
|
||||
Conduit does currently (2021-09) not offer HTTPS by itself. Only unencrypted HTTP requests will be accepted on this |
||||
port. Unless you know what you are doing, this port should not be exposed to the internet. Instead, use a reverse proxy |
||||
capable of doing TLS to offer your Conduit server to the internet via HTTPS. See [TODO] for example configurations. |
||||
|
||||
## Optional configuration options |
||||
|
||||
These config options come with defaults and don't need to be configured for Conduit to run. That said, you should still |
||||
check them to make sure that your Conduit server behaves like you want it to do. |
||||
|
||||
### Maximum request size |
||||
|
||||
- Config file key: `max_request_size` |
||||
- Environment variable: `CONDUIT_MAX_REQUEST_SIZE` |
||||
- Default value: `20_000_000` (~= 20 MB) |
||||
|
||||
The maximum size in bytes for incoming requests to Conduit. You can use underscores to improve readability. |
||||
|
||||
This will effectively limit the size for images, videos and other files users on your Conduit server can send. |
||||
|
||||
### Allow Registration? |
||||
|
||||
- Config file key: `allow_registration` |
||||
- Environment variable: `CONDUIT_ALLOW_REGISTRATION` |
||||
- Default value: `true` |
||||
- Possible values: `true`, `false` |
||||
|
||||
It this is set to `false`, no new users can register accounts on your Conduit server. Already registered users will not |
||||
be affected from this setting and can continue to user your server. |
||||
|
||||
The first user to ever register on your Conduit server will be considered the admin account and is automatically invited |
||||
into the admin room. |
||||
|
||||
### Allow Encryption? |
||||
|
||||
- Config file key: `allow_encryption` |
||||
- Environment variable: `CONDUIT_ALLOW_ENCRYPTION` |
||||
- Default value: `true` |
||||
- Possible values: `true`, `false` |
||||
|
||||
If this is set to `false`, Conduit disables the ability for users to create encrypted chats. Existing encrypted chats |
||||
may continue to work. |
||||
|
||||
### Allow federation? |
||||
|
||||
- Config file key: `allow_federation` |
||||
- Environment variable: `CONDUIT_ALLOW_FEDERATION` |
||||
- Default value: `false` |
||||
- Possible values: `true`, `false` |
||||
|
||||
Federation means that users from different Matrix servers can chat with each other. E.g. `@mathew:matrix.org` can chat |
||||
with `@timo:conduit.rs`. |
||||
|
||||
If this option is set to `false`, users on your Conduit server can only talk with other users on your Conduit server. |
||||
|
||||
Federation with other servers needs to happen over HTTPS, so make sure you have set up a reverse proxy. |
||||
|
||||
### Jaeger Tracing |
||||
|
||||
- Config file key: `allow_jaeger` |
||||
- Environment variable: `CONDUIT_ALLOW_JAEGER` |
||||
- Default value: `false` |
||||
- Possible values: `true`, `false` |
||||
|
||||
Enable Jaeger to support monitoring and troubleshooting through Jaeger. |
||||
|
||||
If you don't know what Jaeger is, you can safely leave this set to `false`. |
||||
|
||||
### Trusted servers |
||||
|
||||
- Config file key: `trusted_servers` |
||||
- Environment variable: `CONDUIT_TRUSTED_SERVERS` |
||||
- Default value: `[]` |
||||
- Possible values: JSON-Array of server domains, e.g. `["matrix.org"]` or `["matrix.org", "conduit.rs"]`. |
||||
|
||||
Matrix servers have so-called "server keys", which authenticate messages from their users. Because your Conduit server |
||||
might not know the server keys from every server it encounters, it can ask a _trusted server_ for them. This speeds |
||||
things up for rooms with people from a lot of different servers. |
||||
|
||||
You should only set this to include trustworthy servers. Most people consider a good default to be `["matrix.org"]`. |
||||
|
||||
Only relevant if you have federation enabled. |
||||
|
||||
### Limit amount of concurrent requests |
||||
|
||||
- Config file key: `max_concurrent_requests` |
||||
- Environment variable: `CONDUIT_MAX_CONCURRENT_REQUESTS` |
||||
- Default value: `100` |
||||
- Suggested values: `1` - `1000` (u16) |
||||
|
||||
How many requests Conduit can make at the same time. This affects federation with other Matrix servers, push |
||||
notifications and app_services. |
||||
|
||||
// TODO Timo: When does it make sense to change this? |
||||
|
||||
### Configure logging |
||||
|
||||
- Config file key: `log` |
||||
- Environment variable: `CONDUIT_LOG` |
||||
- Default value: `info,state_res=warn,rocket=off,_=off,sled=off` |
||||
|
||||
Configures which kind of messages Conduit logs. |
||||
|
||||
> // TODO: Better and more thorough explanation |
||||
|
||||
### Worker threads |
||||
|
||||
- Config file key: `workers` |
||||
- Environment variable: `CONDUIT_WORKERS` |
||||
- Default value: cpu core count * 2 |
||||
- Possible values: // TODO |
||||
|
||||
> // TODO: Which thing exactly threads? What not? |
||||
|
||||
### Listening address |
||||
|
||||
- Config file key: `address` |
||||
- Environment variable: `CONDUIT_ADDRESS` |
||||
- Default value: `127.0.0.1` |
||||
- Possible values: Valid IP addresses. |
||||
|
||||
Which IP address conduit is listening on. 127.0.0.1 means that Conduit can only be accessed from the same server or |
||||
through a reverse proxy on that server. If you want it to be accessible from any network interface (which you should |
||||
not, because other matrix servers should talk to your Conduit via a reverse proxy and not directly), you can set it |
||||
to `0.0.0.0`. |
||||
|
||||
### Database cache capacity |
||||
|
||||
- Config file key: `db_cache_capacity_mb` |
||||
- Environment variable: `CONDUIT_DB_CACHE_CAPACITY_MB` |
||||
- Default value: `200` |
||||
- Possible values: `true`, `false` |
||||
|
||||
The total amount of memory (RAM) that the database cache will be able to use. |
||||
|
||||
> // TODO: this needs clearification: In RAM or on disk and for what exactly? |
||||
|
||||
### PDU cache capacity |
||||
|
||||
- Config file key: `pdu_cache_capacity` |
||||
- Environment variable: `CONDUIT_PDU_CACHE_CAPACITY` |
||||
- Default value: `100_000` |
||||
- Suggested values: `1_000` - `1_000_000` (u32) |
||||
|
||||
The total capacity (read: number of items) the pdu cache can hold in memory. Setting this to a lower number may slow |
||||
Conduit down, as it must fetch more data from the database. Increasing it will mean that Conduit will start to use more |
||||
memory as the cache slowly fills up. |
||||
|
||||
### SQLite WAL clean interval |
||||
|
||||
- Config file key: `sqlite_wal_clean_second_interval` |
||||
- Environment variable: `CONDUIT_SQLITE_WAL_CLEAN_SECOND_INTERVAL` |
||||
- Default value: `60` (every 60 seconds) |
||||
- Suggested values: `1` - `3600` (u32) |
||||
|
||||
How often the WAL file should be cleaned up. The WAL file will be written to until cleaned up, after which it restarts |
||||
writing from the beginning. |
||||
|
||||
The file's size will correspond to how long it could write to it in one go. (e.g. if conduit writes 100MB of data to the |
||||
database inbetween that period, the file will grow to 100MB). You can read more about that in |
||||
the [SQLite Docs](https://www.sqlite.org/draft/wal.html). |
||||
|
||||
Reducing this down too much can offset the benefits of using a WAL at all. However, having this too high can result in a |
||||
large WAL file. |
||||
|
||||
Only relevant when using SQLite as the database. |
||||
|
||||
### Still undocumented config options |
||||
|
||||
- `tracing_flame` |
||||
- `proxy` |
||||
- `jwt_secret` |
||||
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
# Cross compilation |
||||
|
||||
Install docker: |
||||
|
||||
```bash |
||||
sudo apt install docker |
||||
sudo usermod -aG docker $USER |
||||
exec sudo su -l $USER |
||||
sudo systemctl start docker |
||||
cargo install cross |
||||
cross build --release --target armv7-unknown-linux-musleabihf |
||||
``` |
||||
The cross-compiled binary is at target/armv7-unknown-linux-musleabihf/release/conduit |
||||
@ -0,0 +1,52 @@
@@ -0,0 +1,52 @@
|
||||
# Conduit |
||||
|
||||
Conduit is a simple, fast and reliable chat server for the [Matrix] protocol written in [Rust]. |
||||
|
||||
----- |
||||
> Note: This project is work-in-progress. Do *not* rely on it yet. |
||||
|
||||
## What is Matrix? |
||||
|
||||
[Matrix] is an open network for secure and decentralized |
||||
communication. It allows you to chat with friends even if they are using |
||||
another servers and client. You can even use bridges to communicate with users |
||||
outside of Matrix, like a community on Discord or your family on Hangouts. |
||||
|
||||
## Why Conduit? |
||||
|
||||
Conduit is an open-source server implementation of the [Matrix |
||||
Specification] with a focus on easy setup and low |
||||
system requirements, making it very easy to set up. |
||||
|
||||
Other server implementations try to be extremely scalable, which makes sense if |
||||
the goal is to support millions of users on a single instance, but makes |
||||
smaller deployments a lot more inefficient. Conduit tries to keep it simple but |
||||
takes full advantage of that, for example by using an in-memory database for |
||||
[huge performance gains](https://github.com/timokoesters/romeo-and-juliet-benchmark). |
||||
|
||||
The future for Conduit in peer-to-peer Matrix (every client contains a server) |
||||
is also bright. |
||||
|
||||
Conduit tries to be reliable by using the Rust programming language and paying |
||||
close attention to error handling to make sure that evil clients, misbehaving |
||||
servers or even a partially broken database will not cause the whole server to |
||||
stop working. |
||||
|
||||
## Chat with us! |
||||
|
||||
We have a room on Matrix: [#conduit:matrix.org](https://matrix.to/#/#conduit:matrix.org) |
||||
|
||||
You can also contact us using: |
||||
- Matrix: [@timo:koesters.xyz](https://matrix.to/#/@timo:koesters.xyz) |
||||
- Email: [conduit@koesters.xyz](mailto:conduit@koesters.xyz) |
||||
|
||||
|
||||
## Donate |
||||
|
||||
Liberapay: <https://liberapay.com/timokoesters/>\ |
||||
Bitcoin: `bc1qnnykf986tw49ur7wx9rpw2tevpsztvar5x8w4n` |
||||
|
||||
|
||||
[Matrix]: https://matrix.org/ |
||||
[Rust]: https://rust-lang.org |
||||
[Matrix Specification]: https://matrix.org/docs/spec |
||||
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
# Distribution packages |
||||
|
||||
## Debian / Ubuntu |
||||
|
||||
[@paul:luon.net](https://matrix.to/#/@paul:luon.net) plans to package Conduit for Debian as soon as it reaches 1.0. |
||||
Until it is available in the official repos, you can install the development version of it manually: |
||||
|
||||
```bash |
||||
sudo apt-get install ca-certificates |
||||
wget --https-only -O /tmp/conduit.deb https://gitlab.com/famedly/conduit/-/jobs/artifacts/master/raw/conduit-x86_64-unknown-linux-gnu.deb?job=build:cargo-deb:x86_64-unknown-linux-gnu |
||||
sudo dpkg -i /tmp/conduit.deb |
||||
``` |
||||
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
# Prerequisites for running Conduit |
||||
|
||||
You'll need: |
||||
|
||||
- A domain. Commonly cost about $10/year. |
||||
- A Linux server with a stable internet connection, at least 500 MB of RAM and some disk space for messages and |
||||
attachments. Commonly start at $5/month. |
||||
- Some basic knowledge about using a shell, SSH and configuring and protecting a server. |
||||
|
||||
|
||||
## A word of caution: |
||||
|
||||
Don't underestimate the toll of administrating your own server. |
||||
Conduit can't protect your conversations if your server gets compromised or deleted. |
||||
|
||||
Make sure that you got: |
||||
|
||||
- Automatic security updates |
||||
- On Ubuntu/Debian: Set up unattended-upgrades |
||||
- On RHEL/CentOS: Have a look at yum-cron |
||||
- A firewall blocking all but the needed incoming ports |
||||
- ufw is an easy interface for the linux firewall |
||||
- Protection against automatic attacks |
||||
- fail2ban scans logs and bans IPs which try to brute force their way into your server. |
||||
- Disable ssh login for root and switch from password to key based authentication. |
||||
- Automated backups |
||||
- Most VPS hosting companies offer whole server backups for a small fee. |
||||
- Or run your own backup with something like borg. |
||||
- A way to get notified if your disk fills up. |
||||
- If you send too much cat videos to your friends, Conduit might at some point become unable to |
||||
store any important messages. |
||||
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
# About Matrix Homeservers |
||||
|
||||
Matrix homeservers manage its users chats. Every Matrix username includes the homserver it belongs to: |
||||
`@alice:matrix.org` means that the `matrix.org` homeserver hosts a user called `@alice`. |
||||
Every time someone chats with Alice, the `matrix.org` homeserver stores these messages. |
||||
When `@alice:matrix.org` talks with `@adelaide:matrix.org`, that's easy. Both users use the same server. |
||||
|
||||
But how can `@bob:vector.tld`, who uses the `vector.tld` homeserver, exchange messages with `@alice:matrix.org`? |
||||
This is where it get's a bit more complicated. |
||||
|
||||
## Matrix Homeserver discovery |
||||
|
||||
The Matrix specification specifies multiple ways how servers can discover and then talk to each other. |
||||
Let's look at the most common one: |
||||
|
||||
### .well-known files |
||||
|
||||
At first, the only information a server has about a user (e.g. `@bob:vector.tld`) is its homeserver name: `vector.tld`. |
||||
It then makes a HTTP GET request to `https://vector.tld/.well-known/matrix/server`. |
||||
In the ideal case, this file contains a content like this: |
||||
|
||||
```json |
||||
{ |
||||
"m.server": "matrix.vector.tld:443" |
||||
} |
||||
``` |
||||
|
||||
This translates to: The matrix homeserver software for users with a username ending on `vector.tld` |
||||
can be found at the address `matrix.vector.tld` at port 443 (which is the common port for HTTPS). |
||||
|
||||
The homeserver on it's quest to find `@bob:vector.tld` now contacts `matrix.vector.tld:443` and is then |
||||
able to exchange chat messages with it. |
||||
|
||||
|
||||
### Why so complicated? |
||||
|
||||
Organizations often don't want to run their Matrix server on the same machine that hosts their website, |
||||
but `@foo:matrix.evil.corp` usernames are ugly and everyone wants to be `@foo:evil.corp`. |
||||
|
||||
To solve that problem, Matrix implements this extra step via a .well-known file or a DNS entry. |
||||
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
site_name: Conduit Docs |
||||
site_description: Conduit is a simple, fast and reliable chat server for the Matrix protocol |
||||
theme: |
||||
name: material |
||||
repo_url: https://gitlab.com/famedly/conduit |
||||
nav: |
||||
- Home: index.md |
||||
- Installation: |
||||
- Prerequisites: installation/prerequisites.md |
||||
- Distribution Packages: installation/packages.md |
||||
- Manual: installation/manual.md |
||||
- Docker: installation/docker.md |
||||
- Configuration: |
||||
- Conduit.toml: configuration/conduit.toml.md |
||||
- Appservices: configuration/appservices.md |
||||
- Development: |
||||
- Basics: development/basics.md |
||||
- Cross compilation: development/cross-compilation.md |
||||
- Tests & CI: development/tests-ci.md |
||||
|
||||
@ -1,101 +0,0 @@
@@ -1,101 +0,0 @@
|
||||
const puppeteer = require('puppeteer'); |
||||
|
||||
run().then(() => console.log('Done')).catch(error => { |
||||
console.error("Registration test failed."); |
||||
console.error("There might be a screenshot of the failure in the artifacts.\n"); |
||||
console.error(error); |
||||
process.exit(111); |
||||
}); |
||||
|
||||
async function run() { |
||||
|
||||
const elementUrl = process.argv[process.argv.length - 2]; |
||||
console.debug("Testing registration with ElementWeb hosted at "+ elementUrl); |
||||
|
||||
const homeserverUrl = process.argv[process.argv.length - 1]; |
||||
console.debug("Homeserver url: "+ homeserverUrl); |
||||
|
||||
const username = "testuser" + String(Math.floor(Math.random() * 100000)); |
||||
const password = "testpassword" + String(Math.floor(Math.random() * 100000)); |
||||
console.debug("Testuser for this run:\n User: " + username + "\n Password: " + password); |
||||
|
||||
const browser = await puppeteer.launch({ |
||||
headless: true, args: [ |
||||
"--no-sandbox" |
||||
] |
||||
}); |
||||
|
||||
const page = await browser.newPage(); |
||||
await page.goto(elementUrl); |
||||
|
||||
await page.screenshot({ path: '01-element-web-opened.png' }); |
||||
|
||||
console.debug("Click [Create Account] button"); |
||||
await page.waitForSelector('a.mx_ButtonCreateAccount'); |
||||
await page.click('a.mx_ButtonCreateAccount'); |
||||
|
||||
await page.screenshot({ path: '02-clicked-create-account-button.png' }); |
||||
|
||||
// The webapp should have loaded right now, if anything takes more than 5 seconds, something probably broke
|
||||
page.setDefaultTimeout(5000); |
||||
|
||||
console.debug("Click [Edit] to switch homeserver"); |
||||
await page.waitForSelector('div.mx_ServerPicker_change'); |
||||
await page.click('div.mx_ServerPicker_change'); |
||||
|
||||
await page.screenshot({ path: '03-clicked-edit-homeserver-button.png' }); |
||||
|
||||
console.debug("Type in local homeserver url"); |
||||
await page.waitForSelector('input#mx_homeserverInput'); |
||||
await page.click('input#mx_homeserverInput'); |
||||
await page.click('input#mx_homeserverInput'); |
||||
await page.keyboard.type(homeserverUrl); |
||||
|
||||
await page.screenshot({ path: '04-typed-in-homeserver.png' }); |
||||
|
||||
console.debug("[Continue] with changed homeserver"); |
||||
await page.waitForSelector("div.mx_ServerPickerDialog_continue"); |
||||
await page.click('div.mx_ServerPickerDialog_continue'); |
||||
|
||||
await page.screenshot({ path: '05-back-to-enter-user-credentials.png' }); |
||||
|
||||
console.debug("Type in username"); |
||||
await page.waitForSelector("input#mx_RegistrationForm_username"); |
||||
await page.click('input#mx_RegistrationForm_username'); |
||||
await page.keyboard.type(username); |
||||
|
||||
await page.screenshot({ path: '06-typed-in-username.png' }); |
||||
|
||||
console.debug("Type in password"); |
||||
await page.waitForSelector("input#mx_RegistrationForm_password"); |
||||
await page.click('input#mx_RegistrationForm_password'); |
||||
await page.keyboard.type(password); |
||||
|
||||
await page.screenshot({ path: '07-typed-in-password-once.png' }); |
||||
|
||||
console.debug("Type in password again"); |
||||
await page.waitForSelector("input#mx_RegistrationForm_passwordConfirm"); |
||||
await page.click('input#mx_RegistrationForm_passwordConfirm'); |
||||
await page.keyboard.type(password); |
||||
|
||||
await page.screenshot({ path: '08-typed-in-password-twice.png' }); |
||||
|
||||
console.debug("Click on [Register] to finish the account creation"); |
||||
await page.waitForSelector("input.mx_Login_submit"); |
||||
await page.click('input.mx_Login_submit'); |
||||
|
||||
await page.screenshot({ path: '09-clicked-on-register-button.png' }); |
||||
|
||||
// Waiting for the app to login can take some time, so be patient.
|
||||
page.setDefaultTimeout(10000); |
||||
|
||||
console.debug("Wait for chat window to show up"); |
||||
await page.waitForSelector("div.mx_HomePage_default_buttons"); |
||||
console.debug("Apparently the registration worked."); |
||||
|
||||
await page.screenshot({ path: '10-logged-in-homescreen.png' }); |
||||
|
||||
|
||||
// Close the browser and exit the script
|
||||
await browser.close(); |
||||
} |
||||
Loading…
Reference in new issue