Compare commits

..
Author SHA1 Message Date
Jonas Zohren 8cbfe9d4ac chore: Suggest vscode users to use the rust-analyzer extension 2021-10-29 18:42:15 +02:00
Timo Kösters 34fa7fee05 Merge branch 'ci-fix-kaniko-i-hope' into 'next'
fix(ci): Convince kaniko that it is indeed running in a container by --force-ing it.

See merge request famedly/conduit!205
2021-09-15 07:05:33 +00:00
Jonas Zohren e8d998cedf fix(ci): Convince kaniko that it is indeed running in a container by --force-ing it. 2021-09-14 20:44:11 +00:00
Timo Kösters 565fe3a7dd Merge branch 'faster-sending' into 'next'
improvement: batch inserts for inserting pdus

See merge request famedly/conduit!204
2021-09-14 18:35:12 +00:00
Timo Kösters 5c02dc7830 improvement: batch inserts for inserting pdus 2021-09-14 14:33:46 +02:00
Timo Kösters 159e22e450 Merge branch 'ci-fix-aarch64-build' into 'next'
fix(ci): Fix aarch64 build

See merge request famedly/conduit!203
2021-09-14 12:09:44 +00:00
Jonas Zohren ab472e9b7c fix(ci): Fix aarch64 build
gcc-8-aarch64-linux-gnu is not available in debian 11 (which the rust image uses), so update to gcc-10

Signed-off-by: Jonas Zohren <git-pbkyr@jzohren.de>
2021-09-14 12:32:07 +02:00
Timo Kösters 31264e3d1d Merge branch 'ci-remove-element-web-register-test' into 'next'
Remove the "register an account with element" test

See merge request famedly/conduit!202
2021-09-14 09:50:24 +00:00
Jonas Zohren 422bd09e32 Remove the "register an account with element" test
Broke due to a timeout and Timo does not like broken tests.
Less testing means less failing tests.

Also, hopefully sytest is less broken now.
2021-09-14 09:44:15 +00:00
Timo Kösters b64538c6f1 Merge branch 'efficient-sqlite' into 'next'
improvement: more efficient sqlite

See merge request famedly/conduit!199
2021-09-14 07:23:02 +00:00
Timo Kösters 178451e9b5 Merge branch 'deduplicate-watchers' into 'next'
improvement: deduplicate watchers

See merge request famedly/conduit!201
2021-09-14 07:10:59 +00:00
Timo Kösters 583a966f6e Merge branch 'less-alloc' into 'next'
Reduce allocations in server_server

See merge request famedly/conduit!190
2021-09-14 07:09:55 +00:00
Timo Kösters cbee7fe111 improvement: deduplicate watchers 2021-09-13 23:20:30 +02:00
Jonas Platte d68c93b5fa Clean up (mostly automated with cargo clippy --fix) 2021-09-13 20:58:58 +02:00
Jonas Platte 979ec6b4fa Upgrade ruma 2021-09-13 20:55:13 +02:00
Jonas Platte 910ad7fed1 Get rid of more unnecessary intermediate collections 2021-09-13 20:55:12 +02:00
Timo Kösters 2c8412fe58 improvement: more efficient sqlite 2021-09-13 20:12:42 +02:00
Timo Kösters 06b0c9267f Merge branch 'appservice-signal' into 'next'
Add mautrix-signal appservice instructions

See merge request famedly/conduit!196
2021-09-13 14:07:18 +00:00
Daniel Wiesenberg 00927a7ce3 Add mautrix-signal appservice instructions 2021-09-09 10:02:11 +02:00
Timo Kösters 4aacafc298 Merge branch 'roomidshort-fix' into 'next'
fix sync not firing on new events in room

See merge request famedly/conduit!194
2021-09-08 13:39:05 +00:00
Jonathan de Jong 23c5ec8099 fix sync not firing on new events in room 2021-09-08 14:50:44 +02:00
Timo Kösters 562a2524d7 Merge branch 'db-errors' into 'next'
fix(database): handle errors in config parsin or database creation

Closes #121

See merge request famedly/conduit!193
2021-09-08 09:53:25 +00:00
Rasmus Thomsen 51245d34f1 fix(database): handle errors in config parsin or database creation
Showing the user a backtrace can be pretty confusing, so just printing
a nice error message makes errors easier to understand for end users.

