Commit Graph

1141 Commits

Author SHA1 Message Date
gnuxie ef592a95e4 Plumb takedown command into room discovery. 2025-03-21 16:19:09 +00:00
gnuxie 8cf7e4b638 Add initial draft of takedown command.
Now we need to hook in discovery when the command is run.
2025-03-21 16:19:09 +00:00
gnuxie 19a78d670c Some shite that didn't get comitted to do with messing up hash store. 2025-03-21 16:19:09 +00:00
gnuxie a6b6508af1 Update unban code for unmasked hashed entities.
We will need to work harder to remove masked hashed entities...
2025-03-21 16:19:09 +00:00
gnuxie eaa21680cf Missing stores initialization code in test fixtures. 2025-03-21 16:19:09 +00:00
gnuxie 0de853b413 Update Draupnir policy handling code for hashed entities. 2025-03-21 16:19:09 +00:00
gnuxie 2909464d36 Store user and server in room hash store too. 2025-03-21 16:19:09 +00:00
gnuxie 9d5e19514a Store details about the room at takedown in the audit log.
We need to do this because they will be impossible to obtain once the
room has been blocked on the server.

We also need to make sure we now include the server the room was
created on, and the creator in the room hash store.
2025-03-21 16:19:09 +00:00
gnuxie 7f0a8da41f Flesh out RoomDiscovery some more.
I really need to move the room details to the audit log, it's there
so we can see what the rooms are that have been takendown.
2025-03-21 16:19:09 +00:00
gnuxie 4fdb142ac2 Only audit takedown when capabilities are not simulated. 2025-03-21 16:19:09 +00:00
gnuxie 003410d41a Change the order of checking the audit log. 2025-03-21 16:19:09 +00:00
gnuxie b80a503ea0 Improve hash store replace query a little.
I'm after realising this whole thing is a mess but there's no time to fix it.
2025-03-21 16:19:08 +00:00
gnuxie 1e581d7394 Test room takedown service and add thoughts to FIXME. 2025-03-21 16:19:08 +00:00
gnuxie d15322dff6 Test and fix the hash store. 2025-03-21 16:19:08 +00:00
gnuxie 442b930d89 Unit test and fix sqlite room audit log. 2025-03-21 16:19:08 +00:00
gnuxie 3f00346ae6 Plumb in SynapseHTTPAntispam to RoomTakedownProtection room discovery. 2025-03-21 16:19:08 +00:00
gnuxie 7b212d75aa Fix typo in SynapseHTTPAntispam UserMayJoinRoom handle. 2025-03-21 16:19:08 +00:00
gnuxie 15f94bc2b2 Export request body types from SynapseHTTPAntispam. 2025-03-21 16:19:08 +00:00
gnuxie 62079457e9 Move roomStateBackingStore into TopLevelStores abstraction. 2025-03-21 16:19:08 +00:00
gnuxie 4ae5e5f63a Begin process of creating top level stores.
We now need to move the roomStateBackingStore into this thingy.
2025-03-21 16:19:08 +00:00
gnuxie b50033ba4a Fix manual launch script for changed room backing store interface. 2025-03-21 16:19:08 +00:00
gnuxie 25f39e20d0 Start plumbing up RoomTakedownProtection into Draupnir.
There are a couple of FIXME's to address. Such as plumbing
up the stores into draupnir and how to poll for new rooms.
2025-03-21 16:19:08 +00:00
gnuxie b8bf6c5692 Add RoomTakedownCapability and SynapseAdmin implementation. 2025-03-21 16:19:08 +00:00
gnuxie 7282374caf Clean up better-sqlite store so that we can test stores with in memeory dbs. 2025-03-21 16:19:08 +00:00
gnuxie b7b9cc78c9 Initial RoomTakedown "service".
I want to change the APIs a little bit so that we can get a takedown
reporter like the audit log but for message rendering and testing.

I also want to make the BetterSqliteStore concrete not depend
on where the database came from so that we can use in memory
databases for unit testing stores.

