Commit graph

3902 commits

Author SHA1 Message Date
1f91a74b27 feat(spaces): wire up enforcement hooks in join, append, and build paths
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6s
Update flake hashes / update-flake-hashes (pull_request) Failing after 6s
Add minimal integration points in existing files:
- append.rs: call on_pdu_appended for event-driven enforcement
- build.rs: call validate_pl_change to protect space-managed PLs
- join.rs: call check_join_allowed to gate joins on role requirements
- timeline/mod.rs: add roles service dependency
2026-03-20 08:52:23 +01:00
5f901a560b feat(spaces): add admin commands for space role management
Add !admin space roles subcommands: list, add, remove, assign, revoke,
require, unrequire, user, room, enable, disable, status. The remove
command uses cascade_remove_role macro to deduplicate member and room
cleanup loops. Role definitions, assignments, and room requirements
are managed via state events.
2026-03-20 08:52:13 +01:00
59401e1786 feat(spaces): add space roles service with enforcement and caching
Implement the roles service with well-factored helper methods:
- Cache population via load_user_roles, load_room_requirements,
  load_child_rooms_index helpers
- Enforcement dispatch via enforce_roles_change, enforce_member_change,
  enforce_room_change, enforce_cascading_toggle
- Child management via handle_child_added, handle_child_removed
- Kick logic via user_qualifies_in_any_parent, kick_user_from_room
- PL computation via compute_effective_pl (highest-wins across spaces)
- Per-space enable/disable, graceful shutdown guards
2026-03-20 08:52:05 +01:00
95fa3b022a feat(spaces): add custom state event types and config for space permission cascading
Add four custom Matrix state event content types for space role
management: space roles definitions, per-user role assignments,
per-room role requirements, and per-space cascading override.

Add server config options: space_permission_cascading (default false)
as the server-wide toggle, and space_roles_cache_flush_threshold
(default 1000) for cache management.
2026-03-20 08:51:57 +01:00
Shane Jaroch
ff85145ee8
fix: missing logic inversion for acquired keys (should speed up room joins) 2026-03-13 20:54:38 -04:00
timedout
906c3df953 style: Reduce migration warning verbosity to info
They aren't actually warning of anything
2026-03-09 13:30:24 +00:00
timedout
33e5fdc16f style: Reduce verbosity of fix_corrupt_msc4133_fields 2026-03-09 13:30:24 +00:00
timedout
77ac17855a fix: Don't fail on invalid stripped state entries during migration 2026-03-09 13:30:24 +00:00
timedout
65ffcd2884 perf: Insert missed migration markers into fresh databases 2026-03-09 13:30:24 +00:00
timedout
7ec88bdbfe feat: Make noise about migrations and make errors more informative 2026-03-09 13:30:24 +00:00
Ginger
da3fac8cb4 fix: Use more robust check for max_request_size 2026-03-09 13:27:39 +00:00
Trash Panda
3366113939 fix: Retrieve content_type and video width/height 2026-03-09 13:27:39 +00:00
Trash Panda
9039784f41 fix: Clippy lints 2026-03-09 13:27:39 +00:00
Trash Panda
7f165e5bbe fix: Refactor and block media downloads larger than max_request_size 2026-03-09 13:27:39 +00:00
Trash Panda
e8746760fa feat(url-preview): Optionally download audio/video files for url preview requests 2026-03-09 13:27:39 +00:00
Ginger
dac619b5f8
fix: Lower "timeline for newly joined room is empty" to debug_warn
Reviewed-by: nex <me@nexy7574.co.uk>
2026-03-07 11:56:15 -05:00
timedout
94c5af40cf
fix: Automatically remove corrupted appservice registrations 2026-03-06 14:21:04 +00:00
Ginger
7e501cdb09
fix: Fix left rooms always being sent on initial sync 2026-03-04 12:51:54 -05:00
Shane Jaroch
da182c162d fix(registration): discrepancy between 401 response and 500 log statement 2026-03-04 16:18:38 +00:00
Skyler Mäntysaari
5feb08dff2 docs: Update delete-past-remote-media example with correct flag syntax
It's not just a single `-` but rather `--`.
2026-03-04 15:37:06 +00:00
Ben Botwin
5eb74bc1dd feat: Readded support for reading registration tokens from a file
Co-authored-by: Ginger <ginger@gingershaped.computer>
2026-03-04 15:06:26 +00:00
Niklas Wojtkowiak
80c9bb4796 fix(rooms): prevent removing admin room alias
Only the server user can now remove the #admins alias, matching the
existing check for setting the alias. This prevents users from
accidentally breaking the admin room functionality.

