Commit Graph

68 Commits

Author SHA1 Message Date
David Teller
82a2e63d23
A room Protection designed to measure lag in a room (#217) 2022-02-24 13:43:31 +01:00
Jess Porter
a58c7d3f1a
move LogProxy.logMessage to Mjolnir.logMessage (#194) 2022-02-15 15:44:41 +00:00
Gnuxie
e9dff8fd5a
Batch events from ban lists together during sync (#221)
* Test for batching ACL.

* Batch events from sync within BanList.

* Introduce the BanList.batch event to the BanList emitter to let Mjolnir sync after new events have been added from sync.

Fixes #203
2022-02-15 13:51:20 +00:00
Jess Porter
f74cf8a6e5
trusted reporters (#183)
* Trusted Reporters protection

* redact/ban reasons

* some documentation
2022-02-08 13:07:42 +00:00
jesopo
813741c42c refactor (and simplify) how protections are stored in-memory 2022-02-07 13:48:32 +00:00
Jess Porter
f70d97e4d9
enable noImplicitAny (#209) 2022-02-02 12:43:05 +00:00
Jess Porter
423a34bebe
runtime persistent settings system (#158) 2022-01-25 14:47:50 +00:00
gnuxie
1a65122b0d Initial Ruleserver prototype.
This is an experimental ruleserver that will serve the combined rules from
the active policy lists to a Synapse module over a web api.
This makes it easier to communicate changes in policy lists to Synapse workers
that do not have an immediate view over all of the policy rooms at
the same time.
This also allows us to express moderation actions to the homeserver
beyond what is currently expressible via MSC2313 policy
lists.
2022-01-21 12:13:04 +00:00
Jess Porter
941d10b015
never mutate config.managementRoom in-place (#184) 2022-01-17 16:24:12 +00:00
David Teller
3f2039f6a7 Let's use getRequestFn/setRequestFn to keep errors readable 2022-01-07 14:06:10 +01:00
David Teller
9a8fed1695 Slightly cleaner MatrixClient wrapping 2022-01-07 14:06:10 +01:00
David Teller
57746f7fb4 Wrap MatrixClient into something that displays nicer error messages 2022-01-07 14:06:10 +01:00
gnuxie
9c47fc917a Provide notice showing how a BanList has changed after updating.
Only shows changes to lists made by other accounts (than the one used by Mjolnir).
Displays when rules are added, removed and modified by either replacing the state event or redacting them.
2021-11-29 11:45:22 +00:00
David Teller
a21415a04c
Give the ability to moderators to react quickly to /report abuse reports. (#137) 2021-11-09 13:15:49 +01:00
David Teller
06e5f00b2d
Intercept /report and display human-readable abuse reports in the moderation room - Resolves #38 (#135)
* Intercept /report and display human-readable abuse reports in the moderation room - Resolves #38
2021-10-07 14:42:08 +02:00
gnuxie
776c1fe063 Tidy logging in integration tests 2021-09-30 15:52:06 +01:00
gnuxie
400af48e6e Move Mjolnir setup and configuration to a sensible place. 2021-09-27 16:04:01 +01:00
gnuxie
68aa717826 Rework integration tests to work with mx-tester 2021-09-24 18:25:27 +01:00
gnuxie
5acc38c8b5 EventRedactionQueue documentation improvements from review 2021-09-16 17:10:59 +01:00
gnuxie
ad199cc7d7 Use a Map for queueing redactions by roomId. 2021-09-15 12:18:55 +01:00
gnuxie
2889599eb2 Rename AutomaticRedactionQueue to UnlistedUserRedactionQueue.
This seems to be a more descriptive name and it also doesn't clash
with the new redaction queue.
2021-09-14 14:45:07 +01:00
gnuxie
c949d26582 When checking a member change, process redactions for that room. 2021-09-14 14:45:07 +01:00
gnuxie
c5b5026d4d WIP: Redact events after all bans have been applied. 2021-09-14 14:13:24 +01:00
David Teller
dd6c06eae5 Fix: Let's default to Synapse's default message when deleting a room without a message 2021-08-17 17:21:17 +02:00
David Teller
62b30b19d9 Replace shutdown_room API with DELETE /_synapse/admin/v1/rooms/<room_id> - Resolves #76, closes #96
As per https://github.com/matrix-org/synapse/issues/9052, shutdown_room is going away, to be replaced with DELETE /_synapse/admin/v1/rooms/<room_id>.
2021-08-17 12:54:24 +02:00
David Teller
2e22154870 Lint: Enabling 'strictNullChecks' 2021-07-22 08:40:29 +02:00
Travis Ralston
ff4cbc018f Update matrix-bot-sdk and use request cleaning function 2021-07-01 15:11:27 -06:00
Neil Middleton
1c5c4bdc15
Remove errant log 2021-06-14 14:51:18 +01:00
Neil Middleton
531fd1379c Make !mjolnir not case sensitive 2021-06-14 14:43:50 +01:00
Travis Ralston
4751b093a5 Add Healthz support 2020-06-12 08:03:08 -06:00
Travis Ralston
013cac1365 Fix remaining getRoomAlias calls 2020-05-11 21:35:37 -06:00
Travis Ralston
232a6e2bb9 Use room aliases in permission errors too 2020-04-15 08:12:42 -06:00
Travis Ralston
f6a856ed4a Resolve room aliases in messages
Fixes https://github.com/matrix-org/mjolnir/issues/47
2020-04-15 08:12:42 -06:00
Travis Ralston
ba7ea90fcb Don't cause panic if the bot can't protect a ban list it didn't create
This only affects users with `protectAllJoinedRooms` enabled, as the bot can't possibly protect ban lists it did not create itself.
2020-02-18 17:06:27 -07:00
Travis Ralston
697ada6592 Make the bot less concerned about the format of commands
Fixes https://github.com/matrix-org/mjolnir/issues/39
2020-02-18 13:46:31 -07:00
Travis Ralston
dea6f8cbf1 Add a command to shut down a room
Fixes https://github.com/matrix-org/mjolnir/issues/21
2020-02-13 13:56:03 -07:00
Travis Ralston
223464227b Move power level change notices to DEBUG
Fixes https://github.com/matrix-org/mjolnir/issues/32
2020-02-12 15:42:10 -07:00
Travis Ralston
9e5c87ac56 Add options to specify custom command prefixes
Fixes https://github.com/matrix-org/mjolnir/issues/29
2020-02-12 15:27:27 -07:00
Travis Ralston
c0365416fa Add an option to protect all joined rooms 2020-01-21 15:19:03 -07:00
Travis Ralston
38e22ee155 Add commands to add/remove protected rooms on the fly 2020-01-21 13:46:15 -07:00
Travis Ralston
959162c4a3 Support automatically redacting users for certain ban reasons 2019-12-09 19:56:12 -07:00
Travis Ralston
f9e3c33935 Don't spam protection warnings, and ensure the user is redacted
We now always prioritize redaction over ban to ensure that the user gets removed from our rooms. This also means that the second image posted by a spammer is redacted after join.

This commit also improves the messaging a bit.
2019-12-09 19:15:51 -07:00
Travis Ralston
0879cd58a0 Actually fix ban command not always applying
Fixes https://github.com/matrix-org/mjolnir/issues/13
2019-12-04 19:28:28 -07:00
Travis Ralston
d5f260b982 Add a protection system with a "first message is an image" demo 2019-12-04 18:51:03 -07:00
Travis Ralston
07c9c04169 Detect UISI errors from pantalaimon in the management room 2019-11-14 15:59:01 -07:00
Travis Ralston
778f9c3459 Add a command to deactivate a user 2019-11-14 15:44:13 -07:00
Travis Ralston
9f84a65598 Don't apply bans globally when membership changes 2019-11-07 11:00:41 -07:00
Travis Ralston
82214c6cd8 Avoid spamming the management room with errors
The intervals are arbitrarily defined.

Fixes https://github.com/matrix-org/mjolnir/issues/10
2019-11-06 19:17:11 -07:00
Travis Ralston
84135c5ff5 Update log handling for debugging 2019-11-06 18:46:49 -07:00
Travis Ralston
5cd89d5c4e Fix handling of state events 2019-10-18 16:38:19 +01:00