Commit Graph
23 Commits
Author SHA1 Message Date
Gnuxie 121d4cf98f Mjolnir would apply stale ACL to rooms during batching (#331)
* banListTest would applyACL before rules appeared in `/state`.

Mjolnir will call applyServerAcls several times while a policy list is being updated, sometimes concurrently. This means a request to set a server ACL in a room which has old data can finish after a more recent recent request with the correct ACL. This means that the old ACL gets applied to the rooms (for a moment).

This is a follow up from https://github.com/matrix-org/mjolnir/pull/314/commits/551065815e65e6117d7e8105afd6f5da9b87c8af

* Only allow one invocation of applyServerAcls at a time as to not conflict with each other by using a promise chain.

We don't use the throttle queue because we don't want to be blocked by other background tasks.
We don't make another throttle queue because we don't want throttling and we don't want to delay the ACL application, which can happen even with throttle time of 0.
2022-08-09 10:57:38 +01:00
David Teller 829e1bd0aa Towards opinions in PolicyLists. (#336)
Towards opinions in PolicyLists.

This changeset is part of an ongoing effort to implement "opinions"
within policy lists, as per MSC3847.

For the time being:
- we rename BanList into PolicyList;
- we cleanup a little dead code;
- we replace a few `string`s with `enum`;
- `ListRule` becomes an abstract class with two concrete subclasses `ListRuleBan` and `ListRuleOpinion`.
2022-07-26 21:47:26 +02: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
Gnuxie ff9a7db159 Make ACL safe so that Mjolnir will not ban itself. (#213) 2022-02-07 17:02:06 +00:00
Jess Porter 941d10b015 never mutate config.managementRoom in-place (#184) 2022-01-17 16:24:12 +00:00
gnuxie c5b5026d4d WIP: Redact events after all bans have been applied. 2021-09-14 14:13:24 +01:00
David Teller 46d099e8e0 Lint: Enabling 'noUnusedLocals' 2021-07-22 08:47:41 +02:00
Travis Ralston 635f9ba03f Prioritize bans over redactions, and queue redactions faster
This could do with some cleanup, particularly around the part where it uses a callback.
2020-06-12 08:15:48 -06:00
Travis Ralston cdc8170a8f Fix assumption that an error message will be present 2020-05-05 18:36:24 -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 8e5f8c19af Move ban message to INFO
Fixes https://github.com/matrix-org/mjolnir/issues/19
2020-02-13 13:46:09 -07:00
Travis Ralston 959162c4a3 Support automatically redacting users for certain ban reasons 2019-12-09 19:56:12 -07:00
Travis Ralston 40113a0760 Use the correct reference to Mjolnir's client 2019-11-11 14:31:25 -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 30e186ca9c Add a config option to reduce homeserver load during ban checks 2019-11-06 18:54:59 -07:00
Travis Ralston 84135c5ff5 Update log handling for debugging 2019-11-06 18:46:49 -07:00
Travis Ralston eccbac9ccf Check if ACLs match before applying them
Fixes https://github.com/matrix-org/mjolnir/issues/9
2019-10-30 14:49:59 -06:00
Travis Ralston 2ea3bdccb3 Fix messaging for bans 2019-10-18 16:38:07 +01:00
Travis Ralston adec9f58a6 Add a no-op mode 2019-10-09 14:51:30 +01:00
Travis Ralston e69f0e6940 Improve/change logging to management room 2019-10-04 20:59:30 -06:00
Travis Ralston 834abc97dd Apply user bans 2019-09-27 19:54:36 -06:00
Travis Ralston d32ad18f3a Update server ACLs when they change 2019-09-27 14:26:57 -06:00