Compare commits

..
Author SHA1 Message Date
timedout 298113c0a6 feat: Update MSC4456 implementation, new route 2026-10-14 10:34:52 +01:00
timedout 62de19970e fix: Address review comments 2026-10-14 10:34:51 +01:00
timedout 6b532eb7d0 perf: Yield ssk instead of doing a serialization roundtrip 2026-10-14 10:34:51 +01:00
timedout b541aadc2b feat: Don't double-sign our own keys 2026-10-14 10:34:51 +01:00
timedout c1f6a7c082 fix: Don't do weird wire signing for server keys route 2026-10-14 10:34:51 +01:00
timedout 3508b1a5e3 fix: Don't make origin key requests to ourself
Intercepting the request and serving it locally seems like a pretty good blanket solution
2026-10-14 10:34:51 +01:00
timedout 9867e99bb2 fix: Typo (MSC4456 -> MSC4556) 2026-10-14 10:34:50 +01:00
timedout 7b180667e8 style: Reformat 2026-10-14 10:34:50 +01:00
timedout e001e4a68a fix: Pass correct object for signing 2026-10-14 10:34:50 +01:00
timedout 75383af35c chore: Update trusted_servers docs 2026-10-14 10:34:50 +01:00
timedout c486eeac06 fix: Don't serve expired responses in the criterialess path 2026-10-14 10:34:49 +01:00
timedout 1ded0b4e97 fix: Enforce specific notary limits per MSC4556 2026-10-14 10:34:49 +01:00
timedout cd94a0d3ab fix: Refuse to process >4096 servers and/or >8192 keys
pending msc
2026-10-14 10:34:49 +01:00
timedout 08307970a1 fix: Deduplicate signing key responses if we already satisfied them 2026-10-14 10:34:49 +01:00
timedout ebf7c9920a fix: Don't short circuit if all requested servers have no query criteria
Also adds some traces
2026-10-14 10:34:48 +01:00
timedout a15905e8c9 chore: Rebuild example config 2026-10-14 10:34:47 +01:00
timedout 19bc5d2016 feat: Correctly ask origin for keys before seeding from local cache 2026-10-14 10:32:36 +01:00
timedout 6bbebd8b54 chore: Add newsfrag 2026-10-14 10:32:36 +01:00
timedout 4e1fb09bfb fix: Maybe query origin when fetching latest keys 2026-10-14 10:32:36 +01:00
timedout 39cd151ca3 fix: Don't attempt to contact origins as a notary more than once a minute 2026-10-14 10:32:36 +01:00
timedout a5a7905494 fix: Actually contact origins in notary key fetching 2026-10-14 10:32:35 +01:00
timedout a05d7a8cf3 style: Condense repeated code into a reusable function 2026-10-14 10:32:35 +01:00
timedout af8ca8580e fix: Correctly sum total_queried_keys 2026-10-14 10:32:35 +01:00
timedout 7050ea84e3 feat: Strip extraneous signatures to avoid leaking our own notaries 2026-10-14 10:32:35 +01:00
timedout 441ab78c4e feat: Notary server 2026-10-14 10:32:34 +01:00
206 changed files with 3855 additions and 4996 deletions

No files matched your search