fixes #121
2021-09-08 09:08:45 +01:00
Timo Kösters 4a773a1096 Merge branch 'rm-unused-deps' into 'next'
Remove unused dependencies

See merge request famedly/conduit!192
2021-09-07 14:00:27 +00:00
Jonas Platte 5821b8e705 Remove unused dependencies 2021-09-07 15:41:01 +02:00
Timo Kösters 0737bc021f Merge branch 'charludo-next-patch-31617' into 'next'
apache2 sample-config error

See merge request famedly/conduit!191
2021-09-06 18:38:38 +00:00
charludo 487046571c These lines get *generated* by certbot. Having them in the file before running certbot results in an apache2 error, and putting them in afterwards is not necessary, since certbot places them there on its own. 2021-09-06 18:35:35 +00:00
Timo Kösters 2d242523fc Merge branch 'next' into 'next'
Fix deprecated/removed Traefik label

See merge request famedly/conduit!189
2021-09-03 20:56:21 +00:00
Daniel Wiesenberg bbe36810ec Fix deprecated/removed Traefik label 2021-09-03 21:51:17 +02:00
Timo Kösters a449b1d73f Merge branch 'fix-old-events' into 'next'
fix: make sure old events don't sneek into the timeline

See merge request famedly/conduit!188
2021-09-03 09:47:24 +00:00
Timo Kösters 71341ea05a fix: make sure old events don't sneek into the timeline 2021-09-03 11:26:15 +02:00
Timo Kösters 73b764322f Merge branch 'adjust-ci-for-next-and-master-development' into 'master'
CI: Adjust CI for master and next branch development model (master)

See merge request famedly/conduit!187
2021-09-02 18:25:57 +00:00
Jonas Zohren a1f51440e2 chore(CI): Adjust CI for master and next branch development model
- Build release builds for branches "master" and "next"
- Push docker images under different tags, depending on why the pipeline started
  - branch master: push to `latest`
  - branch next: push to `next`
  - tag: push to `$TAG_NAME`

Signed-off-by: Jonas Zohren <git-pbkyr@jzohren.de>
2021-09-02 17:17:51 +02:00
Timo Kösters 0d6ae2e1e7 Merge branch 'thanks' into 'master'
docs: add thanks to

See merge request famedly/conduit!185
2021-09-02 11:10:23 +00:00
Timo Kösters d0baca44f8 docs: add thanks to 2021-09-02 13:05:19 +02:00
Timo Kösters 5536bfdca5 Merge branch 'ci-also-run-for-tags' into 'master'
Also run CI on git tags, not only new commits.

See merge request famedly/conduit!184
2021-09-02 07:33:25 +00:00
Jonas Zohren 3357bbec1e chore: Also run CI on git tags, not only new commits.
Signed-off-by: Jonas Zohren <git-pbkyr@jzohren.de>
2021-09-02 09:17:25 +02:00
Timo Kösters 102ff574ea Merge branch 'readme' into 'master'
docs: update readme and version

See merge request famedly/conduit!180
2021-09-01 21:28:28 +00:00
Timo Kösters 2770ce2cf6 fix: avoid panic 2021-09-01 23:00:24 +02:00
Timo Kösters 7cd7f1923f chore: update dependencies 2021-09-01 22:31:25 +02:00
Timo Kösters 43d693ca19 revert Arc<EventId> commit 2021-09-01 22:30:11 +02:00
Timo Kösters 875b345a5f docs: update readme and version 2021-09-01 22:18:19 +02:00
Timo Kösters 17adf096e9 Merge branch 'server-server-opt' into 'master'
Remove unneeded intermediary container collection

See merge request famedly/conduit!183
2021-09-01 20:02:37 +00:00
Jonas Platte 487601a249 Remove unneeded intermediary container collection 2021-09-01 21:46:05 +02:00
Timo Kösters 27788af022 Merge branch 'batch_keys' into 'master'
Get required keys in batch when joining a room

