Compare commits

...
Author SHA1 Message Date
timedout fc6aec62ec fix: Perform state resolution when converging multiple DAG branches 2026-10-16 17:31:19 +01:00
renovate a973f3e10c chore(Nix): Updated flake hashes 2026-10-16 05:07:35 +00:00
Renovate Bot ab939da036 chore(deps): update rust to v1.99.1 2026-10-16 05:02:46 +00:00
Ginger 138dd61f82 chore: Switch to upstream ruma 2026-10-15 22:56:04 -04:00
Ginger 98c694eaa3 chore: Add some comments 2026-10-15 22:56:04 -04:00
Ginger e6ca06a501 feat: Add support for MSC4560 2026-10-15 22:56:04 -04:00
Ginger 4f21fa2bda refactor: Clean up join rule evaluation logic 2026-10-15 22:55:36 -04:00
Jade Ellis 08301fba2a fix: Correctly rebuild the build metadata crate when git changes 2026-10-15 11:31:03 +01:00
Renovate Bot a21b0918dc chore(deps): update rust crate rustls to v0.23.46 [security] 2026-10-15 05:17:59 +00:00
Renovate Bot a17a805293 chore(deps): update github-actions-digest 2026-10-13 05:17:44 +00:00
timedout 090203c2ea style: Remove import 2026-10-12 22:28:50 +01:00
timedout ff63d9f203 fix: Don't unconditionally mark gapfilled events as referenced
This is pointless and fallible
2026-10-12 22:28:50 +01:00
timedout 511e791b9f fix: Mark state and auth chain events as referenced after joining a room
It's generally safe to assume that all of these events have been referenced by the time we get to joining.
2026-10-12 22:28:50 +01:00
timedout bc70c4eaff fix: Mark PDUs as referenced during gapfill immediately 2026-10-12 22:28:50 +01:00
timedout bbbc9bc7d8 fix: Never add unknown events to the extremity tracker 2026-10-12 22:28:46 +01:00
Erwan Leboucher 7da0ef6e2b docs: Document environment variables for config options 2026-10-12 11:32:45 +01:00
Erwan Leboucher 24e289113b fix(pusher): Only strip notification_push_path as a URL suffix 2026-10-12 11:14:02 +01:00
Erwan Leboucher 805d4d9416 fix(pusher): Enforce ip_range_denylist on resolved pusher hosts 2026-10-12 11:14:02 +01:00
Erwan Leboucher fe0ab62124 refactor: Unify retry backoff helpers 2026-10-12 11:14:01 +01:00
stratself bd005edd59 fix(docs): Remove dead link in guides' _meta.json 2026-10-12 09:48:08 +00:00
stratself c66fb684f0 docs: Add guide for push notifications (#2244)
Adds a page for push notifications under /guides. The main thing it covers are how push works in Matrix, UnifiedPush usage and selfhosting, and some troubleshooting of common push issues.

I took the liberty to include various aspects of push not pertaining to the server itself, because it was commonly asked in our chatrooms and are quite important for all matrix users. Kind of like livekit.

Closes #2136

Reviewed-on: https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2244
Reviewed-by: Jade Ellis <jade@ellis.link>
Reviewed-by: Henry-Hiles <henry@henryhiles.com>
Reviewed-by: lveneris <tyler@kludgecs.com>
2026-10-12 09:23:45 +00:00
theS1LV3R 0773cd1f78 chore: Update chanagelog to be more descript 2026-10-12 10:14:53 +01:00
theS1LV3R 929ef60780 chore: Add changelog 2026-10-12 10:14:53 +01:00
theS1LV3R 39bb4fefa1 feat: Add support for custom DNS servers
Adds an option `dns_servers` which takes IPs for custom servers.
Does not allow for custom DNS ports as this is largely not supported in
tokio and hickory, and would otherwise be a pain to implement properly.

Fixes: #1866
See-Also: https://matrix.to/#/!ksTlboXVgcyWjv5GrlEeKyQuJ8ZCprnwQx2b6-BQ44Q/%24qrBGOzosK4BdRbF5jhf5ehrxQUTaIr-U-UpqTmPhkPY?via=wolfgirl.pet&via=matrix.org
2026-10-12 10:14:53 +01:00
Sebastian Spaeth b4a2a457a1 debian: Change weekly versioning scheme
Right now our weekly Debian versioning scheme is VERSION="$BASE_VERSION~git$DATE.$SHA-$CLEAN_COMPONENT".
This sorts weekly releases AFTER the BASE_VERSION, so when both stable
and unstable are enabled, we never get weekly versions installed.
https://wiki.debian.org/Versioning proposes {upcoming_version}~git{date}.{hash}-{revision} for nightly releases, which means we would have to know the release number of the upcoming version in advance. I don't think that is useful for us.

By switching from a tilde to a dash, our weekly versions are not sorted
above the stable base version and we will install the weekly versions
over the base version, which I believe is closer to what we intend.

Fixes:  https://forgejo.ellis.link/continuwuation/continuwuity/issues/2081
2026-10-12 09:13:24 +00:00
Clubs dac940784d docs: Added the changelog for 2292 2026-10-12 10:10:17 +01:00
Clubs 8200487787 feat: add optional flags for filtering !admin user list, hide deactivated users by default 2026-10-12 10:10:14 +01:00
Renovate Bot b5c3da3f52 chore(deps): update dependency cargo-bins/cargo-binstall to v1.25.3 2026-10-12 09:05:37 +00:00
Jade Ellis 3975d31b91 refactor: Delegate otlp_protocol to standard OTLP env variables 2026-10-12 10:03:16 +01:00
Erwan Leboucher fd4cb4a306 fix(runtime): Log final runtime metrics at debug 2026-10-12 10:03:16 +01:00
Erwan Leboucher c79e9e29a3 fix(metrics): Skip instruments when no exporter is enabled 2026-10-12 10:03:16 +01:00
Erwan Leboucher 698edda6bd fix(metrics): Read database memory gauges without a cache 2026-10-12 10:03:15 +01:00
Erwan Leboucher ea3ec965ed fix(metrics): Address review feedback 2026-10-12 10:03:15 +01:00
Erwan Leboucher 9d454fd883 refactor(metrics): Use Tower HTTP instrumentation 2026-10-12 10:03:15 +01:00
Erwan Leboucher 4996471878 docs(metrics): Document OTLP export and update the dashboard 2026-10-12 10:03:14 +01:00
Erwan Leboucher 5185045cb6 feat(metrics): Record metrics with OpenTelemetry and export over OTLP 2026-10-12 10:03:14 +01:00
Erwan Leboucher e96b6e6665 chore(deps): Bump OpenTelemetry to 0.33 2026-10-12 10:03:14 +01:00
Erwan Leboucher e584e1a572 feat: Add Grafana dashboard for Prometheus metrics 2026-10-12 10:03:13 +01:00
Erwan Leboucher 31bce80524 fix(metrics): Start latency histogram buckets at 1ms 2026-10-12 10:03:13 +01:00
Erwan Leboucher f14c401f39 feat: Add Prometheus metrics endpoint 2026-10-12 10:03:12 +01:00
Jade Ellis ea96858c4a docs: Changelog 2026-10-12 10:01:06 +01:00
Jade Ellis 75c439a9d0 fix: Correctly set rocksdb descriptor_cf_options 2026-10-12 10:01:06 +01:00
Renovate Bot d3b9aee3ab chore(deps): update ghcr.io/renovatebot/renovate docker tag to v44.151.2 2026-10-12 05:03:12 +00:00
timedout 3af5302dd8 feat: Add more useful errors to send_join
See also: #2340
2026-10-10 02:23:39 +01:00
timedout 0415a35fa8 perf: Always treat self as healthy 2026-10-08 20:29:51 +01:00
timedout b76dc816a4 fix: Handle policy server errors better 2026-10-08 20:26:30 +01:00
timedout 536d96abb4 fix: Apply ignore filtering to peeking route
Reviewed-By: Jade Ellis <jade@ellis.link>
2026-10-08 19:02:59 +01:00
Renovate Bot 2fad908f27 chore(deps): update pre-commit hook crate-ci/typos to v1.51.1 2026-10-07 05:03:34 +00:00
Jade Ellis b081ac36ff chore: Replace deprecated kebab-case lints with snake_case 2026-10-07 00:23:28 +01:00
Jade Ellis c3ba97adb6 style: Resolve clippy warnings in database and service 2026-10-07 00:17:35 +01:00
Jade Ellis 30508ea353 chore: Ignore clippy lint assert_is_empty in workspace 2026-10-07 00:14:44 +01:00
Jade Ellis df3466e68d chore: Changelog 2026-10-06 23:56:32 +01:00
Jade Ellis 5d55b413a2 feat: Send private read receipts to appservices 2026-10-06 23:56:30 +01:00
Jade Ellis 7ce47be4de feat: Send read receipts and typing indicators to appservices 2026-10-06 23:56:28 +01:00
Ginger 7cedf9f322 fix: Always route userinfo endpoint 2026-10-06 22:22:56 +00:00
Jade Ellis 17f5ce10f4 chore: Update LLVM version 2026-10-06 23:18:49 +01:00
Renovate Bot 5f13bab52f chore(deps): update github-actions-digest 2026-10-06 05:01:46 +00:00
timedout c1e4f926c8 feat: Allow server admins to do timestamp massaging too 2026-10-06 02:34:10 +00:00
timedout 63578eba8c fix: Properly move /send redaction fields 2026-10-06 02:34:10 +00:00
timedout 20fe43d200 fix: Don't insert top-level redacts in v11+ rooms 2026-10-06 02:34:10 +00:00
timedout 1ffb1d637e fix: Don't invert redaction target helper 2026-10-06 02:34:10 +00:00
timedout 0224a558b3 fix: Stop embedding prev_content during event creation 2026-10-06 02:34:10 +00:00
Renovate Bot ae2e71ff45 chore(deps): update dependency cargo-bins/cargo-binstall to v1.25.1 2026-10-05 21:04:26 +00:00
renovate 52435fa02d chore(Nix): Updated flake hashes 2026-10-05 21:04:00 +00:00
Renovate Bot c0d8f5ab8b chore(deps): update rust to v1.99.0 2026-10-05 21:04:00 +00:00
Renovate Bot 80851bba06 chore(deps): update node-patch-updates to v2.0.23 2026-10-05 21:03:42 +00:00
Ginger 4d7341c32d fix: Check for client ID mismatch in step-up auth 2026-10-05 14:22:53 +00:00
Ginger 18f2118c42 fix: Make missing scope descriptions very obvious 2026-10-05 14:22:53 +00:00
Ginger 240c806d70 fix: Small cosmetic fixes 2026-10-05 14:22:53 +00:00
Ginger 2fdd59ae54 fix: Use ApiFullAccess as required scope for NoAccessToken endpoints 2026-10-05 14:22:53 +00:00
Ginger a8a6ab9e3d chore: Update news fragments 2026-10-05 14:22:53 +00:00
Ginger f55a5bd1c3 chore: Switch back to upstream Ruma 2026-10-05 14:22:53 +00:00
Ginger 7ab415c4b6 fix: Make require_auth_for_profile_requests work again 2026-10-05 14:22:53 +00:00
Ginger c9b0fbaeac chore: Update MSC4540 support 2026-10-05 14:22:53 +00:00
Ginger bc9b97e97f feat: Add support for MSC4540 2026-10-05 14:22:53 +00:00
Ginger 0d48c9681d feat: Give scope lists and device cards a fresh coat of paint 2026-10-05 14:22:53 +00:00
Ginger 38f8011b95 chore: Update ruma 2026-10-05 14:22:53 +00:00
Ginger e963adf524 feat: Add support for MSC4363 2026-10-05 14:22:53 +00:00
Ginger af84202ba4 fix: Don't bail on unrecognized OAuth scopes 2026-10-05 14:22:53 +00:00
Ginger 08b6ab4af7 chore: News fragment 2026-10-05 14:22:53 +00:00
Ginger 823ee9f6e1 feat: Add support for MSC4484 2026-10-05 14:22:53 +00:00
Ginger 3a20ad7ff2 refactor: Adjust auth check logic structure 2026-10-05 14:22:53 +00:00
Renovate Bot 4d4693494b chore(deps): update ghcr.io/renovatebot/renovate docker tag to v44.133.0 2026-10-05 05:03:04 +00:00
Jade Ellis 1e34bd2ed9 style: Run formatting 2026-10-05 00:27:12 +01:00
stratself d83da6ada7 docs(deploying: Fixes from PR comments 2026-10-03 15:52:20 +00:00
stratself 9377ff7abd fix: Trailing whitespace 2026-10-03 15:52:20 +00:00
stratself 2118eb8501 docs: Move Configuration page below Deploying section 2026-10-03 15:52:20 +00:00
stratself ef0483feb9 docs(deploying): Note the conduwuit name and other small style changes 2026-10-03 15:52:20 +00:00
stratself 25f59e3e2c docs(deploying): Add baseline instructions and buttons for installation
The OverviewGroup thingy is hardcoded for now because figuring out
rspress hooks to read from _meta.json is a pain.
2026-10-03 15:52:20 +00:00
stratself 060eee983d chore: Add changelog to #2252 2026-10-03 15:52:20 +00:00
stratself 7fba194bff docs(deploying): Add missing links and small wording changes to some pages 2026-10-03 15:52:20 +00:00
stratself 7bf6f3bd11 docs(deploying): Shorten the release tracks section 2026-10-03 15:52:20 +00:00
stratself 8b77a559e0 docs(generic): Add small intro 2026-10-03 15:52:20 +00:00
stratself c1d75183d1 docs(deploying): Prioritize FreeBSD page above Nomad and K8s 2026-10-03 15:52:20 +00:00
stratself f9a6171cc5 docs(debian): Add "next steps" redir and fix headings' levels 2026-10-03 15:52:20 +00:00
stratself 5fcc43e803 docs(deploying): redirect all 'next steps' section to main deploying page 2026-10-03 15:52:20 +00:00
stratself 26646f9df6 docs(deploying): Populate the stub Deploying page with useful info
* Detail Continuwuity's release tracks
* Add general update advises
* Add installation and post-installation sections
2026-10-03 15:52:20 +00:00
stratself c221d60654 docs(rpm): Remove instructions to disable GPG checking 2026-10-03 15:40:15 +00:00
stratself 70cce17b7f fix(docs,rpm): Correct path of config file 2026-10-03 15:40:15 +00:00
stratself 2f45a5c794 docs(rpm): Fixes from PR comments 2026-10-03 15:40:15 +00:00
stratself b64f8a76ac chore: Add changelog for #2275 2026-10-03 15:40:15 +00:00
stratself aab456e0e0 docs(rpm): Add basic configuration instructions
Needed as the docs implied it works OOTB. Also moved building and
uninstallation instructions to an Appendix section
2026-10-03 15:40:15 +00:00
Clubs b40204a6c7 docs: changelog for adding !admin token issue registration conditional 2026-10-03 15:37:58 +00:00
Clubs ea16e78092 fix: ensure that registration is enabled before giving tokens from !admin token issue 2026-10-03 15:37:58 +00:00
Erwan Leboucher 56c2d8d901 refactor(media): Simplify preview image handling 2026-10-03 15:35:18 +00:00
Erwan Leboucher 7d8a5f6bab fix(media): Preserve remote preview dimensions without decoding images 2026-10-03 15:35:18 +00:00
Erwan Leboucher de578c2163 fix(media): Validate preview image downloads 2026-10-03 15:35:18 +00:00
timedout c94fa39fd1 fix: Don't panic when a join doesn't include a create event 2026-10-03 15:19:10 +00:00
Ginger 2773ff3e16 feat: Import images correctly from OIDC claims 2026-10-03 15:04:07 +00:00
Ginger 6bbea25034 feat: Allow configuring additional trusted OIDC audiences 2026-10-03 15:03:47 +00:00
Ginger 39bee607c0 refactor: Remove recaptcha-verify 2026-10-03 15:03:34 +00:00
timedout 935ddf1d0f style: Change Allow to Default etc
`ExplicitAllow` -> `Allow`
2026-10-02 18:10:18 +01:00
timedout 495eeedd24 style: Don't return Allow in an else block 2026-10-02 18:10:17 +01:00
timedout 63294f8775 fix: Inverted check 2026-10-02 18:10:17 +01:00
timedout 7243c92dbc chore: add newsfrag 2026-10-02 18:10:17 +01:00
timedout 43ee11bb00 feat: Support MSC4494 2026-10-02 18:10:17 +01:00
Ginger f1d9537b14 fix: Fix startup panic in old migrations 2026-10-02 11:41:37 -04:00
Ginger cb7af18bc2 fix: Make unembed_unsigned_info infallible 2026-10-01 18:43:54 +00:00
Ginger a6fae7498d fix: Don't bump version if it's already bumped 2026-10-01 18:43:54 +00:00
Ginger 48c36d6f17 refactor: Remove some unnecessary macro logic 2026-10-01 18:43:54 +00:00
Ginger 23d07e3d4f refactor: Clean up migration logic 2026-10-01 18:43:54 +00:00
stratself 1220144495 fix: Uncenter 2026-10-01 16:18:43 +00:00
stratself a718aa92eb fix: A word 2026-10-01 16:11:22 +00:00
stratself 4a97dc8c96 docs: Add donate section and backers count badge to README 2026-10-01 16:11:22 +00:00
stratself 8414af2349 fix: Trailing whitespace 2026-10-01 16:11:22 +00:00
stratself 4daf674337 fix: Use div align and br instead of inline css for donate button 2026-10-01 16:11:22 +00:00
stratself 847412367b docs(README): Better colors for some buttons 2026-10-01 16:11:22 +00:00
stratself 95e99a393d docs(README): Add Open Collective donation button 2026-10-01 16:11:22 +00:00
stratself a4faa82f38 docs(README): Tagline concision 2026-10-01 16:11:22 +00:00
stratself e931fdca15 docs(README): Smart linking the contrib page and other improvements
CONTRIBUTION.md is now linked directly when viewed from the repo.

When viewed in the website, links to /CONTRIBUTION.md will be redirected
towards /development/contributing using the `pluginClientRedirects`
options

The other dev docs can also benefit from these hackarounds
2026-10-01 16:11:22 +00:00
stratself db6e70eae8 docs(README): Remove "what are we working on" section
Not a very useful indicator of project progress for now
2026-10-01 16:11:22 +00:00
stratself d97fcc9acd style(docs,README): Remove anchor tags (seems unused for anything) 2026-10-01 16:11:22 +00:00
stratself c087c3cdb8 style(docs,README): Cleanup badge using indirect links 2026-10-01 16:11:22 +00:00
stratself c186879138 fix(docs): Fix header levels in README.md 2026-10-01 16:11:22 +00:00
Renovate Bot 92bc1111ee chore(deps): update dependency cargo-bins/cargo-binstall to v1.24.0 2026-10-01 16:07:21 +00:00
stratself 0989155929 docs(intro): Dehyphenate 2026-10-01 16:05:59 +00:00
stratself 15bb2f7bf5 docs(intro): Fixes from PR comments 2026-10-01 16:05:59 +00:00
stratself a62f7ecc28 docs(intro): Use fednex's tagline from the website 2026-10-01 16:05:59 +00:00
stratself 30266fe3b5 docs: New Jade link 2026-10-01 16:05:59 +00:00
stratself 7d1163e35d fix: Newline 2026-10-01 16:05:59 +00:00
stratself a88da6fd5c fix(docs): Intro page logo resizing 2026-10-01 16:05:59 +00:00
stratself d413a3ebdc chore: Add changelog for #2279 2026-10-01 16:05:59 +00:00
stratself 4dd538219a docs: Rename meta for introduction page to "Introduction" 2026-10-01 16:05:59 +00:00
stratself 413ebc0061 docs(intro): Draw the rest of the introduction page (see notes)
* Add stub Deploying section
* Add Try it out section with short instructions for partnered
  homeservers
* Add Donate section with OC button and individual links
* Add Contact section, move all chatroom and source code buttons there
* Use new `no-zoom` html class to disable image zooms
2026-10-01 16:05:59 +00:00
stratself 2eda5de86b docs(intro): Rewrite intro page from hidden sections of main index 2026-10-01 16:05:59 +00:00
Ginger 931686e84e fix: Fix panic in room creation 2026-09-30 18:49:03 +00:00
Ginger eb602e83a1 chore: Fix clippy lints 2026-09-30 14:47:46 -04:00
Renovate Bot 5c4066cbfd chore(deps): update pre-commit hook crate-ci/typos to v1.50.3 2026-09-30 05:03:27 +00:00
timedout 58d135bc57 fix: Return the actual state at in !admin debug get-state-at
Previously this command actually returned the state *before*, which made debugging with it confusing.
2026-09-29 22:06:48 +01:00
Clubs 684820c7c1 fix: check for user account status before attemping to process email change. 2026-09-29 18:36:35 +00:00
Ginger cbdf978b84 fix: Preserve custom fields in create event content 2026-09-29 17:52:32 +00:00
Ginger 38b7987335 fix: Add invitees as creators for v12+ trusted private chats 2026-09-29 17:52:32 +00:00
stratself 612a261b61 docs(auth): with --> to 2026-09-29 16:26:07 +00:00
stratself b1e51ab0fb docs(internal auth): Redo rego methods (see commit notes)
* Tokens + recaptcha combinations have been removed since they don't
  work. Docstring in config tomlto be removed later
* Method 3 expanded to include both static and admin issued tokens
* Methods 1-3 are the "trusted token flow" and 4-6 are the "untrusted
  captcha flow"
2026-09-29 16:26:07 +00:00
stratself 8f56f99e2f docs(oidc): Incorporate wording fixes wrt subject claim from PR review 2026-09-29 16:26:07 +00:00
stratself 95f65fdba4 docs(auth): Wording fixes according to PR review 2026-09-29 16:26:07 +00:00
stratself 23a0fc1b0f docs(oidc): kanidm --> Kanidm 2026-09-29 16:26:07 +00:00
stratself f49bda81d2 docs(auth): Incorporate changes from PR review comments 2026-09-29 16:26:07 +00:00
stratself f35eb7677c fix: Typo 2026-09-29 16:26:07 +00:00
stratself b2a90f118d docs(deploying): Fix OIDC links
The deploying stub page will be rewritten sooon and the "What's next"
steps should migrate there. In the meantime this helps npm not break
when building the docs
2026-09-29 16:26:07 +00:00
stratself 4b79acba97 chore: Changelog for #2234 2026-09-29 16:26:07 +00:00
stratself 01a83067c6 docs: Remove OIDC page from Guides section
It now resides in the Authentication section
2026-09-29 16:26:07 +00:00
stratself 84cf4196e2 docs(auth): Fix wordings and add links to admin commands
* Add confirmed email + reCAPTCHA registration method as well
2026-09-29 16:26:07 +00:00
stratself 83341062af docs(oidc): Add advanced options section, and more notes for linked accounts 2026-09-29 16:26:07 +00:00
stratself 1d196f24ec docs(auth): Reword sources section a bit 2026-09-29 16:26:07 +00:00
stratself 4631854325 docs(auth): Address concerns from feedback part 1 2026-09-29 16:26:07 +00:00
stratself 26b8e527aa docs(oidc): Add important notice to OIDC breaking legacy logins 2026-09-29 16:26:07 +00:00
stratself c07922fff2 docs(auth): Simplify auth sources section & add client well-known notice 2026-09-29 16:26:07 +00:00
stratself e41435f13c docs(auth): Rename rego page to "internal auth" & add pwd reset details
* Moved around a few paragraphs to fit new title as well
2026-09-29 16:26:07 +00:00
stratself 8c0fcfd108 chore: Add few todos 2026-09-29 16:26:07 +00:00
stratself 516f94d83f docs(auth): Copy stuff from the OIDC guide
The guide would be removed at a later time
2026-09-29 16:26:07 +00:00
stratself 97533eea05 docs(auth): Writeup on auth sources and flows 2026-09-29 16:26:07 +00:00
stratself 062cb5b412 docs(registration): Remove challengeless rego mentions, add rego platforms 2026-09-29 16:26:07 +00:00
stratself 17084a363b docs(registration): Number all the rego methods and add admin commands for emails 2026-09-29 16:26:07 +00:00
stratself ac96b57506 chore(docs): Add some todos 2026-09-29 16:26:07 +00:00
stratself 385f6639c4 docs(auth): Move legacy auth page to rego page (see desc)
The commit moves legacy.mdx to registration.mdx and significantly
shortens it. Instead of explaining every registration option now a table
is provided. Renaming the page because besides registration there is not
much else to explain about legacy auth. If anything, those should be
elaborated on the main authentication.mdx page (i.e. difference between
OAuth and UIAA)

The email section has also been updated with (some) relevant info.
2026-09-29 16:26:07 +00:00
stratself b3a15fc305 docs(auth): Add token-based registration instructions 2026-09-29 16:26:07 +00:00
stratself 979c1b2fc7 docs: Initialize authentication chapter 2026-09-29 16:26:07 +00:00
Ginger 8f2f7f09ed docs: Remove cards from index page 2026-09-29 15:39:26 +00:00
Renovate Bot b59e697ed6 chore(deps): update github-actions-digest 2026-09-29 05:01:36 +00:00
nex 9c0b88f67c chore: Publish admin announcement 2026-09-29 02:30:34 +00:00
Renovate Bot 76e87c93d8 chore(deps): update ghcr.io/renovatebot/renovate docker tag to v44.115.13 2026-09-28 05:03:08 +00:00
nex aa40142b87 fix(ci): Disable GitLab mirror 2026-09-28 03:13:34 +00:00
180 changed files with 13252 additions and 2331 deletions

No files matched your search

+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@94c31af3204a9f15ab40b35ad084410b905bbc73 # v2
uses: https://github.com/taiki-e/install-action@1168f6810a3cb30a3514bf5756a3b7f0422c6df8 # v2
with:
tool: git-warp-time,timelord-cli@3.0.1
+7 -7
View File
@@ -37,9 +37,9 @@ creds:
- registry: forgejo.ellis.link
user: "{{env \"BUILTIN_REGISTRY_USER\"}}"
pass: "{{env \"BUILTIN_REGISTRY_PASSWORD\"}}"
- registry: registry.gitlab.com
user: "{{env \"GITLAB_USERNAME\"}}"
pass: "{{env \"GITLAB_TOKEN\"}}"
# - registry: registry.gitlab.com
# user: "{{env \"GITLAB_USERNAME\"}}"
# pass: "{{env \"GITLAB_TOKEN\"}}"
- registry: git.nexy7574.co.uk
user: "{{env \"N7574_GIT_USERNAME\"}}"
pass: "{{env \"N7574_GIT_TOKEN\"}}"
@@ -58,10 +58,10 @@ defaults:
# Sync configuration - each registry gets different image sets
sync:
- source: *source
target: registry.gitlab.com/continuwuity/continuwuity
type: repository
<<: *tags-main
#- source: *source
# target: registry.gitlab.com/continuwuity/continuwuity
# type: repository
# <<: *tags-main
- source: *source
target: ghcr.io/continuwuity/continuwuity
type: repository
+1 -1
View File
@@ -144,7 +144,7 @@ jobs:
COMPONENT="dev-$(echo '${{ forge.ref_name }}' | sed 's/[^a-zA-Z0-9.+]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-30)"
fi
CLEAN_COMPONENT=$(echo $COMPONENT | sed 's/[^a-zA-Z0-9.+]/~/g')
VERSION="$BASE_VERSION~git$DATE.$SHA-$CLEAN_COMPONENT"
VERSION="$BASE_VERSION-git$DATE.$SHA-$CLEAN_COMPONENT"
fi
echo "component=$COMPONENT" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
+3 -3
View File
@@ -32,7 +32,7 @@ jobs:
- 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@820762786026740c76f36085b0efc47a31fe5020 # v7
uses: https://github.com/actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: 24
@@ -56,7 +56,7 @@ jobs:
- name: Deploy to Cloudflare Pages (Production)
if: github.ref == 'refs/heads/main' && vars.CLOUDFLARE_PROJECT_NAME != ''
uses: https://github.com/cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4
uses: https://github.com/cloudflare/wrangler-action@953926a2e2182532811c01a25e53647d93bf07c0 # v4
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@@ -64,7 +64,7 @@ jobs:
- name: Deploy to Cloudflare Pages (Preview)
if: github.ref != 'refs/heads/main' && vars.CLOUDFLARE_PROJECT_NAME != ''
uses: https://github.com/cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4
uses: https://github.com/cloudflare/wrangler-action@953926a2e2182532811c01a25e53647d93bf07c0 # v4
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+1 -1
View File
@@ -55,7 +55,7 @@ jobs:
# repositories: continuwuity
- name: Install regsync
uses: https://github.com/regclient/actions/regsync-installer@bb562fac724b7b37c17f19671df07fe34fabc376 # main
uses: https://github.com/regclient/actions/regsync-installer@dd58ad94f76adb73d8ac1bf75ed25f01545d5b32 # main
- name: Check what images need mirroring
run: |
+1 -1
View File
@@ -43,7 +43,7 @@ jobs:
name: Renovate
runs-on: ubuntu-latest
container:
image: ghcr.io/renovatebot/renovate:44.104.2@sha256:d19051d0a908e098c7fbba04a16435ef136208bfa47105d59a9fe47059e2bd25
image: ghcr.io/renovatebot/renovate:44.151.2@sha256:29b3bf193f855c6f4b7027395a9c66c3417ad8bb6f30458090e1c2363d04eef7
options: --tmpfs /tmp:exec
steps:
- name: Checkout
+1 -1
View File
@@ -24,7 +24,7 @@ repos:
- id: check-added-large-files
- repo: https://github.com/crate-ci/typos
rev: v1.50.2
rev: v1.51.1
hooks:
- id: typos
- id: typos
Generated
+107 -51
View File
@@ -324,6 +324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90"
dependencies = [
"axum-core",
"axum-macros",
"bytes",
"form_urlencoded",
"futures-util",
@@ -392,6 +393,17 @@ dependencies = [
"tracing",
]
[[package]]
name = "axum-macros"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7aa268c23bfbbd2c4363b9cd302a4f504fb2a9dfe7e3451d66f35dd392e20aca"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "axum-server"
version = "0.8.0"
@@ -916,8 +928,11 @@ dependencies = [
"log",
"opentelemetry",
"opentelemetry-otlp",
"opentelemetry-prometheus",
"opentelemetry-semantic-conventions",
"opentelemetry_sdk",
"parking_lot",
"prometheus",
"reqwest 0.13.5",
"rustls",
"sentry",
@@ -1036,7 +1051,12 @@ dependencies = [
"nix",
"num-traits",
"openidconnect",
"opentelemetry",
"opentelemetry-prometheus",
"opentelemetry-semantic-conventions",
"opentelemetry_sdk",
"parking_lot",
"prometheus",
"rand 0.10.3",
"regex",
"reqwest 0.13.5",
@@ -1117,6 +1137,7 @@ dependencies = [
"hyper",
"hyper-util",
"log",
"opentelemetry-instrumentation-tower",
"ruma",
"rustls",
"sd-notify",
@@ -1162,9 +1183,7 @@ dependencies = [
"openidconnect",
"p256",
"rand 0.10.3",
"recaptcha-verify",
"regex",
"reqwest 0.12.28",
"reqwest 0.13.5",
"resolvematrix",
"ruma",
@@ -1202,8 +1221,6 @@ dependencies = [
"lettre",
"memory-serve",
"openidconnect",
"recaptcha-verify",
"reqwest 0.12.28",
"ruma",
"serde",
"serde_json",
@@ -2749,7 +2766,6 @@ dependencies = [
"hyper",
"hyper-util",
"rustls",
"rustls-native-certs",
"tokio",
"tokio-rustls",
"tower-service",
@@ -3796,7 +3812,7 @@ version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51e219e79014df21a225b1860a479e2dcd7cbd9130f4defd4bd0e191ea31d67d"
dependencies = [
"base64 0.21.7",
"base64 0.22.1",
"chrono",
"getrandom 0.2.17",
"http",
@@ -4033,9 +4049,9 @@ checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
[[package]]
name = "opentelemetry"
version = "0.32.0"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0142c63252a9e054e68a4c61a5778f7b14f576274d593f8ce883d191a099682"
checksum = "6cdb0b1b267eb9db3331b434ed9ddab10d50e280a9adf9d13e5233e2002b61b5"
dependencies = [
"futures-core",
"futures-sink",
@@ -4047,9 +4063,9 @@ dependencies = [
[[package]]
name = "opentelemetry-http"
version = "0.32.0"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5683015d09e2df236ef005b17f6f196f0d5f6313c4fa43a7b6a53b52776e4331"
checksum = "ee2c3625b8aa04209f7e01e513bc8044da9687fa38a9eacf59628ca5f3b87300"
dependencies = [
"async-trait",
"bytes",
@@ -4059,12 +4075,30 @@ dependencies = [
]
[[package]]
name = "opentelemetry-otlp"
version = "0.32.0"
name = "opentelemetry-instrumentation-tower"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9966929966d17620d7c316c643ba62631826e10021409357772d5eea84f62c35"
checksum = "1e7006f3b1853d315462a7237c81eec3d7adfa5b70975a02b19e92d045bc22d7"
dependencies = [
"axum",
"http",
"http-body",
"opentelemetry",
"opentelemetry-http",
"opentelemetry-semantic-conventions",
"pin-project-lite",
"tower-layer",
"tower-service",
]
[[package]]
name = "opentelemetry-otlp"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "699a67345e21962a231955b9059a157e428b219fa5df8efe11f08346fb23a344"
dependencies = [
"http",
"httpdate",
"opentelemetry",
"opentelemetry-http",
"opentelemetry-proto",
@@ -4078,10 +4112,23 @@ dependencies = [
]
[[package]]
name = "opentelemetry-proto"
version = "0.32.0"
name = "opentelemetry-prometheus"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56d658ba1faf63f7b9c492cfbe6e0ec365440a16132d3270c1065f7b33f1b638"
checksum = "274c2e3a2ad55524484500d5a78dffbfee23e4a1e4c3d3fcbd881b61b033e6df"
dependencies = [
"once_cell",
"opentelemetry",
"opentelemetry_sdk",
"prometheus",
"tracing",
]
[[package]]
name = "opentelemetry-proto"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25da1ac11a0aeccf38d7f77ee0348715adaf8340f65ad46c94a02c6b20e2f65d"
dependencies = [
"opentelemetry",
"opentelemetry_sdk",
@@ -4091,10 +4138,16 @@ dependencies = [
]
[[package]]
name = "opentelemetry_sdk"
version = "0.32.1"
name = "opentelemetry-semantic-conventions"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b59f80e1ac4d5ff7a2db8fb6c80badb7f0f3f858211fba08dd9aaec750894f9"
checksum = "d288b1e1bc3590052fbb8f0f635ef248dd9022cf1fbaeb6582b7ad6081a17b87"
[[package]]
name = "opentelemetry_sdk"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb39533d9d1c912123efd7d41d7e0c29d16917b60ce15b4c8d87cb1af7f67520"
dependencies = [
"futures-channel",
"futures-executor",
@@ -4507,6 +4560,20 @@ dependencies = [
"yansi",
]
[[package]]
name = "prometheus"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ca5326d8d0b950a9acd87e6a3f94745394f62e4dae1b1ee22b2bc0c394af43a"
dependencies = [
"cfg-if",
"fnv",
"lazy_static",
"memchr",
"parking_lot",
"thiserror 2.0.21",
]
[[package]]
name = "prost"
version = "0.14.4"
@@ -4739,17 +4806,6 @@ dependencies = [
"rand_core 0.10.1",
]
[[package]]
name = "recaptcha-verify"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "409bf11a93fe93093f3c0254aab67576524f1e0524692615b5b63091dbc88a79"
dependencies = [
"reqwest 0.12.28",
"serde",
"serde_json",
]
[[package]]
name = "redox_syscall"
version = "0.5.18"
@@ -4829,7 +4885,6 @@ dependencies = [
"pin-project-lite",
"quinn",
"rustls",
"rustls-native-certs",
"rustls-pki-types",
"serde",
"serde_json",
@@ -4879,6 +4934,7 @@ dependencies = [
"rustls-platform-verifier",
"serde",
"serde_json",
"serde_urlencoded",
"sync_wrapper",
"tokio",
"tokio-rustls",
@@ -4963,7 +5019,7 @@ dependencies = [
[[package]]
name = "ruma"
version = "0.17.0"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"assign",
"js_int",
@@ -4982,7 +5038,7 @@ dependencies = [
[[package]]
name = "ruma-appservice-api"
version = "0.17.0"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"http",
"js_int",
@@ -4995,7 +5051,7 @@ dependencies = [
[[package]]
name = "ruma-client-api"
version = "0.25.0"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"as_variant",
"assign",
@@ -5017,7 +5073,7 @@ dependencies = [
[[package]]
name = "ruma-common"
version = "0.20.0"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"as_variant",
"base64 0.23.1",
@@ -5050,7 +5106,7 @@ dependencies = [
[[package]]
name = "ruma-events"
version = "0.35.0"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"as_variant",
"indexmap 2.14.2",
@@ -5071,7 +5127,7 @@ dependencies = [
[[package]]
name = "ruma-federation-api"
version = "0.16.0"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"bytes",
"http",
@@ -5093,7 +5149,7 @@ dependencies = [
[[package]]
name = "ruma-identifiers-validation"
version = "0.12.1"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"js_int",
"thiserror 2.0.21",
@@ -5102,7 +5158,7 @@ dependencies = [
[[package]]
name = "ruma-macros"
version = "0.20.0"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"as_variant",
"cfg-if",
@@ -5118,7 +5174,7 @@ dependencies = [
[[package]]
name = "ruma-push-gateway-api"
version = "0.16.0"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"js_int",
"ruma-common",
@@ -5130,7 +5186,7 @@ dependencies = [
[[package]]
name = "ruma-signatures"
version = "0.22.0"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"base64 0.23.1",
"ed25519-dalek 3.0.0",
@@ -5147,7 +5203,7 @@ dependencies = [
[[package]]
name = "ruma-state-res"
version = "0.18.0"
source = "git+https://github.com/ruma/ruma.git?rev=e7384f01eacd454c593683de50491201e2160fd1#e7384f01eacd454c593683de50491201e2160fd1"
source = "git+https://github.com/ruma/ruma.git?rev=62659d64f712adf3cad126df6b8969f785414bd5#62659d64f712adf3cad126df6b8969f785414bd5"
dependencies = [
"js_int",
"ruma-common",
@@ -5234,9 +5290,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.23.45"
version = "0.23.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634"
checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
dependencies = [
"aws-lc-rs",
"log",
@@ -5598,7 +5654,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8050abb251097357e24aff63ba2c52a6309ecb7d23a5474023df960a02694d8"
dependencies = [
"annotate-snippets",
"base64 0.21.7",
"base64 0.23.1",
"encoding_rs_io",
"granit-parser",
"nohash-hasher",
@@ -5928,9 +5984,9 @@ dependencies = [
[[package]]
name = "smallvec"
version = "1.16.2"
version = "1.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e"
checksum = "ba467056f1b547ed52077911161fc86985becbc60e8e1857c8a144dab0def891"
dependencies = [
"serde",
]
@@ -6111,9 +6167,9 @@ dependencies = [
[[package]]
name = "termimad"
version = "0.35.5"
version = "0.35.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "092b11fb38404fa873f019f8e5f300fa5787f381b7a58b923546d94b5a9065fd"
checksum = "2374179aac8b77011a1aefe2f44d0c34eb680c9b4bd1c369a88991262c60c85a"
dependencies = [
"coolor",
"crokey",
@@ -6688,9 +6744,9 @@ dependencies = [
[[package]]
name = "tracing-opentelemetry"
version = "0.33.0"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adbc64cba7137545b8044cb1fe9814f7aacf3c6b5f9b45be8bb5db538befdb26"
checksum = "0a904802a1b902f43638b677ff2a650847e3b4404101b6c586d648e8c1e3e8fe"
dependencies = [
"js-sys",
"opentelemetry",
+60 -38
View File
@@ -163,6 +163,7 @@ features = [
"hickory-dns",
"http2",
"stream",
"form",
]
[workspace.dependencies.serde]
@@ -347,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 = "e7384f01eacd454c593683de50491201e2160fd1"
rev = "62659d64f712adf3cad126df6b8969f785414bd5"
features = [
"appservice-api-c",
"client-api",
@@ -378,11 +379,16 @@ features = [
"unstable-msc4380",
"unstable-msc4143",
"unstable-msc4293",
"unstable-msc4363",
"unstable-msc4406",
"unstable-msc4439",
"unstable-msc4354",
"unstable-msc4480",
"unstable-msc4466",
"unstable-msc4494",
"unstable-msc4484",
"unstable-msc4540",
"unstable-msc4560",
"unstable-extensible-events",
]
@@ -411,20 +417,36 @@ version = "4.0.1"
# optional opentelemetry, performance measurements, flamegraphs, etc for performance measurements and monitoring
[workspace.dependencies.opentelemetry]
version = "0.32.0"
version = "0.33.0"
[workspace.dependencies.opentelemetry-instrumentation-tower]
version = "0.19.0"
default-features = false
features = ["axum"]
[workspace.dependencies.opentelemetry-semantic-conventions]
version = "0.33.0"
features = ["semconv_experimental"]
[workspace.dependencies.tracing-flame]
version = "0.2.0"
[workspace.dependencies.tracing-opentelemetry]
version = "0.33.0"
version = "0.34.0"
[workspace.dependencies.opentelemetry_sdk]
version = "0.32.0"
version = "0.33.0"
features = ["rt-tokio"]
[workspace.dependencies.opentelemetry-prometheus]
version = "0.33.0"
[workspace.dependencies.prometheus]
version = "0.14.0"
default-features = false
[workspace.dependencies.opentelemetry-otlp]
version = "0.32.0"
version = "0.33.0"
features = ["http", "grpc-tonic", "trace", "logs", "metrics"]
@@ -804,37 +826,37 @@ codegen-units = 16
#
[workspace.lints.rust]
absolute-paths-not-starting-with-crate = "warn"
#box-pointers = "warn"
deprecated-in-future = "warn"
elided-lifetimes-in-paths = "warn"
explicit-outlives-requirements = "warn"
ffi-unwind-calls = "warn"
keyword-idents = "warn"
macro-use-extern-crate = "warn"
meta-variable-misuse = "warn"
missing-abi = "warn"
#missing-copy-implementations = "warn" # TODO
#missing-debug-implementations = "warn" # TODO
non-ascii-idents = "warn"
rust-2021-incompatible-closure-captures = "warn"
rust-2021-incompatible-or-patterns = "warn"
rust-2021-prefixes-incompatible-syntax = "warn"
rust-2021-prelude-collisions = "warn"
single-use-lifetimes = "warn"
trivial-casts = "warn"
trivial-numeric-casts = "warn"
unit-bindings = "warn"
#unnameable-types = "warn" # TODO
unreachable-pub = "warn"
unsafe-op-in-unsafe-fn = "warn"
unstable-features = "warn"
unused-extern-crates = "warn"
unused-import-braces = "warn"
unused-lifetimes = "warn"
unused-macro-rules = "warn"
unused-qualifications = "warn"
#unused-results = "warn" # TODO
absolute_paths_not_starting_with_crate = "warn"
#box_pointers = "warn"
deprecated_in_future = "warn"
elided_lifetimes_in_paths = "warn"
explicit_outlives_requirements = "warn"
ffi_unwind_calls = "warn"
keyword_idents = { level = "warn", priority = -1 }
macro_use_extern_crate = "warn"
meta_variable_misuse = "warn"
missing_abi = "warn"
#missing_copy_implementations = "warn" # TODO
#missing_debug_implementations = "warn" # TODO
non_ascii_idents = "warn"
rust_2021_incompatible_closure_captures = "warn"
rust_2021_incompatible_or_patterns = "warn"
rust_2021_prefixes_incompatible_syntax = "warn"
rust_2021_prelude_collisions = "warn"
single_use_lifetimes = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unit_bindings = "warn"
#unnameable_types = "warn" # TODO
unreachable_pub = "warn"
unsafe_op_in_unsafe_fn = "warn"
unstable_features = "warn"
unused_extern_crates = "warn"
unused_import_braces = "warn"
unused_lifetimes = "warn"
unused_macro_rules = "warn"
unused_qualifications = "warn"
#unused_results = "warn" # TODO
## some sadness
mismatched_lifetime_syntaxes = "allow" # TODO!
@@ -888,6 +910,7 @@ significant_drop_tightening = { level = "allow", priority = 1 } # TODO
pedantic = { level = "warn", priority = -1 }
## some sadness
assert_is_empty = { level = "allow", priority = 1 }
too_long_first_doc_paragraph = { level = "allow", priority = 1 }
doc_markdown = { level = "allow", priority = 1 }
enum_glob_use = { level = "allow", priority = 1 }
@@ -930,7 +953,6 @@ float_cmp_const = "warn"
fn_to_numeric_cast_any = "warn"
format_push_string = "warn"
get_unwrap = "warn"
impl_trait_in_params = "warn"
lossy_float_literal = "warn"
mem_forget = "warn"
missing_assert_message = "warn"
@@ -976,7 +998,7 @@ let_underscore_future = { level = "allow", priority = 1 }
literal_string_with_formatting_args = { level = "allow", priority = 1 }
# This lint is stupid, there's no point defining generics for simple trait params
impl-trait-in-params = { level = "allow", priority = 1 }
impl_trait_in_params = { level = "allow", priority = 1 }
needless_raw_string_hashes = "allow"
+66 -45
View File
@@ -1,49 +1,77 @@
# continuwuity
# Continuwuity
<!-- ANCHOR: catchphrase -->
## A community-driven [Matrix](https://matrix.org/) homeserver
## A community-driven [Matrix](https://matrix.org/) homeserver in Rust
[![Chat on Matrix][matrix-chat-badge]][matrix-chatroom]
[![Join the space][matrix-space-badge]][matrix-space]
[![Open Collective backers and sponsors][opencollective-contributors-badge]][opencollective]
[![Chat on Matrix](https://img.shields.io/matrix/continuwuity%3Acontinuwuity.org?server_fqdn=matrix.continuwuity.org&fetchMode=summary&logo=matrix)](https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) [![Join the space](https://img.shields.io/matrix/space%3Acontinuwuity.org?server_fqdn=matrix.continuwuity.org&fetchMode=summary&logo=matrix&label=space)](https://matrix.to/#/#space:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org)
<!-- ANCHOR_END: catchphrase -->
[matrix-chat-badge]: https://img.shields.io/matrix/continuwuity%3Acontinuwuity.org?server_fqdn=matrix.continuwuity.org&fetchMode=summary&logo=matrix
[matrix-chatroom]: https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org
[matrix-space-badge]: https://img.shields.io/matrix/space%3Acontinuwuity.org?server_fqdn=matrix.continuwuity.org&fetchMode=summary&logo=matrix&label=space
[matrix-space]: https://matrix.to/#/#space:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org
[opencollective-contributors-badge]: https://img.shields.io/opencollective/all/continuwuity
[opencollective]: https://opencollective.com/continuwuity
[continuwuity] is a Matrix homeserver written in Rust.
It's the official community continuation of the [conduwuit](https://github.com/girlbossceo/conduwuit) homeserver.
<!-- ANCHOR: body -->
[![forgejo.ellis.link][forge-badge]][forge-link]
[![Stars][forge-stars-badge]][forge-stars-link]
[![Issues][forge-issues-badge]][forge-issues-link]
[![Pull Requests][forge-pulls-badge]][forge-pulls-link]
[![forgejo.ellis.link](https://img.shields.io/badge/Ellis%20Git-main+packages-green?style=flat&logo=forgejo&labelColor=fff)](https://forgejo.ellis.link/continuwuation/continuwuity) [![Stars](https://forgejo.ellis.link/continuwuation/continuwuity/badges/stars.svg?style=flat)](https://forgejo.ellis.link/continuwuation/continuwuity/stars) [![Issues](https://forgejo.ellis.link/continuwuation/continuwuity/badges/issues/open.svg?style=flat)](https://forgejo.ellis.link/continuwuation/continuwuity/issues?state=open) [![Pull Requests](https://forgejo.ellis.link/continuwuation/continuwuity/badges/pulls/open.svg?style=flat)](https://forgejo.ellis.link/continuwuation/continuwuity/pulls?state=open)
[![GitHub][github-badge]][github-link] ![Stars][github-stars-badge] -
[![Codeberg][codeberg-badge]][codeberg-link] [![Stars][codeberg-stars-badge]][codeberg-stars-link] -
[![GitLab][gitlab-badge]][gitlab-link] [![Stars][gitlab-stars-badge]][gitlab-stars-link]
[![GitHub](https://img.shields.io/badge/GitHub-mirror-blue?style=flat&logo=github&labelColor=fff&logoColor=24292f)](https://github.com/continuwuity/continuwuity) [![Stars](https://img.shields.io/github/stars/continuwuity/continuwuity?style=flat)](https://github.com/continuwuity/continuwuity/stargazers)
<br>
<a href="https://opencollective.com/continuwuity" target="_blank">
<img src="https://opencollective.com/webpack/donate/button.png?color=blue" width="250"/>
</a>
[![GitLab](https://img.shields.io/badge/GitLab-mirror-blue?style=flat&logo=gitlab&labelColor=fff)](https://gitlab.com/continuwuity/continuwuity) [![Stars](https://img.shields.io/gitlab/stars/continuwuity/continuwuity?style=flat)](https://gitlab.com/continuwuity/continuwuity/-/starrers)
[forge-badge]: https://img.shields.io/badge/Ellis%20Git-main+packages-green?style=flat&logo=forgejo&labelColor=fff
[forge-link]: https://forgejo.ellis.link/continuwuation/continuwuity
[forge-stars-badge]: https://forgejo.ellis.link/continuwuation/continuwuity/badges/stars.svg?style=flat&labelColor=fff&color=8a5cd0
[forge-stars-link]: https://forgejo.ellis.link/continuwuation/continuwuity/stars
[forge-issues-badge]: https://forgejo.ellis.link/continuwuation/continuwuity/badges/issues/open.svg?style=flat&labelColor=fff&color=8a5cd0
[forge-issues-link]: https://forgejo.ellis.link/continuwuation/continuwuity/issues?state=open
[forge-pulls-badge]: https://forgejo.ellis.link/continuwuation/continuwuity/badges/pulls/open.svg?style=flat&labelColor=fff&color=8a5cd0
[forge-pulls-link]: https://forgejo.ellis.link/continuwuation/continuwuity/pulls?state=open
[![Codeberg](https://img.shields.io/badge/Codeberg-mirror-2185D0?style=flat&logo=codeberg&labelColor=fff)](https://codeberg.org/continuwuity/continuwuity) [![Stars](https://codeberg.org/continuwuity/continuwuity/badges/stars.svg?style=flat)](https://codeberg.org/continuwuity/continuwuity/stars)
[github-badge]: https://img.shields.io/badge/GitHub-mirror-blue?style=flat&logo=github&labelColor=fff&logoColor=24292f
[github-link]: https://github.com/continuwuity/continuwuity
[github-stars-badge]: https://img.shields.io/github/stars/continuwuity/continuwuity?style=flat
[gitlab-badge]:https://img.shields.io/badge/GitLab-mirror-blue?style=flat&logo=gitlab&labelColor=fff
[gitlab-link]: https://gitlab.com/continuwuity/continuwuity
[gitlab-stars-badge]: https://img.shields.io/gitlab/stars/continuwuity/continuwuity?style=flat
[gitlab-stars-link]: https://gitlab.com/continuwuity/continuwuity/-/starrers
[codeberg-badge]:https://img.shields.io/badge/Codeberg-mirror-2185D0?style=flat&logo=codeberg&labelColor=fff
[codeberg-link]: https://codeberg.org/continuwuity/continuwuity
[codeberg-stars-badge]: https://codeberg.org/continuwuity/continuwuity/badges/stars.svg?style=flat
[codeberg-stars-link]: https://codeberg.org/continuwuity/continuwuity/stars
### Why does this exist?
## Why does this exist?
The original conduwuit project has been archived and is no longer maintained. Rather than letting this Rust-based Matrix homeserver disappear, a group of community contributors have forked the project to continue its development, fix outstanding issues, and add new features.
We aim to provide a stable, well-maintained alternative for current conduwuit users and welcome newcomers seeking a lightweight, efficient Matrix homeserver.
### Who are we?
## Who are we?
We are a group of Matrix enthusiasts, developers and system administrators who have used conduwuit and believe in its potential. Our team includes both previous
contributors to the original project and new developers who want to help maintain and improve this important piece of Matrix infrastructure.
We operate as an open community project, welcoming contributions from anyone interested in improving continuwuity.
### What is Matrix?
## What is Matrix?
[Matrix](https://matrix.org) is an open, federated, and extensible network for
decentralized communication. Users from any Matrix homeserver can chat with users from all
other homeservers over federation. Matrix is designed to be extensible and built on top of.
You can even use bridges such as Matrix Appservices to communicate with users outside of Matrix, like a community on Discord.
### What are the project's goals?
## What are the project's goals?
Continuwuity aims to:
@@ -55,11 +83,11 @@ Continuwuity aims to:
- Create a sustainable development model for long-term maintenance
- Keep a lightweight, efficient codebase that can run on modest hardware
### Can I try it out?
## Can I try it out?
Check out the [documentation](https://continuwuity.org) for installation instructions.
Check out our [website](https://continuwuity.org) for installation instructions. Start with the [deployment section](https://continuwuity.org/deploying).
If you want to try it out as a user, we have some partnered homeservers you can use:
If you want to try it out as a user, we have some partnered homeservers you can join:
* You can head over to [https://federated.nexus](https://federated.nexus/) in your browser.
* Hit the `Apply to Join` button. Once your request has been accepted, you will receive an email with your username and password.
* Head over to [https://app.federated.nexus](https://app.federated.nexus/) and you can sign in there, or use any other matrix chat client you wish elsewhere.
@@ -67,31 +95,20 @@ If you want to try it out as a user, we have some partnered homeservers you can
* There's also [https://continuwuity.rocks/](https://continuwuity.rocks/). You can register a new account using Cinny via [this convenient link](https://app.cinny.in/register/continuwuity.rocks), or you can use Element or another matrix client *that supports registration*.
### What are we working on?
## Can I migrate my data from X?
We're working our way through all of the issues in the [Forgejo project](https://forgejo.ellis.link/continuwuation/continuwuity/issues).
- [Packaging & availability in more places](https://forgejo.ellis.link/continuwuation/continuwuity/issues/747)
- [Appservices bugs & features](https://forgejo.ellis.link/continuwuation/continuwuity/issues?q=&type=all&state=open&labels=178&milestone=0&assignee=0&poster=0)
- [Improving compatibility and spec compliance](https://forgejo.ellis.link/continuwuation/continuwuity/issues?labels=119)
- Automated testing
- [Admin API](https://forgejo.ellis.link/continuwuation/continuwuity/issues/748)
- [Policy-list controlled moderation](https://forgejo.ellis.link/continuwuation/continuwuity/issues/750)
### Can I migrate my data from x?
- Conduwuit: Yes
- Conduit: No, database is now incompatible
- Grapevine: No, database is now incompatible
- Dendrite: No
- Synapse: No
- **Conduwuit**: Yes
- **Conduit**: No, database is now incompatible
- **Grapevine**: No, database is now incompatible
- **Dendrite**: No
- **Synapse**: No
We haven't written up a guide on migrating from incompatible homeservers yet. Reach out to us if you need to do this!
<!-- ANCHOR_END: body -->
## Contribution
See our [Contributing page](CONTRIBUTING.md) for more details.
### Development flow
- Features / changes must developed in a separate branch
@@ -104,7 +121,6 @@ We haven't written up a guide on migrating from incompatible homeservers yet. Re
The main branch is always green!
### Policy on pulling from other forks
We welcome contributions from other forks of conduwuit, subject to our review process.
@@ -117,13 +133,18 @@ When incorporating code from other forks:
- We prioritize stability and compatibility when evaluating external contributions
- Features that align with our project goals will be given priority consideration
<!-- ANCHOR: footer -->
## Donate to us!
#### Contact
If you like what we're doing, consider donating to our [**Open Collective**][opencollective]!
You can also donate individually to each of the maintainers:
- Nex: https://timedout.uk/donate.html
- Jade: https://jade.ellis.link/sponsors
- Ginger: https://github.com/sponsors/gingershaped
## Contact
Join our [Matrix room](https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) and [space](https://matrix.to/#/#space:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) to chat with us about the project!
<!-- ANCHOR_END: footer -->
[continuwuity]: https://forgejo.ellis.link/continuwuation/continuwuity
+3
View File
@@ -0,0 +1,3 @@
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
@@ -0,0 +1 @@
Added support for [MSC4484](https://github.com/matrix-org/matrix-spec-proposals/pull/4484). Clients which use the built-in Matrix server administration APIs will need to ask for the appropriate scope when signing in with OAuth. Contributed by @ginger.
+1
View File
@@ -0,0 +1 @@
Profile banners are now treated as images when imported from OIDC claims, like avatars already were.
+1
View File
@@ -0,0 +1 @@
Added support for MSC4363 (OAuth step-up authentication). Contributed by @ginger.
+1
View File
@@ -0,0 +1 @@
For deployments using OIDC with `profile_key_import_mode` set to `on_login`, users' avatars will no longer be clobbered if they didn't change their avatar since their last login.
+1
View File
@@ -0,0 +1 @@
The userinfo endpoint is now accessible even if federation is disabled, allowing LiveKit to be used on servers with federation disabled without using the server name whitelist.
+1
View File
@@ -0,0 +1 @@
Add support for using custom DNS servers instead of using /etc/resolv.conf. Contributed by @s1lv3r.
+1
View File
@@ -0,0 +1 @@
Invitees are now added as room creators when creating a v12+ trusted private chat. Contributed by @ginger.
+1
View File
@@ -0,0 +1 @@
Continuwuity now supports configuring additional trusted audience values for deployments using OIDC with an IDP that sends them. Contributed by @ginger
+1
View File
@@ -0,0 +1 @@
Add the Authentication section to document available auth methods for Continuwuity. The "delegated authentication" guide has also been migrated to here. Contributed by @stratself.
+1
View File
@@ -0,0 +1 @@
Add a guide for push notifications, detailing how it works, push gateway specifics, troubleshooting common issues, and pointing to external guides for UnifiedPush backends. Contributed by @stratself
+1
View File
@@ -0,0 +1 @@
The deploying page now includes vital general information about installing Continuwuity: release tracks, update steps, and post-installation recommendations. Contributed by @stratself
+1
View File
@@ -0,0 +1 @@
Fixed push gateway URLs containing the configured notification path outside of their suffix. Contributed by @eleboucher.
+1
View File
@@ -0,0 +1 @@
Add some missing instructions on configuring Continuwuity on the RPM page. Users are encouraged to use the [generic deploying docs](https://continuwuity.org/deploying/generic) for the bulk of guidance anyhow. Contributed by @stratself
+1
View File
@@ -0,0 +1 @@
Better, more succinct [introduction page](https://continuwuity.org/introduction.html). Contributed by @stratself
+1
View File
@@ -0,0 +1 @@
"!admin users list" now hides deactivated users by default, but can display them with the optional "--show-deactivated" flag. "--hide-suspended" and "--hide-locked" have been added as well, which stop suspended and locked users from being displayed respectively. Contributed by @Clubs.
+1
View File
@@ -0,0 +1 @@
Added support for [MSC4494: Membership-based invite blocking](https://github.com/matrix-org/matrix-spec-proposals/pull/4494)
+1
View File
@@ -0,0 +1 @@
"!admin users change-email" now verifies a user exists before attempting to change their email. Contributed by @Clubs.
+1
View File
@@ -0,0 +1 @@
`!admin token issue` can no longer issue registration tokens when `allow_registration` is false. Contributed by @Clubs.
+1
View File
@@ -0,0 +1 @@
Fixed URL preview image MIME types and rejected failed downloads. Contributed by @eleboucher.
+1
View File
@@ -0,0 +1 @@
Appservices now receive typing indicators and read receipts. Contributed by @Jade
+1
View File
@@ -0,0 +1 @@
Correctly set RocksDB column options, including enabling block caches. Contributed by @Jade
@@ -0,0 +1 @@
Added opt-in OpenTelemetry metrics, exported over OTLP or scraped by Prometheus from `/_continuwuity/metrics`, and a Grafana dashboard. Contributed by @eleboucher.
+313 -17
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -10,7 +10,7 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean
# Match Rustc version as close as possible
# rustc -vV
ARG LLVM_VERSION=22
ARG LLVM_VERSION=23
# ENV RUSTUP_TOOLCHAIN=${RUST_VERSION}
# Install repo tools
@@ -50,7 +50,7 @@ EOF
# Developer tool versions
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
ENV BINSTALL_VERSION=1.23.0
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
+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.23.0
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
+8 -3
View File
@@ -2,7 +2,12 @@
{
"type": "file",
"name": "introduction",
"label": "Continuwuity"
"label": "Introduction"
},
{
"type": "dir",
"name": "deploying",
"label": "Deploying"
},
{
"type": "file",
@@ -11,8 +16,8 @@
},
{
"type": "dir",
"name": "deploying",
"label": "Deploying"
"name": "authentication",
"label": "Authentication"
},
{
"type": "dir",
+35
View File
@@ -0,0 +1,35 @@
# Authentication
This chapter describes various ways to authenticate to Continuwuity.
## Authentication flows
Continuwuity implements the following authentication flows:
- **OAuth login** (also known as **next-gen auth**): clients redirect the user to Continuwuity's own login and registration page to complete the authentication process.
- **Legacy login** (also known as the **User Interactive Authentication** framework): clients provide their own UI to log in to or register with the server directly.
Different sets of clients support different flows, but most clients are moving towards next-gen auth. One can set which login modes are allowed via the `compatibility_mode` variable of the `[global.oauth]` config file section.
:::important Configure your client well-known for OAuth logins
To ensure OAuth logins work, Continuwuity must know the base URL its Client-Server API is being served on:
```toml
[global.well_known]
client = "https://matrix.example.com"
```
Refer to the [delegation](./guides/delegation) documentation for more details.
:::
## Authentication sources
Continuwuity can read user authentication data from the following sources:
- **Internal authentication** - this is the default setup, where Continuwuity reads user authentication data from its local database. It allows for registration, email, and password reset self-service. See the [**internal authentication documentation**](./authentication/internal).
- **Delegated authentication** - in this mode, the server connects to an OpenID Connect identity provider for user authentication. This method allows for integrating with single sign-on services, but enabling it will disable legacy logins. See the [**delegated authentication documentation**](./authentication/oidc).
Only one authentication source can be used at a time.
+12
View File
@@ -0,0 +1,12 @@
[
{
"type": "file",
"name": "internal",
"label": "Internal authentication"
},
{
"type": "file",
"name": "oidc",
"label": "Delegated authentication (OIDC)"
}
]
+46
View File
@@ -0,0 +1,46 @@
# Internal authentication
Continuwuity comes with an internal database for user authentication, which it uses by default. This allows for self-servicing of account registration, linking emails, and password resets.
## Registration
Registration is disabled by default. To enable it, set `allow_registration = true` in your config file and use at least one of the registration methods below.
| Method | Description | Additional configuration needed |
| ------ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| 1 | Admin-issued tokens (recommended) | None. Use the [`!admin token issue`](../reference/admin/token#admin-token-issue) command |
| 2 | Static registration token | `registration_token` or `registration_token_file` |
| 3 | Token + email | Method 1 or 2 + `require_email_for_token_registration = true` in `[global.smtp]`. See [Email configuration](#email-configuration) |
| 4 | Email-only registration | `require_email_for_registration = true` in `[global.smtp]` section. See [Email configuration](#email-configuration) |
| 5 | reCAPTCHA-only registration | `recaptcha_site_key` and `recaptcha_private_site_key` |
| 6 | Email + reCAPTCHA registration | Methods 4 + 5 |
Admin-issued tokens are the recommended registration method. These tokens are well suited for private or invite-only servers, and they can be scoped with an expiry duration or given a usage limit. See the [`!admin token`](../reference/admin/token) commands for more details.
Other registration methods are meant for **untrusted, public registration**. Care must be taken when allowing these modes of operation.
## Email configuration
Continuwuity can be configured to send emails via an SMTP relay of your choice. These are used for verifying user email addresses and sending password reset links to them.
A user is associated with only **one** email address at a time.
All email options are in the `[global.smtp]` block of the [configuration file](../reference/config.mdx), and are toggled on when the block is uncommented. For example:
```toml
[global.smtp]
# Example URI for the user john@example.com on the `mail.example.net` mail server
connection_uri = "smtps://john%40example.com:password@mail.example.net:465"
sender = "John's Continuwuity server <john@example.com>"
```
A user's email address can also be modified by the [`!admin users change-email`](../reference/admin/users#admin-users-change-email) command. To view current user-email associations, use the `!admin users get-email` and `!admin users get-user-by-email` command.
Use [`!admin debug send-test-email`](../reference/admin/debug#admin-debug-send-test-email) to test that your email setup is working.
## Password resets
Password resets in Continuwuity can be made via:
- Self-service password resets. This requires a user's email to have been set up and verified.
- Using the [`!admin users reset-password`](../reference/admin/users#admin-users-reset-password) command.
+103
View File
@@ -0,0 +1,103 @@
# 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.
:::important Delegated authentication and legacy logins
When delegated authentication is configured, Continuwuity will disable its support for legacy logins. **Only clients that support OAuth** will be able to login.
:::
An account on the homeserver can only be associated with one OIDC subject claim - that is, one account on the identity provider - at a time. Linking an account will also prevent the user from deactivating it themselves.
## Instructions
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.
### Configuring the OIDC provider
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.
First, create a new application for Continuwuity in your identity provider.
```sh
# 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.yourdomain.com/_continuwuity/oidc/complete
```
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. Other identity providers may show this information in their web UI.
```sh
kanidm system oauth2 show-basic-secret c10y
d1qgx352kkuvs1j70b6w293d65x68jve1f7b27fyk90gjhpr
```
[kanidm]: https://kanidm.com
### Configuring Continuwuity
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://idm.example.com/oauth2/openid/c10y"
# 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
Finally, restart Continuwuity, and log out and back in again. Your client should prompt you to continue in your web browser and open a webpage with the Continuwuity logo that allows you to continue in your identity provider. Once you log in successfully there, you will be prompted to choose a user ID -- to link your existing account, enter its user ID, and then your old password.
Continuwuity offers several additional configuration options to tweak its integration with your identity provider. Review the `[global.oauth.oidc]` section towards the bottom of the [reference configuration](../reference/config) for a complete list of options and documentation.
## Advanced options
### Minting tokens for non-OIDC accounts
With OIDC delegation enabled, accounts without an OIDC mapping (such as bot accounts) can still be created via the admin commands, but will not be able to log in to the homeserver. To accommodate this, homeserver admins can use the [`!admin users issue-token`](../reference/admin/users#admin-users-issue-token) command to issue tokens for them. This command requires the account to have set a local password, which can be done with [`!admin users reset-password`](../reference/admin/users#admin-users-reset-password).
### Manually linking users to OIDC claims
To view associations between local users and their linked subject claim, issue the following command:
```
!admin query raw raw-iter openidsubject_localpart
("1d3fc994-3947-406d-b22c-0fc529baf235", "john")
("ba543628-e6a5-45d8-9bd2-6cc497400136", "jane")
```
These associations can be changed manually with the [`!admin oidc`](../reference/admin/oidc) commands, which are useful to debug some account linkage issues. For example, to link the user `jane` to a new Subject Identifier claim of `721c36a8-ce04-4474-8e97-b62655b07340`:
```
!admin oidc unlink ba543628-e6a5-45d8-9bd2-6cc497400136
Subject `ba543628-e6a5-45d8-9bd2-6cc497400136` unlinked.
!admin oidc link jane 721c36a8-ce04-4474-8e97-b62655b07340
Subject `721c36a8-ce04-4474-8e97-b62655b07340` linked to account @jane:example.com.
!admin query raw raw-iter openidsubject_localpart
("1d3fc994-3947-406d-b22c-0fc529baf235", "john")
("721c36a8-ce04-4474-8e97-b62655b07340", "jane")
```
### Decommissioning OIDC delegation
It is possible to revert to using the internal database for authentication. First, comment out the `[global.oauth.oidc]` section in your config file and restart the homeserver. Then, execute the [`!admin users reset-password --convert-to-local-account`](../reference/admin/users#admin-users-reset-password) for each user to assign them a local password and convert their linked accounts into local ones.
+4
View File
@@ -37,6 +37,10 @@ CONTINUWUITY_ANTISPAM__DRAUPNIR__BASE_URL="https://draupnir.example.com"
# Alternatively, you can pass a (quoted) struct to define an entire section
# This maps to the [global.well_known] section
CONTINUWUITY_WELL_KNOWN="{ client=https://example.com,server=example.com:443 }"
# Options that take a list are written as a (quoted) array
CONTINUWUITY_TRUSTED_SERVERS='["matrix.org"]'
CONTINUWUITY_PORT='[8008, 8448]'
```
### Alternative prefixes
+106 -1
View File
@@ -1,3 +1,108 @@
import { OverviewGroup } from '@rspress/core/theme';
# Deploying
This chapter describes various ways to deploy Continuwuity.
This chapter describes various ways to deploy Continuwuity. Start reading on this page for useful general information, and then proceed to one of the deployment methods.
:::tip Getting help
If you run into any problems while setting up Continuwuity, ask us in [`#continuwuity:continuwuity.org`][support-room] or [open an issue on Forgejo][forgejo-new-issue].
:::
[support-room]: https://matrix.to/#/%23continuwuity:continuwuity.org
[forgejo-new-issue]: https://forgejo.ellis.link/continuwuation/continuwuity/issues/new
## Release tracks
Continuwuity offers two release tracks to accommodate different needs: tracking the **main branch** of the [repository], and following the regular **release schedule**.
### Main branch
As Continuwuity is rapidly evolving software, we encourage deployments to follow the main branch to receive the latest fixes and features. Commits in main are stable and have been thoroughly tested by the maintainers before merging.
To be notified of updates to main, it is best to [**track the `/changelog.d` directory**][changelog-d] in the repository, which contains changelog snippets from merged pull requests. These may contain breaking changes. Then, proceed to update or build Continuwuity according to your deployment method.
[repository]: https://forgejo.ellis.link/continuwuation/continuwuity
[changelog-d]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/changelog.d
### Regular releases
Regular releases are periodic, versioned cutoffs from the main branch from time to time, and can be found on the [Releases] page. They are suitable in cases where updating more frequently is not viable, such as when using third-party packaging.
For regular releases, **always read the release notes before upgrading to a new version**, as they may contain breaking changes that affect your deployment.
[Releases]: https://forgejo.ellis.link/continuwuation/continuwuity/releases
## Installation
:::info Mind the name!
The binary for Continuwuity is called `conduwuit`, and the configuration file `conduwuit.toml`.
:::
To have Continuwuity working, you will generally need to:
1. Have a domain name pointing to your server's IP address - we will be using `example.com` in our guides.
2. Download or build Continuwuity from your preferred source.
3. Configure Continuwuity via the config file or environment variables. See the [Configuration](./configuration.mdx) page for more.
4. Employ a reverse proxy in front of Continuwuity - we will mainly provide examples for Caddy in our guides.
5. And finally, start the Continuwuity service.
Navigate to your preferred method of deploying Continuwuity as listed below, and follow the instructions there.
<OverviewGroup
group={{
items: [
{
"link": "deploying/generic",
"text": "Generic"
},
{
"link": "deploying/docker",
"text": "Docker"
},
{
"link": "deploying/debian",
"text": "Debian"
},
{
"link": "deploying/rpm",
"text": "RPM"
},
{
"link": "deploying/nixos",
"text": "NixOS"
},
{
"link": "deploying/arch-linux",
"text": "Arch Linux"
},
{
"link": "deploying/freebsd",
"text": "FreeBSD"
},
{
"link": "deploying/kubernetes",
"text": "Kubernetes"
},
{
"link": "deploying/nomad",
"text": "Nomad"
}
],
}}
/>
## Post-installation
After Continuwuity is up and running, consider the following:
- For smooth federation, set up a caching resolver according to the [**DNS tuning guide**](./guides/dns.mdx) (strongly recommended).
- To set up Audio/Video communication, see the [**Calls**](./calls.mdx) page.
- See the [**Authentication chapter**](./authentication.mdx) for various ways to access to your homeserver, such as logging in with an external OIDC provider.
- Consult the [**Maintenance**](./maintenance.mdx) page for guidance on maintaining your homeserver.
- If you want to set up an appservice, take a look at the [**Appservice Guide**](./appservices.mdx).
- See the [**Troubleshooting**](./troubleshooting.mdx) page for commonly diagnosed issues.
+5 -5
View File
@@ -29,6 +29,11 @@
"name": "arch-linux",
"label": "Arch Linux"
},
{
"type": "file",
"name": "freebsd",
"label": "FreeBSD"
},
{
"type": "file",
"name": "kubernetes",
@@ -38,10 +43,5 @@
"type": "file",
"name": "nomad",
"label": "Nomad"
},
{
"type": "file",
"name": "freebsd",
"label": "FreeBSD"
}
]
+8 -2
View File
@@ -1,5 +1,11 @@
# Continuwuity for Arch Linux
Continuwuity is available in the `archlinuxcn` repository and AUR with the same package name `continuwuity`, which includes the latest tagged version. The development version is available on AUR as `continuwuity-git`.
Continuwuity is available in the [`archlinuxcn`][archlinuxcn] repository and AUR with the same package name, [`continuwuity`][aur-continuwuity].
Simply install the `continuwuity` package. Configure the service in `/etc/conduwuit/conduwuit.toml`, then enable and start the continuwuity.service.
The development version is available on the AUR as [`continuwuity-git`][aur-continuwuity-git].
[archlinuxcn]: https://www.archlinuxcn.org/
[aur-continuwuity]: https://aur.archlinux.org/packages/continuwuity
[aur-continuwuity-git]: https://aur.archlinux.org/packages/continuwuity-git
Simply install the `continuwuity` package. Configure the service in `/etc/conduwuit/conduwuit.toml`, then enable and start the `continuwuity.service`.
+12 -11
View File
@@ -1,15 +1,17 @@
# Continuwuity for Docker
This page describes how to deploy Continuwuity via Docker containers. Make sure that you have installed `docker` on your system before continuing.
## Preparation
### Choose an image
The following OCI images are available for Continuwuity:
| Image | Notes |
| Image | Notes |
| ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| [https://forgejo.ellis.link/continuwuation/continuwuity:**latest**][latest] | Latest tagged release. (recommended) |
| [https://forgejo.ellis.link/continuwuation/continuwuity:**main**][main] | Latest `main` branch commit. Built with [CI][release-image] |
| [https://forgejo.ellis.link/continuwuation/continuwuity:**latest**][latest] | Latest tagged release. |
| [https://forgejo.ellis.link/continuwuation/continuwuity:**main**][main] | Latest `main` branch commit. Built with [CI][release-image] |
| [https://forgejo.ellis.link/continuwuation/continuwuity:**latest-maxperf**][latest-maxperf] | Latest tagged release, [performance optimised version](./generic.mdx#performance-optimised-builds). |
| [https://forgejo.ellis.link/continuwuation/continuwuity:**main-maxperf**][main-maxperf] | Latest `main` branch commit, [performance optimised version](./generic.mdx#performance-optimised-builds). |
@@ -210,7 +212,13 @@ docker compose pull
docker compose up -d
```
## Other deployment methods
## What's next?
Navigate to [Post-installation](../deploying.mdx#post-installation) for next steps.
---
## Appendix - Other deployment methods
### Docker - Quick Run
@@ -289,10 +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/
## Next steps
- For smooth federation, set up a caching resolver according to the [**DNS tuning guide**](../guides/dns.mdx) (recommended)
- To set up Audio/Video communication, see the [**Calls**](../calls.mdx) page.
- Consult the [Maintenance](../maintenance.mdx) page for guidance on maintaining your homeserver.
- If you want to set up an appservice, take a look at the [**Appservice Guide**](../appservices.mdx).
+3 -1
View File
@@ -4,4 +4,6 @@ Continuwuity doesn't provide official FreeBSD packages; however, a community-mai
Please see the installation instructions in that repository. Direct any questions to its issue tracker or to [@katie:kat5.dev](https://matrix.to/#/@katie:kat5.dev).
For general BSD support, please join our [Continuwuity BSD](https://matrix.to/#/%23bsd:continuwuity.org) community room.
For general BSD support, please join our [Continuwuity support room][support-room].
[support-room]: https://matrix.to/#/%23continuwuity:continuwuity.org
+4 -12
View File
@@ -1,12 +1,6 @@
# Generic deployment documentation
:::tip Getting help
If you run into any problems while setting up Continuwuity, ask us in
`#continuwuity:continuwuity.org` or [open an issue on
Forgejo][forgejo-new-issue].
:::
[forgejo-new-issue]: https://forgejo.ellis.link/continuwuation/continuwuity/issues/new
This page provides instructions on deploying Continuwuity on a generic Linux distro via a systemd service file. It also contains common routing instructions for reverse proxies.
## Installing Continuwuity
@@ -270,11 +264,9 @@ curl https://example.com/_matrix/client/versions
## What's next?
- For smooth federation, set up a caching resolver according to the [**DNS tuning guide**](../guides/dns.mdx) (recommended)
- To configure OIDC login with an identity provider, see the [**delegated authentication guide**](../guides/oidc.mdx).
- For Audio/Video call functionality see the [**Calls**](../calls.md) page.
- Consult the [Maintenance](../maintenance.mdx) page for guidance on maintaining your homeserver.
- If you want to set up an appservice, take a look at the [**Appservice Guide**](../appservices.md).
Navigate to [Post-installation](../deploying.mdx#post-installation) for next steps.
---
## Appendix
+1 -1
View File
@@ -79,7 +79,7 @@ spec:
value: "https://matrix.example.com"
- name: CONTINUWUITY_ALLOW_REGISTRATION
value: "false"
- name: RUST_LOG
- name: CONTINUWUITY_LOG
value: info
readinessProbe:
httpGet:
+36 -20
View File
@@ -1,4 +1,4 @@
import { Tab, Tabs} from '@rspress/core/theme';
import { Tab, Tabs } from '@rspress/core/theme';
# RPM Installation Guide
@@ -28,7 +28,7 @@ Available for openSUSE Tumbleweed, Slowroll, and [supported Leap versions](https
## Installation methods
### Stable releases (recommended)
### Stable releases
<Tabs groupId="distro">
<Tab label="Fedora">
@@ -49,6 +49,7 @@ openSUSE packages are available through an openSUSE Build Service project namesp
</Tabs>
### Nightly releases
Nightly versions are built from the latest commit on the `main` branch every 24 hours.
<Tabs groupId="distro">
@@ -68,14 +69,22 @@ In the meantime, you may follow the [generic deployment instructions](generic).
</Tab>
</Tabs>
## Service management and removal
## Configuration
**Systemd service commands**
Consult the [generic deployment instructions](./generic.mdx) for detailed steps. You will at least need to adjust the config file located at `/etc/conduwuit/conduwuit.toml` to suit your needs, and configure a [reverse proxy](./generic.mdx#setting-up-the-reverse-proxy).
## Service management
Now, you can start your Continuwuity service with:
```bash
# Start the service
sudo systemctl start conduwuit
```
Other useful commands include:
```bash
# Enable on boot
sudo systemctl enable conduwuit
@@ -84,27 +93,13 @@ sudo systemctl status conduwuit
# View logs
sudo journalctl -u conduwuit -f
```
**Uninstallation**
```bash
# Stop and disable the service
# Stopping the service
sudo systemctl stop conduwuit
sudo systemctl disable conduwuit
# Remove the package
sudo dnf remove continuwuity # replace `dnf` with `zypper` on openSUSE
```
## Troubleshooting
**GPG key errors**: Temporarily disable GPG checking
```bash
sudo dnf --nogpgcheck install continuwuity
```
**Repository metadata issues**: Clear and rebuild cache
```bash
@@ -122,7 +117,28 @@ dnf --showduplicates list continuwuity
sudo dnf install continuwuity-<version>
```
## Building locally
## What's next?
Navigate to [Post-installation](../deploying.mdx#post-installation) for next steps.
---
## Appendix
### Uninstallation
To uninstall Continuwuity:
```bash
# Stop and disable the service
sudo systemctl stop conduwuit
sudo systemctl disable conduwuit
# Remove the package
sudo dnf remove continuwuity # replace `dnf` with `zypper` on openSUSE
```
### Building locally
<Tabs groupId="distro">
<Tab label="Fedora">
+7 -2
View File
@@ -16,7 +16,12 @@
},
{
"type": "file",
"name": "oidc",
"label": "Delegated authentication"
"name": "metrics",
"label": "Metrics"
},
{
"type": "file",
"name": "push",
"label": "Push notifications"
}
]
+100
View File
@@ -0,0 +1,100 @@
# Metrics
Continuwuity records metrics with OpenTelemetry and can export them in two ways, both disabled by default:
- **Prometheus scraping** from `/_continuwuity/metrics`
- **OTLP push**, alongside traces
## Prometheus
```toml
[global]
allow_prometheus_metrics = true
prometheus_metrics_token = "a-long-random-secret"
```
The endpoint is served on the same listener as the rest of the server. Either set `prometheus_metrics_token` or block `/_continuwuity/metrics` at your reverse proxy so it is not publicly readable.
```yaml
scrape_configs:
- job_name: continuwuity
scheme: https
metrics_path: /_continuwuity/metrics
authorization:
credentials: a-long-random-secret
static_configs:
- targets: ["matrix.example.com"]
```
## OTLP
Requires the `otlp_telemetry` feature, enabled in default builds.
```toml
[global]
allow_otlp_metrics = true
```
Configure the exporter with standard OpenTelemetry environment variables:
```sh
OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf # or "grpc"
OTEL_METRIC_EXPORT_INTERVAL=15000
```
`service.instance.id` defaults to the server name, and `OTEL_RESOURCE_ATTRIBUTES` or `OTEL_SERVICE_NAME` override the defaults.
Prometheus can receive OTLP directly when started with `--web.enable-otlp-receiver`, using `http://prometheus:9090/api/v1/otlp` as the endpoint.
## Exported metrics
Names below are as they appear in Prometheus. OTLP uses the dotted OpenTelemetry names, such as `continuwuity.sender.events`. HTTP and process metrics follow the OpenTelemetry semantic conventions.
| Metric | Type | Labels | Description |
| --- | --- | --- | --- |
| `target_info` | gauge | `service_version`, `service_instance_id` | Running server version and name |
| `http_server_request_duration_seconds` | histogram | `http_request_method`, `http_route`, `http_response_status_code`, `network_protocol_name`, `network_protocol_version`, `url_scheme` | Handled HTTP requests, by route template |
| `http_server_active_requests` | gauge | `http_request_method`, `url_scheme` | Requests currently being handled |
| `http_server_request_body_size_bytes` | histogram | HTTP request duration labels | Request body sizes, when `Content-Length` is supplied |
| `http_server_response_body_size_bytes` | histogram | HTTP request duration labels | Response body sizes, when known |
| `continuwuity_federation_incoming_transaction_duration_seconds` | histogram | `outcome` | Processing time of incoming transactions |
| `continuwuity_federation_incoming_transactions_active` | gauge | | Incoming transactions currently being processed |
| `continuwuity_federation_incoming_pdus_total` | counter | `type`, `outcome` | Incoming PDUs by event type and outcome: `accepted`, `forbidden`, `invalid`, `error` or `unparsable` |
| `continuwuity_federation_incoming_pdu_duration_seconds` | histogram | `outcome` | Time to handle an incoming PDU |
| `continuwuity_federation_incoming_pdu_lag_seconds` | histogram | | Time between an accepted PDU's `origin_server_ts` and its arrival |
| `continuwuity_federation_incoming_edus_total` | counter | `type` | Incoming EDUs by type |
| `continuwuity_federation_incoming_edu_duration_seconds` | histogram | `type` | Time to handle an incoming EDU |
| `continuwuity_federation_outgoing_request_duration_seconds` | histogram | `outcome` | Outgoing federation requests |
| `continuwuity_federation_destinations` | gauge | `state` | Remote servers in retry `backoff` or with a `stale` destination cache entry |
| `continuwuity_sender_transaction_duration_seconds` | histogram | `destination`, `outcome` | Outgoing federation, appservice and push transactions |
| `continuwuity_sender_events_total` | counter | `destination`, `kind`, `outcome` | PDUs and EDUs sent in outgoing transactions |
| `continuwuity_sender_events_queued_total` | counter | `destination`, `kind` | PDUs and EDUs queued for sending |
| `continuwuity_sender_queue_depth` | gauge | | Messages waiting for the sender workers |
| `continuwuity_users` | gauge | `origin` | Known `local` users, including deactivated, and `remote` users |
| `continuwuity_invites_total` | counter | `direction`, `destination`, `outcome` | Invites sent by local users or received over federation |
| `continuwuity_media_write_size_bytes` | histogram | `origin` | Media files written, from local uploads or cached remote media |
| `continuwuity_media_read_size_bytes` | histogram | `origin` | Media files served |
| `continuwuity_media_files` | gauge | | Stored media files, including thumbnails |
| `continuwuity_antispam_checks_total` | counter | `check`, `outcome` | Antispam service checks; denials include the service being unreachable |
| `continuwuity_database_size_bytes` | gauge | | Total size of RocksDB SST files |
| `continuwuity_database_memory_bytes` | gauge | `name` | RocksDB memtable, table reader and row cache usage |
| `continuwuity_database_block_cache_bytes` | gauge | `column` | RocksDB block cache usage |
| `continuwuity_cache_entries` | gauge | `name` | Entries in the auth chain and state info caches |
| `continuwuity_jemalloc_memory_bytes` | gauge | `kind` | jemalloc statistics, only with the `jemalloc_stats` feature |
| `process_uptime_seconds` | gauge | | Time since the server started |
| `process_cpu_time_seconds_total` | counter | `cpu_mode` | CPU time used by the process |
| `process_memory_usage_bytes` | gauge | | Resident memory (Linux) |
| `process_memory_virtual_bytes` | gauge | | Virtual memory (Linux) |
| `process_unix_file_descriptor_count` | gauge | | Open file descriptors (Linux) |
| `continuwuity_tokio_workers` | gauge | | Tokio runtime worker threads |
| `continuwuity_tokio_alive_tasks` | gauge | | Alive tokio tasks |
| `continuwuity_tokio_global_queue_depth` | gauge | | Tasks in the tokio global queue |
| `continuwuity_tokio_worker_busy_time_seconds_total` | counter | | Time worker threads spent busy |
| `continuwuity_tokio_worker_parks_total` | counter | | Number of times worker threads parked |
User and media file counts are estimates taken from RocksDB (`rocksdb.estimate-num-keys`), so they may lag slightly or drift after deletions.
## Grafana dashboard
Import [grafana-dashboard.json](/guides/grafana-dashboard.json) under **Dashboards → New → Import**, or provision it from a file.
-56
View File
@@ -1,56 +0,0 @@
# Configuring delegated authentication
Continuwuity supports delegating user authentication to an external identity provider that implements the OpenID Connect specification, such as Authentik, kanidm, or Keycloak.
:::warning{title="OIDC versus OAuth, and supported clients"}
**OIDC** is not to be confused with **OAuth**. In the context of Matrix, OAuth is the protocol that Matrix clients use to authenticate with the _homeserver_. OIDC is the protocol that the _homeserver_ uses to communicate with the _identity provider_. Continuwuity supports OAuth by default, alongside the legacy **UIAA** authentication framework.
When OIDC is configured, Continuwuity will disable its support for legacy authentication. **Only clients that support OAuth**, such as the Element family of clients, will be able to log in when OIDC is configured. If your client of choice shows an error when you try to log in after configuring OIDC, it likely does not support OAuth. This is an issue with your client, not Continuwuity, and should be reported to your client's developers.
:::
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. This guide will use kanidm as an example, but the described steps are broadly applicable to other identity providers.
First, create a new application for Continuwuity in your identity provider.
```sh
# 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.yourdomain.com/_continuwuity/oidc/complete
```
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. Other identity providers may show this information in their web UI.
```sh
kanidm system oauth2 show-basic-secret c10y
d1qgx352kkuvs1j70b6w293d65x68jve1f7b27fyk90gjhpr
```
Configure Continuwuity with the client ID, client secret, and discovery URL. 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://idm.example.com/oauth2/openid/c10y"
# 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"
```
Finally, restart Continuwuity, and log out and back in again. Your client should prompt you to continue in your web browser and open a webpage with the Continuwuity logo that allows you to continue in your identity provider. Once you log in successfully, you will be prompted to choose a user ID -- to link your existing account, enter its user ID, and then your old password when prompted.
Continuwuity offers several additional configuration options to tweak its integration with your identity provider. Review the `[global.oauth.oidc]` section towards the bottom of the [reference configuration](../reference/config) for a complete list of options and documentation.
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

+215
View File
@@ -0,0 +1,215 @@
import { Tab, Tabs } from '@rspress/core/theme';
# Push notifications
Matrix clients receive notifications in the following ways:
- **In-band notifications**, which are shown when the client actively syncs with the server.
- **Push notifications**, which are posted to the client by the server through an external push service. This is typically used to send out-of-band notifications to mobile devices, and it is the focus of this page.
Generally, your mobile device is preconfigured for push notifications out of the box. The details below are for advanced use cases, such as using an alternative push backend (like UnifiedPush) or hosting your own.
## Overview
Continuwuity supports two push methods: the legacy **Matrix Push Gateway** and the new **Web Push** protocol. The former is currently supported by more clients, but the latter enables end-to-end-encrypted push notifications. They work as follows:
<Tabs groupId="push-ops">
<Tab label="Registration">
<img src="./push-registration.webp"
alt="Diagram showing the push registration flow, described in the text below."
style= {{"max-height":300,display:"flex",margin:"1rem auto","border-radius":"5px"}}
/>
1. A client app obtains a _push key_ from the push app that it hooks up to.
2. Then, it registers a _pusher_ with Continuwuity, bringing along the _push key_ and the following additional information:
- For the Push Gateway method: The _push gateway_ URL, which is [provided by the client](#unifiedpush-and-push-gateways).
- For the Web Push method: Some _encryption details_ generated by the client, so the server knows how to encrypt its push payloads.
</Tab>
<Tab label="Operation (Push Gateway)">
<img src="./push-operation-gateway.webp"
alt="Diagram showing the push operation with the Push Gateway method, described in the text below."
style={{"max-height":300,display:"flex",margin:"1rem auto","border-radius":"5px"}}
/>
1. Continuwuity pushes messages to the push gateway
2. The push gateway converts the messages to a suitable format and forwards them to the push provider server.
3. The push provider server passes them along to the push app.
4. The push app wakes the client, prompting it to fetch new messages from Continuwuity.
5. Finally, the client calculates against a set of _push rules_ to determine whether the fetched message(s) should be notified to users.
</Tab>
<Tab label="Operation (Web Push)">
<img src="./push-operation-webpush.webp"
alt="Diagram showing the push operation with the Web Push method, described in the text below."
style={{"max-height":300,display:"flex",margin:"1rem auto","border-radius":"5px"}}
/>
1. Continuwuity pushes encrypted messages to the push provider server.
2. The push provider server passes them along to the push app.
3. The push app wakes the client, which decrypts the payload, and if needed, fetches new messages from Continuwuity.
4. Finally, the client calculates against a set of _push rules_ to determine whether the pushed message(s) should be notified to users.
Note that this mechanism does not require a push gateway component.
[MSC4174]: https://github.com/matrix-org/matrix-spec-proposals/pull/4174
</Tab>
</Tabs>
_([excalidraw file of the diagrams](/guides/push-notifications.excalidraw))_
Therefore, Continuwuity's role within this system is to keep track of client-registered _pushers_ and send relevant payloads to them. To view and manage these pushers, use the [`!admin query pusher`](../reference/admin/query.md#admin-query-pusher) set of commands.
## UnifiedPush
[UnifiedPush][unifiedpush] is an open and self-hostable notifications system that is supported by many Matrix clients on Android and Linux. It is compatible with both the Web Push and Push Gateway mechanisms, and therefore requires no additional setup from the homeserver.
:::info Debugging UnifiedPush
To debug and test your UnifiedPush installation, use the [UP-Example] app for Android and the [UnifiedPush Troubleshooter] app for Linux distributions.
:::
[unifiedpush]: https://unifiedpush.org
[UP-Example]: https://codeberg.org/UnifiedPush/android-example
[UnifiedPush Troubleshooter]: https://flathub.org/en/apps/org.unifiedpush.Troubleshooter
### UnifiedPush and push gateways
The push gateway URL is usually pre-configured by the client app. However, some clients (such as Element X) implement UnifiedPush's [Gateway Discovery] mechanism, and attempt to detect a push gateway _on the same domain as the push provider_, before falling back to a hardcoded one.
Per the [spec][spec-push-gateway-api], these push gateways must be available on the `/_matrix/push/v1/notify` path of said domain. To test that a push gateway is accessible to the homeserver, make a request for it from the homeserver's IP:
```txt
curl https://push.example.com/_matrix/push/v1/notify
{"unifiedpush":{"gateway":"matrix"}}
```
[Gateway Discovery]: https://unifiedpush.org/users/gateway/#discovery--hosting
### ntfy
[ntfy][ntfy] is a widely supported UnifiedPush implementation, with an easy-to-install push app and plenty of publicly available instances. Its server includes an embedded Matrix push gateway and can be self-hosted.
Some tutorials on self-hosting ntfy can be found below:
- [Official ntfy self-hosting tutorial][official-ntfy-selfhosting]
- [Element's tutorial on Unified Push and ntfy][element-ntfy]
:::warning Avoid ntfy.sh
Avoid using the `https://ntfy.sh` push server, which is configured as the default in the ntfy app. This server is known to ratelimit requests aggressively.
:::
[ntfy]: https://ntfy.sh
[element-ntfy]: https://docs.element.io/latest/element-support/element-androidios-client-settings/using-unified-push-and-ntfy-for-push-notifications/
[official-ntfy-selfhosting]: https://docs.ntfy.sh/install/
### Other UnifiedPush distributors
To find a list of other UnifiedPush distributors, visit this [page][unifiedpush-distributors].
[unifiedpush-distributors]: https://unifiedpush.org/users/distributors/
Community tutorials for selfhosting some of these stacks are listed below. Unless stated otherwise, they are all tested against Element X Android and the push gateway mechanism, but they should work with Web Push as well.
- [Self-hosting Sunup for Matrix and UnifiedPush][kimiblock-selfhosting-sunup], by Kimiblock.
- Push gateway: [common-proxies]
- Push server: [autopush-rs]
- Push app: [Sunup][sunup]
- [Matrix notifications on Android, powered by XMPP][stratself-xmpp], by stratself.
- Push gateway: [common-proxies]
- Push server: [ejabberd's mod_unified_push]
- Push app: [Conversations] (and forks)
- [Element X push notifications via Conversations][alfredolin-xmpp], by Alfredo Lin.
- Push gateway: [common-proxies]
- Push server: [Prosody's mod_unified_push]
- Push app: [Conversations]
- Nextcloud's NextPush flow, which uses the following stack:
- Push server + push gateway: [uppush] (selfhosting tutorial included)
- Push app: [NextPush Android]
[kimiblock-selfhosting-sunup]: https://blog.kimiblock.top/2025/09/11/selfhosting-sunup/
[stratself-xmpp]: https://muoi.me/~stratself/articles/matrix-notifs-xmpp
[alfredolin-xmpp]: https://alfredolin.eu/blog/2026/07/24/element-x-push-notifications-via-conversations/
[common-proxies]: https://codeberg.org/UnifiedPush/common-proxies/
[sunup]: https://codeberg.org/Sunup/android
[autopush-rs]: https://github.com/mozilla-services/autopush-rs
[ejabberd's mod_unified_push]: https://github.com/processone/ejabberd-contrib/tree/master/mod_unified_push
[Prosody's mod_unified_push]: https://modules.prosody.im/mod_unified_push
[Conversations]: https://conversations.im
[uppush]: https://codeberg.org/NextPush/uppush
[NextPush Android]: https://codeberg.org/NextPush/nextpush-android
## Troubleshooting
Issues with push notifications can arise from the components of the system beyond your homeserver (for example, if the connection fails between the gateway and the push server). Make sure you check the logs of these components for debugging as well.
### Locally hosted push gateways / push providers
Outbound requests, including push notifications, follows the `ip_range_denylist` config option which refuses loopback and private-range destinations by default. This would break against push components that are self-hosted on a LAN address, and will result in these log entries at push creation time:
```txt
WARN conduwuit_service::pusher: Pusher URL is a forbidden remote address url=https://push.example.com/_matrix/push/v1/notify
```
To fix this, remove your push gateway or push server's address from `ip_range_denylist`, and restart Continuwuity to apply the changes.
### Push notifications not audible/not displaying
This is likely an issue with your account's _push rules_, which determines which events are shown to to the user as notifications. Check these push rules in the client's notifications settings and tweak accordingly. Continuwuity also provides an [`!admin users reset-push-rules`](../reference/admin/users#admin-users-reset-push-rules) command, which restores the rules to the default of notifying for every message.
Another reason may be that push background services are frequently being terminated by your operating system, which is a [well-known problem][dontkillmyapp] with many Android-based systems. To fix this, follow your operating system's instructions to exempt your push app from background restrictions.
Otherwise, if you find Continuwuity not sending push notifications according to the spec, feel free to discuss in our [support room][support-room] or open an issue.
[dontkillmyapp]: https://dontkillmyapp.com
[support-room]: https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org
### Various "Could not send request to pusher" log entries
If you find spurious log entries like this in your Continuwuity deployment:
```txt
WARN push{user_id="@user:example.com" pushkey="very-long-string-of-letters" events=1}:send_push_notice:send_notice:send_request: conduwuit_service::pusher: Could not send request to pusher https//push.example.com: error sending request for url (https://push.example.com/_matrix/push/v1/notify)
```
Then, your server is most likely sending push requests to too many invalid targets. This could be due to one of the following reasons:
#### Connection issues between the server and the push gateway
Verify that the connection to the push gateway is working correctly. This includes checking firewall rules, DNS, and that the push gateway is online. The section on [locally-hosted gateways/push providers](#locally-hosted-push-gateways--push-providers) may also apply to you.
#### Expired push endpoints
Active Matrix clients periodically renew their pushkeys as the old ones expire, and consequently register them against Continuwuity. As these pushers build up over time, the homeserver will keep sending more requests to an increasing number of "dead" push endpoints. This results in the errors seen above, and can heavily impact performance if not mitigated.
To work around this issue, the following actions can be taken:
- Delete all of a user's pushers with the [`!admin query pusher delete-all-user`](../reference/admin/query##admin-query-pusher-delete-all-user) command. This command is not typically disruptive, as active clients will re-register new pushers the next time they log on.
- Alternatively, delete one's own pushers from a client that supports doing so. Currently this only includes FluffyChat and Element Classic/SchildiChat Legacy.
While clients are supposed to automatically delete old pushers under their own control, this behaviour has been inconsistent. A further discussion of this issue can be found in [#2242][issue-2242].
[issue-2242]: https://forgejo.ellis.link/continuwuation/continuwuity/issues/2242
## Related Documentation
Specifications:
- [Matrix specification for the Push Gateway API][spec-push-gateway-api]
- [Matrix Client-Server API for push notifications][spec-c-s-push-notifications]
- [UnifiedPush specifications][unifiedpush-spec]
- [MSC4174: Web push][MSC4174]
- [Web Push RFCs][webpush-rfcs]
Other:
- [Matrix Push Rules and Notifications][clokep-push] - blogpost on push rules in Matrix
[webpush-rfcs]: https://datatracker.ietf.org/wg/webpush/documents/
[spec-push-gateway-api]: https://spec.matrix.org/latest/push-gateway-api/
[spec-c-s-push-notifications]: https://spec.matrix.org/latest/client-server-api/#push-notifications
[unifiedpush-spec]: https://unifiedpush.org/developers/spec/definitions/
[clokep-push]: https://patrick.cloke.us/posts/2023/05/08/matrix-push-rules-notifications/
-28
View File
@@ -32,33 +32,5 @@ beforeFeatures:
link: https://matrix.org/docs/matrix-concepts/elements-of-matrix/
buttonText: Read the Guide
features:
- title: 🚀 High Performance
details: Built with Rust for exceptional speed and efficiency. Designed to run smoothly even on modest hardware.
- title: 🔒 Secure by Default
details: Memory-safe Rust implementation with built-in security features to protect your communication.
- title: 🌐 Matrix Protocol
details: Fully compatible with the Matrix ecosystem. Connect with users across the federated network.
- title: 🛠️ Community Maintained
details: Actively developed by a dedicated community of Matrix enthusiasts and contributors.
- title: 📦 Easy to Deploy
details: Multiple deployment options including Docker, NixOS, and traditional package managers.
- title: 🔌 Appservice Support
details: Bridge to other platforms like Discord, Telegram, and more with Matrix appservices.
doc: false
---
## What is Continuwuity?
Continuwuity is a Matrix homeserver.
Matrix is an open chat network that lets anyone talk to anyone, no matter what server or address they use - sort of like email.
Continuwuity receives and keeps track of all your messages, and delivers what you send to the right people.
## Why is Continuwuity different?
Continuwuity is light and fast, using a fraction of the memory of other major homeservers. It's also simple to set up, and secure by default.
We are a community run project, filled with diverse and friendly people. Everything is built by people who care about the project volunteering their free time.
+86 -70
View File
@@ -1,98 +1,114 @@
<div align="center">
<img src="/assets/logo.svg" width="150"/>
# Continuwuity
## A community-driven [Matrix](https://matrix.org/) homeserver in Rust
</div>
[![Chat on Matrix](https://img.shields.io/matrix/continuwuity%3Acontinuwuity.org?server_fqdn=matrix.continuwuity.org&fetchMode=summary&logo=matrix)](https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) [![Join the space](https://img.shields.io/matrix/space%3Acontinuwuity.org?server_fqdn=matrix.continuwuity.org&fetchMode=summary&logo=matrix&label=space)](https://matrix.to/#/#space:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org)
## What is Continuwuity?
[continuwuity] is a Matrix homeserver written in Rust.
It's the official community continuation of the [conduwuit](https://github.com/girlbossceo/conduwuit) homeserver.
Continuwuity is a Matrix homeserver. [Matrix] is an open chat network that lets anyone talk to anyone, no matter what server or address they use, like email.
[![forgejo.ellis.link](https://img.shields.io/badge/Ellis%20Git-main+packages-green?style=flat&logo=forgejo&labelColor=fff)](https://forgejo.ellis.link/continuwuation/continuwuity) [![Stars](https://forgejo.ellis.link/continuwuation/continuwuity/badges/stars.svg?style=flat)](https://forgejo.ellis.link/continuwuation/continuwuity/stars) [![Issues](https://forgejo.ellis.link/continuwuation/continuwuity/badges/issues/open.svg?style=flat)](https://forgejo.ellis.link/continuwuation/continuwuity/issues?state=open) [![Pull Requests](https://forgejo.ellis.link/continuwuation/continuwuity/badges/pulls/open.svg?style=flat)](https://forgejo.ellis.link/continuwuation/continuwuity/pulls?state=open)
Continuwuity receives and keeps track of all your messages, and delivers what you send to the right people.
[![GitHub](https://img.shields.io/badge/GitHub-mirror-blue?style=flat&logo=github&labelColor=fff&logoColor=24292f)](https://github.com/continuwuity/continuwuity) [![Stars](https://img.shields.io/github/stars/continuwuity/continuwuity?style=flat)](https://github.com/continuwuity/continuwuity/stargazers)
[Matrix]: https://matrix.org
[![GitLab](https://img.shields.io/badge/GitLab-mirror-blue?style=flat&logo=gitlab&labelColor=fff)](https://gitlab.com/continuwuity/continuwuity) [![Stars](https://img.shields.io/gitlab/stars/continuwuity/continuwuity?style=flat)](https://gitlab.com/continuwuity/continuwuity/-/starrers)
## Why is Continuwuity different?
[![Codeberg](https://img.shields.io/badge/Codeberg-mirror-2185D0?style=flat&logo=codeberg&labelColor=fff)](https://codeberg.org/continuwuity/continuwuity) [![Stars](https://codeberg.org/continuwuity/continuwuity/badges/stars.svg?style=flat)](https://codeberg.org/continuwuity/continuwuity/stars)
Continuwuity is light and fast, using a fraction of the resources of other major homeservers. It's also simple to set up, and secure by default.
## Why does this exist?
We are a community-run project, made up of friendly and diverse people. Everything is built by people who care about the project volunteering their free time.
The original conduwuit project has been archived and is no longer maintained. Rather than letting this Rust-based Matrix homeserver disappear, a group of community contributors have forked the project to continue its development, fix outstanding issues, and add new features.
## Deploying Continuwuity
We aim to provide a stable, well-maintained alternative for current conduwuit users and welcome newcomers seeking a lightweight, efficient Matrix homeserver.
Head over to the [**Deploying chapter**](./deploying.mdx) to get started.
## Who are we?
## Try it out!
We are a group of Matrix enthusiasts, developers and system administrators who have used conduwuit and believe in its potential. Our team includes both previous
contributors to the original project and new developers who want to help maintain and improve this important piece of Matrix infrastructure.
If you want to try it out as a user, we have some [partnered homeservers](./community/ops-guidelines.mdx) you can use:
We operate as an open community project, welcoming contributions from anyone interested in improving continuwuity.
**`federated.nexus`** - A community resource hosting multiple FOSS (especially federated) services.
- Go to https://federated.nexus, click on "Apply to Join", and follow the prompts.
- Once your request has been accepted, you will receive an email with your username and password, which you can use to sign in from any Matrix client.
- Remember to change your password after logging in!
## What is Matrix?
**`continuwuity.rocks`** - the demo server, run by us.
- Sign up using any Matrix client, or via this [convenient link][cinny-register] for Cinny.
[Matrix](https://matrix.org) is an open, federated, and extensible network for
decentralized communication. Users from any Matrix homeserver can chat with users from all
other homeservers over federation. Matrix is designed to be extensible and built on top of.
You can even use bridges such as Matrix Appservices to communicate with users outside of Matrix, like a community on Discord.
[cinny-register]: https://app.cinny.in/register/continuwuity.rocks
## What are the project's goals?
## Donate to us {#donate}
continuwuity aims to:
If you like what we're doing, consider donating to our Open Collective via the button below!
- Maintain a stable, reliable Matrix homeserver implementation in Rust
- Improve compatibility and specification compliance with the Matrix protocol
- Fix bugs and performance issues from the original conduwuit
- Add missing features needed by homeserver administrators
- Provide comprehensive documentation and easy deployment options
- Create a sustainable development model for long-term maintenance
- Keep a lightweight, efficient codebase that can run on modest hardware
<div class="no-zoom" align="center">
<br/>
<a href="https://opencollective.com/continuwuity" target="_blank">
<img src="https://opencollective.com/webpack/donate/button@2x.png?color=blue" width="250"/>
</a>
</div>
## Can I try it out?
You can also donate individually to each of the maintainers
Check out the [documentation](https://continuwuity.org) for installation instructions.
- Nex: https://timedout.uk/donate.html
If you want to try it out as a user, we have some partnered homeservers you can use:
* You can head over to [https://federated.nexus](https://federated.nexus/) in your browser.
* Hit the `Apply to Join` button. Once your request has been accepted, you will receive an email with your username and password.
* Head over to [https://app.federated.nexus](https://app.federated.nexus/) and you can sign in there, or use any other matrix chat client you wish elsewhere.
* Your username for matrix will be in the form of `@username:federated.nexus`, however you can simply use the `username` part to log in. Your password is your password.
- Jade: https://jade.ellis.link/sponsors
* There's also [https://continuwuity.rocks/](https://continuwuity.rocks/). You can register a new account using Cinny via [this convenient link](https://app.cinny.in/register/continuwuity.rocks), or you can use Element or another matrix client *that supports registration*.
## What are we working on?
We're working our way through all of the issues in the [Forgejo project](https://forgejo.ellis.link/continuwuation/continuwuity/issues).
- [Packaging & availability in more places](https://forgejo.ellis.link/continuwuation/continuwuity/issues/747)
- [Appservices bugs & features](https://forgejo.ellis.link/continuwuation/continuwuity/issues?q=&type=all&state=open&labels=178&milestone=0&assignee=0&poster=0)
- [Improving compatibility and spec compliance](https://forgejo.ellis.link/continuwuation/continuwuity/issues?labels=119)
- Automated testing
- [Admin API](https://forgejo.ellis.link/continuwuation/continuwuity/issues/748)
- [Policy-list controlled moderation](https://forgejo.ellis.link/continuwuation/continuwuity/issues/750)
## Can I migrate my data from x?
- **Conduwuit**: Yes
- **Conduit**: No, database is now incompatible
- **Grapevine**: No, database is now incompatible
- **Dendrite**: No
- **Synapse**: No
We haven't written up a guide on migrating from incompatible homeservers yet. Reach out to us if you need to do this!
## How can I deploy my own?
- [Deployment options](deploying)
If you want to connect an appservice to continuwuity, take a look at the
[appservices documentation](appservices).
## How can I contribute?
See the [contributor's guide](development/contributing)
- Ginger: https://github.com/sponsors/gingershaped
## Contact
Join our [Matrix room](https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) and [space](https://matrix.to/#/#space:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org) to chat with us about the project!
[continuwuity]: https://forgejo.ellis.link/continuwuation/continuwuity
<div class="no-zoom" align="center">
[![Chat on Matrix][matrix-chat-badge]][matrix-chatroom]
[![Join the space][matrix-space-badge]][matrix-space]
</div>
[matrix-chat-badge]: https://img.shields.io/matrix/continuwuity%3Acontinuwuity.org?server_fqdn=matrix.continuwuity.org&fetchMode=summary&logo=matrix
[matrix-chatroom]: https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org
[matrix-space-badge]: https://img.shields.io/matrix/space%3Acontinuwuity.org?server_fqdn=matrix.continuwuity.org&fetchMode=summary&logo=matrix&label=space
[matrix-space]: https://matrix.to/#/#space:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org
Our source code and mirrors can be accessed through these buttons:
<div class="no-zoom" align="center">
[![forgejo.ellis.link][forge-badge]][forge-link]
[![Releases][forge-releases-badge]][forge-releases-link]
[![Stars][forge-stars-badge]][forge-stars-link]
[![Issues][forge-issues-badge]][forge-issues-link]
[![Pull Requests][forge-pulls-badge]][forge-pulls-link]
[![GitHub][github-badge]][github-link] ![Stars][github-stars-badge] -
[![Codeberg][codeberg-badge]][codeberg-link] [![Stars][codeberg-stars-badge]][codeberg-stars-link] -
[![GitLab][gitlab-badge]][gitlab-link] [![Stars][gitlab-stars-badge]][gitlab-stars-link]
</div>
[forge-badge]: https://img.shields.io/badge/Ellis%20Git-main+packages-green?style=flat&logo=forgejo&labelColor=fff
[forge-link]: https://forgejo.ellis.link/continuwuation/continuwuity
[forge-releases-badge]: https://forgejo.ellis.link/continuwuation/continuwuity/badges/release.svg?style=flat&label=Latest%20release&labelColor=fff&color=green
[forge-releases-link]: https://forgejo.ellis.link/continuwuation/continuwuity
[forge-stars-badge]: https://forgejo.ellis.link/continuwuation/continuwuity/badges/stars.svg?style=flat&labelColor=fff&color=8a5cd0
[forge-stars-link]: https://forgejo.ellis.link/continuwuation/continuwuity/stars
[forge-issues-badge]: https://forgejo.ellis.link/continuwuation/continuwuity/badges/issues/open.svg?style=flat&labelColor=fff&color=8a5cd0
[forge-issues-link]: https://forgejo.ellis.link/continuwuation/continuwuity/issues?state=open
[forge-pulls-badge]: https://forgejo.ellis.link/continuwuation/continuwuity/badges/pulls/open.svg?style=flat&labelColor=fff&color=8a5cd0
[forge-pulls-link]: https://forgejo.ellis.link/continuwuation/continuwuity/pulls?state=open
[github-badge]: https://img.shields.io/badge/GitHub-mirror-blue?style=flat&logo=github&labelColor=fff&logoColor=24292f
[github-link]: https://github.com/continuwuity/continuwuity
[github-stars-badge]: https://img.shields.io/github/stars/continuwuity/continuwuity?style=flat&logo=github
[gitlab-badge]:https://img.shields.io/badge/GitLab-mirror-blue?style=flat&logo=gitlab&labelColor=fff
[gitlab-link]: https://gitlab.com/continuwuity/continuwuity
[gitlab-stars-badge]: https://img.shields.io/gitlab/stars/continuwuity/continuwuity?style=flat
[gitlab-stars-link]: https://gitlab.com/continuwuity/continuwuity/-/starrers
[codeberg-badge]:https://img.shields.io/badge/Codeberg-mirror-2185D0?style=flat&logo=codeberg&labelColor=fff
[codeberg-link]: https://codeberg.org/continuwuity/continuwuity
[codeberg-stars-badge]: https://codeberg.org/continuwuity/continuwuity/badges/stars.svg?style=flat
[codeberg-stars-link]: https://codeberg.org/continuwuity/continuwuity/stars
@@ -6,10 +6,10 @@
"message": "Welcome to Continuwuity! Important announcements about the project will appear here."
},
{
"id": 20,
"id": 21,
"mention_room": true,
"date": "2026-09-16",
"message": "[Continuwuity 26.9.0](https://forgejo.ellis.link/continuwuation/continuwuity/releases/tag/v26.9.0) has just been released - this update features a bunch of bug fixes, and some bandwidth saving improvements for sliding sync.\n\nAny questions? Ask in our [support room](https://matrix.to/#/#continuwuity:continuwuity.org)!"
"date": "2026-09-29",
"message": "[Continuwuity 26.9.1](https://forgejo.ellis.link/continuwuation/continuwuity/releases/tag/v26.9.1) has just been released - this update features a fix for a **critical** security issue, please read the release notes for more information."
}
]
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -12,7 +12,7 @@
target:
target.fromToolchainName {
name = (lib.importTOML "${inputs.self}/rust-toolchain.toml").toolchain.channel;
sha256 = "sha256-p8h3Sl/YRByZfZTAKXdsvF6xEenXKrXSVvpphmZENH4=";
sha256 = "sha256-+xUr6Al1wZSqX8aEsq7DpuFOK4Ve/i+qTl+K5uWQ9GM=";
};
in
{
+90 -90
View File
@@ -125,13 +125,13 @@
}
},
"node_modules/@rsbuild/core": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/@rsbuild/core/-/core-2.2.5.tgz",
"integrity": "sha512-nf34ri1iZduYhHUr5Vc79L7Eml+IlN0nFIaF/g3OW4WR/gShxuf5wVXS69/H8FTHJYN4SdYlNcefSZQluEMKgA==",
"version": "2.2.11",
"resolved": "https://registry.npmjs.org/@rsbuild/core/-/core-2.2.11.tgz",
"integrity": "sha512-avPW0j6RaEbtV2mfl0AzTAJEimPX4Xj0pCcZyxNCrE9vkS91HmweM5V7XQj3kI5iTYfHRp9Y6To8RRHYLEvG7A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rspack/core": "~2.2.3",
"@rspack/core": "~2.2.8",
"@swc/helpers": "^0.5.23"
},
"bin": {
@@ -169,32 +169,32 @@
}
},
"node_modules/@rspack/binding": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-2.2.3.tgz",
"integrity": "sha512-532+T5N6yIdukChiL85H4NFN2vn9oi8wlLa1ByPNtpNYriE9s24fUhn0RiK7w/xACqnNpYmXCqLYCvjOzyCy+w==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-2.2.8.tgz",
"integrity": "sha512-c9flkSua3khHnOKBCRk8BkHGOwU9YB7niv+5JfQXiLZIvJmgKsZ7PD8QrFklMhsJT3oVAc6c9GN7/wy1YkACjA==",
"dev": true,
"license": "MIT",
"optionalDependencies": {
"@rspack/binding-darwin-arm64": "2.2.3",
"@rspack/binding-darwin-x64": "2.2.3",
"@rspack/binding-linux-arm64-gnu": "2.2.3",
"@rspack/binding-linux-arm64-musl": "2.2.3",
"@rspack/binding-linux-ppc64-gnu": "2.2.3",
"@rspack/binding-linux-riscv64-gnu": "2.2.3",
"@rspack/binding-linux-riscv64-musl": "2.2.3",
"@rspack/binding-linux-s390x-gnu": "2.2.3",
"@rspack/binding-linux-x64-gnu": "2.2.3",
"@rspack/binding-linux-x64-musl": "2.2.3",
"@rspack/binding-wasm32-wasi": "2.2.3",
"@rspack/binding-win32-arm64-msvc": "2.2.3",
"@rspack/binding-win32-ia32-msvc": "2.2.3",
"@rspack/binding-win32-x64-msvc": "2.2.3"
"@rspack/binding-darwin-arm64": "2.2.8",
"@rspack/binding-darwin-x64": "2.2.8",
"@rspack/binding-linux-arm64-gnu": "2.2.8",
"@rspack/binding-linux-arm64-musl": "2.2.8",
"@rspack/binding-linux-ppc64-gnu": "2.2.8",
"@rspack/binding-linux-riscv64-gnu": "2.2.8",
"@rspack/binding-linux-riscv64-musl": "2.2.8",
"@rspack/binding-linux-s390x-gnu": "2.2.8",
"@rspack/binding-linux-x64-gnu": "2.2.8",
"@rspack/binding-linux-x64-musl": "2.2.8",
"@rspack/binding-wasm32-wasi": "2.2.8",
"@rspack/binding-win32-arm64-msvc": "2.2.8",
"@rspack/binding-win32-ia32-msvc": "2.2.8",
"@rspack/binding-win32-x64-msvc": "2.2.8"
}
},
"node_modules/@rspack/binding-darwin-arm64": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-2.2.3.tgz",
"integrity": "sha512-MGLx4lMTY6XEtJi55S+fk83+683GeUDuoqzjixbq6ehHdr/l6nGiHhgvMtV5DYt9sCytUDzyrCkcJ0AWqJxnTA==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-2.2.8.tgz",
"integrity": "sha512-d6GuY/k7kJk7SOXmruIz0m+2fIXaLv2SnBHEYsbvBzE7ZO6QXq7fSABWFWNnSnNu+brYHA5Dr/skV81bXgTTCw==",
"cpu": [
"arm64"
],
@@ -206,9 +206,9 @@
]
},
"node_modules/@rspack/binding-darwin-x64": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-2.2.3.tgz",
"integrity": "sha512-5B/c1YTYEz9m7TyqtGQgTmXMr9PoPewyqsyHB4N0AB7nxDhtgmki0GniP2Lqtx3LJzOvQMjwet+I2lmWxvxwCg==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-2.2.8.tgz",
"integrity": "sha512-xCVou/jJASjEAjwy1T3hPJcJqA5QZASJfUwHqEk+nA0v44MagwH8tM8lsOvRfhzR7N2+YFac1rfZOUT8uM3awg==",
"cpu": [
"x64"
],
@@ -220,9 +220,9 @@
]
},
"node_modules/@rspack/binding-linux-arm64-gnu": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-2.2.3.tgz",
"integrity": "sha512-sU+jPGD2xz3BxFvsdBQVGce538YHqrSKMB4ZSfKhj6RSKjeGzpJ1BVl8+IndiQsfTgaUxi7N+r5cs/ezGy1TVQ==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-2.2.8.tgz",
"integrity": "sha512-Zy/ss6YAQTjOWKDkcWrbKtu+pySltqT22wn68nlrWKygPWLNmMdU5anlsnwRTIuQ3MF0YJRS42ARauVtlqvRQw==",
"cpu": [
"arm64"
],
@@ -237,9 +237,9 @@
]
},
"node_modules/@rspack/binding-linux-arm64-musl": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-2.2.3.tgz",
"integrity": "sha512-EQuADbqWbVgNAh5ep/u/B7Z/8UUkZjMLzHAOKZJklBpe4Y8mnhFNjieX0xc9NadR+drj9tqmEANxzTOkFtVPyQ==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-2.2.8.tgz",
"integrity": "sha512-lxgp5O8PhL3St9p82llHoNoeWzp9jltW5S9F00p00XPJZHUIuxbwfLSzn/6Wg86USEmafLoBkyD9CM8rBd3SNQ==",
"cpu": [
"arm64"
],
@@ -254,9 +254,9 @@
]
},
"node_modules/@rspack/binding-linux-ppc64-gnu": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-2.2.3.tgz",
"integrity": "sha512-kyXROzr519a5juBII9ysuc5ZD2apEZ0DJqL5PPCAOVHjzMfThEIBwnX3gicNCmp+kY0CCIOl2LagwbtFaOzoiA==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-2.2.8.tgz",
"integrity": "sha512-MY+YqpT02tcDCMgHy+IewQsaz7ql4mbJaAqqMlTIqvQwAUl9dXEP7BL352OgCxm9VRebTldE5lK99A3wVd3zqA==",
"cpu": [
"ppc64"
],
@@ -271,9 +271,9 @@
]
},
"node_modules/@rspack/binding-linux-riscv64-gnu": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-2.2.3.tgz",
"integrity": "sha512-F3x6Nu0RUSoLtiaMse3hYQ3Nf5A2de6vTWWDXj14Ll6BpGWXGn+U/eXT/nB199fFnDEYf+CJEa7d6fzcYdwdjA==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-2.2.8.tgz",
"integrity": "sha512-wmN9OigSGNGCKY+AOYaWI8LJcIi8qvs5KjueBueCKOnTV6MPIEujA75QZH1pehTTYKvdGv7r2EtUXUmWpn7/SQ==",
"cpu": [
"riscv64"
],
@@ -288,9 +288,9 @@
]
},
"node_modules/@rspack/binding-linux-riscv64-musl": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-2.2.3.tgz",
"integrity": "sha512-O3HK7OnPvoBxZu4MX2j+t3gk4qiUsFYqj/29L3WgU1iQsdUSIN6PInW2JvbiLqyuzt09VltIEXTKayY8EysCpQ==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-2.2.8.tgz",
"integrity": "sha512-ZcQMYR10hLh581zs9MFnFFn0F7wyt5fkDffyukeMHJEoPJrbkfl6cQtsUdpQnZ+mYGYS5KydD1DT9/eMH65jjw==",
"cpu": [
"riscv64"
],
@@ -305,9 +305,9 @@
]
},
"node_modules/@rspack/binding-linux-s390x-gnu": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-2.2.3.tgz",
"integrity": "sha512-SIxfGdwBdAjwJ8pDlPTb8MPIZIv/i2lKHn4/ywuDpFOxlUA4Bo/OKqQOenHx2MFD2mN8jigBZQTF0KVe5YP1uQ==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-2.2.8.tgz",
"integrity": "sha512-ahBiE+Ir1FMYvStYicihhSJlS2YRagxtry0jWH8zW287o7C0eiHJ+pteJHHC15T5RJqm0j6w5TuwYe+F9AYxxg==",
"cpu": [
"s390x"
],
@@ -322,9 +322,9 @@
]
},
"node_modules/@rspack/binding-linux-x64-gnu": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-2.2.3.tgz",
"integrity": "sha512-IzQGcw09WYn/IzwB1SQpg7FQ211MBr+fJB2/WoRrPS6CNdtlkDHZaI8z2oq+2Oc5Su21jgX75VlWFajirUx5Dw==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-2.2.8.tgz",
"integrity": "sha512-dncEI515NoPXh3zzWk06Rb3mhSV76myiFKqXiJ8K4fVAe5x/RlweMhvPhHhm7RnIMeBld7BeStzOqj38XFsWGA==",
"cpu": [
"x64"
],
@@ -339,9 +339,9 @@
]
},
"node_modules/@rspack/binding-linux-x64-musl": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-2.2.3.tgz",
"integrity": "sha512-9OKSx2ickrR+PFal94XE6Hkj49AQ2HI3KuR9XeRkKOwSxjwrskV/Pn1wc2itDOHkm/QHP7k+MttsYb4FGuNIqw==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-2.2.8.tgz",
"integrity": "sha512-pfFyU03PjD0GaQG8zOQOHwq51rrJZetXjTGpMmz7iA1hq/f9lChJsDWrC8/7VXeQLwBofLZlOODqe8OM8OBzgA==",
"cpu": [
"x64"
],
@@ -356,9 +356,9 @@
]
},
"node_modules/@rspack/binding-wasm32-wasi": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-wasm32-wasi/-/binding-wasm32-wasi-2.2.3.tgz",
"integrity": "sha512-gici3jWJi0GDy9kbYh57LoA57H8A2EAD9cV2jFKp1YoJ2aX2U9lANh4L+xoKPTvVQYpRvleoA5jkAvyfeLQ5bw==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-wasm32-wasi/-/binding-wasm32-wasi-2.2.8.tgz",
"integrity": "sha512-3mOJuZTrF56jOh/GD9chLMJKbzPZ6Ty2OIML7+lLz0Yk2XS/xWRfLn85Dmnkb/O6UF65x7+p8VPAIZlBtLTclw==",
"cpu": [
"wasm32"
],
@@ -372,9 +372,9 @@
}
},
"node_modules/@rspack/binding-win32-arm64-msvc": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-2.2.3.tgz",
"integrity": "sha512-1MG66kcuqAGFs9ewiBc+/NJSTQr1jHrkZ2nCVMyhukl1o8embmFZa3BCibYgBYs5P7FRc6Sa+CDXcrfDZOLInQ==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-2.2.8.tgz",
"integrity": "sha512-Cu/RMZT/16s+67xhl6X1pswetL3GLSQl+LnugKRh08Ul21A/tR7vxC4g4aih4u9k5SXCAngxFUt8zAjKnHIBqA==",
"cpu": [
"arm64"
],
@@ -386,9 +386,9 @@
]
},
"node_modules/@rspack/binding-win32-ia32-msvc": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-2.2.3.tgz",
"integrity": "sha512-CAigxxh9DYJmEwH9f6FRkSsmt0GhKVqKaFRVFFrF9WDL7gXP3hyE/h/cCeMdmlTzRt8Mht87AvnDX7PG3neMrA==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-2.2.8.tgz",
"integrity": "sha512-H/erd6di8OapZhhM0raA/7XduPn9jusfLMeO1XF+AmF9WF3HzHgMjha1j+KwtPgQnaH69w6AhY+G2472VIwQmw==",
"cpu": [
"ia32"
],
@@ -400,9 +400,9 @@
]
},
"node_modules/@rspack/binding-win32-x64-msvc": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-2.2.3.tgz",
"integrity": "sha512-qa5Wc34a+Uux5foZ1Z+9fPQceVRbgTunaIulHezVF/ZxvqKO4DkAC7tFl53shB0YRVBAPg8R78MGd8cByfoxLQ==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-2.2.8.tgz",
"integrity": "sha512-BziHSUlIQM0MliCqdcHuBXSkQGtPoHQTXJce7fsgnTAzQFgPeog92qTNezYI4IrQ7pQouyiVJ2HPieUbVPRKQQ==",
"cpu": [
"x64"
],
@@ -414,13 +414,13 @@
]
},
"node_modules/@rspack/core": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/core/-/core-2.2.3.tgz",
"integrity": "sha512-VHejw+PDd5B5v6VduFyjLSTIFaHBMNGPMKw+Y0zjkMqjYhDD1hjLOBC5frRKjTWcfYdk+Q73auWPp9k/H9PfIQ==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@rspack/core/-/core-2.2.8.tgz",
"integrity": "sha512-JugsVrnbMGNYzMH++7gR9enygpP/lAo9PbVRq3XmJg0ryIvCpST0XJjBcccaSjYaaPamsjrddihmgVLMFp+yXw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rspack/binding": "2.2.3"
"@rspack/binding": "2.2.8"
},
"engines": {
"node": "^20.19.0 || >=22.12.0"
@@ -455,17 +455,17 @@
}
},
"node_modules/@rspress/core": {
"version": "2.0.22",
"resolved": "https://registry.npmjs.org/@rspress/core/-/core-2.0.22.tgz",
"integrity": "sha512-mS/+xJYxVSR72GAjTz8GIGcJwwb2NSbbduq1fQOSv7k73EJ2aa0Q/o14nnnI4DRmRSEmK0t81vkVGcKHWQzPcA==",
"version": "2.0.23",
"resolved": "https://registry.npmjs.org/@rspress/core/-/core-2.0.23.tgz",
"integrity": "sha512-two8zdTxN9iJBSyiFXwRLLDXz/yLY2+4ycz8wHjJYzeeuFi/EN2eqsKw1nSpY7sxEGIssY1X74c6017JJUBTyA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@mdx-js/mdx": "^3.1.1",
"@mdx-js/react": "^3.1.1",
"@rsbuild/core": "^2.2.5",
"@rsbuild/core": "^2.2.10",
"@rsbuild/plugin-react": "~2.1.0",
"@rspress/shared": "2.0.22",
"@rspress/shared": "2.0.23",
"@shikijs/rehype": "^4.2.0",
"@types/mdast": "^4.0.4",
"@types/react": "^19.2.18",
@@ -484,7 +484,7 @@
"react-dom": "^19.2.8",
"react-lazy-with-preload": "^2.2.1",
"react-render-to-markdown": "19.1.0",
"react-router-dom": "^7.18.3",
"react-router-dom": "^7.18.4",
"rehype-external-links": "^3.0.0",
"rehype-raw": "^7.0.0",
"remark-cjk-friendly": "^2.3.1",
@@ -508,9 +508,9 @@
}
},
"node_modules/@rspress/plugin-client-redirects": {
"version": "2.0.22",
"resolved": "https://registry.npmjs.org/@rspress/plugin-client-redirects/-/plugin-client-redirects-2.0.22.tgz",
"integrity": "sha512-pyOLIfxji1xbh//H0egdmhXVdO5hfp9dLXCTnZKcet9K3FJpre21/syuhRbRwWviMpcKtE73PZVcSaNVTYQYZw==",
"version": "2.0.23",
"resolved": "https://registry.npmjs.org/@rspress/plugin-client-redirects/-/plugin-client-redirects-2.0.23.tgz",
"integrity": "sha512-TdpvO3TREv6s2mE32ztFvG3P232qUwjyQCKKsb9g0XT0q7rzcStZFRE7XT/L8i0XTzH/mfli1tVl4guTea/J3Q==",
"dev": true,
"license": "MIT",
"engines": {
@@ -521,9 +521,9 @@
}
},
"node_modules/@rspress/plugin-sitemap": {
"version": "2.0.22",
"resolved": "https://registry.npmjs.org/@rspress/plugin-sitemap/-/plugin-sitemap-2.0.22.tgz",
"integrity": "sha512-2SNLW8Oh4osCyqnzea1WDVA9469Luwu0piNuh5HNjlzcgjguzynA3447WRFpqBL1Z/B7H5IB5SMcwYaMsgFhvQ==",
"version": "2.0.23",
"resolved": "https://registry.npmjs.org/@rspress/plugin-sitemap/-/plugin-sitemap-2.0.23.tgz",
"integrity": "sha512-r37TvCP2wuQX8JbA7hHti8JXhVx4HiaJPn702NgFhGyolGJYIUTRQCO2/ixiP1FZJuxZ4c0yb4ZyNeDa9ZPMlw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -534,13 +534,13 @@
}
},
"node_modules/@rspress/shared": {
"version": "2.0.22",
"resolved": "https://registry.npmjs.org/@rspress/shared/-/shared-2.0.22.tgz",
"integrity": "sha512-1UXwG6gAhWBw5vClv3wb2Oy8hPXYNgQwQ5zWXEG8auY5ZcMywvHCBi6pFJtYNOgXe5327lNgiOG0S1R8l0OLeg==",
"version": "2.0.23",
"resolved": "https://registry.npmjs.org/@rspress/shared/-/shared-2.0.23.tgz",
"integrity": "sha512-kE2GXRCQ7GAl2wll1JBWRHEkZICKcWv3V86m8TkjiWb0eEdjACl3kns7j00KTq4UbE35kUPOs+0Lx8vGqK7q9w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rsbuild/core": "^2.2.5",
"@rsbuild/core": "^2.2.10",
"@shikijs/rehype": "^4.2.0",
"@types/react": "^19.2.18",
"mdast-util-mdx-jsx": "^3.2.0",
@@ -3288,9 +3288,9 @@
}
},
"node_modules/react-router": {
"version": "7.18.3",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.3.tgz",
"integrity": "sha512-gyXgtdr5uACJ5b1Q4udzjVV+tb/rlHIMJKuJ0e89R4Kzgz47z/rgP0dIKxktqIEUhDHluGTPJJH/wRha7CyqsA==",
"version": "7.18.4",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.4.tgz",
"integrity": "sha512-PUPQcMhMGRAslLcvtlPz/kmzBEWPhLdgLFrL7pLNepBL6dX0lWj4WD2cUYVgYCuT3jxvghYFg81cDTj44DhetQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3311,13 +3311,13 @@
}
},
"node_modules/react-router-dom": {
"version": "7.18.3",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.3.tgz",
"integrity": "sha512-ytVbyBBM7vMfRCam25r0WMhSVSom909A8p+8m0/f1w853dz/xfFu6etAT2SEbVoSnI+ZoPRDqIsQXVT89gp7kg==",
"version": "7.18.4",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.4.tgz",
"integrity": "sha512-yrfmJHIpDG7taCpqKjT1G5B6q3O2K+RN8/fgNf0lTjCwiPbQ0ei6vXX9ZjQR+7ld8Tr7Z5xmyMnZ8YJrphWQUw==",
"dev": true,
"license": "MIT",
"dependencies": {
"react-router": "7.18.3"
"react-router": "7.18.4"
},
"engines": {
"node": ">=20.0.0"
+7 -3
View File
@@ -2,7 +2,7 @@
This document provides information about downloading and deploying the Debian package. You can also use this guide for other deb-based distributions such as Ubuntu.
### Installation
## Installation
To add the Continuwuation apt repository:
```bash
@@ -26,16 +26,20 @@ The `continuwuity` package conflicts with the old `conduwuit` package and will r
See the [generic deployment guide](/deploying/generic.mdx) for additional information about using the Debian package.
### Configuration
## Configuration
After installation, Continuwuity places the example configuration at `/etc/conduwuit/conduwuit.toml` as the default configuration file. The configuration file indicates which settings you must change before starting the service.
You can customize additional settings by uncommenting and modifying the configuration options in `/etc/conduwuit/conduwuit.toml`.
### Running
## Running
The package uses the `conduwuit.service` systemd unit file to start and stop Continuwuity. The binary installs at `/usr/bin/conduwuit`.
By default, this package assumes that Continuwuity runs behind a reverse proxy. The default configuration options apply (listening on `localhost` and TCP port `6167`). Matrix federation requires a valid domain name and TLS. To federate properly, you must set up TLS certificates and certificate renewal.
For information about setting up a reverse proxy and TLS, consult online documentation and guides. The [generic deployment guide](/deploying/generic.md#setting-up-the-reverse-proxy) documents Caddy, which is the most user-friendly option for reverse proxy configuration.
## What's next?
Navigate to [Post-installation](/deploying#post-installation) for next steps.
+13 -1
View File
@@ -11,9 +11,15 @@ export default defineConfig({
light: '/assets/logo.svg',
dark: '/assets/logo.svg',
},
// Use `.no-zoom` class to disable image zooms
mediumZoom: {
selector: '.rspress-doc :not(.no-zoom *) > img',
},
markdown: {
link: {
checkDeadLinks: {
// exclude files in the `docs/public` folder from dead link checking
// (they are linked to without the `/public` prefix)
excludes: [
'/deploying/docker-compose.with-caddy.yml',
'/deploying/docker-compose.with-caddy-labels.yml',
@@ -26,7 +32,10 @@ export default defineConfig({
'/advanced/delegated.docker-compose.for-traefik.yml',
'/advanced/delegated.docker-compose.with-traefik.yml',
'/calls/livekit.docker-compose.with-caddy-labels.yml',
'/calls/livekit.nginx.conf'
'/calls/livekit.nginx.conf',
'/guides/grafana-dashboard.json',
'/guides/push-notifications.excalidraw',
'CONTRIBUTING.md'
]
},
},
@@ -92,6 +101,9 @@ export default defineConfig({
}, {
from: "^/source(|_code)$",
to: "https://forgejo.ellis.link/continuwuation/continuwuity",
}, {
from: "^/(CONTRIBUTING.md|contributing)$",
to: "/development/contributing"
}
]
})],
+1 -1
View File
@@ -10,7 +10,7 @@
[toolchain]
profile = "minimal"
channel = "1.98.1"
channel = "1.99.1"
components = [
# For rust-analyzer
"rust-src",
+32 -11
View File
@@ -8,13 +8,15 @@ use std::{
use conduwuit::{
Err, Result, at, debug_error, err, info,
matrix::{
Event,
Event, StateKey,
pdu::{PduEvent, PduId, RawPduId},
},
state_res::EventTypeExt,
trace, utils,
utils::{
stream::{IterStream, ReadyExt},
string::EMPTY,
to_canonical_object,
},
warn,
};
@@ -27,7 +29,9 @@ use resolvematrix::{
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId,
OwnedRoomOrAliasId, OwnedServerName, RoomId, RoomVersionId, UInt,
api::federation::event::get_room_state, events::AnyStateEvent, serde::Raw,
api::federation::event::get_room_state,
events::{AnyStateEvent, StateEventType},
serde::Raw,
};
use service::rooms::{
short::{ShortEventId, ShortRoomId},
@@ -533,19 +537,36 @@ impl crate::Context<'_> {
.collect()
.await;
let pdus: Vec<CanonicalJsonObject> = state_ids
let mut pdus: HashMap<(StateEventType, StateKey), CanonicalJsonObject> = state_ids
.iter()
.try_stream()
.and_then(|id| self.services.rooms.timeline.get_pdu_json(id))
.try_stream::<conduwuit::Error>()
.and_then(|id| async {
let pdu_json = self.services.rooms.timeline.get_pdu_json(id).await?;
let event_type = pdu_json
.get("type")
.and_then(CanonicalJsonValue::as_str)
.expect("event type must be present in events");
let state_key = pdu_json
.get("state_key")
.and_then(CanonicalJsonValue::as_str)
.expect("state keys must be present for events in the room state");
Ok(((event_type.into(), state_key.into()), pdu_json))
})
.try_collect()
.await?;
let json = serde_json::to_string_pretty(&pdus).map_err(|e| {
err!(Database(
"Failed to convert room state events to pretty JSON, possible invalid room \
state events in our database {e}",
))
})?;
let pdu = self.services.rooms.timeline.get_pdu(&event_id).await?;
if let Some(state_key) = pdu.state_key() {
pdus.insert(pdu.kind().with_state_key(state_key), to_canonical_object(pdu)?);
}
let json =
serde_json::to_string_pretty(&pdus.values().collect::<Vec<_>>()).map_err(|e| {
err!(Database(
"Failed to convert room state events to pretty JSON, possible invalid room \
state events in our database {e}",
))
})?;
let out = format!("```json\n{json}\n```");
self.write_str(&out).await
+3
View File
@@ -4,6 +4,9 @@ use service::registration_tokens::TokenExpires;
impl crate::Context<'_> {
pub(super) async fn issue_registration_token(&self, expires: super::TokenExpires) -> Result {
if !self.services.config.allow_registration {
return Err!("Registration has been disabled on this homeserver.");
}
let expires = {
if expires.immortal {
None
+33 -8
View File
@@ -31,14 +31,36 @@ const AUTO_GEN_PASSWORD_LENGTH: usize = 25;
const BULK_JOIN_REASON: &str = "Bulk force joining this room as initiated by the server admin.";
impl crate::Context<'_> {
pub(super) async fn list_users(&self) -> Result {
let users: Vec<_> = self
.services
.users
.stream_local_users()
.map(|id| id.as_str().to_owned())
.collect()
.await;
pub(super) async fn list_users(
&self,
show_deactivated: bool,
hide_suspended: bool,
hide_locked: bool,
) -> Result {
let mut users: Vec<String> = Vec::new();
let mut user_stream = self.services.users.stream_local_users();
while let Some(id) = user_stream.next().await {
if !show_deactivated {
if matches!(self.services.users.status(&id).await, AccountStatus::Deactivated) {
continue;
}
}
let suspended = match self.services.users.is_suspended(&id).await {
| Err(_) => continue,
| Ok(suspended) => suspended,
};
if hide_suspended && suspended {
continue;
}
let locked = match self.services.users.is_locked(&id).await {
| Err(_) => continue,
| Ok(locked) => locked,
};
if hide_locked && locked {
continue;
}
users.push(id.as_str().to_owned());
}
let mut plain_msg = format!("Found {} local user account(s):\n```\n", users.len());
plain_msg += users.join("\n").as_str();
@@ -1083,6 +1105,9 @@ impl crate::Context<'_> {
pub(super) async fn change_email(&self, user_id: String, email: Option<String>) -> Result {
let user_id = parse_local_user_id(self.services, &user_id)?;
if matches!(self.services.users.status(&user_id).await, AccountStatus::NotFound) {
return Err!("This account does not exist.");
}
let Ok(new_email) = email.map(Address::try_from).transpose() else {
return Err!("Invalid email address.");
};
+11 -1
View File
@@ -164,7 +164,17 @@ pub enum UserCommand {
/// List local users in the database
#[command(name = "list", alias = "list-users")]
ListUsers,
ListUsers {
// Include deactivated users in the user list
#[arg(long)]
show_deactivated: bool,
// Hide suspended accounts from the user list
#[arg(long)]
hide_suspended: bool,
// Hide locked accounts from the user list
#[arg(long)]
hide_locked: bool,
},
/// Lists all the rooms (local and remote) that the specified user is
/// invited to
+15 -11
View File
@@ -1,14 +1,17 @@
use std::collections::BTreeMap;
use std::collections::{BTreeMap, BTreeSet};
use axum::extract::State;
use conduwuit::{Result, Server};
use ruma::{
RoomVersionId,
api::client::discovery::get_capabilities::{
self,
v3::{
Capabilities, GetLoginTokenCapability, ProfileFieldsCapability, RoomVersionStability,
RoomVersionsCapability, ThirdPartyIdChangesCapability,
api::{
OAuthClientScope,
client::discovery::get_capabilities::{
self,
v3::{
AdminCapability, Capabilities, GetLoginTokenCapability, ProfileFieldsCapability,
RoomVersionStability, RoomVersionsCapability, ThirdPartyIdChangesCapability,
},
},
},
assign,
@@ -25,6 +28,8 @@ pub(crate) async fn get_capabilities_route(
State(services): State<crate::State>,
body: Ruma<get_capabilities::v3::Request>,
) -> Result<get_capabilities::v3::Response> {
let sender_user = body.identity.expect_sender_user()?;
let available: BTreeMap<RoomVersionId, RoomVersionStability> =
Server::available_room_versions().collect();
@@ -43,13 +48,12 @@ pub(crate) async fn get_capabilities_route(
capabilities.forget_forced_upon_leave.enabled = true;
if services
.users
.is_admin(body.identity.expect_sender_user()?)
.await
{
if services.users.is_admin(sender_user).await {
capabilities.account_moderation.lock = true;
capabilities.account_moderation.suspend = true;
capabilities.admin =
AdminCapability::new(BTreeSet::from_iter([OAuthClientScope::ServerAdministration]));
}
capabilities.profile_fields = Some(
+10 -2
View File
@@ -267,11 +267,19 @@ pub(crate) async fn get_public_rooms_filtered_helper(
summary.into()
})
.ready_filter_map(|chunk: PublicRoomsChunk| {
if !filter.room_types.is_empty() && !filter.room_types.contains(&RoomTypeFilter::from(chunk.room_type.clone())) {
if !filter.room_types.is_empty()
&& !filter
.room_types
.contains(&RoomTypeFilter::from(chunk.room_type.clone()))
{
return None;
}
if let Some(query) = filter.generic_search_term.as_ref().map(|q| q.to_lowercase()) {
if let Some(query) = filter
.generic_search_term
.as_ref()
.map(|q| q.to_lowercase())
{
if let Some(name) = &chunk.name {
if name.to_lowercase().contains(&query) {
return Some(chunk);
+26
View File
@@ -2,6 +2,7 @@ use axum::extract::State;
use conduwuit::{
Err, Result, debug_error, err, info,
matrix::{event::gen_event_id_canonical_json, pdu::PartialPdu},
metrics::KeyValue,
trace, warn,
};
use futures::FutureExt;
@@ -113,6 +114,31 @@ pub(crate) async fn invite_helper(
room_id: &RoomId,
reason: Option<String>,
is_direct: bool,
) -> Result {
let result =
send_invite(services, sender_user, recipient_user, room_id, reason, is_direct).await;
let destination = if services.globals.user_is_local(recipient_user) {
"local"
} else {
"remote"
};
services.server.metrics.instruments.invites.add(1, &[
KeyValue::new("direction", "outgoing"),
KeyValue::new("destination", destination),
KeyValue::new("outcome", if result.is_ok() { "success" } else { "failure" }),
]);
result
}
async fn send_invite(
services: &Services,
sender_user: &UserId,
recipient_user: &UserId,
room_id: &RoomId,
reason: Option<String>,
is_direct: bool,
) -> Result {
if !services.users.is_admin(sender_user).await && services.config.block_non_admin_invites {
info!(
+4 -1
View File
@@ -55,5 +55,8 @@ fn oauth_router() -> Router<crate::State> {
.route(concat!("/", JWKS_URI_PATH), get(async || Json(json!({"keys": []}))))
.route(concat!("/", TOKEN_PATH), post(token::token_route))
.route(concat!("/", TOKEN_REVOKE_PATH), post(token::revoke_token_route))
.route(concat!("/", DEVICE_AUTHORIZATION_PATH), post(device::device_authorization_route))
.route(
concat!("/", DEVICE_AUTHORIZATION_PATH),
post(device::device_authorization_route),
)
}
+12
View File
@@ -29,6 +29,12 @@ pub(crate) async fn get_profile_route(
State(services): State<crate::State>,
body: Ruma<get_profile::v3::Request>,
) -> Result<get_profile::v3::Response> {
if services.config.require_auth_for_profile_requests && body.identity.is_none() {
return Err!(Request(Unauthorized(
"This server requires authentication to access user profiles."
)));
}
let Some(profile) = fetch_full_profile(&services, &body.user_id).await else {
return Err!(Request(NotFound("This user's profile could not be fetched.")));
};
@@ -40,6 +46,12 @@ pub(crate) async fn get_profile_field_route(
State(services): State<crate::State>,
body: Ruma<get_profile_field::v3::Request>,
) -> Result<get_profile_field::v3::Response> {
if services.config.require_auth_for_profile_requests && body.identity.is_none() {
return Err!(Request(Unauthorized(
"This server requires authentication to access user profiles."
)));
}
let value = fetch_profile_field(&services, &body.user_id, body.field.clone()).await?;
Ok(assign!(get_profile_field::v3::Response::default(), { value }))
+6 -4
View File
@@ -77,7 +77,7 @@ pub(crate) async fn set_read_marker_route(
.readreceipt_update(
sender_user,
&body.room_id,
&ReceiptEvent::new(
ReceiptEvent::new(
body.room_id.clone(),
ReceiptEventContent::from_iter(receipt_content),
),
@@ -103,7 +103,8 @@ pub(crate) async fn set_read_marker_route(
services
.rooms
.read_receipt
.private_read_set(&body.room_id, sender_user, count);
.private_read_set(&body.room_id, sender_user, event, count)
.await;
}
services.sync.wake(sender_user).await;
@@ -176,7 +177,7 @@ pub(crate) async fn create_receipt_route(
.readreceipt_update(
sender_user,
&body.room_id,
&ReceiptEvent::new(
ReceiptEvent::new(
body.room_id.clone(),
ReceiptEventContent::from_iter(receipt_content),
),
@@ -200,7 +201,8 @@ pub(crate) async fn create_receipt_route(
services
.rooms
.read_receipt
.private_read_set(&body.room_id, sender_user, count);
.private_read_set(&body.room_id, sender_user, &body.event_id, count)
.await;
},
| _ => {
return Err!(Request(InvalidParam(warn!(
+170 -155
View File
@@ -1,18 +1,23 @@
use std::collections::{BTreeMap, BTreeSet};
use std::collections::{BTreeMap, BTreeSet, HashSet};
use axum::extract::State;
use conduwuit::{
Err, Error, Result, debug, debug_info, err, info,
matrix::{StateKey, pdu::PartialPdu},
trace, warn,
trace,
utils::to_canonical_object,
warn,
};
use conduwuit_service::{Services, appservice::RegistrationInfo};
use futures::FutureExt;
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, Int, MilliSecondsSinceUnixEpoch, OwnedRoomAliasId,
OwnedUserId, RoomAliasId, RoomId, RoomVersionId, UserId,
OwnedUserId, RoomAliasId, RoomId,
api::{
client::room::{self, create_room},
client::room::{
self,
create_room::{self, RoomPowerLevelsContentOverride, v3::CreationContent},
},
error::ErrorKind::Forbidden,
},
assign,
@@ -33,13 +38,24 @@ use ruma::{
},
int,
room_version_rules::{AuthorizationRules, RoomIdFormatVersion},
serde::{JsonObject, Raw},
serde::Raw,
};
use ruminuwuity::invite_permission_config::FilterLevel;
use serde_json::{json, value::to_raw_value};
use serde::Deserialize;
use serde_json::value::to_raw_value;
use crate::{Ruma, client::invite_helper};
// We use this to keep around extra data in the `creation_content`
// while still parsing and validating keys that we care about.
#[derive(Deserialize, Default)]
struct FullCreationContent {
#[serde(flatten)]
creation_content: CreationContent,
#[serde(flatten)]
extra_create_keys: CanonicalJsonObject,
}
/// # `POST /_matrix/client/v3/createRoom`
///
/// Creates a new room.
@@ -153,6 +169,12 @@ pub(crate) async fn create_room_route(
return Err!(Request(Forbidden("Publishing rooms to the room directory is not allowed")));
}
// Figure out preset. We need it for preset specific events
let preset = body.preset.clone().unwrap_or(match &body.visibility {
| room::Visibility::Public => RoomPreset::PublicChat,
| _ => RoomPreset::PrivateChat, // Room visibility should not be custom
});
let mut invitees = BTreeSet::new();
for recipient_user in &body.invite {
@@ -191,54 +213,67 @@ pub(crate) async fn create_room_route(
| _ => None,
};
let create_content = match &body.creation_content {
| Some(content) => {
use RoomVersionId::*;
let FullCreationContent { creation_content, mut extra_create_keys } = body
.creation_content
.as_ref()
.map(Raw::deserialize_as_unchecked::<FullCreationContent>)
.transpose()
.map_err(|e| err!(Request(BadJson(error!("Failed to parse creation content: {e}")))))?
.unwrap_or_default();
let mut content = content
.deserialize_as_unchecked::<CanonicalJsonObject>()
.map_err(|e| {
err!(Request(BadJson(error!(
"Failed to deserialise content as canonical JSON: {e}"
))))
})?;
match room_version {
| V1 | V2 | V3 | V4 | V5 | V6 | V7 | V8 | V9 | V10 => {
content.insert(
"creator".into(),
json!(&sender_user).try_into().map_err(|e| {
err!(Request(BadJson(debug_error!("Invalid creation content: {e}"))))
})?,
);
},
| _ => {
// V11+ removed the "creator" key
},
}
content.insert(
"room_version".into(),
json!(room_version.as_str())
.try_into()
.map_err(|e| err!(Request(BadJson("Invalid creation content: {e}"))))?,
);
content
},
| None => {
use RoomVersionId::*;
let content = match room_version {
| V1 | V2 | V3 | V4 | V5 | V6 | V7 | V8 | V9 | V10 =>
RoomCreateEventContent::new_v1(sender_user.to_owned()),
| _ => RoomCreateEventContent::new_v11(),
};
let mut content =
serde_json::from_str::<CanonicalJsonObject>(to_raw_value(&content)?.get())?;
content.insert("room_version".into(), json!(room_version.as_str()).try_into()?);
content
},
let mut create_event_content = if room_version_rules.authorization.use_room_create_sender {
RoomCreateEventContent::new_v11()
} else {
RoomCreateEventContent::new_v1(sender_user.to_owned())
};
let mut privileged_creators = HashSet::new();
create_event_content.federate = creation_content.federate;
create_event_content.predecessor = creation_content.predecessor;
create_event_content.room_type = creation_content.room_type;
create_event_content.room_version = room_version.clone();
if room_version_rules.authorization.additional_room_creators {
create_event_content.additional_creators = creation_content.additional_creators;
// If we're making a trusted private chat, add the invitees as
// additional creators
if preset == RoomPreset::TrustedPrivateChat {
create_event_content
.additional_creators
.extend(invitees.iter().cloned());
}
// Make sure the primary creator of the room isn't in the additional
// creator list
if create_event_content
.additional_creators
.iter()
.any(|user| user == sender_user)
{
return Err!(Request(InvalidParam(
"The primary creator of the room may not also be an additional creator."
)));
}
// Sort and deduplicate additional creators to avoid any funny business
create_event_content.additional_creators.sort();
create_event_content.additional_creators.dedup();
}
// Track privileged creators so we can remove them from PLs later
if room_version_rules
.authorization
.explicitly_privilege_room_creators
{
privileged_creators.insert(sender_user.to_owned());
if room_version_rules.authorization.additional_room_creators {
privileged_creators.extend(create_event_content.additional_creators.iter().cloned());
}
}
let state_lock = match room_id.clone() {
| Some(room_id) => {
let _short_id = services
@@ -272,13 +307,20 @@ pub(crate) async fn create_room_route(
.map(MilliSecondsSinceUnixEpoch)
};
let mut create_event_content = to_canonical_object(create_event_content)
.expect("should be able to serialize create event content");
// `extra_create_keys` can't clobber any important fields because we
// already pulled them out into `create_event_content`
create_event_content.append(&mut extra_create_keys);
let create_event_id = services
.rooms
.timeline
.build_and_append_pdu(
PartialPdu {
event_type: TimelineEventType::RoomCreate,
content: to_raw_value(&create_content)?,
content: to_raw_value(&create_event_content)?,
state_key: Some(StateKey::new()),
timestamp: custom_origin_server_ts,
..Default::default()
@@ -289,6 +331,7 @@ pub(crate) async fn create_room_route(
)
.boxed()
.await?;
trace!("Created room create event with ID {}", &create_event_id);
let room_id = match room_id.clone() {
| Some(room_id) => room_id,
@@ -330,64 +373,27 @@ pub(crate) async fn create_room_route(
.await?;
// 3. Power levels
let mut power_levels_to_grant = BTreeMap::new();
// Figure out preset. We need it for preset specific events
let preset = body.preset.clone().unwrap_or(match &body.visibility {
| room::Visibility::Public => RoomPreset::PublicChat,
| _ => RoomPreset::PrivateChat, // Room visibility should not be custom
});
// If this room version doesn't privilege creators, grant PLs to them
if !room_version_rules
.authorization
.explicitly_privilege_room_creators
{
power_levels_to_grant.insert(sender_user.to_owned(), int!(100));
let mut power_levels_to_grant = BTreeMap::from_iter([(sender_user.to_owned(), int!(100))]);
let mut creators: Vec<OwnedUserId> = vec![sender_user.to_owned()];
if preset == RoomPreset::TrustedPrivateChat {
for recipient_user in invitees.iter().cloned() {
if room_version_rules
.authorization
.explicitly_privilege_room_creators
{
creators.push(recipient_user);
} else {
if preset == RoomPreset::TrustedPrivateChat {
for recipient_user in invitees.iter().cloned() {
power_levels_to_grant.insert(recipient_user, int!(100));
}
}
}
// Do we care about additional_creators?
if room_version_rules
.authorization
.explicitly_privilege_room_creators
{
// Have they been specified?
if let Some(additional_creators) = create_content.get("additional_creators") {
// Are they a real array?
if let Some(additional_creators) = additional_creators.as_array() {
// Iterate through them
for creator in additional_creators {
// Are they a string?
if let Some(creator) = creator.as_str() {
// Do they parse into a real user ID?
if let Ok(creator) = UserId::parse(creator) {
// Add them to the power levels and creators
creators.push(creator);
}
}
}
}
}
} else {
power_levels_to_grant.insert(sender_user.to_owned(), int!(100));
creators.clear(); // If this vec is not empty, default_power_levels_content will
// treat this as a v12 room
}
let power_levels_content = default_power_levels_content(
body.power_level_content_override
.as_ref()
.map(Raw::cast_ref),
body.power_level_content_override.as_ref(),
&body.visibility,
power_levels_to_grant,
creators,
privileged_creators,
&room_version_rules.authorization,
)?;
@@ -619,74 +625,83 @@ pub(crate) async fn create_room_route(
}
/// creates the power_levels_content for the PDU builder
#[allow(clippy::or_fun_call)]
fn default_power_levels_content(
power_level_content_override: Option<&Raw<RoomPowerLevelsEventContent>>,
power_level_content_override: Option<&Raw<RoomPowerLevelsContentOverride>>,
visibility: &room::Visibility,
users: BTreeMap<OwnedUserId, Int>,
creators: Vec<OwnedUserId>,
mut users: BTreeMap<OwnedUserId, Int>,
creators: HashSet<OwnedUserId>,
authorization_rules: &AuthorizationRules,
) -> Result<serde_json::Value> {
let mut power_levels_content =
serde_json::to_value(assign!(RoomPowerLevelsEventContent::new(authorization_rules), {
users
}))
.unwrap();
) -> Result<RoomPowerLevelsEventContent> {
use ruma::events::TimelineEventType::*;
let mut power_levels_content = power_level_content_override
.map(Raw::cast_ref::<RoomPowerLevelsEventContent>)
.map(Raw::deserialize)
.transpose()
.map_err(|err| err!(Request(BadJson("Invalid power_level_content_override: {err:?}"))))?
.map_or_else(
|| RoomPowerLevelsEventContent::new(authorization_rules),
|mut content| {
if authorization_rules.explicitly_privilege_room_creators {
// If an override was supplied we need to make sure the
// tombstone default is raised to 150
// for v12+. Otherwise, if one wasn't supplied,
// `RoomPowerLevelsEventContent::new` will handle this.
content.events.entry(RoomTombstone).or_insert(int!(150));
}
content
},
);
power_levels_content.users.append(&mut users);
for creator in creators {
power_levels_content.users.remove(&creator);
}
// secure proper defaults of sensitive/dangerous permissions that moderators
// (power level 50) should not have easy access to
power_levels_content["events"]["m.room.power_levels"] =
serde_json::to_value(100).expect("100 is valid Value");
power_levels_content["events"]["m.room.server_acl"] =
serde_json::to_value(100).expect("100 is valid Value");
power_levels_content["events"]["m.room.tombstone"] =
serde_json::to_value(100).expect("100 is valid Value");
power_levels_content["events"]["m.room.encryption"] =
serde_json::to_value(100).expect("100 is valid Value");
power_levels_content["events"]["m.room.history_visibility"] =
serde_json::to_value(100).expect("100 is valid Value");
let admin_only_events = [
RoomPowerLevels,
RoomServerAcl,
// this will not apply for v12+ rooms since we raised it to 150 earlier
RoomTombstone,
RoomEncryption,
RoomHistoryVisibility,
];
for event_type in admin_only_events {
power_levels_content
.events
.entry(event_type)
.or_insert(int!(100));
}
// always allow users to respond (not post new) to polls. this is primarily
// useful in read-only announcement rooms that post a public poll.
power_levels_content["events"]["org.matrix.msc3381.poll.response"] =
serde_json::to_value(0).expect("0 is valid Value");
power_levels_content["events"]["m.poll.response"] =
serde_json::to_value(0).expect("0 is valid Value");
power_levels_content
.events
.entry(PollResponse)
.or_insert(int!(0));
power_levels_content
.events
.entry(UnstablePollResponse)
.or_insert(int!(0));
// synapse does this too. clients do not expose these permissions. it
// prevents default users from calling public rooms, for obvious reasons.
if *visibility == room::Visibility::Public {
power_levels_content["events"]["m.call.invite"] =
serde_json::to_value(50).expect("50 is valid Value");
power_levels_content["events"]["m.call"] =
serde_json::to_value(50).expect("50 is valid Value");
power_levels_content["events"]["m.call.member"] =
serde_json::to_value(50).expect("50 is valid Value");
power_levels_content["events"]["org.matrix.msc3401.call"] =
serde_json::to_value(50).expect("50 is valid Value");
power_levels_content["events"]["org.matrix.msc3401.call.member"] =
serde_json::to_value(50).expect("50 is valid Value");
}
if let Some(power_level_content_override) = power_level_content_override {
let json: JsonObject = serde_json::from_str(power_level_content_override.json().get())
.map_err(|e| err!(Request(BadJson("Invalid power_level_content_override: {e:?}"))))?;
for (key, value) in json {
power_levels_content[key] = value;
}
}
if !creators.is_empty() {
// Raise the default power level of tombstone to 150
power_levels_content["events"]["m.room.tombstone"] =
serde_json::to_value(150).expect("150 is valid Value");
for creator in creators {
// Omit creators from the power level list altogether
power_levels_content["users"]
.as_object_mut()
.expect("users is an object")
.remove(creator.as_str());
}
power_levels_content
.events
.entry(CallInvite)
.or_insert(int!(50));
power_levels_content
.events
.entry(CallMember)
.or_insert(int!(50));
}
Ok(power_levels_content)
+18 -5
View File
@@ -2,15 +2,21 @@ use axum::extract::State;
use conduwuit::{
Err, Event, Result, at, debug_warn,
result::LogErr,
utils::{BoolExt, stream::TryTools},
utils::{
BoolExt,
stream::{TryIgnore, WidebandExt},
},
};
use futures::{FutureExt, TryStreamExt, future::try_join4};
use futures::{FutureExt, StreamExt, TryStreamExt, future::try_join4};
use ruma::{
api::client::peeking::get_current_state::v3::{PaginationChunk, Request, Response},
assign,
};
use crate::Ruma;
use crate::{
Ruma,
client::{ignored_filter, visibility_filter},
};
const LIMIT_MAX: usize = 100;
@@ -52,8 +58,11 @@ pub(crate) async fn room_initial_sync_route(
.rooms
.timeline
.pdus_rev(room_id, None)
.try_take(limit)
.and_then(async |mut pdu| {
.ignore_err()
.wide_filter_map(|item| ignored_filter(&services, item, sender_user))
.wide_filter_map(|item| visibility_filter(&services, item, sender_user))
.take(limit)
.wide_then(async |mut pdu| {
let ctx = services
.rooms
.timeline
@@ -77,6 +86,10 @@ pub(crate) async fn room_initial_sync_route(
.boxed()
.await?;
if events.is_empty() {
return Ok(Response::new(room_id.to_owned()));
}
let end = events
.first()
.map(at!(0))
+3 -2
View File
@@ -2,11 +2,12 @@ mod aliases;
mod create;
mod event;
mod initial_sync;
mod stripped_state;
mod summary;
mod upgrade;
pub(crate) use self::{
aliases::get_room_aliases_route, create::create_room_route, event::get_room_event_route,
initial_sync::room_initial_sync_route, summary::get_room_summary,
upgrade::upgrade_room_route,
initial_sync::room_initial_sync_route, stripped_state::get_stripped_state_route,
summary::get_room_summary, upgrade::upgrade_room_route,
};
+71
View File
@@ -0,0 +1,71 @@
use axum::extract::State;
use conduwuit::{Err, Result};
use ruma::{
api::client::state::get_stripped_state, assign, events::ALLOWED_STRIPPED_STATE_EVENTS,
};
use service::rooms::summary::{Accessibility, RoomStrippedState};
use crate::{Ruma, router::ClientIdentity};
/// # `POST /_matrix/client/unstable/org.continuwuity.msc4560.stripped_state/{room_id_or_alias}` ([MSC4560])
///
/// Returns a room's stripped state.
///
/// [MSC4560]: https://github.com/matrix-org/matrix-spec-proposals/pull/4560
#[tracing::instrument(skip_all, name = "stripped_state", level = "info")]
pub(crate) async fn get_stripped_state_route(
State(services): State<crate::State>,
body: Ruma<get_stripped_state::unstable::Request>,
) -> Result<get_stripped_state::unstable::Response> {
let user_id = body.identity.as_ref().and_then(ClientIdentity::sender_user);
if body.via.len() > get_stripped_state::unstable::MAX_VIAS {
return Err!(Request(TooLarge("Too many vias, please be less indecisive.")));
}
if let Some(forbidden_type) = body
.state
.iter()
.find(|event_type| !ALLOWED_STRIPPED_STATE_EVENTS.contains(event_type))
{
return Err!(Request(InvalidParam(
"Event type {forbidden_type} may not be requested as stripped state."
)));
}
let (room_id, _) = services
.rooms
.alias
.resolve_with_servers(&body.room_id_or_alias, Some(body.via.clone()))
.await?;
if services.rooms.metadata.is_banned(&room_id).await {
return Err!(Request(Forbidden("This room is banned on this homeserver.")));
}
match services
.rooms
.summary
.get_stripped_state_for_user(
user_id,
&room_id,
&body.via,
&body.state,
body.num_joined_members,
)
.await
{
| Accessibility::Accessible((
via,
RoomStrippedState { state, num_joined_members, .. },
)) => Ok(
assign!(get_stripped_state::unstable::Response::new(via), { state, num_joined_members }),
),
| Accessibility::Inaccessible => {
Err!(Request(Forbidden("You may not request this room's stripped state.")))
},
| Accessibility::NotFound => {
Err!(Request(NotFound("This room does not exist.")))
},
}
}
+3 -6
View File
@@ -13,7 +13,7 @@ pub(crate) async fn get_room_summary(
State(services): State<crate::State>,
body: Ruma<get_summary::v1::Request>,
) -> Result<get_summary::v1::Response> {
let (room_id, servers) = services
let (room_id, _) = services
.rooms
.alias
.resolve_with_servers(&body.room_id_or_alias, Some(body.via.clone()))
@@ -27,12 +27,9 @@ pub(crate) async fn get_room_summary(
.rooms
.summary
.get_room_summary_for_user(
body.identity
.as_ref()
.map(ClientIdentity::expect_sender_user)
.transpose()?,
body.identity.as_ref().and_then(ClientIdentity::sender_user),
&room_id,
&servers,
&body.via,
)
.await?;
+23 -2
View File
@@ -6,7 +6,10 @@ use conduwuit::{
matrix::pdu::{PartialPdu, sticky},
utils,
};
use ruma::{api::client::message::send_message_event, events::MessageLikeEventType};
use ruma::{
OwnedEventId, api::client::message::send_message_event, events::MessageLikeEventType,
};
use serde::Deserialize;
use serde_json::from_str;
use crate::{Ruma, client_ip::ClientIp};
@@ -77,6 +80,13 @@ pub(crate) async fn send_message_event_route(
let content = from_str(body.body.body.json().get())
.map_err(|e| err!(Request(BadJson("Invalid JSON body: {e}"))))?;
let redacts = if body.body.event_type == MessageLikeEventType::RoomRedaction {
from_str::<MaybeRedaction>(body.body.body.json().get())
.ok()
.and_then(|r| r.redacts)
} else {
None
};
let event_id = services
.rooms
@@ -92,11 +102,14 @@ pub(crate) async fn send_message_event_route(
.flatten()
.map(sticky::object),
unsigned: Some(unsigned),
timestamp: if body.identity.is_appservice() {
timestamp: if body.identity.is_appservice()
|| services.admin.user_is_admin(sender_user).await
{
body.timestamp
} else {
None
},
redacts,
..Default::default()
},
sender_user,
@@ -116,3 +129,11 @@ pub(crate) async fn send_message_event_route(
Ok(send_message_event::v3::Response::new(event_id))
}
/// Struct containing exclusively the `redacts` field for MSC4169 compatible
/// redaction moving.
#[derive(Deserialize)]
struct MaybeRedaction {
#[serde(default)]
redacts: Option<OwnedEventId>,
}
+17 -12
View File
@@ -1563,20 +1563,25 @@ where
// joined users
device_list_changes.extend(
services
.rooms
.state_cache
.room_members(room_id)
// Don't send key updates from the sender to the sender
.ready_filter(|user_id| sender_user != *user_id)
// Only send keys if the sender doesn't share an encrypted room with the target
// already
.filter_map(async |user_id| {
share_encrypted_room(services, sender_user, &user_id, Some(room_id))
.rooms
.state_cache
.room_members(room_id)
// Don't send key updates from the sender to the sender
.ready_filter(|user_id| sender_user != *user_id)
// Only send keys if the sender doesn't share an encrypted room with
// the target already
.filter_map(async |user_id| {
share_encrypted_room(
services,
sender_user,
&user_id,
Some(room_id),
)
.map(|res| res.or_some(user_id.clone()))
.await
})
.collect::<Vec<_>>()
.await,
})
.collect::<Vec<_>>()
.await,
);
}
}
+31 -1
View File
@@ -1,9 +1,12 @@
use axum::{Json, extract::State, response::IntoResponse};
use conduwuit::{
Result,
Err, Result,
matrix::versions::{unstable_features, versions},
metrics::PROMETHEUS_CONTENT_TYPE,
utils::string::constant_time_eq,
};
use futures::StreamExt;
use http::{HeaderMap, header};
use ruma::{api::client::discovery::get_supported_versions, assign};
use crate::Ruma;
@@ -75,3 +78,30 @@ pub(crate) async fn continuwuity_local_user_count(
"count": user_count
})))
}
/// # `GET /_continuwuity/metrics`
///
/// Prometheus metrics in the text exposition format. Only routed when
/// `allow_prometheus_metrics` is enabled.
pub(crate) async fn continuwuity_metrics(
State(services): State<crate::State>,
headers: HeaderMap,
) -> Result<impl IntoResponse> {
if let Some(token) = &services.config.prometheus_metrics_token {
let authorized = headers
.get(header::AUTHORIZATION)
.and_then(|value| value.to_str().ok())
.and_then(|value| value.split_once(' '))
.is_some_and(|(scheme, provided)| {
scheme.eq_ignore_ascii_case("bearer") && constant_time_eq(provided, token)
});
if !authorized {
return Err!(Request(Unauthorized("Invalid metrics token")));
}
}
let body = services.server.metrics.render()?;
Ok(([(header::CONTENT_TYPE, PROMETHEUS_CONTENT_TYPE)], body))
}
+20 -8
View File
@@ -21,7 +21,7 @@ use crate::{admin, client, server};
pub fn build(router: Router<State>, state: State) -> Router<State> {
let config = &state.server.config;
let mut router = router
.ruma_route(&client::appservice_ping)
.ruma_route(&client::appservice_ping)
.ruma_route(&client::get_supported_versions_route)
.ruma_route(&client::get_register_available_route)
.ruma_route(&client::register::register_route)
@@ -61,8 +61,8 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
.ruma_route(&client::get_global_account_data_route)
.ruma_route(&client::get_room_account_data_route)
.ruma_route(&client::get_profile_field_route)
.ruma_route(&client::set_profile_field_route)
.ruma_route(&client::delete_profile_field_route)
.ruma_route(&client::set_profile_field_route)
.ruma_route(&client::delete_profile_field_route)
.ruma_route(&client::get_profile_route)
.ruma_route(&client::set_presence_route)
.ruma_route(&client::get_presence_route)
@@ -112,14 +112,17 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
.ruma_route(&client::search_users_route)
.ruma_route(&client::get_member_events_route)
.ruma_route(&client::get_protocols_route)
.route("/_matrix/client/unstable/thirdparty/protocols",
get(client::get_protocols_route_unstable))
.route(
"/_matrix/client/unstable/thirdparty/protocols",
get(client::get_protocols_route_unstable),
)
.ruma_route(&client::send_message_event_route)
.ruma_route(&client::send_state_event_for_key_route)
.ruma_route(&client::get_state_events_route)
.ruma_route(&client::get_state_event_for_key_route)
// Ruma doesn't have support for multiple paths for a single endpoint yet, and these routes
// share one Ruma request / response type pair with {get,send}_state_event_for_key_route
// Ruma doesn't have support for multiple paths for a single endpoint yet, and these
// routes share one Ruma request / response type pair with
// {get,send}_state_event_for_key_route
.route(
"/_matrix/client/r0/rooms/{room_id}/state/{event_type}",
get(client::get_state_events_for_empty_key_route)
@@ -181,6 +184,7 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
.ruma_route(&client::get_mutual_rooms_unstable_route)
.ruma_route(&client::get_mutual_rooms_route)
.ruma_route(&client::get_room_summary)
.ruma_route(&client::get_stripped_state_route)
.ruma_route(&client::get_suspended_status)
.ruma_route(&client::put_suspended_status)
.ruma_route(&client::get_lock_status)
@@ -196,6 +200,10 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
.ruma_route(&admin::rooms::ban::ban_room)
.ruma_route(&admin::rooms::list::list_rooms);
if config.allow_prometheus_metrics {
router = router.route("/_continuwuity/metrics", get(client::continuwuity_metrics));
}
if config.allow_federation {
router = router
.ruma_route(&server::get_server_version_route)
@@ -221,8 +229,8 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
.ruma_route(&server::get_profile_information_route)
.ruma_route(&server::get_keys_route)
.ruma_route(&server::claim_keys_route)
.ruma_route(&server::get_openid_userinfo_route)
.ruma_route(&server::get_hierarchy_route)
.ruma_route(&server::get_stripped_state_route)
.ruma_route(&server::well_known_server)
.ruma_route(&server::get_content_route)
.ruma_route(&server::get_content_thumbnail_route)
@@ -235,6 +243,10 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
.route("/_continuwuity/local_user_count", any(federation_disabled));
}
// Always add userinfo endpoint, even if federation is disabled, so livekit
// and other functionality will continue to work
router = router.ruma_route(&server::get_openid_userinfo_route);
if config.allow_legacy_media {
router = router
.ruma_route(&client::get_media_config_legacy_route)
+13 -4
View File
@@ -8,7 +8,7 @@ use axum::{
use conduwuit::{Error, Result, err};
use ruma::{
CanonicalJsonObject,
api::{IncomingRequest, IncomingRequestExt},
api::{IncomingRequest, IncomingRequestExt, auth_scheme::AuthScheme},
};
use serde::Deserialize;
@@ -92,13 +92,22 @@ where
let request = hyper::Request::from_parts(parts, body.as_ref());
// Check authentication
let auth =
R::Authentication::authenticate::<R, &[u8]>(services, &request, auth_query).await?;
let authentication =
R::Authentication::extract_authentication(&request).map_err(|err| {
err!(Request(Unauthorized(warn!(
path = request.uri().path(),
err = err.into(),
"Failed to extract authentication"
))))
})?;
let identity =
R::Authentication::check::<R>(services, &request, authentication, auth_query).await?;
// Deserialize the body
let body = R::try_from_http_request(request, &borrowed_path)
.map_err(|e| err!(Request(BadJson(debug_warn!("{e}")))))?;
Ok(Self { body, json_body, identity: auth })
Ok(Self { body, json_body, identity })
}
}
+226 -199
View File
@@ -1,4 +1,7 @@
use std::any::{Any, TypeId};
use std::{
any::{Any, TypeId},
collections::BTreeSet,
};
use conduwuit::{
Err, Error, Result, err,
@@ -9,13 +12,13 @@ use ruma::{
DeviceId, MilliSecondsSinceUnixEpoch, OwnedDeviceId, OwnedServerName, OwnedUserId, UInt,
UserId,
api::{
IncomingRequest,
IncomingRequest, OAuthClientScope,
auth_scheme::{
AccessToken, AccessTokenOptional, AppserviceToken, AppserviceTokenOptional,
AuthScheme, NoAccessToken, NoAuthentication,
},
client,
error::{ErrorKind, UnknownTokenErrorData},
error::{ErrorKind, InsufficientUserAuthenticationErrorData, UnknownTokenErrorData},
federation::authentication::ServerSignatures,
},
assign,
@@ -84,75 +87,50 @@ impl ClientIdentity {
pub(crate) trait CheckAuth: AuthScheme {
type Identity: Send;
fn authenticate<R: IncomingRequest + Any, B: AsRef<[u8]> + Sync>(
fn check<R: IncomingRequest<Authentication = Self> + Any>(
services: &Services,
incoming_request: &hyper::Request<B>,
incoming_request: &hyper::Request<&[u8]>,
authentication: Self::Output,
query: AuthQueryParams,
) -> impl Future<Output = Result<Self::Identity>> + Send {
async move {
let route = TypeId::of::<R>();
let output = Self::extract_authentication(incoming_request).map_err(|err| {
err!(Request(Unauthorized(warn!(
"Failed to extract authorization: {}",
err.into()
))))
})?;
Self::verify(services, output, incoming_request, query, route).await
}
}
fn verify<B: AsRef<[u8]> + Sync>(
services: &Services,
output: Self::Output,
request: &hyper::Request<B>,
query: AuthQueryParams,
route: TypeId,
) -> impl Future<Output = Result<Self::Identity>> + Send;
}
impl CheckAuth for ServerSignatures {
type Identity = OwnedServerName;
async fn verify<B: AsRef<[u8]> + Sync>(
async fn check<R: IncomingRequest<Authentication = Self> + Any>(
services: &Services,
output: Self::Output,
request: &hyper::Request<B>,
incoming_request: &hyper::Request<&[u8]>,
authentication: Self::Output,
_query: AuthQueryParams,
_route: TypeId,
) -> Result<Self::Identity> {
let destination = services.globals.server_name();
if output
.destination
.as_ref()
.is_some_and(|supplied_destination| supplied_destination != destination)
{
return Err!(Request(Unauthorized("Destination mismatch.")));
}
let min_valid_ts =
MilliSecondsSinceUnixEpoch(UInt::new_saturating(millis_since_unix_epoch()));
let key = services
.server_keys
.get_single_verify_key(&output.origin, &output.key, min_valid_ts)
.get_single_verify_key(&authentication.origin, &authentication.key, min_valid_ts)
.await
.ok_or_else(|| {
err!(Request(Unauthorized(debug_warn!(
origin=%output.origin,
origin=%authentication.origin,
"Unable to acquire your signing key (ID: {})",
output.key
authentication.key
))))
})?;
let keys: PubKeys = [(output.key.to_string(), key.key)].into();
let keys: PubKeyMap = [(output.origin.as_str().into(), keys)].into();
let keys: PubKeys = [(authentication.key.to_string(), key.key)].into();
let keys: PubKeyMap = [(authentication.origin.as_str().into(), keys)].into();
match output.verify_http_request(request, destination, &keys) {
match authentication.verify_http_request(
incoming_request,
services.globals.server_name(),
&keys,
) {
| Ok(()) => {
if services
.moderation
.is_remote_server_forbidden(&output.origin)
.is_remote_server_forbidden(&authentication.origin)
{
return Err!(Request(Forbidden(
"You are blocked from federating with this server."
@@ -160,15 +138,15 @@ impl CheckAuth for ServerSignatures {
}
// Ping the server as healthy
if services.federation.mark_healthy(&output.origin) {
if services.federation.mark_healthy(&authentication.origin) {
services
.sending
.flush_servers([output.origin.clone()].stream())
.flush_servers([authentication.origin.clone()].stream())
.await
.ok();
}
Ok(output.origin)
Ok(authentication.origin)
},
| Err(err) => Err!(Request(Unauthorized(debug_warn!(
"Failed to verify X-Matrix header: {err}"
@@ -180,120 +158,44 @@ impl CheckAuth for ServerSignatures {
impl CheckAuth for AccessToken {
type Identity = ClientIdentity;
async fn verify<B: AsRef<[u8]> + Sync>(
async fn check<R: IncomingRequest<Authentication = Self> + Any>(
services: &Services,
output: Self::Output,
_request: &hyper::Request<B>,
_incoming_request: &hyper::Request<&[u8]>,
authentication: Self::Output,
query: AuthQueryParams,
route: TypeId,
) -> Result<Self::Identity> {
if output.is_empty() {
return Err!(Request(Unauthorized("Missing access token.")));
}
if let Some((sender_user, sender_device, status)) =
services.users.find_from_token(&output).await
{
// If the token is expired we return a soft logout
if matches!(status, AccessTokenStatus::Expired) {
return Err(Error::Request(
ErrorKind::UnknownToken(
assign!(UnknownTokenErrorData::new(), { soft_logout: true }),
),
"This token has expired".into(),
StatusCode::UNAUTHORIZED,
));
}
// Locked users can only use /logout and /logout/all
if services
.users
.is_locked(&sender_user)
.await
.is_ok_and(std::convert::identity)
{
if !(route == TypeId::of::<client::session::logout::v3::Request>()
|| route == TypeId::of::<client::session::logout_all::v3::Request>())
{
return Err!(Request(UserLocked("Your account is locked.")));
}
}
Ok(ClientIdentity::User { sender_user, sender_device })
} else if let Ok(appservice_info) = services.appservice.find_from_token(&output).await {
let Ok(sender_user) = query.user_id.clone().map_or_else(
|| {
UserId::parse_with_server_name(
appservice_info.registration.sender_localpart.as_str(),
services.globals.server_name(),
)
},
UserId::parse,
) else {
return Err!(Request(InvalidUsername("Username is invalid.")));
};
if !appservice_info.is_user_match(&sender_user) {
return Err!(Request(Exclusive("User is not in namespace.")));
}
// MSC3202/MSC4190: Handle device_id masquerading for appservices.
// The device_id can be provided via `device_id` or
// `org.matrix.msc3202.device_id` query parameter.
let sender_device = if let Some(device_id) = query
.device_id
.or(query.legacy_device_id)
.as_deref()
.map(Into::into)
{
// Verify the device exists for this user
if services
.users
.get_device_metadata(&sender_user, device_id)
.await
.is_err()
{
return Err!(Request(Forbidden(
"Device does not exist for user or appservice cannot masquerade as this \
device."
)));
}
Some(device_id.to_owned())
} else {
None
};
Ok(ClientIdentity::Appservice {
sender_user,
sender_device,
appservice_info: Box::new(appservice_info),
})
} else {
Err(Error::Request(
ErrorKind::UnknownToken(UnknownTokenErrorData::new()),
"Invalid token".into(),
StatusCode::UNAUTHORIZED,
))
}
check_access_token(
services,
&authentication,
query,
TypeId::of::<R>(),
R::required_client_scopes(),
)
.await
}
}
impl CheckAuth for AccessTokenOptional {
type Identity = Option<ClientIdentity>;
async fn verify<B: AsRef<[u8]> + Sync>(
async fn check<R: IncomingRequest<Authentication = Self> + Any>(
services: &Services,
output: Self::Output,
request: &hyper::Request<B>,
_incoming_request: &hyper::Request<&[u8]>,
authentication: Self::Output,
query: AuthQueryParams,
route: TypeId,
) -> Result<Self::Identity> {
match output {
| Some(token) =>
<AccessToken as CheckAuth>::verify(services, token, request, query, route)
.await
.map(Some),
| None => Ok(None),
if let Some(authentication) = authentication {
check_access_token(
services,
&authentication,
query,
TypeId::of::<R>(),
R::required_client_scopes(),
)
.await
.map(Some)
} else {
Ok(None)
}
}
}
@@ -301,40 +203,31 @@ impl CheckAuth for AccessTokenOptional {
impl CheckAuth for AppserviceToken {
type Identity = RegistrationInfo;
async fn verify<B: AsRef<[u8]> + Sync>(
async fn check<R: IncomingRequest + Any>(
services: &Services,
output: Self::Output,
_request: &hyper::Request<B>,
_incoming_request: &hyper::Request<&[u8]>,
authentication: Self::Output,
_query: AuthQueryParams,
_route: TypeId,
) -> Result<Self::Identity> {
if output.is_empty() {
return Err!(Request(Unauthorized("Missing access token.")));
}
let Ok(appservice_info) = services.appservice.find_from_token(&output).await else {
return Err!(Request(Unauthorized("Invalid appservice token.")));
};
Ok(appservice_info)
check_appservice_token(services, &authentication).await
}
}
impl CheckAuth for AppserviceTokenOptional {
type Identity = Option<RegistrationInfo>;
async fn verify<B: AsRef<[u8]> + Sync>(
async fn check<R: IncomingRequest<Authentication = Self> + Any>(
services: &Services,
output: Self::Output,
request: &hyper::Request<B>,
query: AuthQueryParams,
route: TypeId,
_incoming_request: &hyper::Request<&[u8]>,
authentication: Self::Output,
_query: AuthQueryParams,
) -> Result<Self::Identity> {
match output {
| Some(token) =>
<AppserviceToken as CheckAuth>::verify(services, token, request, query, route)
.await
.map(Some),
| None => Ok(None),
if let Some(authentication) = authentication {
check_appservice_token(services, &authentication)
.await
.map(Some)
} else {
Ok(None)
}
}
}
@@ -342,13 +235,12 @@ impl CheckAuth for AppserviceTokenOptional {
impl CheckAuth for NoAuthentication {
type Identity = ();
fn verify<B: AsRef<[u8]> + Sync>(
fn check<R: IncomingRequest<Authentication = Self> + Any>(
_services: &Services,
_output: Self::Output,
_request: &hyper::Request<B>,
_incoming_request: &hyper::Request<&[u8]>,
_authentication: Self::Output,
_query: AuthQueryParams,
_route: TypeId,
) -> impl Future<Output = Result<Self::Identity>> {
) -> impl Future<Output = Result<Self::Identity>> + Send {
std::future::ready(Ok(()))
}
}
@@ -356,31 +248,166 @@ impl CheckAuth for NoAuthentication {
impl CheckAuth for NoAccessToken {
type Identity = Option<ClientIdentity>;
async fn verify<B: AsRef<[u8]> + Sync>(
async fn check<R: IncomingRequest<Authentication = Self> + Any>(
services: &Services,
_output: Self::Output,
request: &hyper::Request<B>,
incoming_request: &hyper::Request<&[u8]>,
_authentication: Self::Output,
query: AuthQueryParams,
route: TypeId,
) -> Result<Self::Identity> {
// We handle these the same as AccessTokenOptional
let token = AccessTokenOptional::extract_authentication(request).map_err(|err| {
err!(Request(Unauthorized(warn!("Failed to extract authorization: {}", err))))
})?;
let authentication = AccessTokenOptional::extract_authentication(incoming_request)
.map_err(|err| {
err!(Request(Unauthorized(warn!("Failed to extract authorization: {}", err))))
})?;
// Check special access restrictions
if (route == TypeId::of::<client::profile::get_avatar_url::v3::Request>()
|| route == TypeId::of::<client::profile::get_display_name::v3::Request>()
|| route == TypeId::of::<client::profile::get_profile_field::v3::Request>()
|| route == TypeId::of::<client::profile::get_profile::v3::Request>())
&& services.config.require_auth_for_profile_requests
&& token.is_none()
{
return Err!(Request(Unauthorized(
"This server requires authentication to access user profiles."
)));
if let Some(authentication) = authentication {
check_access_token(services, &authentication, query, TypeId::of::<R>(), &[
OAuthClientScope::ApiFullAccess,
])
.await
.map(Some)
} else {
Ok(None)
}
<AccessTokenOptional as CheckAuth>::verify(services, token, request, query, route).await
}
}
async fn check_access_token(
services: &Services,
token: &str,
query: AuthQueryParams,
route: TypeId,
required_scopes: &[OAuthClientScope],
) -> Result<ClientIdentity> {
if token.is_empty() {
return Err!(Request(Unauthorized("Empty access token.")));
}
if let Some((sender_user, sender_device, status)) =
services.users.find_from_token(token).await
{
// If the token is expired we return a soft logout
if matches!(status, AccessTokenStatus::Expired) {
return Err(Error::Request(
ErrorKind::UnknownToken(
assign!(UnknownTokenErrorData::new(), { soft_logout: true }),
),
"This token has expired".into(),
StatusCode::UNAUTHORIZED,
));
}
// Locked users can only use /logout and /logout/all
if services
.users
.is_locked(&sender_user)
.await
.is_ok_and(std::convert::identity)
{
if !(route == TypeId::of::<client::session::logout::v3::Request>()
|| route == TypeId::of::<client::session::logout_all::v3::Request>())
{
return Err!(Request(UserLocked("Your account is locked.")));
}
}
let session_info = services
.oauth
.get_session_info_for_device(&sender_user, &sender_device)
.await
.map(Box::new);
// Make sure the user has the right scopes to use the route
let user_scopes = if let Some(session_info) = &session_info {
session_info.scopes()
} else {
let mut scopes = BTreeSet::from_iter([OAuthClientScope::ApiFullAccess]);
if services.admin.user_is_admin(&sender_user).await {
scopes.insert(OAuthClientScope::ServerAdministration);
}
scopes
};
if !required_scopes
.iter()
.any(|scope| user_scopes.contains(scope))
{
return Err(Error::Request(
ErrorKind::InsufficientUserAuthentication(Box::new(
assign!(InsufficientUserAuthenticationErrorData::new(), {
scope: required_scopes.iter().cloned().collect()
}),
)),
"You do not have permission to access this endpoint.".into(),
StatusCode::UNAUTHORIZED,
));
}
Ok(ClientIdentity::User { sender_user, sender_device })
} else if let Ok(appservice_info) = services.appservice.find_from_token(token).await {
let Ok(sender_user) = query.user_id.clone().map_or_else(
|| {
UserId::parse_with_server_name(
appservice_info.registration.sender_localpart.as_str(),
services.globals.server_name(),
)
},
UserId::parse,
) else {
return Err!(Request(InvalidUsername("Username is invalid.")));
};
if !appservice_info.is_user_match(&sender_user) {
return Err!(Request(Exclusive("User is not in namespace.")));
}
// MSC3202/MSC4190: Handle device_id masquerading for appservices.
// The device_id can be provided via `device_id` or
// `org.matrix.msc3202.device_id` query parameter.
let sender_device = if let Some(device_id) = query
.device_id
.or(query.legacy_device_id)
.as_deref()
.map(Into::into)
{
// Verify the device exists for this user
if services
.users
.get_device_metadata(&sender_user, device_id)
.await
.is_err()
{
return Err!(Request(Forbidden(
"Device does not exist for user or appservice cannot masquerade as this \
device."
)));
}
Some(device_id.to_owned())
} else {
None
};
Ok(ClientIdentity::Appservice {
sender_user,
sender_device,
appservice_info: Box::new(appservice_info),
})
} else {
Err(Error::Request(
ErrorKind::UnknownToken(UnknownTokenErrorData::new()),
"Invalid token".into(),
StatusCode::UNAUTHORIZED,
))
}
}
async fn check_appservice_token(services: &Services, token: &str) -> Result<RegistrationInfo> {
let Ok(appservice_info) = services.appservice.find_from_token(token).await else {
return Err!(Request(Unauthorized("Invalid appservice token.")));
};
Ok(appservice_info)
}
+18 -2
View File
@@ -5,6 +5,7 @@ use base64::{Engine as _, engine::general_purpose};
use conduwuit::{
Err, Error, EventTypeExt, PduEvent, Result, debug, err, error,
matrix::{Event, StateKey},
metrics::KeyValue,
result::FlatOk,
state_res, trace,
utils::hash::sha256,
@@ -31,6 +32,21 @@ use crate::{Ruma, server::utils::validate_any_membership_event};
pub(crate) async fn create_invite_route(
State(services): State<crate::State>,
body: Ruma<create_invite::v2::Request>,
) -> Result<create_invite::v2::Response> {
let result = create_invite(&services, body).await;
services.server.metrics.instruments.invites.add(1, &[
KeyValue::new("direction", "incoming"),
KeyValue::new("destination", "local"),
KeyValue::new("outcome", if result.is_ok() { "success" } else { "failure" }),
]);
result
}
async fn create_invite(
services: &crate::State,
body: Ruma<create_invite::v2::Request>,
) -> Result<create_invite::v2::Response> {
if !services.server.supported_room_version(&body.room_version) {
return Err(Error::BadRequest(
@@ -64,7 +80,7 @@ pub(crate) async fn create_invite_route(
"Validating invite room state for invite request"
);
let (create_event_id, state) = validate_invite_state(
&services,
services,
&body.invite_room_state,
&room_version_rules,
body.room_id.clone(),
@@ -92,7 +108,7 @@ pub(crate) async fn create_invite_route(
// And then we can validate the member event itself
let (mut signed_event, sender_user, recipient_user) = validate_invite_membership_event(
&services,
services,
&body.event,
&room_version_rules,
&body.identity,
+67 -185
View File
@@ -1,29 +1,19 @@
use std::{borrow::ToOwned, pin::pin};
use axum::extract::State;
use conduwuit::{
Err, Error, Result, debug, debug_info, info, matrix::pdu::PartialPdu, utils, warn,
};
use conduwuit_service::Services;
use futures::StreamExt;
use conduwuit::{Err, Error, Result, info, matrix::pdu::PartialPdu, utils};
use ruma::{
OwnedUserId, RoomId, UserId,
OwnedUserId,
api::{
error::{ErrorKind, IncompatibleRoomVersionErrorData},
federation::membership::prepare_join_event,
},
assign,
events::{
StateEventType,
room::{
join_rules::{AllowRule, JoinRule, RoomJoinRulesEventContent},
member::{MembershipState, RoomMemberEventContent},
},
events::room::{
join_rules::JoinRule,
member::{MembershipState, RoomMemberEventContent},
},
};
use serde_json::value::to_raw_value;
use service::rooms::state::RoomMutexGuard;
use tokio::join;
use service::rooms::membership::{JoinConditionEntity, JoinConditionResult};
use crate::Ruma;
@@ -35,9 +25,6 @@ pub(crate) async fn create_join_event_template_route(
State(services): State<crate::State>,
body: Ruma<prepare_join_event::v1::Request>,
) -> Result<prepare_join_event::v1::Response> {
if !services.rooms.metadata.exists(&body.room_id).await {
return Err!(Request(NotFound("Room is unknown to this server.")));
}
if !services
.rooms
.state_cache
@@ -63,18 +50,6 @@ pub(crate) async fn create_join_event_template_route(
.acl_check(&body.identity, &body.room_id)
.await?;
if services
.moderation
.is_remote_server_forbidden(&body.identity)
{
warn!(
"Server {} for remote user {} tried joining room ID {} which has a server name that \
is globally forbidden. Rejecting.",
body.identity, &body.user_id, &body.room_id,
);
return Err!(Request(Forbidden("Server is banned on this homeserver.")));
}
let room_version = services.rooms.state.get_room_version(&body.room_id).await?;
let room_version_rules = room_version.rules().unwrap();
if !body.ver.contains(&room_version) {
@@ -87,41 +62,78 @@ pub(crate) async fn create_join_event_template_route(
}
let state_lock = services.rooms.state.mutex.lock(body.room_id.as_str()).await;
let (is_invited, is_joined) = join!(
services
.rooms
.state_cache
.is_invited(&body.user_id, &body.room_id),
services
.rooms
.state_cache
.is_joined(&body.user_id, &body.room_id)
);
let current_membership = services
.rooms
.state_accessor
.get_member(&body.room_id, &body.user_id)
.await
.ok()
.map_or_else(|| MembershipState::Leave, |content| content.membership);
let join_authorized_via_users_server: Option<OwnedUserId> = {
if is_joined || is_invited {
// User is already joined or invited and consequently does not need
// an authorising user
if matches!(
current_membership,
MembershipState::Join | MembershipState::Invite | MembershipState::Knock
) {
// User is already joined, invited, or knocked, and consequently
// does not need an authorising user
None
} else if !room_version_rules.authorization.restricted_join_rule {
// room version does not support restricted join rules
// Room version does not support restricted join rules
None
} else if user_can_perform_restricted_join(&services, &body.user_id, &body.room_id)
.await?
{
Some(
select_authorising_user(&services, &body.room_id, &body.user_id, &state_lock)
.await?,
)
} else {
None
let join_rules = services
.rooms
.state_accessor
.get_join_rules(&body.room_id)
.await;
if let JoinRule::Restricted(conditions) | JoinRule::KnockRestricted(conditions) =
join_rules
{
match services
.rooms
.membership
.evaluate_join_conditions(
&body.room_id,
JoinConditionEntity::User(&body.user_id),
&conditions,
)
.await
{
| JoinConditionResult::Satisfied => {
// Try to find an authorizing user
services
.rooms
.membership
.select_authorizing_user(&body.room_id, &body.user_id, &state_lock)
.await
.map(Some)?
},
| JoinConditionResult::Unsatisfied => {
return Err!(Request(Forbidden(
"You do not satisfy this room's join conditions."
)));
},
| JoinConditionResult::UnableToAuthorizeJoin => {
return Err!(Request(UnableToAuthorizeJoin(
"This server cannot check this room's join conditions."
)));
},
}
} else {
None
}
}
};
if services.antispam.check_all_joins() && join_authorized_via_users_server.is_none() {
if services.antispam.check_all_joins() {
if services
.antispam
.meowlnir_accept_make_join(body.room_id.clone(), body.user_id.clone())
.await
.is_err()
!= JoinConditionResult::Satisfied
{
return Err!(Request(Forbidden("Antispam rejected join request.")));
}
@@ -153,133 +165,3 @@ pub(crate) async fn create_join_event_template_route(
}),
)
}
/// Attempts to find a user who is able to issue an invite in the target room.
pub(crate) async fn select_authorising_user<'a>(
services: &Services,
room_id: &'a RoomId,
user_id: &'a UserId,
state_lock: &'a RoomMutexGuard,
) -> Result<OwnedUserId> {
let candidates = services.rooms.state_cache.local_users_in_room(room_id);
let mut candidates = pin!(candidates);
while let Some(candidate) = candidates.next().await {
if services
.rooms
.state_accessor
.user_can_invite(room_id, &candidate, user_id, state_lock)
.await
{
return Ok(candidate);
}
}
Err!(Request(UnableToGrantJoin(
"No user on this server is able to assist in joining."
)))
}
/// Checks whether the given user can join the given room via a restricted join.
pub(crate) async fn user_can_perform_restricted_join(
services: &Services,
user_id: &UserId,
room_id: &RoomId,
) -> Result<bool> {
let Ok(join_rules_event_content) = services
.rooms
.state_accessor
.room_state_get_content::<RoomJoinRulesEventContent>(
room_id,
&StateEventType::RoomJoinRules,
"",
)
.await
else {
// No join rules means there's nothing to authorise (defaults to invite)
return Ok(false);
};
let (JoinRule::Restricted(r) | JoinRule::KnockRestricted(r)) =
join_rules_event_content.join_rule
else {
// This is not a restricted room
return Ok(false);
};
if r.allow.is_empty() {
// This will never be authorisable, return forbidden.
return Err!(Request(Forbidden("You are not invited to this room.")));
}
let mut could_satisfy = true;
for allow_rule in &r.allow {
match allow_rule {
| AllowRule::RoomMembership(membership) => {
if !services
.rooms
.state_cache
.server_in_room(services.globals.server_name(), &membership.room_id)
.await
{
// Since we can't check this room, mark could_satisfy as
// false so that we can return
// M_UNABLE_TO_AUTHORIZE_JOIN later.
could_satisfy = false;
continue;
}
if services
.rooms
.state_cache
.is_joined(user_id, &membership.room_id)
.await
{
debug!(
"User {} is allowed to join room {} via membership in room {}",
user_id, room_id, membership.room_id
);
return Ok(true);
}
},
| other if other.rule_type() == "fi.mau.spam_checker" =>
return match services
.antispam
.meowlnir_accept_make_join(room_id.to_owned(), user_id.to_owned())
.await
{
| Ok(()) => Ok(true),
| Err(_) => Err!(Request(Forbidden("Antispam rejected join request."))),
},
| _ => {
// We don't recognise this join rule, so we cannot satisfy the
// request.
could_satisfy = false;
debug_info!(
"Unsupported allow rule in restricted join for room {}: {:?}",
room_id,
allow_rule
);
},
}
}
if could_satisfy {
// We were able to check all the restrictions and can be certain that
// the prospective member is not permitted to join.
Err!(Request(Forbidden(
"You do not belong to any of the rooms or spaces required to join this room."
)))
} else {
// We were unable to check all the restrictions. This usually means we
// aren't in one of the rooms this one is restricted to, ergo can't
// check its state for the user's membership, and consequently the
// user *might* be able to join if they ask another server.
Err!(Request(UnableToAuthorizeJoin(
"You do not belong to any of the recognised rooms or spaces required to join this \
room, but this server is unable to verify every requirement. You may be able to \
join via another server."
)))
}
}
+2
View File
@@ -18,6 +18,7 @@ pub(super) mod send_knock;
pub(super) mod send_leave;
pub(super) mod state;
pub(super) mod state_ids;
pub(super) mod stripped_state;
pub(super) mod user;
pub(super) mod version;
pub(super) mod well_known;
@@ -42,6 +43,7 @@ pub(super) use send_knock::*;
pub(super) use send_leave::*;
pub(super) use state::*;
pub(super) use state_ids::*;
pub(super) use stripped_state::*;
pub(super) use user::*;
pub(super) use version::*;
pub(super) use well_known::*;
+96 -3
View File
@@ -6,6 +6,7 @@ use std::{
use axum::extract::State;
use conduwuit::{
Err, Error, Result, debug, debug_error, debug_warn, err, error,
metrics::KeyValue,
result::LogErr,
trace,
utils::{
@@ -22,7 +23,8 @@ use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
use http::StatusCode;
use itertools::Itertools;
use ruma::{
CanonicalJsonObject, OwnedEventId, OwnedRoomId, OwnedUserId, RoomId, ServerName, UserId,
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, OwnedUserId, RoomId,
ServerName, UserId,
api::{
error::{ErrorKind, LimitExceededErrorData},
federation::transactions::{
@@ -34,7 +36,10 @@ use ruma::{
send_transaction_message,
},
},
events::receipt::{ReceiptEvent, ReceiptEventContent, ReceiptType},
events::{
TimelineEventType,
receipt::{ReceiptEvent, ReceiptEventContent, ReceiptType},
},
serde::Raw,
to_device::DeviceIdOrAllDevices,
};
@@ -151,6 +156,15 @@ async fn process_inbound_transaction(
{
| Ok(pdu) => Some(pdu),
| Err(error) => {
services
.server
.metrics
.instruments
.federation_incoming_pdus
.add(1, &[
KeyValue::new("type", pdu_type_label(raw_pdu_type(pdu).as_deref())),
KeyValue::new("outcome", "unparsable"),
]);
let queued = services
.rooms
.event_handler
@@ -181,6 +195,17 @@ async fn process_inbound_transaction(
.catch_unwind()
.map_err(Error::from_panic)
.await;
let outcome = if matches!(handle_result, Ok(Ok(_))) {
"success"
} else {
"failure"
};
services
.server
.metrics
.instruments
.federation_incoming_transaction_duration
.record(txn_start_time.elapsed().as_secs_f64(), &[KeyValue::new("outcome", outcome)]);
let results = match handle_result {
| Ok(Ok(results)) => results,
| Ok(Err(err)) => {
@@ -337,6 +362,16 @@ async fn handle_room(
.server
.check_running()
.map_err(|_| TransactionError::ShuttingDown)?;
let event_type = KeyValue::new(
"type",
pdu_type_label(value.get("type").and_then(CanonicalJsonValue::as_str)),
);
let origin_server_ts = value
.get("origin_server_ts")
.and_then(CanonicalJsonValue::as_integer)
.and_then(|ts| u64::try_from(i64::from(ts)).ok());
let start = Instant::now();
let result = services
.rooms
.event_handler
@@ -344,12 +379,44 @@ async fn handle_room(
.boxed()
.await
.map(|_| ());
let outcome = KeyValue::new("outcome", match &result {
| Ok(()) => "accepted",
| Err(Error::BadRequest(ErrorKind::Forbidden, ..)) => "forbidden",
| Err(Error::BadRequest(ErrorKind::InvalidParam | ErrorKind::BadJson, ..)) =>
"invalid",
| Err(_) => "error",
});
let instruments = &services.server.metrics.instruments;
instruments
.federation_incoming_pdu_duration
.record(start.elapsed().as_secs_f64(), std::slice::from_ref(&outcome));
if let (Ok(()), Some(ts)) = (&result, origin_server_ts) {
let lag = millis_since_unix_epoch().saturating_sub(ts);
instruments
.federation_incoming_pdu_lag
.record(Duration::from_millis(lag).as_secs_f64(), &[]);
}
instruments
.federation_incoming_pdus
.add(1, &[event_type, outcome]);
results.push((event_id, result));
}
Ok(results)
}
async fn handle_edu(services: &Services, origin: &ServerName, edu: Edu) {
let edu_type = match &edu {
| Edu::Presence(_) => "m.presence",
| Edu::Receipt(_) => "m.receipt",
| Edu::Typing(_) => "m.typing",
| Edu::DeviceListUpdate(_) => "m.device_list_update",
| Edu::DirectToDevice(_) => "m.direct_to_device",
| Edu::SigningKeyUpdate(_) => "m.signing_key_update",
| _ => "other",
};
let start = Instant::now();
match edu {
| Edu::Presence(presence) if services.server.config.allow_incoming_presence =>
handle_edu_presence(services, origin, presence).await,
@@ -373,6 +440,32 @@ async fn handle_edu(services: &Services, origin: &ServerName, edu: Edu) {
| _ => trace!(?edu, "skipped"),
}
let edu_type = [KeyValue::new("type", edu_type)];
let instruments = &services.server.metrics.instruments;
instruments
.federation_incoming_edu_duration
.record(start.elapsed().as_secs_f64(), &edu_type);
instruments.federation_incoming_edus.add(1, &edu_type);
}
/// Known event types, or `other`, so remote servers cannot create new
/// attribute values.
fn pdu_type_label(event_type: Option<&str>) -> String {
match event_type.map(TimelineEventType::from) {
| Some(TimelineEventType::_Custom(_)) | None => "other".to_owned(),
| Some(event_type) => event_type.to_string(),
}
}
fn raw_pdu_type(pdu: &serde_json::value::RawValue) -> Option<String> {
#[derive(serde::Deserialize)]
struct Typed {
#[serde(rename = "type")]
kind: Option<String>,
}
serde_json::from_str::<Typed>(pdu.get()).ok()?.kind
}
async fn handle_edu_presence(
@@ -502,7 +595,7 @@ async fn handle_edu_receipt_room_user(
.readreceipt_update(
user_id,
room_id,
&ReceiptEvent::new(
ReceiptEvent::new(
room_id.to_owned(),
ReceiptEventContent::from_iter(content),
),
+76 -14
View File
@@ -16,9 +16,11 @@ use ruma::{
TimelineEventType,
room::member::{MembershipState, RoomMemberEventContent},
},
room::JoinRule,
room_version_rules::RoomVersionRules,
};
use serde_json::value::to_raw_value;
use service::rooms::membership::{JoinConditionEntity, JoinConditionResult};
use crate::{Ruma, server::utils::validate_any_membership_event};
@@ -108,18 +110,56 @@ async fn create_join_event(
they cannot authorise your join."
)));
}
if !super::user_can_perform_restricted_join(services, &sender, room_id).await? {
return Err!(Request(UnableToAuthorizeJoin(
"Joining user did not pass restricted room's rules."
// If the user is invited or joined we don't need to check the join
// conditions, but in that case the requesting server shouldn't
// have set `join_authorized_via_users_server` in the first place.
let join_rules = services.rooms.state_accessor.get_join_rules(room_id).await;
if let JoinRule::Restricted(conditions) | JoinRule::KnockRestricted(conditions) =
join_rules
{
match services
.rooms
.membership
.evaluate_join_conditions(
room_id,
JoinConditionEntity::User(&sender),
&conditions,
)
.await
{
| JoinConditionResult::Satisfied => {
// Sign the join to prove that we checked the conditions.
services
.server_keys
.hash_and_sign_event(&mut pdu, room_version_rules)
.map_err(|e| {
err!(Request(InvalidParam(warn!(
"Failed to sign send_join event: {e}"
))))
})?;
},
| JoinConditionResult::Unsatisfied => {
return Err!(Request(Forbidden(
"You do not satisfy this room's join conditions."
)));
},
| JoinConditionResult::UnableToAuthorizeJoin => {
return Err!(Request(UnableToAuthorizeJoin(
"This server cannot check this room's join conditions."
)));
},
}
} else {
// We can't sign this, and if we don't sign it our event will fail
// the auth check, so we have to bail out here.
return Err!(Request(InvalidParam(
"join_authorized_via_users_server was supplied for a room that is not restricted"
)));
}
services
.server_keys
.hash_and_sign_event(&mut pdu, room_version_rules)
.map_err(|e| {
err!(Request(InvalidParam(warn!("Failed to sign send_join event: {e}"))))
})?;
}
let mutex_lock = services
@@ -163,7 +203,14 @@ async fn create_join_event(
}
Some(event_id)
})
.broad_and_then(|event_id| services.rooms.timeline.get_pdu_json(event_id))
.broad_and_then(|event_id| async move {
services
.rooms
.timeline
.get_pdu_json(event_id)
.await
.map_err(|e| err!(Database("Could not fetch state event {event_id}: {e:?}")))
})
.broad_and_then(|pdu| {
services
.sending
@@ -172,7 +219,12 @@ async fn create_join_event(
})
.try_collect()
.boxed()
.await?;
.await
.map_err(|e| {
err!(BadServerResponse(
error!(err=?e, "Failed to build room state at new join event")
))
})?;
let starting_events = state_ids.iter().map(Borrow::borrow);
trace!("Constructing auth chain");
@@ -181,7 +233,12 @@ async fn create_join_event(
.auth_chain
.event_ids_iter(room_id, starting_events)
.broad_and_then(|event_id| async move {
services.rooms.timeline.get_pdu_json(&event_id).await
services
.rooms
.timeline
.get_pdu_json(&event_id)
.await
.map_err(|e| err!(Database("Could not fetch state event {event_id}: {e:?}")))
})
.broad_and_then(|pdu| {
services
@@ -191,7 +248,12 @@ async fn create_join_event(
})
.try_collect()
.boxed()
.await?;
.await
.map_err(|e| {
err!(BadServerResponse(
error!(err=?e, "Failed to build auth chain for new join event")
))
})?;
info!(fast_join = %omit_members, "Sending join event to other servers");
services.sending.send_pdu_room(room_id, &pdu_id).await?;
debug!("Finished sending join event");
+54
View File
@@ -0,0 +1,54 @@
use axum::extract::State;
use conduwuit::{Err, Result};
use ruma::{
api::federation::event::get_stripped_state, assign, events::ALLOWED_STRIPPED_STATE_EVENTS,
};
use service::rooms::summary::{Accessibility, RoomStrippedState};
use crate::Ruma;
/// # `POST /_matrix/federation/unstable/org.continuwuity.msc4560.stripped_state/{room_id}` ([MSC4560])
///
/// Returns a room's stripped state.
///
/// [MSC4560]: https://github.com/matrix-org/matrix-spec-proposals/pull/4560
pub(crate) async fn get_stripped_state_route(
State(services): State<crate::State>,
body: Ruma<get_stripped_state::unstable::Request>,
) -> Result<get_stripped_state::unstable::Response> {
if let Some(forbidden_type) = body
.state
.iter()
.find(|event_type| !ALLOWED_STRIPPED_STATE_EVENTS.contains(event_type))
{
return Err!(Request(InvalidParam(
"Event type {forbidden_type} may not be requested as stripped state."
)));
}
if services.rooms.metadata.is_banned(&body.room_id).await {
return Err!(Request(Forbidden("This room is banned on this homeserver.")));
}
match services
.rooms
.summary
.get_local_stripped_state_for_server(
&body.identity,
&body.room_id,
&body.state,
body.num_joined_members,
)
.await
{
| Accessibility::Accessible(RoomStrippedState { state, num_joined_members, .. }) => Ok(
assign!(get_stripped_state::unstable::Response::default(), { state, num_joined_members }),
),
| Accessibility::Inaccessible => {
Err!(Request(Forbidden("You may not access this room's stripped state.")))
},
| Accessibility::NotFound => {
Err!(Request(NotFound("This room is not known to this server.")))
},
}
}
+63 -8
View File
@@ -1,5 +1,10 @@
use std::{
collections::BTreeMap, env, fmt::Write as FmtWrite, fs, io::Write, path::Path,
collections::BTreeMap,
env,
fmt::Write as FmtWrite,
fs,
io::Write,
path::{Path, PathBuf},
process::Command,
};
@@ -130,18 +135,68 @@ fn main() {
}
// --- Rerun Triggers ---
// TODO: The git rerun triggers seem to always run
// // Rerun if the git HEAD changes
// println!("cargo:rerun-if-changed=.git/HEAD");
// // Rerun if the ref pointed to by HEAD changes (e.g., new commit on
// branch) if let Some(ref_path) = run_git_command(&["symbolic-ref",
// "--quiet", "HEAD"]) { println!("cargo:rerun-if-changed=.git/{ref_path}"
// ); }
let resolve_git_path = |path_str: &str| -> PathBuf {
let p = Path::new(path_str);
if p.is_absolute() {
p.to_path_buf()
} else {
Path::new(&manifest_dir).join(p)
}
};
// If workspace root has a .git file (e.g., git worktree or submodule),
// watch it
let workspace_git = metadata.workspace_root.as_std_path().join(".git");
if workspace_git.is_file() {
println!("cargo:rerun-if-changed={}", workspace_git.display());
}
// Rerun if the git HEAD changes
if let Some(git_head) = run_git_command(&["rev-parse", "--git-path", "HEAD"]) {
let head_path = resolve_git_path(&git_head);
if head_path.exists() {
println!("cargo:rerun-if-changed={}", head_path.display());
}
}
// Rerun if the ref pointed to by HEAD changes (e.g., new commit on branch)
if let Some(ref_name) = run_git_command(&["symbolic-ref", "--quiet", "HEAD"]) {
if let Some(git_ref) = run_git_command(&["rev-parse", "--git-path", &ref_name]) {
let ref_path = resolve_git_path(&git_ref);
if ref_path.exists() {
println!("cargo:rerun-if-changed={}", ref_path.display());
} else {
// If the loose ref file does not exist (e.g. refs are packed),
// watch the nearest existing ancestor directory
// so newly created refs trigger rerun.
let mut dir = ref_path.parent();
while let Some(d) = dir {
if d.exists() {
println!("cargo:rerun-if-changed={}", d.display());
break;
}
dir = d.parent();
}
}
}
}
// If packed-refs exists, watch it so git pack-refs or updates to packed
// refs trigger rerun
if let Some(git_packed) = run_git_command(&["rev-parse", "--git-path", "packed-refs"]) {
let packed_path = resolve_git_path(&git_packed);
if packed_path.exists() {
println!("cargo:rerun-if-changed={}", packed_path.display());
}
}
println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH");
println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH_SHORT");
println!("cargo:rerun-if-env-changed=GIT_REMOTE_URL");
println!("cargo:rerun-if-env-changed=GIT_REMOTE_COMMIT_URL");
println!("cargo:rerun-if-env-changed=CONTINUWUITY_VERSION_EXTRA");
println!("cargo:rerun-if-env-changed=CONDUWUIT_VERSION_EXTRA");
println!("cargo:rerun-if-env-changed=CONDUIT_VERSION_EXTRA");
}
fn generate_features_code(features: &BTreeMap<String, Vec<String>>) -> String {
+5
View File
@@ -113,6 +113,9 @@ tracing-subscriber.workspace = true
tracing.workspace = true
url.workspace = true
parking_lot.workspace = true
opentelemetry.workspace = true
opentelemetry-semantic-conventions.workspace = true
prometheus.workspace = true
lock_api.workspace = true
hyper-util.workspace = true
resolvematrix.workspace = true
@@ -127,6 +130,8 @@ hardened_malloc-rs.optional = true
[dev-dependencies]
maplit.workspace = true
opentelemetry_sdk.workspace = true
opentelemetry-prometheus.workspace = true
[lints]
workspace = true
+3
View File
@@ -10,3 +10,6 @@ pub fn memory_stats(_opts: &str) -> Option<String> { None }
/// Always returns None
#[must_use]
pub fn memory_usage() -> Option<String> { None }
#[must_use]
pub fn memory_usage_stats() -> Option<[(&'static str, usize); 6]> { None }
+3
View File
@@ -9,6 +9,9 @@ pub fn trim<I: Into<Option<usize>>>(_: I) -> crate::Result { Ok(()) }
//TODO: get usage
pub fn memory_usage() -> Option<String> { None }
#[must_use]
pub fn memory_usage_stats() -> Option<[(&'static str, usize); 6]> { None }
#[must_use]
pub fn memory_stats(_opts: &str) -> Option<String> {
Some("Extended statistics are not available from hardened_malloc.".to_owned())
+25 -13
View File
@@ -56,25 +56,15 @@ fn _static_initialization() {
#[must_use]
#[cfg(feature = "jemalloc_stats")]
pub fn memory_usage() -> Option<String> {
use mallctl::stats;
let mibs = |input: Result<usize, mallctl::Error>| {
let input = input.unwrap_or_default();
let mibs = |input: usize| {
let kibs = input / 1024;
let kibs = u32::try_from(kibs).unwrap_or_default();
let kibs = f64::from(kibs);
kibs / 1024.0
};
// Acquire the epoch; ensure latest stats are pulled in
acq_epoch().ok()?;
let allocated = mibs(stats::allocated::read());
let active = mibs(stats::active::read());
let mapped = mibs(stats::mapped::read());
let metadata = mibs(stats::metadata::read());
let resident = mibs(stats::resident::read());
let retained = mibs(stats::retained::read());
let [allocated, active, mapped, metadata, resident, retained] =
memory_usage_stats()?.map(|(_, bytes)| mibs(bytes));
Some(format!(
"allocated: {allocated:.2} MiB\nactive: {active:.2} MiB\nmapped: {mapped:.2} \
MiB\nmetadata: {metadata:.2} MiB\nresident: {resident:.2} MiB\nretained: {retained:.2} \
@@ -86,6 +76,28 @@ pub fn memory_usage() -> Option<String> {
#[cfg(not(feature = "jemalloc_stats"))]
pub fn memory_usage() -> Option<String> { None }
#[must_use]
#[cfg(feature = "jemalloc_stats")]
pub fn memory_usage_stats() -> Option<[(&'static str, usize); 6]> {
use mallctl::stats;
// Acquire the epoch; ensure latest stats are pulled in
acq_epoch().ok()?;
Some([
("allocated", stats::allocated::read().unwrap_or_default()),
("active", stats::active::read().unwrap_or_default()),
("mapped", stats::mapped::read().unwrap_or_default()),
("metadata", stats::metadata::read().unwrap_or_default()),
("resident", stats::resident::read().unwrap_or_default()),
("retained", stats::retained::read().unwrap_or_default()),
])
}
#[must_use]
#[cfg(not(feature = "jemalloc_stats"))]
pub fn memory_usage_stats() -> Option<[(&'static str, usize); 6]> { None }
pub fn memory_stats(opts: &str) -> Option<String> {
const MAX_LENGTH: usize = 1_048_576;
+3 -3
View File
@@ -4,7 +4,7 @@
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
pub mod je;
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
pub use je::{memory_stats, memory_usage, trim};
pub use je::{memory_stats, memory_usage, memory_usage_stats, trim};
#[cfg(all(not(target_env = "msvc"), feature = "hardened_malloc", not(feature = "jemalloc")))]
pub mod hardened;
@@ -13,7 +13,7 @@ pub mod hardened;
feature = "hardened_malloc",
not(feature = "jemalloc")
))]
pub use hardened::{memory_stats, memory_usage, trim};
pub use hardened::{memory_stats, memory_usage, memory_usage_stats, trim};
#[cfg(any(
target_env = "msvc",
@@ -24,4 +24,4 @@ pub mod default;
target_env = "msvc",
all(not(feature = "hardened_malloc"), not(feature = "jemalloc"))
))]
pub use default::{memory_stats, memory_usage, trim};
pub use default::{memory_stats, memory_usage, memory_usage_stats, trim};
Loaded 100 of 180 files, more files were not shown because too many files have changed in this diff. Show more