@@ -44,7 +44,7 @@ runs:
- name: Login to builtin registry
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
registry: ${{ env.BUILTIN_REGISTRY }}
username: ${{ inputs.registry_user }}
@@ -79,7 +79,7 @@ runs:
- name: Login to builtin registry
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
registry: ${{ env.BUILTIN_REGISTRY }}
username: ${{ inputs.registry_user }}
+1 -1
View File
@@ -7,7 +7,7 @@ runs:
using: composite
steps:
- name: Install sccache
uses: https://forgejo.ellis.link/continuwuation/sccache-action@b5ae5b4541ed5fb0f616e3cb616bf213fefa1c40 # v1
uses: https://git.tomfos.tr/tom/sccache-action@v1
- name: Configure sccache
uses: https://github.com/actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
@@ -29,7 +29,7 @@ runs:
steps:
- name: Detect runner OS
id: runner-os
uses: https://forgejo.ellis.link/continuwuation/detect-versions@d39555789fed25b8eb8e086d9f199c514dfa311e # v1
uses: https://git.tomfos.tr/actions/detect-versions@v1
- name: Configure cross-compilation architecture
if: inputs.dpkg-arch != ''
+2 -2
View File
@@ -39,7 +39,7 @@ runs:
steps:
- name: Detect runner OS
id: runner-os
uses: https://forgejo.ellis.link/continuwuation/detect-versions@d39555789fed25b8eb8e086d9f199c514dfa311e # v1
uses: https://git.tomfos.tr/actions/detect-versions@v1
- name: Configure Cargo environment
shell: bash
@@ -147,7 +147,7 @@ runs:
run: echo "::group::📦 Restoring build cache"
- name: Setup sccache
uses: https://forgejo.ellis.link/continuwuation/sccache-action@b5ae5b4541ed5fb0f616e3cb616bf213fefa1c40 # v1
uses: https://git.tomfos.tr/tom/sccache-action@v1
- name: End build cache restore group
shell: bash
+1 -1
View File
@@ -71,7 +71,7 @@ runs:
- name: Install timelord-cli and git-warp-time
if: steps.check-binaries.outputs.need-install == 'true'
uses: https://github.com/taiki-e/install-action@cfdb7ed4ccc7c7dce37759eae89dc5674b469b39 # v2
uses: https://github.com/taiki-e/install-action@1168f6810a3cb30a3514bf5756a3b7f0422c6df8 # v2
with:
tool: git-warp-time,timelord-cli@3.0.1
+5
View File
@@ -4,6 +4,11 @@ on:
pull_request_target:
types: [opened, reopened]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
auto-label:
name: Apply labels based on changed files
+1 -1
View File
@@ -60,7 +60,7 @@ jobs:
cargo-debian-${{ steps.debian-version.outputs.distribution }}-${{ matrix.arch }}-
- name: Setup sccache
uses: https://forgejo.ellis.link/continuwuation/sccache-action@b5ae5b4541ed5fb0f616e3cb616bf213fefa1c40 # v1
uses: https://git.tomfos.tr/tom/sccache-action@v1
- name: Configure sccache environment
run: |
+3 -1
View File
@@ -54,6 +54,8 @@ jobs:
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download binary artifacts
@@ -63,7 +65,7 @@ jobs:
path: binaries
merge-multiple: true
- name: Create Release and Upload
uses: https://github.com/softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3
uses: https://github.com/softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3
with:
draft: true
files: binaries/*
+5
View File
@@ -4,6 +4,11 @@ on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
check-changelog:
name: Check changelog is added
+2 -2
View File
@@ -28,13 +28,13 @@ jobs:
- name: Detect runner environment
id: runner-env
uses: https://forgejo.ellis.link/continuwuation/detect-versions@d39555789fed25b8eb8e086d9f199c514dfa311e # v1
uses: https://git.tomfos.tr/actions/detect-versions@v1
- name: Setup Node.js
if: steps.runner-env.outputs.node_major == '' || steps.runner-env.outputs.node_major < '20'
uses: https://github.com/actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: 26
node-version: 24
- name: Cache npm dependencies
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
+4
View File
@@ -7,6 +7,10 @@ on:
- main
workflow_dispatch:
permissions:
contents: read
pull-requests: read
jobs:
fast-checks:
name: Pre-commit & Formatting
+13 -3
View File
@@ -31,6 +31,11 @@ jobs:
build-release:
name: "Build ${{ matrix.slug }} (release)"
runs-on: dind
permissions:
contents: read
packages: write
attestations: write
id-token: write
strategy:
matrix:
include:
@@ -79,7 +84,6 @@ jobs:
outputs: |
${{ env.BUILTIN_REGISTRY_ENABLED == 'true' && format('type=image,"name={0}",push-by-digest=true,name-canonical=true,push=true', env.IMAGE_PATH) || format('type=image,"name={0}",push=false', env.IMAGE_PATH) }}
type=local,dest=/tmp/binaries
pull: true # Base images were becoming out of date
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
- name: Upload Docker artifacts
@@ -113,6 +117,11 @@ jobs:
name: "Build ${{ matrix.slug }} (max-perf)"
runs-on: dind
needs: build-release
permissions:
contents: read
packages: write
attestations: write
id-token: write
strategy:
matrix:
include:
@@ -163,7 +172,6 @@ jobs:
outputs: |
${{ env.BUILTIN_REGISTRY_ENABLED == 'true' && format('type=image,"name={0}",push-by-digest=true,name-canonical=true,push=true', env.IMAGE_PATH) || format('type=image,"name={0}",push=false', env.IMAGE_PATH) }}
type=local,dest=/tmp/binaries
pull: true # Base images were becoming out of date
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
- name: Upload max-perf Docker artifacts
@@ -199,6 +207,8 @@ jobs:
needs:
- build-release
- build-maxperf
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download binary artifacts
@@ -208,7 +218,7 @@ jobs:
path: binaries
merge-multiple: true
- name: Create Release and Upload
uses: https://github.com/softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3
uses: https://github.com/softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3
with:
draft: true
files: binaries/*
+1 -1
View File
@@ -43,7 +43,7 @@ jobs:
name: Renovate
runs-on: ubuntu-latest
container:
image: ghcr.io/renovatebot/renovate:44.210.1@sha256:45cc73346c44a9afe037f2d19766f2b545b59b2ed31b937b5b09017d2958e45f
image: ghcr.io/renovatebot/renovate:44.151.2@sha256:29b3bf193f855c6f4b7027395a9c66c3417ad8bb6f30458090e1c2363d04eef7
options: --tmpfs /tmp:exec
steps:
- name: Checkout
+1 -2
View File
@@ -7,7 +7,6 @@ f419c64aca300a338096b4e0db4c73ace54f23d0
5998a0d883d31b866f7c8c46433a8857eae51a89
# trailing whitespace and newlines
46c193e74b2ce86c48ce802333a0aabce37fd6e9
# rustfmt updates that rewrapped tons of comments
# rustfmt update that rewrapped tons of comments
9fbabe221051e6956a05d8824142092ede68971e
b0c0905472b882ff0cc79232e73d307fd0b5035b
9c27441acf2e65f85c106ccff5c6b6c37030ddca
-1
View File
@@ -1,4 +1,3 @@
open_collective: continuwuity
github: [JadedBlueEyes, timedoutuk, gingershaped]
custom:
- https://timedout.uk/donate.html
+1 -1
View File
@@ -32,7 +32,7 @@ repos:
stages: [ commit-msg ]
- repo: https://github.com/crate-ci/committed
rev: v1.1.12
rev: v1.1.11
hooks:
- id: committed
Generated
+712 -706
View File
File diff suppressed because it is too large. Load diff
+68 -83
View File
@@ -18,11 +18,11 @@ version = "26.9.1"
name = "conduwuit"
[workspace.dependencies.arrayvec]
version = "0.7.8"
version = "0.7.6"
features = ["serde"]
[workspace.dependencies.smallvec]
version = "1.16.5"
version = "1.14.0"
features = [
"const_generics",
"const_new",
@@ -39,10 +39,10 @@ features = ["ffi", "std", "union"]
version = "1.1.0"
[workspace.dependencies.ctor]
version = "1.0.13"
version = "1.0.6"
[workspace.dependencies.dtor]
version = "1.0.6"
version = "1.0.0"
[workspace.dependencies.cargo_toml]
version = "1.0"
@@ -50,7 +50,7 @@ default-features = false
features = ["features"]
[workspace.dependencies.toml]
version = "1.2.1"
version = "1.1.2"
default-features = false
features = ["parse", "serde"]
@@ -58,7 +58,7 @@ features = ["parse", "serde"]
version = "0.6.0"
[workspace.dependencies.base64]
version = "0.23.1"
version = "0.23.0"
default-features = false
# used for TURN server authentication
@@ -71,40 +71,39 @@ version = "0.5.0"
default-features = false
[workspace.dependencies.p256]
version = "0.14.0"
version = "0.13.2"
default-features = false
features = ["ecdsa", "std"]
# used for checking if an IP is in specific subnets / CIDR ranges easier
[workspace.dependencies.ipaddress]
version = "0.2.11"
version = "0.2.0"
[workspace.dependencies.rand]
version = "0.10.3"
version = "0.10.1"
# Used for the http request / response body type for Ruma endpoints used with reqwest
[workspace.dependencies.bytes]
version = "1.12.1"
version = "1.10.1"
[workspace.dependencies.http-body-util]
version = "0.1.5"
version = "0.1.3"
[workspace.dependencies.http]
version = "1.5.0"
version = "1.3.1"
# parses the HTTP-date form of Retry-After
[workspace.dependencies.httpdate]
version = "1.0.3"
[workspace.dependencies.regex]
version = "1.13.1"
version = "1.11.1"
[workspace.dependencies.axum]
version = "0.8.9"
version = "0.8.8"
default-features = false
features = [
"form",
"query",
"http1",
"http2",
"json",
@@ -114,7 +113,7 @@ features = [
]
[workspace.dependencies.axum-extra]
version = "0.12.6"
version = "0.12.0"
default-features = false
features = ["typed-header", "tracing", "cookie"]
@@ -133,12 +132,12 @@ default-features = false
version = "0.2"
[workspace.dependencies.tower]
version = "0.5.3"
version = "0.5.2"
default-features = false
features = ["util"]
[workspace.dependencies.tower-http]
version = "0.7.1"
version = "0.7.0"
default-features = false
features = [
"add-extension",
@@ -152,46 +151,38 @@ features = [
]
[workspace.dependencies.rustls]
version = "0.23.46"
version = "0.23.25"
default-features = false
[workspace.dependencies.reqwest]
version = "0.13.5"
version = "0.13.2"
default-features = false
features = [
"rustls-no-provider",
"socks",
"hickory-dns",
"http2",
"stream",
"form",
]
# Needed for as long as openidconnect is on an outdated reqwest
[workspace.dependencies.reqwest_0_12]
package = "reqwest"
version = "0.12"
default-features = false
features = [
"rustls-tls-native-roots-no-provider",
]
[workspace.dependencies.serde]
version = "1.0.229"
version = "1.0.219"
default-features = false
features = ["rc"]
[workspace.dependencies.serde_json]
version = "1.0.154"
version = "1.0.140"
default-features = false
features = ["raw_value"]
# Used for appservice registration files
[workspace.dependencies.serde-saphyr]
version = "2.1.1"
version = "1.0.0"
# Used to load forbidden room/user regex from config
[workspace.dependencies.serde_regex]
version = "1.2.0"
version = "1.1.0"
# Used for password hashing
[workspace.dependencies.argon2]
@@ -201,7 +192,7 @@ default-features = false
# Used to generate thumbnails for images
[workspace.dependencies.image]
version = "0.25.10"
version = "0.25.5"
default-features = false
features = [
"jpeg",
@@ -212,29 +203,29 @@ features = [
# logging
[workspace.dependencies.log]
version = "0.4.35"
version = "0.4.27"
default-features = false
[workspace.dependencies.tracing]
version = "0.1.44"
version = "0.1.41"
default-features = false
[workspace.dependencies.tracing-subscriber]
version = "0.3.23"
version = "0.3.20"
default-features = false
features = ["env-filter", "std", "tracing", "tracing-log", "ansi", "fmt"]
[workspace.dependencies.tracing-journald]
version = "0.3.2"
version = "0.3.1"
[workspace.dependencies.tracing-core]
version = "0.1.36"
version = "0.1.34"
default-features = false
# for URL previews
[workspace.dependencies.webpage]
version = "2.1.0"
version = "2.0.1"
default-features = false
# used for conduwuit's CLI and admin room command parsing
[workspace.dependencies.clap]
version = "4.6.7"
version = "4.5.35"
default-features = false
features = [
"derive",
@@ -247,12 +238,12 @@ features = [
]
[workspace.dependencies.futures]
version = "0.3.34"
version = "0.3.31"
default-features = false
features = ["std", "async-await"]
[workspace.dependencies.tokio]
version = "1.54.1"
version = "1.44.2"
default-features = false
features = [
"fs",
@@ -267,25 +258,25 @@ features = [
]
[workspace.dependencies.tokio-metrics]
version = "0.5.2"
version = "0.5.0"
[workspace.dependencies.libloading]
version = "0.9.0"
# Validating urls in config, was already a transitive dependency
[workspace.dependencies.url]
version = "2.5.8"
version = "2.5.4"
default-features = false
features = ["serde"]
# standard date and time tools
[workspace.dependencies.chrono]
version = "0.4.45"
version = "0.4.38"
features = ["alloc", "std"]
default-features = false
[workspace.dependencies.hyper]
version = "1.12.0"
version = "1.6.0"
default-features = false
features = [
"server",
@@ -304,7 +295,7 @@ features = [
# to support multiple variations of setting a config option
[workspace.dependencies.either]
version = "1.19.0"
version = "1.15.0"
default-features = false
features = ["serde"]
@@ -315,7 +306,7 @@ default-features = false
features = ["env", "toml"]
[workspace.dependencies.hickory-resolver]
version = "0.26.3"
version = "0.26.0"
default-features = false
features = [
"serde",
@@ -325,7 +316,7 @@ features = [
# Used for conduwuit::Error type
[workspace.dependencies.thiserror]
version = "2.0.21"
version = "2.0.12"
default-features = false
# Used to make working with iterators easier, was already a transitive depdendency
@@ -339,14 +330,14 @@ version = "2.1.1"
# used for MPSC channels
[workspace.dependencies.loole]
version = "0.6.0"
version = "0.4.0"
# used for MPMC channels
[workspace.dependencies.async-channel]
version = "2.5.0"
[workspace.dependencies.async-trait]
version = "0.1.92"
version = "0.1.88"
[workspace.dependencies.lru-cache]
version = "0.1.2"
@@ -357,7 +348,7 @@ version = "1.1.1"
# Used for matrix spec type definitions and helpers
[workspace.dependencies.ruma]
git = "https://github.com/ruma/ruma.git"
rev = "0ed7fba34213f18a628a56f527c6cc795cd7eef5"
rev = "f5e5e1c885f598036fd4326c566e9d1928027d5d"
features = [
"appservice-api-c",
"client-api",
@@ -397,13 +388,12 @@ features = [
"unstable-msc4494",
"unstable-msc4484",
"unstable-msc4540",
"unstable-msc4560",
"unstable-extensible-events",
]
[workspace.dependencies.rust-rocksdb]
git = "https://forgejo.ellis.link/continuwuation/rust-rocksdb-zaidoon1"
rev = "6021299f3e0e9455dc3f2e39c65e1dc217be8903"
rev = "0a25ff92f7c09b55eec496b9c192c7d5136ab2b8"
default-features = false
features = [
"multi-threaded-cf",
@@ -414,7 +404,7 @@ features = [
]
[workspace.dependencies.sha2]
version = "0.11.1"
version = "0.11.0"
default-features = false
[workspace.dependencies.sha1]
@@ -422,13 +412,11 @@ version = "0.11.0"
default-features = false
[workspace.dependencies.openidconnect]
version = "4.1.0"
default-features = false
features = ["reqwest"]
version = "4.0.1"
# optional opentelemetry, performance measurements, flamegraphs, etc for performance measurements and monitoring
[workspace.dependencies.opentelemetry]
version = "0.33.1"
version = "0.33.0"
[workspace.dependencies.opentelemetry-instrumentation-tower]
version = "0.19.0"
@@ -436,7 +424,7 @@ default-features = false
features = ["axum"]
[workspace.dependencies.opentelemetry-semantic-conventions]
version = "0.33.1"
version = "0.33.0"
features = ["semconv_experimental"]
[workspace.dependencies.tracing-flame]
@@ -446,25 +434,25 @@ version = "0.2.0"
version = "0.34.0"
[workspace.dependencies.opentelemetry_sdk]
version = "0.33.1"
version = "0.33.0"
features = ["rt-tokio"]
[workspace.dependencies.opentelemetry-prometheus]
version = "0.33.1"
version = "0.33.0"
[workspace.dependencies.prometheus]
version = "0.14.0"
default-features = false
[workspace.dependencies.opentelemetry-otlp]
version = "0.33.1"
version = "0.33.0"
features = ["http", "grpc-tonic", "trace", "logs", "metrics"]
# optional sentry metrics for crash/panic reporting
[workspace.dependencies.sentry]
version = "0.49.5"
version = "0.48.0"
default-features = false
features = [
"backtrace",
@@ -479,14 +467,14 @@ features = [
]
[workspace.dependencies.sentry-tracing]
version = "0.49.5"
version = "0.48.0"
[workspace.dependencies.sentry-tower]
version = "0.49.5"
version = "0.48.0"
# jemalloc usage
[workspace.dependencies.tikv-jemalloc-sys]
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
rev = "ac4d4861b335b199f812807996e8c9166961041a"
rev = "df86ff89d4b1e223b9f7d2dd2fbb7f202da7f554"
default-features = false
features = [
"background_threads_runtime_support",
@@ -494,7 +482,7 @@ features = [
]
[workspace.dependencies.tikv-jemallocator]
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
rev = "ac4d4861b335b199f812807996e8c9166961041a"
rev = "df86ff89d4b1e223b9f7d2dd2fbb7f202da7f554"
default-features = false
features = [
"background_threads_runtime_support",
@@ -502,7 +490,7 @@ features = [
]
[workspace.dependencies.tikv-jemalloc-ctl]
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
rev = "ac4d4861b335b199f812807996e8c9166961041a"
rev = "df86ff89d4b1e223b9f7d2dd2fbb7f202da7f554"
default-features = false
features = ["use_std"]
@@ -510,7 +498,7 @@ features = ["use_std"]
version = "0.5"
[workspace.dependencies.nix]
version = "0.31.3"
version = "0.31.0"
default-features = false
features = ["resource"]
@@ -532,7 +520,7 @@ version = "0.4.9"
default-features = false
[workspace.dependencies.termimad]
version = "0.35.5"
version = "0.35.0"
default-features = false
[workspace.dependencies.checked_ops]
@@ -555,10 +543,10 @@ features = ["hardware-lock-elision", "deadlock_detection"] # TODO: Check if dead
# Use this when extending with_lock::WithLock to parking_lot
[workspace.dependencies.lock_api]
version = "0.5.0"
version = "0.4.13"
[workspace.dependencies.bytesize]
version = "2.7"
version = "2.0"
[workspace.dependencies.core_affinity]
version = "0.8.3"
@@ -570,11 +558,11 @@ version = "0.2"
version = "0.2"
[workspace.dependencies.minicbor]
version = "2.3.1"
version = "2.1.1"
features = ["std"]
[workspace.dependencies.minicbor-serde]
version = "0.7.2"
version = "0.7.0"
features = ["std"]
[workspace.dependencies.maplit]
@@ -584,10 +572,10 @@ version = "1.0.2"
version = "1.0.1"
[workspace.dependencies.askama]
version = "0.16.1"
version = "0.16.0"
[workspace.dependencies.lettre]
version = "0.11.23"
version = "0.11.19"
default-features = false
features = ["smtp-transport", "pool", "hostname", "builder", "rustls", "rustls-native-certs", "tokio1", "rustls-no-provider", "tokio1-rustls", "tracing", "serde"]
@@ -600,7 +588,7 @@ features = ["std"]
version = "0.3.0"
[workspace.dependencies.resolvematrix]
version = "1.4.0"
version = "1.3.0"
[workspace.dependencies.serde_urlencoded]
version = "0.7.1"
@@ -1020,7 +1008,4 @@ collapsible_if = "allow"
cognitive_complexity = "allow"
[workspace.metadata.cargo-shear]
# All of these crates provide macros that are used across the codebase
# and that every crate depends on. cargo-shear can't tell this because
# it doesn't expand macros.
ignored = ["const-str", "ctor", "dtor", "tracing"]
ignored = ["const-str", "ctor", "dtor"]
+2 -2
View File
@@ -53,7 +53,7 @@ fi
# The base docker image to use for complement tests
# You can build the default with `docker build -t continuwuity:complement -f ./docker/complement.Dockerfile .`
# after running `cargo build -p conduwuit --features openreg`. Only the debug binary is used.
# after running `cargo build`. Only the debug binary is used.
COMPLEMENT_BASE_IMAGE="${COMPLEMENT_BASE_IMAGE:-continuwuity:complement}"
# Complement tests that are skipped due to flakiness/reliability issues or we don't implement such features and won't for a long time
@@ -99,7 +99,7 @@ fi
if ! docker image inspect "$COMPLEMENT_BASE_IMAGE" > /dev/null 2>&1; then
echo "Complement base image not found: $COMPLEMENT_BASE_IMAGE"
echo "Build it with: cargo build -p conduwuit --features openreg && docker build -t $COMPLEMENT_BASE_IMAGE -f docker/complement.Dockerfile ."
echo "Build it with: cargo build -p conduwuit && docker build -t $COMPLEMENT_BASE_IMAGE -f docker/complement.Dockerfile ."
exit 1
fi
-3
View File
@@ -1,3 +0,0 @@
Implemented unstable support for [MSC4560] (Stripped state requests over federation). Contributed by @ginger.
[MSC4560]: https://github.com/matrix-org/matrix-spec-proposals/pull/4560
-1
View File
@@ -1 +0,0 @@
Upgraded rocksdb from 11.1.1 to 11.12.0 and jemalloc to 5.4.0.
-1
View File
@@ -1 +0,0 @@
The first-run version of the web UI now includes a link to the registration page. Contributed by @ginger
-1
View File
@@ -1 +0,0 @@
Room summary visibility checks are no longer incorrectly applied for remote rooms. Contributed by @ginger.
@@ -1 +0,0 @@
Fix new devices sometimes never reaching other users' device lists. Contributed by @eleboucher.
-1
View File
@@ -1 +0,0 @@
The documentation now refers to the Continuwuity Docker service as `continuwuity` instead of `homeserver`.
@@ -1 +0,0 @@
Fix gap filling skipping outlier events that are missing their previous events. Contributed by @eleboucher.
@@ -1 +0,0 @@
Fix incoming federation events losing state changes when predecessors share the same state-before snapshot. Contributed by @eleboucher.
@@ -1 +0,0 @@
Fix state resolution applying events out of order, which could undo room joins. Contributed by @eleboucher.
@@ -1 +0,0 @@
Fix to-device messages, including room keys, sometimes being lost before delivery. Contributed by @eleboucher.
+1
View File
@@ -0,0 +1 @@
Added support for acting as a trusted server, meaning the `trusted_servers` list can consist of servers that are either Synapse OR continuwuity.
-1
View File
@@ -1 +0,0 @@
Add a section on [troubleshooting Docker issues](https://continuwuity.org/troubleshooting#docker-issues). Contributed by @stratself.
-1
View File
@@ -1 +0,0 @@
Instructions for Authelia added to the [OIDC guide](https://continuwuity.org/authentication/oidc.html). Contributed by @fhoekstra
-1
View File
@@ -1 +0,0 @@
Fix some possible deadlocks/freezes and reduce lock contention (improving performance). Contributed by @Jade
-1
View File
@@ -1 +0,0 @@
Docker compose examples now use bind mounts by default, instead of Docker volumes, as they are easier to work with esp. for backup/restore. Contributed by @stratself.
-1
View File
@@ -1 +0,0 @@
Once again fixed how room extremities are handled, fixing a problem that made continuwuity gradually make rooms needlessly complex, which also caused more frequent state resets.
-1
View File
@@ -1 +0,0 @@
The OAuth identity reset page is no longer linked from the account management UI to reduce confusion. Contributed by @ginger.
-1
View File
@@ -1 +0,0 @@
Fixed a worker panic when knocking on a room over federation. Contributed by @eleboucher.
-1
View File
@@ -1 +0,0 @@
Perform more validation on events received during atomic gapfill from remote servers, fixing a panic if bad data was persisted by another server and later lazily fetched by us.
-1
View File
@@ -1 +0,0 @@
Redirect URIs in OAuth clients' metadata are now properly validated to be on a subdomain of the OAuth issuer URL domain. Contributed by @ginger.
-1
View File
@@ -1 +0,0 @@
Updated internal Sentry integration setup to the new pattern required by the SDK.
-1
View File
@@ -1 +0,0 @@
Fix v12 rooms created by the same user in the same millisecond ending up as the same room. Contributed by @eleboucher.
-1
View File
@@ -1 +0,0 @@
Client-server API endpoints are now properly ratelimited for unauthenticated requests. Contributed by @ginger.
-1
View File
@@ -1 +0,0 @@
Setting a profile key longer than 255 bytes now returns 400 `M_KEY_TOO_LARGE` as required by the spec, instead of 413 `M_TOO_LARGE`.
-1
View File
@@ -1 +0,0 @@
Setting profile data that would make the profile exceed 64 KiB now returns 400 `M_PROFILE_TOO_LARGE` as required by the spec, instead of a 500 error.
-1
View File
@@ -1 +0,0 @@
Appservices masquerading as a device that does not exist now receive 400 `M_UNKNOWN_DEVICE` as required by the spec, instead of 403 `M_FORBIDDEN`.
-1
View File
@@ -1 +0,0 @@
Setting `m.fully_read` via the account data endpoints now returns 405 `M_BAD_JSON` as required by the spec, instead of 400.
-1
View File
@@ -1 +0,0 @@
The `m.forget_forced_upon_leave` capability now reflects the `forget_forced_upon_leave` config option instead of always being advertised as enabled.
-1
View File
@@ -1 +0,0 @@
Fixed push notifications for membership events setting `user_is_target` based on the sender rather than the user being notified.
-1
View File
@@ -1 +0,0 @@
Ensure HTTP clients actually follow the `dns_servers` config option. Contributed by @silversys
-1
View File
@@ -1 +0,0 @@
Reworked event relations to follow the spec more closely. Pagination of `/relations` now returns the correct pages and `next_batch` tokens, recursive relations are returned in the right order without duplicates, and bundled `m.reference` aggregations now include every reference. Contributed by @Henry-Hiles (QuadRadical).
-1
View File
@@ -1 +0,0 @@
Read receipts are now more spec compliant, will work better in threads and are less likely to end up causing loops with other software. Contributed by @Jade
+2 -12
View File
@@ -685,13 +685,6 @@
# env: CONTINUWUITY_SENDER_SHUTDOWN_TIMEOUT
#sender_shutdown_timeout = 5
# Maximum number of requests per minute that unauthenticated clients
# may make to ratelimited client-server API routes. This ratelimit is
# global across all endpoints for each IP.
#
# env: CONTINUWUITY_UNAUTHENTICATED_REQUEST_RATELIMIT
#unauthenticated_request_ratelimit = 30
# Enables registration. If set to false, no users can register on this
# server.
#
@@ -1025,10 +1018,7 @@
# (trusted key notary servers), as well as serve as trusted servers for
# other operations like backfill and event fetching.
#
# Currently, continuwuity doesn't support inbound key requests, so
# this list should only contain other Synapse servers.
#
# example: ["matrix.org", "starstruck.systems"]
# example: ["continuwuity.org", "matrix.org"]
#
# It is possible to restrict which signing keys trusted servers are
# allowed to sign responses with. Without configuring this, all responses
@@ -1066,7 +1056,7 @@
# is discouraged for performance and reliability reasons.
#
# env: CONTINUWUITY_TRUSTED_SERVERS
#trusted_servers = ["matrix.org"]
#trusted_servers = ["continuwuity.org", "continuwuity.rocks", "matrix.org"]
# Whether to prioritise trusted server lookups over origin server lookups.
#
+2 -2
View File
@@ -50,7 +50,7 @@ EOF
# Developer tool versions
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
ENV BINSTALL_VERSION=1.26.2
ENV BINSTALL_VERSION=1.25.3
# renovate: datasource=github-releases depName=psastras/sbom-rs
ENV CARGO_SBOM_VERSION=0.9.1
# renovate: datasource=crate depName=lddtree
@@ -192,7 +192,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
jq -r ".target_directory"))
mkdir /out/sbin
PACKAGE=conduwuit
xx-cargo build --locked --profile ${RUST_PROFILE} \
CARGO_LOG=debug xx-cargo build --locked --profile ${RUST_PROFILE} \
--no-default-features --features ${CARGO_FEATURES} \
-p $PACKAGE;
BINARIES=($(cargo metadata --no-deps --format-version 1 | \
+1 -1
View File
@@ -18,7 +18,7 @@ RUN --mount=type=cache,target=/etc/apk/cache apk add \
# Developer tool versions
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
ENV BINSTALL_VERSION=1.26.2
ENV BINSTALL_VERSION=1.25.3
# renovate: datasource=github-releases depName=psastras/sbom-rs
ENV CARGO_SBOM_VERSION=0.9.1
# renovate: datasource=crate depName=lddtree
+18 -74
View File
@@ -1,5 +1,3 @@
import { Tab, Tabs } from '@rspress/core/theme';
# Delegated authentication with OIDC
Continuwuity supports delegating user authentication to an external identity provider that implements the OpenID Connect (OIDC) specification, such as Authentik, Kanidm, or Keycloak.
@@ -14,110 +12,56 @@ An account on the homeserver can only be associated with one OIDC subject claim
A simple OIDC configuration is as easy as creating a new OIDC application in your identity provider's settings and supplying Continuwuity with the client ID and client secret.
The instructions below make the following assumptions:
- Continuwuity's base URL: `https://matrix.example.com`. Note that if you employ [well-known delegation](../guides/delegation), this must match the client well-known domain rather than your server name.
- OIDC provider's base URL: `https://idm.example.com`
### Configuring the OIDC provider
This guide will cover [**Kanidm**][kanidm] and [**Authelia**][authelia], but the basic concepts apply to most identity providers. Contributions for them are welcome.
This guide will use [**Kanidm**][kanidm] as an example, but the described steps are broadly applicable to other identity providers. Contributions for them are welcome.
<Tabs groupId="idp">
<Tab label="KanIDM">
Create a new application for continuwuity in kanidm. We will use `c10y` as the client ID.
First, create a new application for Continuwuity in your identity provider.
```sh
kanidm system oauth2 create c10y Continuwuity https://matrix.example.com
# Here, `c10y` is the client ID that Kanidm will use, and `Continuwuity` is the display name.
# Other identity providers may generate a client ID for you.
# Use the domain that clients can reach Continuwuity at, which may not be the same as your server name
# if you have configured well-known delegation.
kanidm system oauth2 create c10y Continuwuity https://matrix.yourdomain.com
```
Configure the redirect URL that Continuwuity uses.
```sh
kanidm system oauth2 add-redirect-url c10y https://matrix.example.com/_continuwuity/oidc/complete
kanidm system oauth2 add-redirect-url c10y https://matrix.yourdomain.com/_continuwuity/oidc/complete
```
Allow Continuwuity to request the `openid` scope.
Allow Continuwuity to request the `openid` scope. Other identity providers may not require this step.
```sh
kanidm system oauth2 update-scope-map c10y idm_all_persons openid
```
Find the client secret that was generated.
Find the client secret that was generated. Other identity providers may show this information in their web UI.
```sh
kanidm system oauth2 show-basic-secret c10y
d1qgx352kkuvs1j70b6w293d65x68jve1f7b27fyk90gjhpr
```
Now the discovery URL for KanIDM is: `https://idm.example.com/oauth2/openid/c10y`
</Tab>
<Tab label="Authelia">
To create a new client in Authelia, it is [recommended][authelia-faq-client-secret] to randomly generate both the client id and client secret. The commands below should get you those:
<Tabs groupId="authelia-generate-client-details">
<Tab label="Bare Binary">
```sh
# Generate random value for Client ID
authelia crypto rand --length 72 --charset rfc3986
# Generate Client Secret (labeled Random Password) and its Digest
authelia crypto hash generate pbkdf2 --variant sha512 --random --random.length 72 --random.charset rfc3986
```
</Tab>
<Tab label="Docker">
```sh
# Generate random value for Client ID
docker run --rm authelia/authelia:latest authelia crypto rand --length 72 --charset rfc3986
# Generate Client Secret (labeled Random Password) and its Digest
docker run --rm authelia/authelia:latest authelia crypto hash generate pbkdf2 --variant sha512 --random --random.length 72 --random.charset rfc3986
```
</Tab>
</Tabs>
Authelia only needs to know the digest of the secret, whereas Continuwuity requires the secret itself.
Go to your Authelia configuration file, find the `identity_provers` block, and add a block for Continuwuity to the `clients` list:
```yaml
identity_providers:
oidc:
jwks:
# This part has the JWKs and is what you configured previously
# ...
clients:
# Add this block below to the clients list
- client_name: continuwuity
client_id: "client-id-goes-here"
# Use the client secret's DIGEST, not the client secret itself
client_secret: "client-secret-DIGEST-goes-here"
redirect_uris: ["https://matrix.example.com/_continuwuity/oidc/complete"]
scopes: [openid]
```
Then restart Authelia to load the new configuration.
The discovery URL is simply the root domain of your Authelia, where it can be reached by clients, i.e. `https://idm.example.com`.
</Tab>
</Tabs>
[kanidm]: https://kanidm.com
[authelia]: https://www.authelia.com
[authelia-faq-client-secret]: https://www.authelia.com/integration/openid-connect/frequently-asked-questions/#how-do-i-generate-a-client-identifier-or-client-secret
### Configuring Continuwuity
Configure Continuwuity with the client ID, client secret, and discovery URL provided from the steps above.
Configure Continuwuity with the client ID, client secret, and discovery URL provided from the steps above. Kanidm has a different discovery URL for each client, but other identity providers may have a single discovery URL at the root of their domain.
```toml
[global.oauth.oidc]
# `/.well-known/openid-configuration` will be appended automatically
discovery_url = "https://your-discovery-url"
discovery_url = "https://idm.example.com/oauth2/openid/c10y"
client_id = "your-client-id"
client_secret = "your-client-secret"
# This may be randomly generated by your identity provider. Kanidm requires
# you to set it manually when you create the application.
client_id = "c10y"
# From the previous step
client_secret = "d1qgx352kkuvs1j70b6w293d65x68jve1f7b27fyk90gjhpr"
```
### Testing that it works
+21 -2
View File
@@ -303,14 +303,33 @@ For browser-based clients, you can also inspect connections using DevTools' Netw
### Docker loopback networking issues
Some distros do not allow Docker containers to connect to the host's public IP, and this breaks connections from `lk-jwt-service` towards `livekit` and `continuwuity` if they're on the same host. This can be tested by the following command:
Some distros do not allow Docker containers in bridge networks to connect to their host's public IP by default. This makes `lk-jwt-service` fail connecting to `livekit` or `continuwuity` on the same host, causing refused and timed out connections to appear in the log entries of the JWT service, even when `LIVEKIT_URL` has been configured correctly.
You can also test that this is the case by cURLing from a sidecar container:
```bash
docker run --rm --net container:lk-jwt-service docker.io/curlimages/curl https://livekit.example.com
# --- some errors ---
```
To resolve this, follow the steps in [Docker loopback networking issues](../troubleshooting.mdx#docker-loopback-networking-issues) of the Troubleshooting page.
To resolve this, configure an `extra_hosts` file mapping LiveKit's and Continuwuity's domain names to Docker's custom host loopback address, represented here by `host-gateway`:
```diff
# in docker-compose.yaml
services:
lk-jwt-service:
...
+ extra_hosts:
+ - "livekit.example.com:host-gateway"
+ - "matrix.example.com:host-gateway"
```
After implementing the changes and restarting your compose, `lk-jwt-service` should now connect to your other services. The sidecar container test above should now return an `OK` from LiveKit.
For more information about the `host-gateway` parameter, kindly refer to the `--add-host` documentation for [Docker][docker-add-host] and [Podman][podman-add-host]. Should you have further difficulties, feel free to enquire in the support rooms.
[docker-add-host]: https://docs.docker.com/reference/cli/docker/container/run/#add-host
[podman-add-host]: https://docs.podman.io/en/latest/markdown/podman-run.1.html#add-host-hostname-hostname-ip
### Incorrect IP address for LiveKit
+1 -1
View File
@@ -348,7 +348,7 @@ After configuration and spin-up, the destination `turns:turn.example.com:443?tra
<summary>Using static credentials</summary>
:::caution
Static credentials are less secure than shared secrets because they don't expire and must be configured in coturn separately. It is strongly advised you use [shared secret authentication](#2-configuring-coturn).
Static credentials are less secure than shared secrets because they don't expire and must be configured in coturn separately. It is strongly advised you use [shared secret authentication](#2-configuration).
:::
If you prefer static username/password credentials instead of shared secrets:
+20 -61
View File
@@ -53,7 +53,7 @@ For more setups with `.well-known` delegation and split-domain deployments, cons
Docker Compose is the recommended deployment method for Continuwuity containers. The following environment variables will be set:
- `CONTINUWUITY_SERVER_NAME` - Your Matrix server's domain name. **This CANNOT be changed later without a data wipe.**
- `CONTINUWUITY_DATABASE_PATH` - Where to store your database. This must match the docker bind mount.
- `CONTINUWUITY_DATABASE_PATH` - Where to store your database. This must match the docker volume mount.
- `CONTINUWUITY_ADDRESS` - Bind address (for Docker, use `0.0.0.0` to listen on all interfaces).
Alternatively, you can specify a path to mount the configuration file using the `CONTINUWUITY_CONFIG` environment variable.
@@ -69,7 +69,7 @@ Docker's default DNS resolver is known to [**cause timeout issues**](../troubles
```yaml title='docker-compose.yml'
services:
continuwuity:
homeserver:
# ...
volumes:
- ./continuwuity-resolv.conf:/etc/resolv.conf
@@ -89,17 +89,15 @@ Consult the [**DNS tuning guide (recommended)**](../guides/dns.mdx) for full sol
<summary>docker-compose.with-caddy.yml ([view raw](/deploying/docker-compose.with-caddy.yml))</summary>
Create a directory called `caddy-data`, which will store TLS certs obtained by Caddy.
Then, create a Caddyfile with the following content:
Create a Caddyfile with the following content:
```
https://example.com:443, https://example.com:8448 {
reverse_proxy http://continuwuity:8008
reverse_proxy http://homeserver:8008
}
```
Then, for the docker compose file:
Then, for the docker-compose:
```yaml file="../public/deploying/docker-compose.with-caddy.yml"
@@ -112,10 +110,6 @@ Then, for the docker compose file:
<details>
<summary>docker-compose.with-caddy-labels.yml ([view raw](/deploying/docker-compose.with-caddy-labels.yml))</summary>
Create a directory called `caddy-data`, which will store TLS certs obtained by Caddy.
Then, for the docker compose file:
```yaml file="../public/deploying/docker-compose.with-caddy-labels.yml"
```
@@ -138,10 +132,6 @@ Then, for the docker compose file:
<details>
<summary>docker-compose.with-traefik.yml ([view raw](/deploying/docker-compose.with-traefik.yml))</summary>
Create a directory called `traefik-acme-data`, which will store TLS certs obtained by Caddy.
Then, for the docker compose file:
```yaml file="../public/deploying/docker-compose.with-traefik.yml"
```
@@ -174,15 +164,10 @@ See the [Other reverse proxies](generic.mdx#setting-up-the-reverse-proxy) sectio
### Starting Your Server
1. Create a directory named `continuwuity-data`. This will be where your server's database lives.
2. Choose your compose file from the above, and rename it to `docker-compose.yml`. Replace `example.com` with your homeserver's domain name, and edit other values as you see fit.
- Follow all extra instructions as needed.
- If using the override file, rename it to `docker-compose.override.yml` and edit your values.
3. Start the server with the following command:
1. Choose your compose file from the above, and rename it to `docker-compose.yml`. Replace `example.com` with your homeserver's domain name, and edit other values as you see fit.
2. If using the override file, rename it to `docker-compose.override.yml` and
edit your values.
3. Start the server:
```bash
docker compose up -d
@@ -204,7 +189,9 @@ See the [Other reverse proxies](generic.mdx#setting-up-the-reverse-proxy) sectio
Pick your own username and password!
```
5. Log in to your server with any Matrix client, and register for an account with the registration token from the previous step. You'll automatically be invited to the admin room where you can [manage your server](../reference/admin).
5. Log in to your server with any Matrix client, and register for an account with the registration token from step 4. You'll automatically be invited to the admin room where you can [manage your server](../reference/admin).
See the [generic deployment guide](generic.mdx) for more deployment options.
## Testing
@@ -212,9 +199,7 @@ Test that your setup works by following these [instructions](./generic.mdx#how-d
Check your container logs using `docker-compose logs --follow` to debug any issues. See the [Troubleshooting](../troubleshooting.mdx) page for common errors and how to fix them.
## Maintenance
### Updating
## Updating
To update to a new version of Continuwuity, use the following commands:
@@ -227,10 +212,6 @@ docker compose pull
docker compose up -d
```
### Backups
The database in `./continuwuity-data` is present on the host system as a regular directory, and therefore can be backed up using normal mechanisms. See the [Backup](../maintenance.mdx#backups) section of the Maintenance page for more details.
## What's next?
Navigate to [Post-installation](../deploying.mdx#post-installation) for next steps.
@@ -289,6 +270,12 @@ Get a working Continuwuity server with an admin user in four steps:
Once configured, log in to your server with any Matrix client, and register for an account with the registration token from step 3. If you did not configure step 4., log in via the `http://<your_server_ip>:8008` address. You will be automatically invited to the admin room where you can [manage your server](../reference/admin).
### (Optional) Building Custom Images
For information on building your own Continuwuity Docker images, see the
[Building Docker Images](../development/index.mdx#building-docker-images)
section in the development documentation.
### Accessing the Server's Console
Before you can access the server's console and [send admin commands](../reference/admin/index.md) from the CLI, you will need to make the container interactive and allocate a pseudo-tty. Make sure you set `admin_console_automatic` to `true` in [the config](../reference/config.mdx) as well for Continuwuity to activate the CLI on startup.
@@ -297,7 +284,7 @@ For Docker Compose deployments this means adding `stdin_open: true` and `tty: tr
```yaml
services:
continuwuity:
homeserver:
stdin_open: true
tty: true
# ...
@@ -310,31 +297,3 @@ From there you can access the server's console by running `docker attach <contai
Note that using `CTRL+c` within `docker attach`'s context will forward the signal to the server, stopping it. See [Docker's reference][docker-attach-reference] for more information.
[docker-attach-reference]: https://docs.docker.com/reference/cli/docker/container/attach/
### Using Docker volumes
The example compose files above utilizes [bind mounts][docker-bind-mounts]. If you want to use [Docker volumes][docker-volumes] instead, apply these changes to your compose file:
```diff
services:
continuwuity:
# ...
volumes:
- - ./continuwuity-data:/var/lib/continuwuity
+ - continuwuity-data:/var/lib/continuwuity
+volumes:
+ continuwuity-data:
```
Consult the [Docker docs][docker-volumes-backup-restore] for details on backing up and restoring Docker volumes
[docker-bind-mounts]: https://docs.docker.com/engine/storage/bind-mounts/
[docker-volumes]: https://docs.docker.com/engine/storage/volumes/
[docker-volumes-backup-restore]: https://docs.docker.com/engine/storage/volumes/#back-up-restore-or-migrate-data-volumes
### Building Custom Images
For information on building your own Continuwuity Docker images, see the
[Building Docker Images](../development/index.mdx#building-docker-images)
section in the development documentation.
-5
View File
@@ -199,11 +199,6 @@ header, making federation non-functional. If you find a workaround, please share
Furthermore, Nginx users need to increase the `client_max_body_size` setting (default is 1M) to match the `max_request_size` defined in conduwuit.toml.
- For HAProxy, ensure that the ACL for the `Host` header matches both the domain and the domain with the port, as federation requests are often sent with the port included. This can be done by using the `host_only` directive:
```
acl matrix-host hdr(host),host_only -i example.com
```
## Starting Your Server
Now you can start Continuwuity with:
+1 -4
View File
@@ -12,14 +12,11 @@ Install Git, Rust, Docker, Go, and `jq`. From this repository's root, build the
server image and run the suite:
```bash
cargo build -p conduwuit --features openreg
cargo build -p conduwuit
docker build -t continuwuity:complement -f docker/complement.Dockerfile .
./bin/complement
```
The `openreg` feature is required: without it the server refuses the open
registrations Complement uses to create test users, and almost every test fails.
The run can take up to an hour. The runner writes the full Go test stream to
`tests/test_results/complement/test_logs.jsonl` and a sorted pass/fail/skip
summary to `tests/test_results/complement/test_results.jsonl`. It exits nonzero
+2 -2
View File
@@ -226,10 +226,10 @@ The following Compose files are taken from [Docker deployment instructions](../d
```txt title="Caddyfile"
https://matrix.example.com:443 {
reverse_proxy http://continuwuity:8008
reverse_proxy http://homeserver:8008
}
https://example.com:443 {
reverse_proxy /.well-known/matrix* http://continuwuity:8008
reverse_proxy /.well-known/matrix* http://homeserver:8008
}
```
+1 -1
View File
@@ -37,7 +37,7 @@ networks:
- subnet: "10.10.10.0/24"
services:
continuwuity:
homeserver:
# ...
volume:
- ./continuwuity-resolv.conf:/etc/resolv.conf:ro
+2 -2
View File
@@ -113,7 +113,7 @@ https://matrix.example.com {
### Tuning your trusted servers
:::important Important: Vet your trusted servers!
:::info Vet your trusted servers!
Trusted servers are your first point of contact when obtaining public keys from other servers, and they could theoretically impersonate other servers and cause significant harm to your deployment. Please thoroughly verify your trusted servers' credibility before adding them to your configuration.
If you need suggestions for trusted servers, ask in the Continuwuity main room.
@@ -128,7 +128,7 @@ trusted_servers = ["codestorm.net","starstruck.systems","unredacted.org","matrix
Avoid prioritising `matrix.org` as your primary trusted server, as it tends to be quite slow.
Some users have also reported that increasing `trusted_server_batch_size` helps with faster joins for huge rooms. Start with doubling the default to `2048` until you find a suitable value.
Some users have also reported that increasing `trusted_server_batch_size` has helped with faster joins for huge rooms. Start with doubling the default to `2048` until you find a suitable value.
### Enable HTTP/3 on your reverse proxy
+1 -1
View File
@@ -17,7 +17,7 @@ Continuwuity has moderation admin commands for:
- fetching `/.well-known/matrix/support` from servers (`!admin federation`)
- blocking incoming federation for certain rooms (not the same as room banning)
(`!admin federation`)
- deleting media
- deleting media (see [the media section](#media))
Any commands with `-list` in them will require a codeblock in the message with
each object being newline delimited. An example of doing this is:
@@ -1,12 +1,12 @@
# Continuwuity - Behind Traefik Reverse Proxy
services:
continuwuity:
homeserver:
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
restart: unless-stopped
command: /sbin/conduwuit
volumes:
- ./continuwuity-data:/var/lib/continuwuity
- db:/var/lib/continuwuity
- ./continuwuity-resolv.conf:/etc/resolv.conf # use custom resolvers rather than Docker's
#- ./continuwuity.toml:/etc/continuwuity.toml
networks:
@@ -12,18 +12,18 @@ services:
- proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./caddy-data:/data
- ./data:/data
restart: unless-stopped
labels:
caddy: example.com
caddy.reverse_proxy: /.well-known/matrix/* continuwuity:8008
caddy.reverse_proxy: /.well-known/matrix/* homeserver:8008
continuwuity:
homeserver:
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
restart: unless-stopped
command: /sbin/conduwuit
volumes:
- ./continuwuity-data:/var/lib/continuwuity
- db:/var/lib/continuwuity
- ./continuwuity-resolv.conf:/etc/resolv.conf # use custom resolvers rather than Docker's
# - ./continuwuity.toml:/etc/continuwuity.toml
environment:
@@ -46,5 +46,8 @@ services:
caddy: matrix.example.com
caddy.reverse_proxy: "{{upstreams 8008}}"
volumes:
db:
networks:
proxy:
@@ -9,17 +9,17 @@ services:
networks:
- caddy
volumes:
- ./caddy-data:/data
- ./data:/data
# mount your created Caddyfile into the container
- ./Caddyfile:/etc/caddy/Caddyfile
restart: unless-stopped
continuwuity:
homeserver:
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
restart: unless-stopped
command: /sbin/conduwuit
volumes:
- ./continuwuity-data:/var/lib/continuwuity
- db:/var/lib/continuwuity
- ./continuwuity-resolv.conf:/etc/resolv.conf # use custom resolvers rather than Docker's
# - ./continuwuity.toml:/etc/continuwuity.toml
environment:
@@ -41,3 +41,6 @@ services:
networks:
proxy:
volumes:
db:
@@ -1,12 +1,12 @@
# Continuwuity - With Traefik Reverse Proxy
services:
continuwuity:
homeserver:
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
restart: unless-stopped
command: /sbin/conduwuit
volumes:
- ./continuwuity-data:/var/lib/continuwuity
- db:/var/lib/continuwuity
- ./continuwuity-resolv.conf:/etc/resolv.conf # use custom resolvers rather than Docker's
#- ./continuwuity.toml:/etc/continuwuity.toml
networks:
@@ -40,7 +40,7 @@ services:
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik-acme-data:/etc/traefik/acme"
- "acme:/etc/traefik/acme"
labels:
- "traefik.enable=true"
@@ -77,5 +77,9 @@ services:
TRAEFIK_PROVIDERS_DOCKER_ENDPOINT: "unix:///var/run/docker.sock"
TRAEFIK_PROVIDERS_DOCKER_EXPOSEDBYDEFAULT: false
volumes:
db:
acme:
networks:
proxy:
@@ -37,7 +37,7 @@ services:
# If you already configured `[global.well_known]` with Continuwuity,
# comment out the *_respond labels and uncomment the line below:
# caddy.reverse_proxy: /.well-known/matrix/* continuwuity:8008
# caddy.reverse_proxy: /.well-known/matrix/* homeserver:8008
# If you are having problems with continuwuity serving headers,
# uncomment the header section below.
@@ -48,7 +48,7 @@ services:
# caddy.0_header.Access-Control-Allow-Headers: "Authorization"
# caddy.0_header.Content-Type: "application/json"
continuwuity:
homeserver:
image: forgejo.ellis.link/continuwuation/continuwuity:latest
restart: unless-stopped
# add additional environment, volume, and network config here...
@@ -1,12 +1,12 @@
# Continuwuity - Behind Traefik Reverse Proxy
services:
continuwuity:
homeserver:
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
restart: unless-stopped
command: /sbin/conduwuit
volumes:
- ./continuwuity-data:/var/lib/continuwuity
- db:/var/lib/continuwuity
- ./continuwuity-resolv.conf:/etc/resolv.conf # use custom resolvers rather than Docker's
#- ./continuwuity.toml:/etc/continuwuity.toml
networks:
@@ -18,7 +18,7 @@ services:
- "traefik.http.routers.continuwuity.tls=true"
- "traefik.http.routers.continuwuity.service=continuwuity"
- "traefik.http.services.continuwuity.loadbalancer.server.port=8008"
# enable tls with the `letsencrypt` certificate resolver (actual name dependant on your static config)
# possibly, depending on your config:
# - "traefik.http.routers.continuwuity.tls.certresolver=letsencrypt"
environment:
CONTINUWUITY_SERVER_NAME: example.com
@@ -34,6 +34,9 @@ services:
server=example.com:443
}
volumes:
db:
networks:
# This must match the network name that Traefik listens on
proxy:
@@ -1,7 +1,7 @@
# Continuwuity - Traefik Reverse Proxy Labels (override file)
services:
continuwuity:
homeserver:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network
@@ -12,15 +12,15 @@ services:
- proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./caddy-data:/data
- ./data:/data
restart: unless-stopped
continuwuity:
homeserver:
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
restart: unless-stopped
command: /sbin/conduwuit
volumes:
- ./continuwuity-data:/var/lib/continuwuity
- db:/var/lib/continuwuity
- ./continuwuity-resolv.conf:/etc/resolv.conf # use custom resolvers rather than Docker's
# - ./continuwuity.toml:/etc/continuwuity.toml
environment:
@@ -10,17 +10,17 @@ services:
networks:
- proxy
volumes:
- ./caddy-data:/data
- ./data:/data
# mount your created Caddyfile into the container
- ./Caddyfile:/etc/caddy/Caddyfile
restart: unless-stopped
continuwuity:
homeserver:
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
restart: unless-stopped
command: /sbin/conduwuit
volumes:
- ./continuwuity-data:/var/lib/continuwuity
- db:/var/lib/continuwuity
- ./continuwuity-resolv.conf:/etc/resolv.conf # use custom resolvers rather than Docker's
# - ./continuwuity.toml:/etc/continuwuity.toml
environment:
@@ -43,3 +43,6 @@ services:
networks:
proxy:
volumes:
db:
@@ -1,12 +1,12 @@
# Continuwuity - With Traefik Reverse Proxy
services:
continuwuity:
homeserver:
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
restart: unless-stopped
command: /sbin/conduwuit
volumes:
- ./continuwuity-data:/var/lib/continuwuity
- db:/var/lib/continuwuity
- ./continuwuity-resolv.conf:/etc/resolv.conf # use custom resolvers rather than Docker's
#- ./continuwuity.toml:/etc/continuwuity.toml
networks:
@@ -40,7 +40,7 @@ services:
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik-acme-data:/etc/traefik/acme"
- "acme:/etc/traefik/acme"
labels:
- "traefik.enable=true"
@@ -77,5 +77,9 @@ services:
TRAEFIK_PROVIDERS_DOCKER_ENDPOINT: "unix:///var/run/docker.sock"
TRAEFIK_PROVIDERS_DOCKER_EXPOSEDBYDEFAULT: false
volumes:
db:
acme:
networks:
proxy:
+33 -30
View File
@@ -1,38 +1,41 @@
# Continuwuity - Bare Configuration (for other reverse proxies)
services:
homeserver:
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
restart: unless-stopped
command: /sbin/conduwuit
ports:
homeserver:
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
restart: unless-stopped
command: /sbin/conduwuit
ports:
# If your reverse proxy is on the host, use this
# and configure it to connect to `127.0.0.1:8008`
- 127.0.0.1:8008:8008
# If your reverse proxy is on the host, use this
# and configure it to connect to `127.0.0.1:8008`
- 127.0.0.1:8008:8008
# If your reverse proxy is on another machine, use this
# and configure it to connect to <this-machine-ip>:8008
# - 8008:8008
# If your reverse proxy is on another machine, use this
# and configure it to connect to <this-machine-ip>:8008
# - 8008:8008
# If your reverse proxy is a docker container on the same network,
# comment out the entire `ports` section, and configure it to connect to `continuwuity:8008`
# If your reverse proxy is a docker container on the same network,
# comment out the entire `ports` section, and configure it to connect to `continuwuity:8008`
volumes:
- ./continuwuity-data:/var/lib/continuwuity
- ./continuwuity-resolv.conf:/etc/resolv.conf # use custom resolvers rather than Docker's
#- ./continuwuity.toml:/etc/continuwuity.toml
environment:
CONTINUWUITY_SERVER_NAME: example.com # EDIT THIS
CONTINUWUITY_DATABASE_PATH: /var/lib/continuwuity
CONTINUWUITY_ADDRESS: 0.0.0.0
CONTINUWUITY_PORT: 8008
#CONTINUWUITY_CONFIG: '/etc/continuwuity.toml' # Uncomment if you mapped config toml above
volumes:
- db:/var/lib/continuwuity
- ./continuwuity-resolv.conf:/etc/resolv.conf # use custom resolvers rather than Docker's
#- ./continuwuity.toml:/etc/continuwuity.toml
environment:
CONTINUWUITY_SERVER_NAME: example.com # EDIT THIS
CONTINUWUITY_DATABASE_PATH: /var/lib/continuwuity
CONTINUWUITY_ADDRESS: 0.0.0.0
CONTINUWUITY_PORT: 8008
#CONTINUWUITY_CONFIG: '/etc/continuwuity.toml' # Uncomment if you mapped config toml above
## (Optional) Serve .well-known files to tell others to reach Continuwuity on port :443
## If you do this, remove all routes to port :8448 on your reverse proxy
# CONTINUWUITY_WELL_KNOWN: |
# {
# client=https://example.com,
# server=example.com:443
# }
## (Optional) Serve .well-known files to tell others to reach Continuwuity on port :443
## If you do this, remove all routes to port :8448 on your reverse proxy
# CONTINUWUITY_WELL_KNOWN: |
# {
# client=https://example.com,
# server=example.com:443
# }
volumes:
db:
+17 -87
View File
@@ -1,9 +1,9 @@
# Troubleshooting Continuwuity
:::warning{title="For Docker users"}
It's common for Docker misconfigurations to cause issues, particularly with networking and
permissions. Before continuing, please first check that your issues are notdue Docker
problems. See the dedicated [**Docker issues**](#docker-issues) section for more details.
:::warning{title="Docker users:"}
Docker can be difficult to use and debug. It's common for Docker
misconfigurations to cause issues, particularly with networking and permissions.
Please check that your issues are not due to problems with your Docker setup.
:::
## Continuwuity issues
@@ -13,9 +13,9 @@ problems. See the dedicated [**Docker issues**](#docker-issues) section for more
Some slowness is to be expected if you're the first person on your homeserver to join a room (which will
always be the case for single-user homeservers). In this situation, your homeserver has to verify the signatures of
all of the state events sent by other servers before your join. To make this process as fast as possible, make sure you have
multiple fast, trusted servers listed in `trusted_servers` in your configuration, and ensure
`query_trusted_key_servers_first_on_join` is set to true (the default). Read the
[Tuning your trusted servers](./guides/performance.mdx#tuning-your-trusted-servers) section for more details on doing so.
[multiple fast, trusted servers](./guides/performance.mdx#tuning-your-trusted-servers) listed in `trusted_servers` in your configuration, and ensure
`query_trusted_key_servers_first_on_join` is set to true (the default).
If you need suggestions for trusted servers, ask in the Continuwuity main room.
However, _very_ slow joins, especially to rooms with only a few users in them or rooms created by another user
on your homeserver, may be caused by [issue !779](https://forgejo.ellis.link/continuwuation/continuwuity/issues/779),
@@ -119,63 +119,11 @@ much possible corruption is restored
- If all goes will, you should be able to restore back to using
`TolerateCorruptedTailRecords` and you have successfully recovered your database
## Docker issues
### Debugging Docker networking
The Continuwuity image does not ship with any shell or internal debugging utilities. To debug network conditions for Continuwuity, run another sidecar container that is attached to its network namespace. For example, using the `curl` container:
```bash
docker run --rm -it \
--network container:continuwuity \
docker.io/curlimages/curl \
curl https://continuwuity.org/.well-known/matrix/server
```
### Docker loopback networking issues
Some distros disallow Docker containers in bridge networks to reach out to their host's public IP by default. This can cause connectivity issues between Continuwuity and other services that are on the same host machine, such as LiveKit or a push server.
One can test if this is the case by cURLing those services with a sidecar container:
```bash
docker run --rm -it --network container:continuwuity docker.io/curlimages/curl curl https://push.example.com
# --- some timeout or refused connection errors ---
```
To fix this, use the `extra_hosts` parameter to map local service domains to `host-gateway` - a special Docker value that resolves to the internal IP address of the host.
```diff title="docker-compose.yaml"
services:
continuwuity:
...
# allow Continuwuity to reach out to the push server and livekit
# via the host gateway loopback address
+ extra_hosts:
+ - "push.example.com:host-gateway"
+ - "livekit.example.com:host-gateway"
lk-jwt-service:
...
# allow jwt service to reach out to Continuwuity and livekit
# via the host gateway loopback address
+ extra_hosts:
+ - "livekit.example.com:host-gateway"
+ - "matrix.example.com:host-gateway"
```
Reload the compose file, and connections between these services (as well as the sidecar container test above) should now work.
For more information about the `host-gateway` parameter, kindly consult the Docker docs on [custom DNS with `extra_hosts`][docker-custom-dns] and the [`--add-host` option][docker-add-host].
[docker-custom-dns]: https://docs.docker.com/compose/how-tos/networking/#custom-dns-with-extra_hosts
[docker-add-host]: https://docs.docker.com/reference/cli/docker/container/run/#add-host
## Debugging
Note that users should not really need to debug things. If you find yourself
debugging and find the issue, please let us know and/or how we can fix it.
Various debug commands can be found in [`!admin debug`](./reference/admin/debug).
Various debug commands can be [found in `!admin debug`](./reference/admin/debug).
### Debug/Trace log level
@@ -188,34 +136,23 @@ you need to access debug/trace log levels, you will need to build without the
Continuwuity supports changing the tracing log environment filter on-the-fly using
the admin command `!admin debug change-log-level <log env filter>`. This accepts
a string **without quotes** in the same format as the `log` config option. Complex
filters are also supported as well.
a string **without quotes** the same format as the `log` config option.
```bash
# set log level to debug
!admin debug change-log-level debug
Example: `!admin debug change-log-level debug`
# trace logs for all outgoing federation to `example.com`
!admin debug change-log-level info,conduwuit_service::federation[{dest="example.com"}]=trace
This can also accept complex filters such as:
`!admin debug change-log-level info,conduit_service[{dest="example.com"}]=trace,ruma_state_res=trace`
`!admin debug change-log-level info,conduit_service[{dest="example.com"}]=trace,conduit_service[send{dest="example.org"}]=trace`
# trace logs for client syncs
!admin debug change-log-level info,conduwuit_api::client=trace
And to reset the log level to the one that was set at startup / last config
load, simply pass the `--reset` flag.
# debug logs for everything except h2 and presence
!admin debug change-log-level trace,h2=off,conduwuit_service::presence=off
```
To reset the log level to the one that was set at last config
load, simply do:
```bash
!admin debug change-log-level --reset
```
`!admin debug change-log-level --reset`
### Pinging servers
Continuwuity can ping other servers using `!admin debug ping <server>`. This takes
a server name, goes through the server discovery process, and queries
a server name and goes through the server discovery process and queries
`/_matrix/federation/v1/version`. Errors are outputted.
While it does measure the latency of the request, it is not indicative of
@@ -261,10 +198,3 @@ and is not easy for non-developers to understand.
[unbound-tuning]: https://unbound.docs.nlnetlabs.nl/en/latest/topics/core/performance.html
[unbound-arch]: https://wiki.archlinux.org/title/Unbound
## Other troubleshooting topics
- [LiveKit troubleshooting](./calls/livekit.mdx#troubleshooting)
- [TURN server troubleshooting](./calls/turn.mdx#troubleshooting)
- [Delegation/split-domain troubleshooting](./guides/delegation.mdx#troubleshooting)
- [Push notifications troubleshooting](./guides/push.mdx#troubleshooting)
Generated
+24 -24
View File
@@ -3,11 +3,11 @@
"advisory-db": {
"flake": false,
"locked": {
"lastModified": 1793979272,
"narHash": "sha256-oUcBtPbtS7PlEMuSrgTAN4wv49cXYbwKbQqhH2pah5w=",
"lastModified": 1789329924,
"narHash": "sha256-mykGMFabQ7yP6G373M3VHkrac9PJPKJstrhQz2D/Rdc=",
"owner": "rustsec",
"repo": "advisory-db",
"rev": "309392b18f6b17022f82c701f300433126901068",
"rev": "455fd4bac659b5f1fca3810661c2d8b3c25dad05",
"type": "github"
},
"original": {
@@ -18,11 +18,11 @@
},
"crane": {
"locked": {
"lastModified": 1793836618,
"narHash": "sha256-TREenflwEjxOSq292FYwbc3kEm7TDRtXCZRNWEdjBmg=",
"lastModified": 1788465171,
"narHash": "sha256-Y1/TTVXjYXGF068IThQH9fPSZ0SIE74PABlUxnWTUH0=",
"owner": "ipetkov",
"repo": "crane",
"rev": "79fd63528501446749c09f08cad486a58c7d173e",
"rev": "eb35abda9f232cc6610b1d1e3200d15c49b7ac54",
"type": "github"
},
"original": {
@@ -39,11 +39,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1794142885,
"narHash": "sha256-xWFSr7q8IerDAVRk4W7/CgTmi05hMy2qjZ0z3VYpOVk=",
"lastModified": 1789298866,
"narHash": "sha256-6eaV5+MdWy1tAlN4HAFr64pTnYc9jiKGXBsu18cyVjE=",
"owner": "nix-community",
"repo": "fenix",
"rev": "f7d416b5073152c7f2e4de1a28d1a4330dd30a26",
"rev": "1fc6f36a23fa16e3740987957266f6e4b915c3cd",
"type": "github"
},
"original": {
@@ -74,11 +74,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1793576659,
"narHash": "sha256-V1h85lUaJBQoHFrB2vpXZOE0Ju1MYSnIpsehoVZYlDo=",
"lastModified": 1788450739,
"narHash": "sha256-glZLQlzIn1fXH6PazR2iUmTo7kzzyYSshrWhLS9TqCU=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "ea2630b7470978622c7689a1ff75d2b389175399",
"rev": "31729ca8cbdb4fa927b34e5f4353e6a83f39e993",
"type": "github"
},
"original": {
@@ -89,11 +89,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1794042290,
"narHash": "sha256-ziZn2PvCJE5JEEpqTdxXwJpPB+L3YqoCpTAMCzyaP3U=",
"lastModified": 1789149629,
"narHash": "sha256-H6GwaZzZf+4npqv0tph94w9tZddSjFjmQrVsW0z78uk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f4a03c008967841f2a0b3cb7c436fc6fc31671f6",
"rev": "eaad089433ca2bb662274377d33df3d0e51ef28b",
"type": "github"
},
"original": {
@@ -105,11 +105,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1793504054,
"narHash": "sha256-ThkfL3D/FhCiZFc9+3BtxwuMmpuK+/bGtXCSo1+yVew=",
"lastModified": 1788057806,
"narHash": "sha256-DTQSMxzDWmT0zhguthvegnVkn7CFqGCv4IHCzk5ZUpM=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "7851ba61fd862b277cb6a9cef37394bc18bb94e4",
"rev": "596e2e3940e09b2abbeb03f75fa1828c57fcd72c",
"type": "github"
},
"original": {
@@ -132,11 +132,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1794096810,
"narHash": "sha256-dWC+YtMX+cwH3e9ndiFB77ijTsKtO5I2OxfcvUY4j3k=",
"lastModified": 1789128286,
"narHash": "sha256-KRxxgHiKIBp7R2n41IJuE5K4IUiLOpg47EEi3AxuSp8=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "03ae6be57aa063bb373f69eead3b8e15168a45d2",
"rev": "6aeeb8cf02741e5da07a1615a05faa506cecb21a",
"type": "github"
},
"original": {
@@ -153,11 +153,11 @@
]
},
"locked": {
"lastModified": 1791885023,
"narHash": "sha256-C3alQ2MEt0zVrUSho5NUDo3jmhbff72++bfwoqT9Omo=",
"lastModified": 1786901030,
"narHash": "sha256-WSFCsDSE5ffgD2MqzkM2CYjeFiKhRF/dJUN8uedb6YE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "0d6d739a833ba9a9c93034862e4a7b061a062a1c",
"rev": "27b3b12a8e6375f28ebe122f07d230ca5459bbfa",
"type": "github"
},
"original": {
+13 -6
View File
@@ -42,12 +42,7 @@ let
env = {
CARGO_PROFILE = profile;
# Rust links with its bundled rust-lld by default on linux-gnu targets.
# This bypasses nixpkgs' linker wrapper (and its rpaths), so we make it use the system one.
# `-C linker-features=-lld` is only stable on x86_64, but cc takes the last `-fuse-ld`.
RUSTFLAGS = lib.concatStringsSep " " (
lib.optional stdenv.hostPlatform.isLinux "-C link-arg=-fuse-ld=bfd" ++ [ rustflags ]
);
RUSTFLAGS = rustflags;
GIT_COMMIT_HASH = self.rev or self.dirtyRev or "";
GIT_COMMIT_HASH_SHORT = self.shortRev or self.dirtyShortRev or "";
}
@@ -65,6 +60,18 @@ craneLib.buildPackage (
inherit cargoExtraArgs;
cargoArtifacts = craneLib.buildDepsOnly attrs;
# Needed to make continuwuity link to rocksdb
postFixup = lib.optionalString (stdenv.hostPlatform.isLinux && rocksdb != null) ''
old_rpath="$(patchelf --print-rpath $out/bin/conduwuit)"
extra_rpath="${
lib.makeLibraryPath [
rocksdb
]
}"
patchelf --set-rpath "$old_rpath:$extra_rpath" $out/bin/conduwuit
'';
meta = {
description = "A community-driven Matrix homeserver in Rust";
mainProgram = "conduwuit";
-19
View File
@@ -18,23 +18,6 @@
{
packages =
let
# These musl deps aren't in the binary cache, so they're built locally, and their
# test suites run (and break) when the builder can execute musl binaries.
#
# TODO: drop tzdata override once https://github.com/NixOS/nixpkgs/pull/582577 reaches nixos-unstable
# - tzdata: `now.ck` checks against the current date.
# TODO: drop sqlite override once https://github.com/NixOS/nixpkgs/issues/580629 is resolved
# - sqlite: its test runner fails to build `testfixture` when cross-compiling to musl.
muslOverlay =
_final: prev:
lib.genAttrs [ "tzdata" "sqlite" ] (
name:
if prev.stdenv.hostPlatform.isMusl then
prev.${name}.overrideAttrs { doCheck = false; }
else
prev.${name}
);
mkPackages =
pkgs:
let
@@ -95,7 +78,6 @@
import inputs.nixpkgs {
localSystem = system;
crossSystem = "x86_64-unknown-linux-musl";
overlays = [ muslOverlay ];
}
)
))
@@ -104,7 +86,6 @@
import inputs.nixpkgs {
localSystem = system;
crossSystem = "aarch64-unknown-linux-musl";
overlays = [ muslOverlay ];
}
)
));
+3 -3
View File
@@ -18,13 +18,13 @@
inherit enableJemalloc;
}).overrideAttrs
({
version = "continuwuity-v0.5.0-unstable-2026-11-08";
version = "continuwuity-v0.5.0-unstable-2026-05-19";
src = fetchFromGitea {
domain = "forgejo.ellis.link";
owner = "continuwuation";
repo = "rocksdb";
rev = "722fa3219df4169610fda8962221a1ff74026fdb";
hash = "sha256-ZuXXp83Hgj0B5v499CNxa9oNQUS/ZKYOAZEhmarUifc=";
rev = "3756b2b905e13216d8b56bcc783d814e7b073aff";
hash = "sha256-rSv4fr2bf9JJwdodgeuPCuceeh7k97KVxrAOC0wyPQY=";
};
# We have this already at https://forgejo.ellis.link/continuwuation/rocksdb/commit/a935c0273e1ba44eacf88ce3685a9b9831486155
+1 -1
View File
@@ -12,7 +12,7 @@
target:
target.fromToolchainName {
name = (lib.importTOML "${inputs.self}/rust-toolchain.toml").toolchain.channel;
sha256 = "sha256-+xUr6Al1wZSqX8aEsq7DpuFOK4Ve/i+qTl+K5uWQ9GM=";
sha256 = "sha256-zm3dyIY2T414ZRR3EhLOvptzG6gta4WZUcawzMUWtqI=";
};
in
{
+335 -372
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -10,7 +10,7 @@
[toolchain]
profile = "minimal"
channel = "1.99.1"
channel = "1.99.0"
components = [
# For rust-analyzer
"rust-src",
+3
View File
@@ -62,6 +62,8 @@ release_max_log_level = [
"conduwuit-service/release_max_log_level",
"tracing/max_level_trace",
"tracing/release_max_level_info",
"log/max_level_trace",
"log/release_max_level_info",
]
zstd_compression = [
"conduwuit-api/zstd_compression",
@@ -82,6 +84,7 @@ ctor.workspace = true
dtor.workspace = true
futures.workspace = true
lettre.workspace = true
log.workspace = true
ruma.workspace = true
serde_json.workspace = true
serde-saphyr.workspace = true
+8 -6
View File
@@ -1,4 +1,4 @@
use conduwuit::{Err, Result, checked, utils::ReadyExt};
use conduwuit::{Err, Result, checked};
use futures::{FutureExt, StreamExt, TryFutureExt};
impl crate::Context<'_> {
@@ -49,6 +49,7 @@ impl crate::Context<'_> {
.services
.appservice
.get_registration(&appservice_identifier)
.await
{
| None => return Err!("Appservice does not exist."),
| Some(config) => {
@@ -77,11 +78,12 @@ impl crate::Context<'_> {
self.services
.users
.stream_local_users()
.ready_filter_map(|user_id| {
self.services
.appservice
.is_user_id(&user_id)
.then_some(user_id)
.filter_map(async |user_id| {
if self.services.appservice.is_user_id(&user_id).await {
Some(user_id)
} else {
None
}
})
.for_each(async |user_id| {
self.services
+2 -43
View File
@@ -14,7 +14,7 @@ use conduwuit::{
state_res::EventTypeExt,
trace, utils,
utils::{
stream::{BroadbandExt, IterStream, ReadyExt},
stream::{IterStream, ReadyExt},
string::EMPTY,
to_canonical_object,
},
@@ -983,8 +983,7 @@ impl crate::Context<'_> {
let resolver: &MatrixResolver = if no_cache {
&MatrixResolverBuilder::new()
.dangerous_tls_accept_invalid_certs(self.services.server.config.allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure)
.http_client(self.services.client.matrix_http_client.clone())
.dns_resolver(self.services.client.dns_resolver.clone())
.http_client(self.services.client.dns.clone())
.build()?
} else {
&self.services.client.matrix_resolver
@@ -1208,46 +1207,6 @@ impl crate::Context<'_> {
.await
}
pub(super) async fn room_extremities(&self, room_id: OwnedRoomId) -> Result {
let mut extremities = self
.services
.rooms
.state
.get_forward_extremities(&room_id)
.broad_filter_map(|event_id| async move {
self.services.rooms.timeline.get_pdu(&event_id).await.ok()
})
.collect::<Vec<_>>()
.await;
extremities.sort_by_key(|pdu| (pdu.depth, pdu.origin_server_ts));
if extremities.is_empty() {
return Err!("No room extremities.");
}
self.write_str("| Event ID | Kind | Sender | Timestamp | Depth |\n")
.await?;
self.write_str("| -------- | ---- | ------ | --------- | ----- |\n")
.await?;
for pdu in extremities {
let url = format!(
"https://matrix.to/#/{}/{}?via={}",
room_id,
pdu.event_id(),
self.services.server.name
);
self.write_str(&format!(
"| [`{}`]({url}) | `{}` | `{}` | `{}` | `{}` |\n",
pdu.event_id(),
pdu.kind(),
pdu.sender(),
pdu.origin_server_ts,
pdu.depth
))
.await?;
}
Ok(())
}
pub(super) async fn servers_in_backoff(
&self,
room_id: Option<OwnedRoomId>,
-4
View File
@@ -234,10 +234,6 @@ pub enum DebugCommand {
page: Option<usize>,
},
RoomExtremities {
room_id: OwnedRoomId,
},
/// Lists remote servers that are currently in a "backoff" state.
///
/// Servers in this list will not be contacted until the retry time elapses,
+8 -4
View File
@@ -39,13 +39,17 @@ conduwuit::mod_dtor! {}
pub use crate::admin::AdminCommand;
/// Install the admin command processor
pub fn init(admin_service: &service::admin::Service) {
pub async fn init(admin_service: &service::admin::Service) {
_ = admin_service.complete.write().insert(processor::complete);
_ = admin_service.handle.write().insert(processor::dispatch);
_ = admin_service
.handle
.write()
.await
.insert(processor::dispatch);
}
/// Uninstall the admin command handler
pub fn fini(admin_service: &service::admin::Service) {
_ = admin_service.handle.write().take();
pub async fn fini(admin_service: &service::admin::Service) {
_ = admin_service.handle.write().await.take();
_ = admin_service.complete.write().take();
}
+1 -1
View File
@@ -24,7 +24,7 @@ pub(super) async fn process(subcommand: AppserviceCommand, context: &Context<'_>
match subcommand {
| AppserviceCommand::GetRegistration { appservice_id } => {
let timer = tokio::time::Instant::now();
let results = services.appservice.get_registration(&appservice_id);
let results = services.appservice.get_registration(&appservice_id).await;
let query_time = timer.elapsed();
+3
View File
@@ -51,6 +51,8 @@ jemalloc_stats = [
release_max_log_level = [
"conduwuit-core/release_max_log_level",
"conduwuit-service/release_max_log_level",
"log/max_level_trace",
"log/release_max_level_info",
"tracing/max_level_trace",
"tracing/release_max_level_info",
]
@@ -78,6 +80,7 @@ http-body-util.workspace = true
hyper.workspace = true
itertools.workspace = true
lettre.workspace = true
log.workspace = true
rand.workspace = true
reqwest.workspace = true
ruma.workspace = true
+1
View File
@@ -135,6 +135,7 @@ pub(crate) async fn add_3pid_route(
let email = services
.threepid
.get_valid_session(&body.sid, &body.client_secret)
.await
.map_err(|message| err!(Request(ThreepidAuthFailed("{message}"))))?
.consume();
+4 -7
View File
@@ -117,13 +117,10 @@ async fn set_account_data(
data: &RawJsonValue,
) -> Result {
if event_type_s == "m.fully_read" {
return Err!(Request(
BadJson(
"This endpoint cannot be used for marking a room as fully read (setting \
m.fully_read)"
),
METHOD_NOT_ALLOWED
));
return Err!(Request(BadJson(
"This endpoint cannot be used for marking a room as fully read (setting \
m.fully_read)"
)));
}
let data: serde_json::Value = serde_json::from_str(data.get())
+4 -2
View File
@@ -20,7 +20,8 @@ pub(crate) async fn create_alias_route(
services
.rooms
.alias
.appservice_checks(&body.room_alias, body.identity.appservice_info())?;
.appservice_checks(&body.room_alias, body.identity.appservice_info())
.await?;
// this isn't apart of alias_checks or delete alias route because we should
// allow removing forbidden room aliases
@@ -68,7 +69,8 @@ pub(crate) async fn delete_alias_route(
services
.rooms
.alias
.appservice_checks(&body.room_alias, body.identity.appservice_info())?;
.appservice_checks(&body.room_alias, body.identity.appservice_info())
.await?;
services
.rooms
+1 -2
View File
@@ -46,8 +46,7 @@ pub(crate) async fn get_capabilities_route(
capabilities.get_login_token =
GetLoginTokenCapability::new(services.server.config.login_via_existing_session);
capabilities.forget_forced_upon_leave.enabled =
services.server.config.forget_forced_upon_leave;
capabilities.forget_forced_upon_leave.enabled = true;
if services.users.is_admin(sender_user).await {
capabilities.account_moderation.lock = true;
+3 -18
View File
@@ -523,22 +523,7 @@ where
for (server, response) in futures {
match response {
| Ok(response) => {
let is_wanted = |user_id: &UserId| {
user_id.server_name() == server && device_keys_input.contains_key(user_id)
};
let filtered_master_keys = response
.master_keys
.into_iter()
.filter(|(user_id, _)| is_wanted(user_id));
let filtered_self_signing_keys = response
.self_signing_keys
.into_iter()
.filter(|(user_id, _)| is_wanted(user_id));
let filtered_device_keys = response
.device_keys
.into_iter()
.filter(|(user_id, _)| is_wanted(user_id));
for (user, master_key) in filtered_master_keys {
for (user, master_key) in response.master_keys {
let (master_key_id, mut master_key) = parse_master_key(&user, &master_key)?;
if let Ok(our_master_key) = services
@@ -564,8 +549,8 @@ where
}
}
self_signing_keys.extend(filtered_self_signing_keys);
device_keys.extend(filtered_device_keys);
self_signing_keys.extend(response.self_signing_keys);
device_keys.extend(response.device_keys);
},
| Err(e) => {
failures.insert(server.to_string(), json!({ "error": e.to_string() }));
+16 -15
View File
@@ -1,4 +1,4 @@
use std::{borrow::Borrow, collections::HashMap, sync::Arc};
use std::{borrow::Borrow, collections::HashMap, iter::once, sync::Arc};
use axum::extract::State;
use conduwuit::{
@@ -461,13 +461,14 @@ async fn knock_room_helper_local(
services
.rooms
.timeline
.progress_extremities(&parsed_knock_pdu)
.append_pdu(
&parsed_knock_pdu,
knock_event,
once(parsed_knock_pdu.event_id.borrow()),
&state_lock,
room_id,
)
.await?;
services
.rooms
.timeline
.append_pdu(&parsed_knock_pdu, knock_event, room_id)
.await;
Ok(())
}
@@ -586,7 +587,7 @@ async fn knock_room_helper_remote(
let mut state_map: HashMap<u64, OwnedEventId> = HashMap::new();
for mut event in state {
for event in state {
let Some(state_key) = event.get("state_key") else {
debug_warn!("send_knock stripped state event missing state_key: {event:?}");
continue;
@@ -613,7 +614,6 @@ async fn knock_room_helper_remote(
.get_or_create_shortstatekey(&event_type, &state_key)
.await;
event.insert("event_id".into(), CanonicalJsonValue::String(event_id.to_string()));
services.rooms.outlier.add_pdu_outlier(&event_id, &event);
state_map.insert(shortstatekey, event_id.clone());
}
@@ -662,13 +662,14 @@ async fn knock_room_helper_remote(
services
.rooms
.timeline
.progress_extremities(&parsed_knock_pdu)
.append_pdu(
&parsed_knock_pdu,
knock_event,
once(parsed_knock_pdu.event_id.borrow()),
&state_lock,
room_id,
)
.await?;
services
.rooms
.timeline
.append_pdu(&parsed_knock_pdu, knock_event, room_id)
.await;
info!("Setting final room state for new room");
// We set the room state after inserting the pdu, so that we never have a
+21 -18
View File
@@ -22,7 +22,7 @@ use conduwuit_service::{
};
use futures::{FutureExt, StreamExt, TryFutureExt, future::OptionFuture, pin_mut};
use ruma::{
EventId, RoomId, UserId,
RoomId, UserId,
api::{
Direction,
client::{filter::RoomEventFilter, message::get_message_events},
@@ -30,9 +30,8 @@ use ruma::{
},
assign,
events::{
AnyStateEvent, StateEventType, SyncEphemeralRoomEvent,
AnyStateEvent, StateEventType,
TimelineEventType::{self, *},
receipt::ReceiptEventContent,
},
serde::Raw,
};
@@ -210,32 +209,36 @@ pub(crate) async fn lazy_loading_witness<'a, I>(
where
I: Iterator<Item = &'a PdusIterItem> + Clone + Send,
{
let chunk_event_ids: std::collections::HashSet<&EventId> =
events.clone().map(|(_, event)| event.event_id()).collect();
let oldest = events
.clone()
.map(|(count, _)| count)
.copied()
.min()
.unwrap_or_else(PduCount::max);
let newest = events
.clone()
.map(|(count, _)| count)
.copied()
.max()
.unwrap_or_else(PduCount::max);
let receipts = services
.rooms
.read_receipt
.readreceipts_since(lazy_loading_context.room_id, None);
.readreceipts_since(lazy_loading_context.room_id, Some(oldest.into_unsigned()));
pin_mut!(receipts);
let receipt_users = receipts.ready_filter_map(|(user_id, _, raw)| {
let event =
serde_json::from_str::<SyncEphemeralRoomEvent<ReceiptEventContent>>(raw.json().get())
.ok()?;
event
.content
.keys()
.any(|id| chunk_event_ids.contains(&**id))
.then_some(user_id)
});
let witness: MemberSet = events
.stream()
.map(ref_at!(1))
.map(Event::sender)
.map(ToOwned::to_owned)
.chain(receipt_users)
.chain(
receipts
.ready_take_while(|(_, c, _)| *c <= newest.into_unsigned())
.map(|(user_id, ..)| user_id),
)
.collect()
.await;
+38 -54
View File
@@ -1,14 +1,14 @@
use std::collections::BTreeMap;
use axum::extract::State;
use conduwuit::{Err, Result, err};
use conduwuit::{Err, PduCount, Result, err};
use ruma::{
MilliSecondsSinceUnixEpoch,
api::client::{read_marker::set_read_marker, receipt::create_receipt},
events::{
RoomAccountDataEventType,
fully_read::{FullyReadEvent, FullyReadEventContent},
receipt::{Receipt, ReceiptEvent, ReceiptEventContent, ReceiptThread, ReceiptType},
receipt::{Receipt, ReceiptEvent, ReceiptEventContent, ReceiptType},
},
};
@@ -27,15 +27,6 @@ pub(crate) async fn set_read_marker_route(
) -> Result<set_read_marker::v3::Response> {
let sender_user = body.identity.expect_sender_user()?;
if !services
.rooms
.state_cache
.is_joined(sender_user, &body.room_id)
.await
{
return Err!(Request(Forbidden("You are not in this room.")));
}
if let Some(event) = &body.fully_read {
let fully_read_event = FullyReadEvent::new(FullyReadEventContent::new(event.to_owned()));
@@ -101,8 +92,13 @@ pub(crate) async fn set_read_marker_route(
.timeline
.get_pdu_count(event)
.await
.map_err(|_| err!(Request(NotFound("Event not found."))))?
.into_unsigned();
.map_err(|_| err!(Request(NotFound("Event not found."))))?;
let PduCount::Normal(count) = count else {
return Err!(Request(InvalidParam(
"Event is a backfilled PDU and cannot be marked as read."
)));
};
services
.rooms
@@ -126,26 +122,11 @@ pub(crate) async fn create_receipt_route(
) -> Result<create_receipt::v3::Response> {
let sender_user = body.identity.expect_sender_user()?;
if !services
.rooms
.state_cache
.is_joined(sender_user, &body.room_id)
.await
{
return Err!(Request(Forbidden("You are not in this room.")));
}
services
.users
.update_device_last_seen(sender_user, body.identity.sender_device(), client_ip)
.await;
if body.receipt_type == create_receipt::v3::ReceiptType::FullyRead
&& body.thread != ReceiptThread::Unthreaded
{
return Err!(Request(InvalidParam("thread_id cannot be specified for m.fully_read")));
}
if matches!(
&body.receipt_type,
create_receipt::v3::ReceiptType::Read | create_receipt::v3::ReceiptType::ReadPrivate
@@ -178,41 +159,44 @@ pub(crate) async fn create_receipt_route(
)
.await?;
},
| create_receipt::v3::ReceiptType::Read =>
if services.config.allow_local_read_receipts
&& !services.users.is_suspended(sender_user).await?
{
let mut receipt = Receipt::new(MilliSecondsSinceUnixEpoch::now());
receipt.thread = body.thread.clone();
let receipt_content = [(
body.event_id.clone(),
| create_receipt::v3::ReceiptType::Read => {
let receipt_content = [(
body.event_id.clone(),
BTreeMap::from_iter([(
ReceiptType::Read,
BTreeMap::from_iter([(
ReceiptType::Read,
BTreeMap::from_iter([(sender_user.to_owned(), receipt)]),
sender_user.to_owned(),
Receipt::new(MilliSecondsSinceUnixEpoch::now()),
)]),
)];
)]),
)];
services
.rooms
.read_receipt
.readreceipt_update(
sender_user,
&body.room_id,
ReceiptEvent::new(
body.room_id.clone(),
ReceiptEventContent::from_iter(receipt_content),
),
)
.await;
},
services
.rooms
.read_receipt
.readreceipt_update(
sender_user,
&body.room_id,
ReceiptEvent::new(
body.room_id.clone(),
ReceiptEventContent::from_iter(receipt_content),
),
)
.await;
},
| create_receipt::v3::ReceiptType::ReadPrivate => {
let count = services
.rooms
.timeline
.get_pdu_count(&body.event_id)
.await
.map_err(|_| err!(Request(NotFound("Event not found."))))?
.into_unsigned();
.map_err(|_| err!(Request(NotFound("Event not found."))))?;
let PduCount::Normal(count) = count else {
return Err!(Request(InvalidParam(
"Event is a backfilled PDU and cannot be marked as read."
)));
};
services
.rooms
+38 -46
View File
@@ -2,7 +2,7 @@ use axum::extract::State;
use conduwuit::{
Err, Result, at, debug_warn, err,
matrix::{Event, event::RelationTypeEqual, pdu::PduCount},
utils::{IterStream, result::FlatOk, stream::WidebandExt},
utils::{IterStream, ReadyExt, result::FlatOk, stream::WidebandExt},
};
use conduwuit_service::Services;
use futures::StreamExt;
@@ -98,10 +98,6 @@ pub(crate) async fn get_relating_events_route(
.await
}
// Spec (v1.10) recommends a depth of at least 3
const RECURSION_DEPTH: u8 = 3;
const LEVELS_BELOW: u8 = RECURSION_DEPTH - 1;
#[allow(clippy::too_many_arguments)]
async fn paginate_relations_with_filter(
services: &Services,
@@ -151,49 +147,28 @@ async fn paginate_relations_with_filter(
.unwrap_or(30)
.min(100);
let max_depth = if recurse { LEVELS_BELOW } else { 0 };
// Spec (v1.10) recommends depth of at least 3
let depth: u8 = if recurse { 3 } else { 1 };
// One more than the limit, to know whether there's another page
let mut events = services
let events: Vec<_> = services
.rooms
.pdu_metadata
.get_relations(
sender_user,
room_id,
target,
start,
limit.saturating_add(1),
max_depth,
dir,
|pdu| {
filter_event_type
.as_ref()
.is_none_or(|kind| kind == pdu.kind())
&& filter_rel_type
.as_ref()
.is_none_or(|rel_type| rel_type.relation_type_equal(pdu))
},
)
.await;
let past_to = to.and_then(|to| {
events
.iter()
.position(|(count, _)| !to.is_after(*count, dir))
});
if let Some(past_to) = past_to {
events.truncate(past_to);
}
let has_more = past_to.is_none() && events.len() > limit;
events.truncate(limit);
let next_batch =
has_more.then(|| events.last().map_or(start, |(count, _)| *count).to_string());
let chunk: Vec<_> = events
.get_relations(sender_user, room_id, target, start, limit, depth, dir)
.await
.into_iter()
.filter(|(_, pdu)| {
filter_event_type
.as_ref()
.is_none_or(|kind| kind == pdu.kind())
})
.filter(|(_, pdu)| {
filter_rel_type
.as_ref()
.is_none_or(|rel_type| rel_type.relation_type_equal(pdu))
})
.stream()
.ready_take_while(|(count, _)| Some(*count) != to)
.take(limit)
.wide_filter_map(|item| visibility_filter(services, sender_user, item))
.wide_filter_map(|item| ignored_filter(services, item, sender_user))
.then(async |mut pdu| {
@@ -207,15 +182,32 @@ async fn paginate_relations_with_filter(
}
pdu
})
.map(at!(1))
.map(Event::into_format)
.collect()
.await;
// Determine if there are more events to fetch
let has_more = events.len() >= limit;
let next_batch = if has_more {
match dir {
| Direction::Forward => events.last(),
| Direction::Backward => events.first(),
}
.map(|(count, _)| count.to_string())
} else {
None
};
let chunk: Vec<_> = events
.into_iter()
.map(at!(1))
.map(Event::into_format)
.collect();
Ok(assign!(get_relating_events::v1::Response::new(chunk), {
next_batch,
prev_batch: from.map(Into::into),
recursion_depth: recurse.then_some(RECURSION_DEPTH.into()),
recursion_depth: recurse.then_some(depth.into()),
}))
}
Loaded 100 of 206 files, more files were not shown because too many files have changed in this diff. Show more