See merge request famedly/conduit!182
2021-09-01 19:12:21 +00:00
Timo Kösters 4b39d7cb64 fix: batch key fetching 2021-09-01 20:02:34 +02:00
Kurt Roeckx c53d79e287 fixup! Get required keys in batch when joining a room 2021-09-01 19:30:32 +02:00
Kurt Roeckx 984ad5ecd6 fixup! Get required keys in batch when joining a room 2021-09-01 19:30:31 +02:00
Kurt Roeckx b546a5bf15 Let our server signing be valid for 1 week
It was valid for 2 minutes, which can result in the server being
asked too much for something that never changes.
2021-09-01 19:30:31 +02:00
Kurt Roeckx a87519fb71 Get required keys in batch when joining a room
We now ask the trusted server for all keys in 1 request, instead of
asking each server individual for it's own keys.
2021-09-01 19:30:30 +02:00
Timo Kösters 9c3f1a9272 Merge branch 'master' into 'master'
Add Traefik setup, incl. step-by-step, to docker README.

See merge request famedly/conduit!158
2021-09-01 16:04:41 +00:00
Timo Kösters 8518d59a0b Merge branch 'clippy' into 'master'
Fix a bunch of clippy lints

See merge request famedly/conduit!178
2021-09-01 10:47:23 +00:00
Timo Kösters 4e68c22457 Merge branch 'docs' into 'master'
docs: documentation for every endpoint

See merge request famedly/conduit!177
2021-09-01 10:20:13 +00:00
Timo Kösters 73d876643c improvement: make pdu cache capacity configurable 2021-09-01 11:03:45 +02:00
Timo Kösters 22779c21d3 Merge branch 'health_script' into 'master'
Fix healthcheck.sh permissions and rearange ci dockerfile

See merge request famedly/conduit!179
2021-09-01 08:08:22 +00:00
Daniel Wiesenberg 8c584887c9 Fix healthcheck.sh permissions and rearange ci dockerfile 2021-08-31 23:17:32 +02:00
Timo Kösters 33738dbbc2 improvement: stop prev event fetching if too many events fail 2021-08-31 22:04:47 +02:00
Jonas Platte a6bb9bbe68 Fix a bunch of clippy lints 2021-08-31 21:20:03 +02:00
Timo Kösters b9eb39a9c6 docs: documentation for every endpoint 2021-08-31 19:20:34 +02:00
Timo Kösters 364820aae4 Merge branch 'registration-default' into 'master'
Default registration true

See merge request famedly/conduit!176
2021-08-31 17:03:05 +00:00
Timo Kösters ec38411620 Merge branch 'health_script' into 'master'
Move docker healthcheck into dedicated script.

See merge request famedly/conduit!173
2021-08-31 16:59:33 +00:00
Jonathan de Jong 9ec8b7f2b3 registration default true 2021-08-31 18:25:35 +02:00
Daniel Wiesenberg a08ea15695 Use $CI_COMMIT_SHORT_SHA for GIT_REF
Using `$CI_COMMIT_REF_NAME` means we get `master` for every image build,
which is not very useful/informative. Using `$CI_COMMIT_SHORT_SHA`,
on the other hand, makes it possible to see exactly from which commit an
image was built.
2021-08-31 18:03:44 +02:00
Timo Kösters 49dd3567c6 Merge branch 'connection-lifetime' into 'master'
thread_local connections

See merge request famedly/conduit!175
2021-08-30 19:05:22 +00:00
Jonathan de Jong 69df9a0145 add tls 2021-08-30 20:18:48 +02:00
Timo Kösters d0d47675d8 Merge branch 'speed' into 'master'
improvement: call /state_ids less often by using state res

See merge request famedly/conduit!174
2021-08-30 17:32:41 +00:00
Timo Kösters bd4ea14a29 improvement: call /state_ids less often by using state res 2021-08-30 16:07:59 +02:00
Timo Kösters 9033cc86aa Merge branch 'speed' into 'master'
fix: make appservices more efficient

