Commit Graph

241 Commits

Author SHA1 Message Date
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
bb8baaa473 Rigidity wrt disposing stores and protections. 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
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
ee76799ec9 v2.3.1 2025-05-29 20:07:03 +01:00
gnuxie
05d388da57 v2.3.0 2025-05-29 18:49:21 +01:00
gnuxie
f25b1f1361 Update to MPS 3.4.0 for room senders / creators. 2025-05-29 15:11:51 +01:00
gnuxie
0d00380c50 Update MPS for async protection factories. 2025-05-26 23:29:49 +01:00
Catalan Lover
ce926ed18f YEEET synapse_antispam (#866) 2025-05-23 01:24:21 +02:00
Gnuxie
5ad37c9b3c Update to MPS 3.1.2 for better ACL handling. (#856)
* Update to MPS 3.1.2 to help with ACL.

* Update ServerACLConsequencesRenderer for MPS update.
2025-05-20 15:17:36 +01:00
Gnuxie
3d9d8abc43 update to interface-manager 4.1.0 (#847)
Fixes a tonne of shite mare.
Importantly https://github.com/the-draupnir-project/Draupnir/issues/845.
And something @ll-SKY-ll mentioned in the draupnir room regarding the new MentionLimitProtection.

Added

- Quote syntax to quote strings.
- Boolean presentation type and translator to string.

Fixed

- Added a pathway to create negative integers.
2025-05-14 23:51:19 +01:00
gnuxie
656b8decb8 v2.3.0-beta.2 2025-04-14 18:36:42 +01:00
gnuxie
70a00e82e1 Update MPS4BotSDK to fix bugs in user redaction API. 2025-04-14 18:33:40 +01:00
gnuxie
720d703ca8 v2.3.0-beta.1 2025-04-14 16:30:44 +01:00
gnuxie
3e705c775f Update MPS. 2025-04-13 20:06:36 +01:00
gnuxie
44c93c3766 Update matrix-protection-suite-for-matrix-bot-sdk v3.1.1. 2025-03-29 20:15:30 +00:00
Gnuxie
ff4f78ee65 RedactionSynchronisationProtection invite retraction (#788)
- The _Redaction Synchronisation Protection_ has been improved in a few ways:
  - Invitations in protected rooms will be rejected as part of the redaction
    process when they are sent from users being redacted (e.g. as a brigading
    tactic).
  - User redaction will now be triggered on bans and the reason will be scanned
    for `automaticallyRedactForReasons` from Draupnir's config.

* Update RedactionSynchronisation for new protection apis.

* Rerwrite redaction synchronisation protection

* Reject invitations on ban.

* Add renderer and simulated redaction synchornisation capability.

* Reduce dependencies of redaction synchronisation protection.

* Allow RedactionSynchronisation to be unit tested.

* Update to MPS 3.1.0.

---------

Signed-off-by: Rory& <root@rory.gay>
Co-authored-by: Rory& <root@rory.gay>
2025-03-28 17:48:57 +00:00
gnuxie
d7df58101c v2.3.0-beta.0 2025-03-28 11:31:54 +00:00
gnuxie
b474e24c5b Update MPS and matrix-basic-types. 2025-03-23 10:20:15 +00:00
gnuxie
6ad94dc1cb v2.2.0 2025-03-03 19:02:19 +00:00
Gnuxie
57a169c6c0 Show help when there is an additional argument provided to a command. (#745)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/744.

Shows the specific command help and the specific argument that is the problem.
2025-03-03 18:53:40 +00:00
Gnuxie
12e99ef6a9 Update MPS and matrix-basic-types. (#738)
Helps with https://github.com/the-draupnir-project/Draupnir/issues/733.
Also limits the number of vias in room references.
2025-03-03 12:31:05 +00:00
Gnuxie
9587d6fcba Update for simulated capabilities from MPS v2.10.0 and add their renderers, commands. (#727)
* Set renderers and glue for new simulated capabilities.

https://github.com/the-draupnir-project/planning/issues/2.

* Distinguish simulated capability messages when rendering.

* Update for MPS 2.10.0

* Add `!protections capability reset <protection name>`  command.

This will allow you to use the default capabilities for a protection.

* Update CHANGELOG for simulated capabilities.
2025-02-12 12:51:44 +00:00
gnuxie
f5ef75844c Update to MPS v2.9.0.
This gives us the `WatchedPolicyRooms` feature.
2025-02-10 18:11:07 +00:00
Gnuxie
3ec98e7ad1 Show a protection's compatible capability providers in the capability set section of !draupnir protections show. (#723)
Currently looks like this, we just don't have alternative capabilities yet: 
![image](https://github.com/user-attachments/assets/24c1040c-54df-4895-b8b7-37d261254bf9)


* Include compatible capability providers in capability set.

* Update to MPS v2.8.0

This gives us the function to find compatible capability providers for
a capability interface.

* Improve description of capability providers some more.

* Iterate capability provider UX some more.
2025-02-03 16:32:39 +00:00
gnuxie
bcfdfdfd03 v2.1.0 2025-02-02 11:06:57 +00:00
Gnuxie
81cb3e5f09 Update to interface-manager v4.0.1 (#715)
- The signature of the `CommandDispatcher` `prefixExtractor` callback has been changed so that it is possible to transform the entire command body with a `commandNormaliser`.  This was changed primarily to fix https://github.com/the-draupnir-project/Draupnir/issues/707.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/707.
2025-02-02 10:47:10 +00:00
Gnuxie
acf0a406de Add functionality for config.protectAllJoinedRooms via a protection + adjacent changes. (#711)
* Initial ProtectAllJoinedRoomsProtection.

We need something like this to implement `config.protectAllJoinedRooms`,
we also need something to go alongside that removes rooms as they
are added or removed.

it will probably be a behaviour of the same protection that we will
split out.

* Move it cos i cba and we need to merge with a protection to unprotect

on leave and ban.

* IDK i keep getting distracted i need my notebook back aaaa.

* Create RoomsSetBehaviourProtection out of redundant protections.

* Add toggle for RoomsSetBehaviour.

* Enable the RoomsSetBehaviour protection by default.

* Add the behaviour protection to protections index.

* Whoopsie unprotected parted rooms should actually call itself.

* Fix bugs meow.

* handleExternalInvite -> handleExternalMembership

* Make sure leave events get propagated in bot mode.

* Add batcher to ProtectJoinedRooms component.

* Hook into handleExternalMembership for RoomsSetBehaviour.

* Remove crap from fixtures.ts

* leave all rooms when starting integration tests.

* Change how protections are informed of membership.

* Add test for Joinig and protecting rooms on invite.

* Tidy up UnprotectPartedRooms rendering.

* Update for MPS v2.7.0

Added

- Generic item batching is now available for protections to use by
  using the `StandardBatcher`.

Changed

- `Task` has been improved to be more liberal in the closures it
  accepts.  And `Task` now has more options for logging how tasks have
  failed.

- The `Protection` callback `handleExternalInvite` has been renamed to
  `handleExternalMembership`.

Fixed

- An issue where adding rooms to the protected rooms set more than
  once could sometimes cause duplicate events to be propagated.

* Fix typo mare.

* Stop protecting rooms automatically when config.protectAllJoinedRooms is false.

* Update CHANGELOG.md
2025-02-01 17:53:10 +00:00
gnuxie
8764a17430 v2.0.2 2025-01-24 16:27:02 +00:00
Gnuxie
0eb8546067 Update to MPS v2.6.0. (#700)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/314.
2025-01-24 15:57:36 +00:00
Gnuxie
bd1cf645d1 Command prefix fixes (#699)
We have added a "command normaliser" to interface-manager that can cover all the edge cases for pinging the bot or prefixing a command.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/678
Fixes https://github.com/the-draupnir-project/Draupnir/issues/686

* Use interface-manager's command normaliser.

There's still work to be done to make sure we can get ahold of the
displyaname.

* Fetch displayname for Draupnir for the command normaliser.

* Update to interface-manager@4.0.0

This gives us the new command normaliser
2025-01-22 15:25:34 +00:00
Gnuxie
5a0305f46a Remove unused dependencies. (#698)
These dependencies aren't used anywhere.

@sentry/tracing
await-lock
humanize-duration
humanize-duration-ts
parse-duration
shell-quote
typescript-formatter
ulidx

@types/humanize-duration
@types/shell-quote
2025-01-20 12:40:35 +00:00
gnuxie
2ee9f35876 v2.0.1 2025-01-18 01:00:42 +00:00
Gnuxie
8a17cfed5d Update for MPS 2.5.2 (#683)
* Test UnbanCommand and UnbanPrompt have unbanned as a side effect.

You'd think it would be obvious, but clearly it hasn't been.  Part of
the reason for it is just how un-ergonomic it used to be to verify
room state.  Fortunately it's quite straight forward to do since MPS
has picked up. So now we can do it easily.

* Update for MPS 2.5.2.

- Fix SchemedMatrixData putting the wrong version number into data.
  Sadly a complication of
  https://github.com/the-draupnir-project/Draupnir/issues/560.

- Fix an issue where the implementation of the RoomUnbanner capability
  was actually calling `/ban`.
2025-01-18 00:54:25 +00:00
gnuxie
a16fb7b2c0 v2.0.0 2025-01-16 19:09:07 +00:00
gnuxie
b1a22dbffa v2.0.0-beta.11 2025-01-16 15:14:49 +00:00
Gnuxie
8d73f6b794 Update for MPS v2.5.1. (#668)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/667.
[2.5.1] - 2025-01-14

Fixed

- An issue with the `SetRoomMembershipRevisionIssuer` that would allow
  duplicate listeners to be added to rooms that were already in the
  set. This would cause lots of issues with downstream revision
  listeners. We've hardened code downstream, e.g.  with the
  `MembershipPolicyRevisionIssuer`, in case this happens again.
2025-01-14 13:54:37 +00:00
Gnuxie
fa5ce9ad9c Fix report poller (#662)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/258
Fixes https://github.com/the-draupnir-project/Draupnir/issues/408
Fixes https://github.com/the-draupnir-project/Draupnir/issues/409

* Create a way to only forward reports in WebAPIs.

Honestly, I'm going to revert this because I think I have found a
better way of testing the report poller.

* Begin improving and fixing the report poller.

We need to change the ReportManager so that we can interface it out
for testing. The reason being that the report poller is inactive
in the harness and so we can't use that with a protection handle
to test. Instead I want to instantiate a report poller with
a mocked report manager.

* Update integration test nginx to mirror reports to synapse.

We need this so that we can test the report poller without needing to
do gymnastics to selectively forward reports.

* Interface out ReportManager.

Needed so we can test the report poller without doing gymnastics with
setting up fake protections.

* Fix report poller from paginating over the same reports.

https://github.com/the-draupnir-project/planning/issues/38.

* Revert "Create a way to only forward reports in WebAPIs."

This reverts commit 59b335f658.
We don't need this anymore.

* Update for MPS v2.4.0

Gives us the synapse admin client, updates schema, and gives us the fix for https://github.com/the-draupnir-project/Draupnir/issues/560
2025-01-10 17:06:54 +00:00
gnuxie
a4603181a2 v2.0.0-beta.10 2025-01-09 18:18:03 +00:00
renovate[bot]
0ea80d3658 Update Production Dependencies (#617)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-09 17:32:16 +00:00
Gnuxie
6fb22af343 Update for MPS v2.3.0 (#655)
* Update ServerACLConsequencesRenderer for updated interface.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/450.

* Update for MPS v2.3.0.

https://github.com/Gnuxie/matrix-protection-suite/releases/tag/v2.3.0
2025-01-08 17:12:58 +00:00
Gnuxie
3225d5d1d3 Update for MembershipPolicyRevision in MPS 2.2.0 (#650)
* Update for MembershipPolicyMatches in MPS 2.2.0.

* Update MPS to 2.2.0.

https://github.com/Gnuxie/matrix-protection-suite/releases/tag/v2.2.0
Fixes: https://github.com/the-draupnir-project/Draupnir/issues/498
Likely also fixes: https://github.com/the-draupnir-project/Draupnir/issues/451 (discovered and fixed bug in MPS)
2025-01-06 16:19:42 +00:00
gnuxie
56a36de654 v2.0.0-beta.9 2024-12-14 15:24:00 +00:00
Gnuxie
613792769f Fix protections config set/add/remove commands. (#638)
* Stop using `setSerializedValue` on protection settings.

We don't need it now that we've updated the command reader.

* Update interface-manager and MPS.

* Enable standard presentation type translators.

This will fix issues with the ban command reason.
2024-12-09 16:56:29 +00:00
Gnuxie
86c887b832 Fix inconsistency in package override for bot-sdk version. (#633) 2024-12-04 13:17:33 +00:00
Gnuxie
b952ee1042 Add a command to switch a protection's active capability provider. (#632)
* Add command to change the active capability provider of a protection.

* Update MPS for persistent capability set config.

The command will actually persist the chosen capabilities
across startup.
2024-12-04 12:11:06 +00:00
Gnuxie
0b531efb83 Make sure we use exact same version of bot-sdk as matrix-appservice-bridge. (#627)
I don't think this has been a problem but it messes up the dev environment
if you want to link all of draupnir's dependencies like matrix-protection-suite,
interface-manager and so on.
2024-11-28 13:30:28 +00:00
gnuxie
e53d178ecd update for MPS. 2024-11-28 12:35:23 +00:00
renovate[bot]
477ac53cf9 fix(deps): update production dependencies (#528)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-26 12:41:09 +01:00
gnuxie
e36fefb4ce v2.0.0-beta.8 2024-10-22 19:33:56 +01:00