Commit Graph

1067 Commits

Author SHA1 Message Date
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 v2.0.0 2025-01-16 19:09:07 +00:00
gnuxie 7184dcfeac v2.0.0 CHANGELOG.
Feel like I'm about to screw up the actual releasing so here goes.
2025-01-16 19:08:41 +00:00
gnuxie b1a22dbffa v2.0.0-beta.11 v2.0.0-beta.11 2025-01-16 15:14:49 +00:00
Gnuxie c1cb3e8dff Update README for 2.0.0. (#676)
* Update README for 2.0.0.

* Mjolnir link.

Thanks to feedback from @mahdi1234.

* Update antispam plugin link.

* Typo in sentance

Thanks to @ll-SKY-ll for spotting meow.
2025-01-15 22:59:01 +00:00
Catalan Lover 0d42cd30f4 Cleanup Integration Test Config. (#675) 2025-01-15 19:01:21 +00:00
Catalan Lover 69b666e56d Make Room state backing store be default enabled. (#673)
* Make Room state backing store be default enabled.

* Disable Room State Backing Store for Integration Tests
2025-01-15 19:01:06 +00:00
Catalan Lover c3552d0c59 Remove confirmWildcardBan config option (#672)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/671
2025-01-15 17:58:11 +00:00
Catalan Lover 731a944a90 Remove Faster membership checks config entry. (#670)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/669
2025-01-15 17:57:41 +00:00
Catalan Lover b9c12b74d7 Remove Protected Rooms config option (#674) 2025-01-15 17:50:07 +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
nexy7574 9d80b44871 Don't send the banned word in the ban reason (#665)
This change makes the ban reason when a user sends a banned word generic, and instead sends the banned word in the management room directly. This prevents the banned word from persisting in the room timeline after redacting the original event.

Signed-off-by: nexy7574 <git@nexy7574.co.uk>
2025-01-11 23:37:52 +00:00
Gnuxie c0d4627c62 Add unique member count to status command. (#663) 2025-01-10 17:24:11 +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 2655572cfc Merge pull request #661 from the-draupnir-project/gnuxie/protection-settings-fixes
Handle broken protection settings better

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

![image](https://github.com/user-attachments/assets/90653c7a-7333-4e9c-9997-8ba1679b450f)
2025-01-10 11:36:44 +00:00
gnuxie bb5b5e21e0 Add a protections config reset command.
Part of https://github.com/the-draupnir-project/Draupnir/issues/658.
2025-01-10 11:31:35 +00:00
gnuxie 6bbac2abe5 Show config errors when enabling protections with invalid config.
Part of https://github.com/the-draupnir-project/Draupnir/issues/658.
2025-01-10 11:17:16 +00:00
gnuxie a4603181a2 v2.0.0-beta.10 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
renovate[bot] 4369c93b5a Update Development Dependencies (#619)
* Update Development Dependencies

* run prettier

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-09 17:20:16 +00:00
Gnuxie f95d349fed Change self ignore logs to debug. (#656)
Follow up from
https://github.com/the-draupnir-project/Draupnir/commit/77a14c820e72c2547d40aaa0f0d7f74569bd4446,
info would have been a bit noisy.
2025-01-08 17:25:25 +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
nexy7574 5d11114751 Remove --true flag for unban command (#653)
Closes #648 by making `--true` the default behaviour.

---------

Signed-off-by: nexy7574 <git@nexy7574.co.uk>
2025-01-07 00:05:46 +00:00
nexy7574 218d7cd0db Only kick members whose membership is join (#654)
Fixes #649. Only members who have the `join` membership state will be kicked, which means that not only will banned members not be implicitly unbanned (bug in ruma, and conduits), but draupnir will also no-longer send no-op leave events.

---------

Signed-off-by: nexy7574 <git@nexy7574.co.uk>
2025-01-06 23:55:26 +00:00
nexy7574 82d4d89f2f Fix rooms being added as a server ban policy (#652)
Fixes #458. Thought this was a fluke at first since I only changed one word, but it appears to work reliably and as intended.

Signed-off-by: nexy7574 <git@nexy7574.co.uk>
2025-01-06 22:29:57 +00:00
nexy7574 77a14c820e Prevent Draupnir triggering its own Flooding & WordList protections (#651)
Fixes the issue displayed in #579 and #559
(fixes #579, fixes #559)

This PR simply adds a check to the start of the execution chain for WordList and BasicFlooding that just returns an Ok result when the event sender was the client's user ID.
I just tested this and can confirm that this prevents the reported loops in WordList and BasicFlooding, as intended.

---------

Signed-off-by: nexy7574 <git@nexy7574.co.uk>
2025-01-06 21:50:25 +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 e24bb80230 Handle invalid report requests properly (#645)
Sorry i forgot where I was in
https://github.com/the-draupnir-project/Draupnir/commit/f07b003e41d5e3d88d5ab7b766f9cf7bdc9c3070.
2024-12-18 00:22:35 +00:00
gnuxie bd86e73f80 If it's an error, log as error mare.
https://github.com/the-draupnir-project/Draupnir/issues/643.
2024-12-17 23:36:00 +00:00
gnuxie f07b003e41 Throw when we're given invalid event/room ids in report forwarding.
https://github.com/the-draupnir-project/Draupnir/issues/643.
2024-12-17 23:36:00 +00:00
gnuxie 56a36de654 v2.0.0-beta.9 v2.0.0-beta.9 2024-12-14 15:24:00 +00:00
gnuxie f9e3bb2e5f Fix interface-manager badArgument hint.
This was printing arguments as their JSON serialized representation
rather than their text presentation.
It also couldn't handle missing arguments.

We also verified that writing the protection name wrong for the commands
will give you a message saying that the protection doesn't exist,
rather than showing the help command.
2024-12-14 14:49:23 +00:00
gnuxie a03feadb84 Sort protections by enabled and alphanumerical order in the list.
https://github.com/the-draupnir-project/planning/issues/35#issuecomment-2543127428.
2024-12-14 14:49:23 +00:00
dependabot[bot] 87ef42c0de Bump nanoid from 3.3.6 to 3.3.8 (#640)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.6 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.6...3.3.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-14 14:06:24 +00:00
Gnuxie ab2fb04e00 Add titles to protection setting schemas. (#639)
They are appearing as untitled when using the `protections show`
command.
2024-12-12 18:47:12 +00:00
dependabot[bot] e73a82364c Bump @eslint/plugin-kit from 0.2.1 to 0.2.3 (#624)
Bumps [@eslint/plugin-kit](https://github.com/eslint/rewrite) from 0.2.1 to 0.2.3.
- [Release notes](https://github.com/eslint/rewrite/releases)
- [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json)
- [Commits](https://github.com/eslint/rewrite/compare/plugin-kit-v0.2.1...plugin-kit-v0.2.3)

---
updated-dependencies:
- dependency-name: "@eslint/plugin-kit"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 16:58:09 +00:00
dependabot[bot] 88df42ef44 Bump cross-spawn from 7.0.3 to 7.0.6 (#625)
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 16:57:56 +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 6f7a13ecae Improve JoinWaveShortCircuitProtection (#636)
- We add the status command that was missing and show how other protections could add their own commands to Draupnir.
- We changed the token system to use a "lazy"[^lazy] version of leaky bucket, which isn't perfect but what was happening before was the protection counted the joins in the elapsed time, and then dropped them all rather than rolling over.
- We've given it a general tidy

The reason for this is because I want to use this protection to write generic documentation (a tutorial) on how to configure protections. 

[^lazy]: "lazy" in the sense that we don't bother to remove tokens all the time, only when a token gets added, which is fine because the throughput on room joins will be tiny.
2024-12-05 12:59:16 +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 402c39c708 Readable message for watch command when list is already watched. (#631)
https://github.com/the-draupnir-project/Draupnir/issues/630
2024-11-29 17:56:20 +00:00
Gnuxie 728089365b Unban propagation prompt now appears whenever there are room bans. (#629)
Before the prompt would only show when there were rules matching the unbanned user. Now we only decide to hide the prompt when there are no rules and no room bans.

Fixes the unban propagation side of https://github.com/the-draupnir-project/Draupnir/issues/622.
2024-11-28 16:36:12 +00:00
Gnuxie 08abad87fd Make reference to show command in the protections list command. (#628)
https://github.com/the-draupnir-project/planning/issues/35
2024-11-28 13:40:36 +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 47c2d5a2fc Merge pull request #626 from the-draupnir-project/gnuxie/config-messing-about
Remove old protection settings config from all protections. This is a change in matrix-protection-suite 2.0 where replace protection settings have been replaced by the new `ConfigDescription`.

We've also added a protections show command which will show a summary of the protection's config and configured capability providers. 

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

![Screenshot_20241126_135802](https://github.com/user-attachments/assets/b856f190-6c84-4a11-a28f-48edc39afa3d)
2024-11-28 12:45:27 +00:00
gnuxie e53d178ecd update for MPS. 2024-11-28 12:35:23 +00:00
gnuxie 9a62254c36 Basic protections show command.
We need to show what the documentation and structure of the protection
settings even when no config is persisted for it.
2024-11-28 12:35:23 +00:00
gnuxie 0238a76612 Update protections command for new protections config. 2024-11-27 19:34:12 +00:00
gnuxie 0ad2f0d3f2 Update draupnir factory for new protection config backends. 2024-11-27 19:34:12 +00:00