See merge request famedly/conduit!172
2021-08-30 09:14:08 +00:00
Timo Kösters 1b25e78e3a fix: inviting dendrite users 2021-08-30 10:56:41 +02:00
Timo Kösters d57c19802d improvement: don't do state updates if the event was soft failed 2021-08-30 10:46:36 +02:00
Daniel Wiesenberg 9ded40e983 Change healthcheck in ci dockerfile 2021-08-30 09:14:08 +02:00
Daniel Wiesenberg a469ca0461 Move docker healthcheck into dedicated script. 2021-08-29 20:01:38 +02:00
Timo Kösters 632a1343eb fix: make appservices more efficient 2021-08-29 20:00:43 +02:00
Timo Kösters 00c9ad12bd Merge branch 'speed' into 'master'
Speed

See merge request famedly/conduit!168
2021-08-28 18:28:25 +00:00
Timo Kösters 1601027605 add warning if calculated event id != requested event id 2021-08-28 19:35:42 +02:00
Timo Kösters afca61fe7c fix: don't retry soft failed events 2021-08-28 11:39:33 +02:00
Devin Ragotzy 9bff276fa9 Use Arc<EventId> in place of most EventIds 2021-08-27 20:20:14 +02:00
Timo Kösters 19b89ab91f fix: server resolution 2021-08-27 20:20:13 +02:00
Timo Kösters 0330d3e270 fix: server resolution with well-known files 2021-08-27 20:20:13 +02:00
Timo Kösters a1e8a99db5 improvement: less IO for auth chains 2021-08-27 20:20:12 +02:00
Timo Kösters 33172a70e6 fix: improve key fetching 2021-08-27 20:20:12 +02:00
Timo Kösters 1b56a7bbfd Merge branch 'speed' into 'master'
fix: e2ee over federation

See merge request famedly/conduit!165
2021-08-26 12:55:47 +00:00
Timo Kösters d485eb5a24 chore: bump dependencies 2021-08-26 14:38:25 +02:00
Timo Kösters 41d07be97b improvement: persist cached auth chains in db 2021-08-26 14:19:08 +02:00
Timo Kösters bef4fe50ce fix: better migration, force e2ee device key updates 2021-08-26 14:19:08 +02:00
Timo Kösters 9152b877a7 fix: wrong soft fail check, too many events in /sync state response 2021-08-26 14:19:07 +02:00
Timo Kösters 9f8c45c763 fix: e2ee over federation
to device events were not being sent
2021-08-26 14:19:07 +02:00
Daniel Wiesenberg 5800e9b797 Add Traefik setup, incl. step-by-step, to docker README. 2021-08-26 12:26:32 +02:00
Timo Kösters 5aa56b92ee Merge branch 'speed' into 'master'
improvement: more efficient auth chain cache

See merge request famedly/conduit!164
2021-08-24 20:12:10 +00:00
Timo Kösters dd87066546 improvement: more efficient auth chain cache 2021-08-24 21:55:18 +02:00
Timo Kösters 30b309b708 Merge branch 'speed' into 'master'
Better E2EE and faster incoming event handling

See merge request famedly/conduit!163
2021-08-24 18:16:56 +00:00
Timo Kösters d5695fb9fe Merge branch 'only-set-max-optimzations-in-ci' into 'master'
Only apply max. optimizations in CI builds.

See merge request famedly/conduit!162
2021-08-24 17:54:17 +00:00
Timo Kösters 81e056417c improvement: better e2ee over fed, faster incoming event handling 2021-08-24 19:52:05 +02:00
Timo Kösters 72dd95f500 Merge branch 'createwarnings' into 'master'
fix: correct create event warnings

See merge request famedly/conduit!161
2021-08-24 17:51:53 +00:00
Jonas Zohren b6e755f67e Only apply max. optimizations in CI builds.
The average german man has a life expectancy of 78.7 years, or 689884.2 hours.
Assuming that Timo is 20 years old, he has rougly 514564.2 hours left on planet earth.
Also assuming that cross release builds took him 25 minutes before,
but 2-2.5x of that with the current release compilation config he wasted roughly an hour waiting for it to complete.
If he continued to work on Conduit for 20 more years (or 175320 hours),
and makes a release compilation about once per day, this means 7305 hours or 304 days wasted waiting for the rust compiler.
By cutting that back down to the original settings, he get's 182 days of his life back.
That's about 0.63% of his remaining life.
182 joyful days he can spend with family and loved ones.
2021-08-22 21:05:32 +00:00
Timo Kösters 4f8cf3bed4 Merge branch 'send_join_v1' into 'master'
Implement federation/v1/send_join

