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.
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
* 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>
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>
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.
* 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.
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.
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.
This function now distinguishes between lists we are watching, lists
that are protected, and lists that we have parted from.
I don't like it. This should exist on the `PolicyRoomsManager` and
this is a complete and total mess. I don't know if there is time to
fix it yet.
Currently looks like this, we just don't have alternative capabilities yet:

* 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.
* 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
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
Purely a UX change for admins, since most text editors append a newline to written files.
* Trim spaces and newlines from secret files
* Extract only the first line from secret files.
---------
Signed-off-by: Rory& <root@rory.gay>
Co-authored-by: gnuxie <Gnuxie@protonmail.com>
This PR closes#622 by adding a `--invite` flag to the `unban` command.
* Add --invite to `unban` command (untested)
* Use RoomInviter to invite users in unban command.
* Condense unban(+invite) log message
---------
Signed-off-by: nexy7574 <git@nexy7574.co.uk>
Co-authored-by: gnuxie <Gnuxie@protonmail.com>
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>
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
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>