There are a couple other FIXME's littered around so be sure to check
those before merging.
2025-03-21 16:19:08 +00:00
Gnuxie 4ca8d23938 Merge pull request #758 from the-draupnir-project/gnuxie/synapse-http-antispam
synapse-http-antispam support
2025-03-14 17:42:57 +00:00
gnuxie 4e9d2a010a We have got issues with utils.ts... 2025-03-14 17:29:17 +00:00
gnuxie 9a9547feb5 Add configuration for synapse-http-antispam. 2025-03-14 17:29:17 +00:00
gnuxie cb6af646d8 Replace antispam with http-antispam in mx-tester. 2025-03-14 17:29:17 +00:00
gnuxie 33e649c508 Add library code to support synapse-http-antispam.
We now need to add config, plumbing, and tests.
2025-03-14 17:29:17 +00:00
gnuxie 2e33e65892 Allow errors from appservice cli to propagate to the top level. 2025-03-12 10:21:17 +00:00
gnuxie 0ede5c8682 Add config schema to appservice config.
Make appservice datapath example consistent with docker image.

Make the appservice config schema check the admin room properly.

We now parse the room id/alias/or permalink.

Make sure to parse the config from cli.ts
2025-03-12 10:21:17 +00:00
Marcel a0f7ee5bb3 Set up state store if configured in d4all mode (#753)
* Set up state store if configured in d4all mode

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Ensure the dataPath is set in both the example and harness appservice config

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Move the SqliteRoomStateBackingStore creation to a static method instead

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Make the storage path canonicalization less confusing

---------

Signed-off-by: MTRNord <mtrnord1@gmail.com>
2025-03-11 20:45:09 +00:00
Bea 04d21a2942 Address #746 and a small SQLite optimization.
Explicitly set the `temp_store` pragma to `file` instead of `memory`
after deciding to place temporary files in `/data` to keep RAM usage
down while addressing #746.

Added a helper function to automatically "flatten" transactions
when you don't need SAVEPOINTs to avoid unnecessary temporary files.

Signed-off-by: Bea <20361868+enbea@users.noreply.github.com>
2025-03-09 17:29:27 +00:00
Gnuxie 0bc511a002 Add a protection to stop excess membership changes. (#748) 2025-03-07 18:02:07 +00:00
gnuxie 6ad94dc1cb v2.2.0 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 7b5ab65328 Test more edge cases in unban command (#743)
* Cover users that are banned indirectly by removed policies

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

* Move findUnbanInformationForMember to UnbanUsers.tsx

* Remove rules on unban even if there are no matching members.

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

* Add even more test cases to unban test.

Fixes #740 
Fixes #742
2025-03-03 18:18:29 +00:00
Gnuxie b9b75d38bf Update CHANGELOG for pending release.... (#741) 2025-03-03 13:09:45 +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 b5e3de5aa3 Make BanPropagationProtection's unban prompt use the unban command. (#737)
https://github.com/the-draupnir-project/Draupnir/issues/736.
2025-02-28 16:38:43 +00:00
Gnuxie d966aed3ed Merge pull request #734 from the-draupnir-project/gnuxie/room-unban-fixing
Improve the unban command and add previews via a new `--no-confirm` option.
2025-02-28 14:41:19 +00:00
gnuxie 1d413a1ab4 Include confirmation prompt listener into draupnir.
`--no-confirm` prompts will not work without this.
2025-02-28 12:19:59 +00:00
gnuxie a45d308597 Refactor and improve the unban command.
We no longer want to accept an argument for the list. We will just
find all appropriate policies and remove them, like we do with the
unban prompt (which we still might want to update to use the new
`--no-confirm` prompt later).

We fix the bugs where the unban command was inviting users regardless
of whether the `--invite` option was provided.

The unban command now uses a preview which shows all the policies that
will have to be removed to unban a user, all the rooms they will need
to be unbanned from, and any rooms that they will be invited to if the
`--invite` option is used.
2025-02-28 12:19:59 +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 d3b55a879a Add !rules matching members command. (#726)
This shows all the rules that are matching members in the protected
rooms set, but probably cannot be actioned either due to permission
limitations or ACL leakage.
2025-02-11 11:13:24 +00:00
Gnuxie 94f41d70ae Merge pull request #725 from the-draupnir-project/gnuxie/revision-feedback
Show the time of the last `RoomStateRevision` for each room in the `!draupnir rooms` command. 

We also do this for policy lists.

https://github.com/the-draupnir-project/Draupnir/issues/718
2025-02-10 20:33:11 +00:00
gnuxie 30ad9f098b Remove spurious error wrapping around status info. 2025-02-10 19:59:22 +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 2f7c598266 Use the new WatchedPolicyRooms MPS feature.
This simplifies anything to do with the way policy rooms are watched.
There was a lot of weird glue code around finding policy rooms and
revisions that has just been whipped out into the WatchedPolicyRooms
abstraction.
2025-02-10 16:39:03 +00:00