See merge request famedly/conduit!141
2021-08-22 12:06:26 +00:00
Timo Kösters b3ea6adc9c Merge branch 'get-pdu-json' into 'master'
Consistent and escaped response in get_pdu

See merge request famedly/conduit!160
2021-08-22 11:08:11 +00:00
Timo Kösters 6d83954c40 fix: room upgrades 2021-08-22 13:06:50 +02:00
Timo Kösters 667ffb4239 fix: correct create event warnings 2021-08-22 13:01:13 +02:00
Kurt Roeckx 48494c9464 Implement federation/v1/send_join 2021-08-22 10:07:38 +02:00
Tom Smeding 2ef23b213a Consistent and escaped response in get_pdu
1. The fallback text of the get_pdu admin room command response message
   now contains the same text as the formatted_body content (namely, the
   json instead of Debug-formatting of a serde type).
2. The formatted_body content of the get_pdu response is now
   html-escaped.
2021-08-21 15:31:26 +02:00
Timo Kösters 33481ec062 Merge branch 'statediffs' into 'master'
Statediffs

See merge request famedly/conduit!145
2021-08-21 13:05:38 +00:00
Timo Kösters 3b78e43a18 fmt 2021-08-21 14:24:10 +02:00
Timo Kösters 4956fb9fba improvement: limit prev event fetching 2021-08-21 14:22:21 +02:00
Timo Kösters b09499c2df fix: don't save empty tokens 2021-08-19 14:05:23 +02:00
Timo Kösters 46d8a46e1f improvement: faster incoming transaction handling 2021-08-19 11:01:43 +02:00
Timo Kösters bf7e019a68 improvement: better prev event fetching, perf improvements 2021-08-17 16:06:09 +02:00
Timo Kösters 75ba8bb565 fix: faster room joins 2021-08-17 00:22:52 +02:00
Timo Kösters 0823506d05 fix: don't load endless prev events and fix room join bug 2021-08-16 23:24:52 +02:00
Timo Kösters 2c3bee34a0 improvement: better sqlite 2021-08-15 13:27:03 +02:00
Timo Kösters a4310f840e improvement: state info cache 2021-08-15 06:48:25 +02:00
Timo Kösters 5bd5b41c70 fix: fetch event multiple times 2021-08-15 06:48:25 +02:00
Timo Kösters f9a2edc0dd fix: also fetch prev events that are outliers already 2021-08-15 06:48:25 +02:00
Timo Kösters ecd1e45a44 fix: fetch more than one prev event 2021-08-15 06:48:24 +02:00
Timo Kösters 1d46569929 fix: don't use recursion for prev events 2021-08-15 06:48:24 +02:00
Timo Kösters 1e3a8ca35d fmt 2021-08-15 06:48:24 +02:00
Timo Kösters 0cb22996be remove prev event fetch limit 2021-08-15 06:48:14 +02:00
Timo Kösters 38effda799 fix: delta calculation 2021-08-14 19:11:10 +02:00
Timo Kösters 3cf0145bc5 fix: room exists panic 2021-08-14 08:26:45 +02:00
Timo Kösters 3eabaa2a95 finish implementing better state store 2021-08-13 19:49:16 +02:00
Timo Kösters 31f60ad6fd improvement: migrations, batch inserts 2021-08-12 17:56:35 +02:00
Timo Kösters 41dd620d74 WIP improvement: much better state storage 2021-08-12 17:56:35 +02:00
Timo Kösters 9410d3ef9c fix: long prev event fetch times for huge rooms 2021-08-12 17:56:14 +02:00
Timo Kösters 665aee11c0 less warnings 2021-08-12 17:56:14 +02:00
Timo Kösters 5173d0deb5 improvement: cache for short event ids 2021-08-12 17:56:14 +02:00
Timo Kösters c2c6a8673e improvement: use u64s in auth chain cache 2021-08-12 17:56:14 +02:00
Timo Kösters 096e0971f1 improvement: smaller cache, better prev event fetching 2021-08-12 17:56:13 +02:00
25 changed files with 121 additions and 470 deletions
+4 -18
View File
@@ -3,7 +3,6 @@ stages:
- build docker image
- test
- upload artifacts
- publish
variables:
GIT_SUBMODULE_STRATEGY: recursive
@@ -76,12 +75,12 @@ build:release:cargo:aarch64-unknown-linux-gnu:
extends: .build-cargo-shared-settings
variables:
TARGET: "aarch64-unknown-linux-gnu"
NEEDED_PACKAGES: "build-essential gcc-8-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross"
NEEDED_PACKAGES: "build-essential gcc-10-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++
TARGET_CC: "/usr/bin/aarch64-linux-gnu-gcc-8"
TARGET_AR: "/usr/bin/aarch64-linux-gnu-gcc-ar-8"
TARGET_CC: "/usr/bin/aarch64-linux-gnu-gcc-10"
TARGET_AR: "/usr/bin/aarch64-linux-gnu-gcc-ar-10"
artifacts:
name: "conduit-aarch64-unknown-linux-gnu"
paths:
@@ -223,6 +222,7 @@ build:docker:next:
- >
/kaniko/executor
$KANIKO_CACHE_ARGS
--force
--context $CI_PROJECT_DIR
--build-arg CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
--build-arg VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml)
@@ -370,17 +370,3 @@ publish:package:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file conduit-x86_64-unknown-linux-gnu.deb "${BASE_URL}/conduit-x86_64-unknown-linux-gnu.deb"'
pages:
stage: "publish"
image:
name: "squidfunk/mkdocs-material"
entrypoint: [""]
tags: ["docker"]
needs: []
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
script:
- "mkdocs build --site-dir public"
artifacts:
paths:
- "public"
+5
View File
@@ -0,0 +1,5 @@
{
"recommendations": [
"matklad.rust-analyzer"
]
}
+71
View File
@@ -0,0 +1,71 @@
# 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](https://github.com/Half-Shot/matrix-appservice-discord)
- [mautrix-hangouts](https://github.com/mautrix/hangouts/)
- [mautrix-telegram](https://github.com/mautrix/telegram/)
- [mautrix-signal](https://github.com/mautrix/signal)
- There are a few things you need to do, in order for the bridge (at least up to version `0.2.0`) to work. Before following the bridge installation guide, you need to map apply a patch to bridges `portal.py`. Go to [portal.py](https://github.com/mautrix/signal/blob/master/mautrix_signal/portal.py) at [mautrix-signal](https://github.com/mautrix/signal) (don't forget to change to the correct commit/version of the file) and copy its content, create a `portal.py` on your host system and paste it in. Now you need to change two lines:
[Line 1020](https://github.com/mautrix/signal/blob/4ea831536f154aba6419d13292479eb383ea3308/mautrix_signal/portal.py#L1020)
```diff
--- levels.users[self.main_intent.mxid] = 9001 if is_initial else 100
+++ levels.users[self.main_intent.mxid] = 100 if is_initial else 100
```
and add a new line between [Lines 1041 and 1042](https://github.com/mautrix/signal/blob/4ea831536f154aba6419d13292479eb383ea3308/mautrix_signal/portal.py#L1041-L1042)
```diff
"type": str(EventType.ROOM_POWER_LEVELS),
+++ "state_key": "",
"content": power_levels.serialize(),
```
Now you just need to map the patched `portal.py` into the `mautrix-signal` container
```yml
volumes:
- ./<your>/<path>/<on>/<host>/portal.py:/usr/lib/python3.9/site-packages/mautrix_signal/portal.py
```
and then read below and start following the bridge [installation instructions](https://docs.mau.fi/bridges/index.html).
## 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.
+11
View File
@@ -0,0 +1,11 @@
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
-16
View File
@@ -1,16 +0,0 @@
[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
-16
View File
@@ -1,16 +0,0 @@
# 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)
-1
View File
@@ -1 +0,0 @@
# Configuration
-2
View File
@@ -1,2 +0,0 @@
# Configuring Conduit
-220
View File
@@ -1,220 +0,0 @@
# 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`
-1
View File
@@ -1 +0,0 @@
# Contribute
-1
View File
@@ -1 +0,0 @@
# Basics
-13
View File
@@ -1,13 +0,0 @@
# 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
-1
View File
@@ -1 +0,0 @@
# Tests & CI
-52
View File
@@ -1,52 +0,0 @@
# 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
-1
View File
@@ -1 +0,0 @@
# Installation
View File
-2
View File
@@ -1,2 +0,0 @@
:::warning Test
:::
-12
View File
@@ -1,12 +0,0 @@
# 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
```
-31
View File
@@ -1,31 +0,0 @@
# 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.
-40
View File
@@ -1,40 +0,0 @@
# 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.
-20
View File
@@ -1,20 +0,0 @@
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
+4 -5
View File
@@ -1092,14 +1092,13 @@ pub(crate) async fn invite_helper<'a>(
"Could not accept incoming PDU as timeline event.",
))?;
for server in db
let servers = db
.rooms
.room_servers(room_id)
.filter_map(|r| r.ok())
.filter(|server| &**server != db.globals.server_name())
{
db.sending.send_pdu(&server, &pdu_id)?;
}
.filter(|server| &**server != db.globals.server_name());
db.sending.send_pdu(servers, &pdu_id)?;
return Ok(());
}
+4 -5
View File
@@ -2104,13 +2104,12 @@ impl Rooms {
// where events in the current room state do not exist
self.set_room_state(room_id, statehashid)?;
for server in self
let servers = self
.room_servers(room_id)
.filter_map(|r| r.ok())
.filter(|server| &**server != db.globals.server_name())
{
db.sending.send_pdu(&server, &pdu_id)?;
}
.filter(|server| &**server != db.globals.server_name());
db.sending.send_pdu(servers, &pdu_id)?;
for appservice in db.appservice.all()? {
if self.appservice_in_room(room_id, &appservice, db)? {
+18 -8
View File
@@ -84,7 +84,7 @@ pub enum SendingEventType {
pub struct Sending {
/// The state for a given state hash.
pub(super) servername_educount: Arc<dyn Tree>, // EduCount: Count of last EDU sync
pub(super) servernameevent_data: Arc<dyn Tree>, // ServernamEvent = (+ / $)SenderKey / ServerName / UserId + PduId / Id (for edus), Data = EDU content
pub(super) servernameevent_data: Arc<dyn Tree>, // ServernameEvent = (+ / $)SenderKey / ServerName / UserId + PduId / Id (for edus), Data = EDU content
pub(super) servercurrentevent_data: Arc<dyn Tree>, // ServerCurrentEvents = (+ / $)ServerName / UserId + PduId / Id (for edus), Data = EDU content
pub(super) maximum_requests: Arc<Semaphore>,
pub sender: mpsc::UnboundedSender<(Vec<u8>, Vec<u8>)>,
@@ -423,13 +423,23 @@ impl Sending {
Ok(())
}
#[tracing::instrument(skip(self, server, pdu_id))]
pub fn send_pdu(&self, server: &ServerName, pdu_id: &[u8]) -> Result<()> {
let mut key = server.as_bytes().to_vec();
key.push(0xff);
key.extend_from_slice(pdu_id);
self.servernameevent_data.insert(&key, &[])?;
self.sender.unbounded_send((key, vec![])).unwrap();
#[tracing::instrument(skip(self, servers, pdu_id))]
pub fn send_pdu<I: Iterator<Item = Box<ServerName>>>(
&self,
servers: I,
pdu_id: &[u8],
) -> Result<()> {
let mut batch = servers.map(|server| {
let mut key = server.as_bytes().to_vec();
key.push(0xff);
key.extend_from_slice(pdu_id);
self.sender.unbounded_send((key.clone(), vec![])).unwrap();
(key, Vec::new())
});
self.servernameevent_data.insert_batch(&mut batch)?;
Ok(())
}
+4 -5
View File
@@ -2880,14 +2880,13 @@ async fn create_join_event(
db,
)?;
for server in db
let servers = db
.rooms
.room_servers(room_id)
.filter_map(|r| r.ok())
.filter(|server| &**server != db.globals.server_name())
{
db.sending.send_pdu(&server, &pdu_id)?;
}
.filter(|server| &**server != db.globals.server_name());
db.sending.send_pdu(servers, &pdu_id)?;
db.flush()?;