fixes #1408
2026-03-04 15:05:24 +00:00
Ginger
83883a002c fix(complement): Fix complement conflicting with first-run
- Disabled first-run mode when running Complement tests
- Updated logging config under complement to be a bit less verbose
- Changed test result and log output locations
2026-03-04 15:04:37 +00:00
31a05b9c
8dd4b71e0e fix: make dropped PDU warning less useless 2026-03-04 14:58:01 +00:00
Jade Ellis
754959e80d
fix: Don't process admin escape commands for local users from federation
Reviewed-By: timedout <git@nexy7574.co.uk>
2026-03-03 19:55:50 +00:00
timedout
37888fb670
fix: Limit body read size of remote requests (CWE-409)
Reviewed-By: Jade Ellis <jade@ellis.link>
2026-03-03 19:54:34 +00:00
Jason Volk
1a7bda209b
feat: Implement Dehydrated Devices MSC3814
Co-authored-by: Jade Ellis <jade@ellis.link>
Signed-off-by: Jason Volk <jason@zemos.net>
2026-03-03 19:39:53 +00:00
timedout
b507898c62
fix: Bump ruwuma again 2026-03-03 18:10:28 +00:00
nexy7574
f4af67575e
fix: Bump ruwuma to resolve duplicate state error 2026-03-03 06:01:02 +00:00
timedout
6adb99397e
feat: Remove MSC4010 support 2026-02-27 17:03:19 +00:00
Niklas Wojtkowiak
052c4dfa21 fix(sync): don't override sliding sync v5 list range start to zero 2026-02-24 13:59:33 +00:00
lynxize
a43dee1728
fix: Don't show successful media deletion as an error
Fixes !admin media delete --mxc <url> responding with an error message
when the media was deleted successfully.
2026-02-23 22:02:34 -07:00
Niklas Wojtkowiak
8a254a33cc fix(api): restore backwards compatibility for RTC foci config 2026-02-23 23:01:15 +00:00
Niklas Wojtkowiak
8ddb7c70c0 feat(api): implement MSC4143 RTC transports discovery endpoint
Add dedicated \`GET /_matrix/client/v1/rtc/transports\` and \`GET /_matrix/client/unstable/org.matrix.msc4143/rtc/transports\` endpoints for MatrixRTC focus discovery (MSC4143), replacing the deprecated well-known approach.

Move RTC foci configuration from \`[global.well_known]\` into a new \`[global.matrix_rtc]\` config section with a \`foci\` field. Remove \`rtc_foci\` from the \`.well-known/matrix/client\` response. Update LiveKit setup documentation accordingly.

Closes #1431
2026-02-23 23:01:15 +00:00
Niklas Wojtkowiak
18d2662b01 fix(config): remove allow_public_room_directory_without_auth 2026-02-23 17:59:13 +00:00
timedout
558262dd1f
chore: Refactor transaction_ids -> transactions 2026-02-23 17:44:35 +00:00
timedout
d311b87579
chore: Fix incorrect capitalisation
I didn't realise I agreed to take an English class with @ginger while
working on this server lol
2026-02-23 17:25:12 +00:00
timedout
8702f55cf5
fix: Don't panic if nobody's listening 2026-02-23 17:22:37 +00:00
Jade Ellis
92351df925
refactor: Make federation transaction handle errors correctly
We have a dedicated error type that's then matched.
Event sorting is now infallible.
Could probably be cleaned up in a bit.
2026-02-23 16:36:46 +00:00
Jade Ellis
47e2733ea1
refactor: Make stream utils generic over the error type 2026-02-23 16:36:46 +00:00
Jade Ellis
6637e4c6a7
fix: Clean up cache, prevent several race conditions
We use one map which is only ever held for a short time.
2026-02-23 16:36:46 +00:00
nexy7574
35e441452f
feat: Attempt to build localised DAG before processing PDUs 2026-02-23 16:36:46 +00:00
nexy7574
66bbb655bf
feat: Warn when server is overloaded 2026-02-23 16:36:45 +00:00
nexy7574
81b202ce51
chore: Decrease transaction log verbosity 2026-02-23 16:36:45 +00:00
nexy7574
4657844d46
feat: Show active transaction handle count in !admin federation incoming-federation 2026-02-23 16:36:45 +00:00
nexy7574
9016cd11a6
chore: Run pre-commit and clippy to fix inherited CI errs 2026-02-23 16:36:45 +00:00
nexy7574
dd70094719
feat: Make max_active_txns actually configurable 2026-02-23 16:36:45 +00:00
nexy7574
fcd49b7ab3
fix: Remove duplicate fields from logs 2026-02-23 16:36:45 +00:00
nexy7574
470c9b52dd
feat: Instrument process_inbound_transaction 2026-02-23 16:36:45 +00:00
nexy7574
0d8cafc329
feat: Support casting transaction processing to the background 2026-02-23 16:36:44 +00:00