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.
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.
* 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
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>
* 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`.
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
* 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.
We introduce a new interface `ManagementRoomDetail`, and our implementation of this has immediate access to the room members and room state.
Immediately, this allows us to warn when the management room is public.
In the future, it gives us a nice place to decide things like decide whether membership of the management room is enough to be considered a moderator, introduce more redundancy in access control, and give capabilities a way to determine who is a moderator (and avoid enacting consequences against them).
* Move management room to its own folder so we can start introspecting on it.
* Add ManagementRoomDetail.ts
This is just used to track who is a moderator and whether the
management room is public.
* Update ManagementRoomOutput to depend on ManagementRoomDetail.
This should allow us to implement the feature that warns when
the management room is public.
* Send a warning if the management room is public.
Fixes https://github.com/the-draupnir-project/Draupnir/issues/413.
* Update to MPS 1.7.0 so we can get the join rule event.
* Rename read to configRead as it should have always been.
* Got a way to extract non-default values.
Now let's try unknown configuration values.
* Show unknown property paths with a warning.
Now we just need to make this scrap available in commands.
* Remove the old Mjolnir horrible RUNTIME client.
* Make the path that is used to load the config available.
* Warn when `--draupnir-config` isn't used.
* Introduce configMeta so that we can log meta on process.exit later.
* Only show non-default config values when draupnir is exiting.
to reduce noise.
* Get consistent with logging.
So it turns out that mps4bot-sdk is using a different instance
of the bot-sdk module than Draupnir, i think.
Since we used to tell MPS's logger to use the bot-sdk's `LogService`,
but the `setLogger` that was used was obviously inconsistent with
Draupnir's.
Obviously the bot-sdk should be a peer dependency in the bot-sdk
to prevent this happening in future.
Currently integration tests will be broken because we took control
over "who starts Draupnir?" away and gave it to the `SafeModeToggle`.
So we need to fix that.
* Update to MPS v1.2.1.
This will allow us to use `describeProtectedRoomsSet` in unit tests.
* Update to @the-draupnir-project/interface-manager@1.1.1.
This allows for better type inference from the command and also for
partial keywords to be provided to commands as arguments.
* Unit test the DraupnirKickCommand.
We split out some utility types from the matrix-protection-suite into a library https://github.com/the-draupnir-project/matrix-basic-types
I can't believe that like the extra lines from
```
import {
} from ...
```
are adding up so much but whatever.
* Move to @the-draupnir-project/basic-matrix-types.
* Whoopsie missed a test.
We have a lot of verbose headers, and i think now is the best opportunity we have to become reuse compliant given that we just did two other similar maintenance changes (prettier, typescirpt5 & eslint9 & typescript-eslint).
* synapse_antispam resuse headers.
* delete old unused tslint.json.
* Add REUSE to pre-commit config.
* reuse info for config directory.
* Migrate to eslint-9 strictTypeChecked & typescript 5.
* Update to MPS 0.23.0.
Required for strict type checks.
* Looks like we found a test that was complete garbage, amazing really.
* FIXUP
* Well, the command handler was bugged previously...
The command handler used to always only return the command
without the prefix due to an operator precedence bug.
This meant that when we made the order of operations explicit,
we were now including the prefix of the command in the copy.
So when we parsed arguments the code wasn't expecting the prefix
to be there.
* update to MPS 0.23.1.
MPS 0.23.0 was bugged because we didn't enable
`noUncheckedIndexedAccess` while upgrading to typescript 5.
* Make sure eslint runs on all ts files.
* eslint fixes.
* enable `noUncheckedIndexedAccess` & `exactOptionalPropertyTypes`.
* eslint ignores is clearly not understood by me.
* Update SuperCoolStream for eslint and ts5.
* stricter eslint done i thinks
* Whoops, added on .only somewhere.
* Update MPS.
* fix broken test realted things.
* Well I guess that part of getMessagesByUserIn was part of the interface.
* Fix redactionCommandTest.
* Account for escapeHTML in tests.
* Fix tests.
* stuff not matching with .editorconfig fixes.
* Fix appservice webAPI test.
* Update for MPS 0.23.3.