1320 Commits

Author SHA1 Message Date
Gnuxie
46e1054834 Merge pull request #926 from the-draupnir-project/gnuxie/weirdo-tests
Improvements to integration tests
2025-08-11 13:48:32 +01:00
gnuxie
5afd97c2f6 "Fix" a race condition with store disposal in fixtures.
https://github.com/the-draupnir-project/Draupnir/issues/927.
2025-08-11 13:42:30 +01:00
gnuxie
fe3cb2e94f Stop dumping the config after every test.
There was a bug where the process.exit handle was being registered
multiple times.
2025-08-07 18:01:59 +01:00
gnuxie
ede92ca6ee Make sure patchMatrixClient is called in all entrypoints.
It wasn't called in integration tests.
Possibly fixes:
https://github.com/the-draupnir-project/Draupnir/issues/760
https://github.com/the-draupnir-project/Draupnir/issues/759
2025-08-07 18:01:00 +01:00
gnuxie
283a50d5e3 v2.5.1 v2.5.1 2025-08-06 17:26:38 +01:00
Gnuxie
dccb0e39b9 Fix appservice management room creation for room V12 (#924)
* Update MPS for client capability negotiation.

* Update appservice room creation for V12.
2025-08-06 17:17:05 +01:00
Gnuxie
1f8da29799 Attempt to allow Draupnir to use room V12. (#918)
- Updated to matrix-basic-types 1.4.0 which changes
  the regex validating room ids.

- Changed the package override so that all dependencies
  use matrix-basic-types 1.4.0, including the matrix-protection-suite.

- Removed code that tries to store details about discovered rooms in
  the room takdedown protection. These were unreliable for so many
  reasons and also are now broken given the room origin cannot be
  extracted from the room id. Details for why this is can be found in
  the reviews of
  matrix-org/matrix-spec-proposals#4291.
2025-07-16 20:35:22 +01:00
Gnuxie
4e13f0d8e2 Improve message users see failing to join acceptInvitesFromSpace. (#917) 2025-07-14 12:13:11 +01:00
gnuxie
0618eee59b v2.5.0 v2.5.0 2025-07-08 12:52:27 +01:00
Gnuxie
5565ef3bc7 Use json reviver in express.json() middleware. (#913) 2025-06-24 13:49:04 +01:00
Gnuxie
5b445d273e Merge pull request #910 from the-draupnir-project/gnuxie/media-extraction
Use new `EventMixin` extraction API from MPS in protections.

This allows protections to retrieve extensible events style mixins from any event.

We also add a protection to automatically redact any event with an erroneous mixin that is likely to cause issues for other clients.

MPS Describes all `m.room.message` `msgtype`s as mixins too.
2025-06-24 11:52:29 +01:00
gnuxie
2ad39d9dbd Ensure appservice calls stop on draupnir.
This is now apparent because the protection that deletes events with
erroneous mixins uses a lazy leaky bucket which has a timeout that
needs cancelling. This will probably fix a few unexplained issues as a
side effect.
2025-06-24 11:46:30 +01:00
gnuxie
d1f8f445ae Update to MPS 3.7.1 for new mixin extraction API. 2025-06-24 11:46:25 +01:00
gnuxie
d61e225f25 Elaborate on how WordList protection works. 2025-06-24 11:20:29 +01:00
gnuxie
05129ed855 Update WordList protection for new event mixin model.
DRP-003.
2025-06-24 11:20:29 +01:00
gnuxie
0616706747 Add InvalidEventProtection to redact events with invalid mixins.
We're quite liberal with our mixin definitions, so we redact events
that don't conform because they could clearly be attempts to play with
clients or protections that don't play nicely.
2025-06-24 11:20:29 +01:00
gnuxie
a0a184643d Update MentionLimitProtection for new event mixins model. 2025-06-24 11:20:29 +01:00
gnuxie
e0dc7b77d1 Update MentionLimitProtection to use handleTimelineMedia.
This is a better API provided by MPS that already handles safe parsing
of Matrix events to extract relevant media.
2025-06-24 11:20:29 +01:00
gnuxie
e42ef157ff v2.4.1 v2.4.1 2025-06-23 21:19:08 +01:00
Gnuxie
e0f6050029 Fix compatibility of PersistentConfigData and PersistentConfigBackend. (#912)
This led to protections not instantiating with their defaults when
their config was requested. Infact, it meant that their configs were
not validated at all.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/911.
2025-06-23 21:15:05 +01:00
gnuxie
548d304ba1 v2.4.0 v2.4.0 2025-06-23 12:43:15 +01:00
Gnuxie
296bce0c8f Update MPS4bot-sdk again for room details schema. (#909)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/908.
2025-06-23 11:56:12 +01:00
Gnuxie
1cc6a9162b Consolidate Synpase admin room details schema. (#907)
Change comes from mps-for-bot-sdk. We're not trusting the room list
or the room details endpoint anymore.
2025-06-19 18:14:00 +01:00
Gnuxie
f72c7fc0c8 Fix synapse room list parse errors. (#906)
Wasn't decoding join rules properly.
2025-06-18 11:15:31 +01:00
Gnuxie
026de3b9cb Account for creators missing in synapse room table. (#905)
This really and deeply sucks
https://github.com/element-hq/synapse/issues/18563.
2025-06-17 17:13:41 +01:00
Gnuxie
8de924c852 Merge pull request #904 from the-draupnir-project/gnuxie/synapse-admin-room-discovery
This removes the need for synapse-http-antispam in order to reveal hashed literals for rooms. This is always available and by default runs a full scan every 30 minutes, or every time a policy changes. There is a configurable 5 minute cooldown between scans.
2025-06-17 12:34:06 +01:00
gnuxie
bb8baaa473 Rigidity wrt disposing stores and protections. 2025-06-17 12:27:03 +01:00
gnuxie
96aaf072d5 Disable the room discovery notification room by default. 2025-06-17 12:27:03 +01:00
gnuxie
c703dbb000 Update MPS for synapse admin room list and other goodies. 2025-06-17 12:27:03 +01:00
gnuxie
a5a1bdd402 Support room discovery via the synapse admin room list. 2025-06-17 12:27:03 +01:00
Catalan Lover
ec388467e4 Add the ability to customise the primary prefix for commands. (#899)
* Add the ability to customise the primary prefix for commands.

* Fix data structure error in config.yaml / harness.yaml

* Apply suggestions from code review

---------

Co-authored-by: Gnuxie <50846879+Gnuxie@users.noreply.github.com>
2025-06-16 20:39:01 +01:00
Gnuxie
f46ff4dddd Implement synapse-http-antispam /ping. (#897)
2a36ef305b
2025-06-09 11:43:19 +01:00
dependabot[bot]
aa66056816 Bump tar-fs from 2.1.2 to 2.1.3 (#890)
Bumps [tar-fs](https://github.com/mafintosh/tar-fs) from 2.1.2 to 2.1.3.
- [Commits](https://github.com/mafintosh/tar-fs/commits)

---
updated-dependencies:
- dependency-name: tar-fs
  dependency-version: 2.1.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-03 18:49:25 +01:00
Gnuxie
d8fc1fbb7a Merge pull request #891 from the-draupnir-project/gnuxie/mps-interface-adaptor
Extract out and depend upon @the-draupnir-project/mps-interface-adaptor

This is just a very simple PR to extract the contents of `src/command/interface-manager` and `src/capabilities/CommonRenderers.tsx` to a library that can be used by other bots that depend on the matrix-protection-suite and interface-manager. Since this is essentially glue code that hasn't made its way into abstractions yet that other bots would need to duplicate to get started.

And we're doing this because we're thinking of making a contributor bot for fun primarily, gathering feedback, and encouraging testing .
2025-06-03 18:33:55 +01:00
gnuxie
375d7ad916 Update to MPS 3.5.0 AND mps-interface-adaptor 0.4.1.
These are basically the dependencies to complete the make
mps-interface-adaptor extraction.
2025-06-03 18:25:29 +01:00
gnuxie
2e0b9dfb98 Extract out and depend upon @the-draupnir-project/mps-interface-adaptor. 2025-06-02 19:52:44 +01:00
Gnuxie
6fe9138655 changelog infos mention search and special thanks. (#887) 2025-05-30 14:10:45 +01:00
gnuxie
ee76799ec9 v2.3.1 v2.3.1 2025-05-29 20:07:03 +01:00
Gnuxie
ed9a14b84d Only invite joined members to the Notification Rooms. (#885)
* Only invite joined members to the Notification Rooms.

* Make NotificationRoom creation invitations more resistant.
2025-05-29 19:49:22 +01:00
gnuxie
05d388da57 v2.3.0 v2.3.0 2025-05-29 18:49:21 +01:00
Gnuxie
cee05901be CHANGELOG for 2.3.0. (#884) 2025-05-29 18:48:48 +01:00
Gnuxie
34680df995 Merge pull request #879 from the-draupnir-project/gnuxie/room-takedown-feedback
- Split out the room discovery notifications into their own matrix room.
- Ensure that information for room creator and the server (that the room create is signed with) are stored in the room info. And add ways to look those up in the future.
-  Stop content violation notifications appearing in takedown/shutdown
2025-05-29 15:29:09 +01:00
gnuxie
6f15fc27c6 Use room delete V2 for takedowns/shutdowns to not notify.
Seems i got it backwards?? or this is just totally random.
2025-05-29 15:20:36 +01:00
gnuxie
f25b1f1361 Update to MPS 3.4.0 for room senders / creators. 2025-05-29 15:11:51 +01:00
gnuxie
1cb9899963 Stop taking down rooms by server and sender.
https://github.com/the-draupnir-project/Draupnir/issues/880.
Postpone takedown by creator for now.
We haven't got time to make sure everything's working and figure out
the UX.
2025-05-29 14:52:34 +01:00
gnuxie
80473155d9 Needs testing, added pathways to takedown rooms by server and sender. 2025-05-29 14:52:34 +01:00
gnuxie
804dfa0e33 Return the new protection instead of playing about. 2025-05-27 14:39:42 +01:00
gnuxie
11025f2ae5 Re-enable room discovery by default now that it creates a distinct room. 2025-05-27 11:57:23 +01:00
gnuxie
3d138d96df Remove seperate room for policy change notification protection.
I don't think we're ready for it yet.
2025-05-27 11:55:00 +01:00
gnuxie
0d00380c50 Update MPS for async protection factories. 2025-05-26 23:29:49 +01:00