Commit Graph

460 Commits

Author SHA1 Message Date
jesopo
fccb4627ce show room ID in consequence log 2022-03-21 14:25:12 +00:00
jesopo
afd003b905 remove line leftover from debugging 2022-03-21 14:11:45 +00:00
gnuxie
fb027fe2af v1.4.0 2022-03-21 12:32:32 +00:00
David Robertson
95d394b964
Merge pull request #246 from matrix-org/dmr/fix-check-username-as-spam
Fix block_usernames config option
2022-03-21 11:54:12 +00:00
David Teller
e05616b327
New command !mjolnir since <date or duration> <kick | ban | show> <limit> [reason] [...rooms] (#238)
A new command `since` to affect all users who have joined a protected room since a given date.
2022-03-21 10:39:15 +01:00
Gnuxie
814e528eaf
Fix incorrect type deceleration in check_username_for_spam (#250)
Fixes https://github.com/matrix-org/mjolnir/issues/245
2022-03-18 17:20:53 +00:00
Gnuxie
48206a8524
Move message_limit into antispam. (#243)
* Move message_limit into antispam.

https://github.com/matrix-org/message_limit

Not ideal but we've had complaints about keeping them separate
and unfortunately the need for this module is not going to go away.
2022-03-18 11:07:21 +00:00
Jess Porter
1880287ac4
standard protection consequences (#232)
* standard protection consequences

* add integration test to make sure good users aren't banned

* the less far `event` propagates, the better

* better document consequence.ts

* improve innocent user integration test

* switch to room.event emit
2022-03-18 10:11:23 +00:00
David Robertson
2c9fc0ccdc
Fix block_usernames config option
Fixes #244.
2022-03-17 16:53:31 +00:00
David Teller
26ae55cd24
A command to show when users in a given room have joined (#225) 2022-03-07 11:34:25 +01:00
Marco Cirillo
97df4d5f61
Add command to elevate a user (or the bot) as room administrator (#219) 2022-03-07 10:14:06 +01:00
jesopo
65af82d46f send whole channel shutdown reason, not just the first word 2022-03-02 10:20:43 +00:00
David Teller
eb7f5f6b3e
Reduce stackspam (#237)
This should cut a lot on the noise in logs.
2022-02-25 17:59:34 +01:00
Gnuxie
17dd0aa173
Fix the test script yarn test:manual and add it to tsconfig (#234)
* Add test:manual launch script to tsconfig

this is so we won't keep breaking it
2022-02-24 14:46:15 +00:00
Gnuxie
7353ba4919
Make limit for ACL batcher more leniant for CI (#235) 2022-02-24 14:27:53 +00:00
David Teller
82a2e63d23
A room Protection designed to measure lag in a room (#217) 2022-02-24 13:43:31 +01:00
gnuxie
a3f77e1b39 v1.3.2 2022-02-23 10:38:42 +00:00
Gnuxie
332da15d0d
Remove old rules when unbanning entities from BanLists. (#227)
* Remove old rules when unbanning entities from BanLists.

Fixes #220
2022-02-21 16:51:14 +00: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
Marco Cirillo
097829d75a
Set missing CORS headers for Report API responses. (#222) 2022-02-15 09:19:13 +01:00
reivilibre
e49e4d05eb
Use public imports for UserID and run_as_background_process (#175) 2022-02-11 10:13:16 +01:00
David Teller
6cb461fed4
Move glob_to_regex into the source - resolves #173 (#218) 2022-02-09 13:07:23 +01:00
David Teller
9c9bd0e029
Let's port to Synapse module API (#128) 2022-02-09 08:40:33 +01:00
Jess Porter
f74cf8a6e5
trusted reporters (#183)
* Trusted Reporters protection

* redact/ban reasons

* some documentation
2022-02-08 13:07:42 +00:00
Gnuxie
ff9a7db159
Make ACL safe so that Mjolnir will not ban itself. (#213) 2022-02-07 17:02:06 +00:00
jesopo
813741c42c refactor (and simplify) how protections are stored in-memory 2022-02-07 13:48:32 +00:00
jesopo
8b23f93b71 splice returns removed items, not a new list with items removed 2022-02-07 13:33:44 +00:00
Graham Christensen
d364d9879a
default.yaml: expand on fasterMembershipChecks (#163)
It isn't clear what it means to have the server "struggle" with state requests.

This change is trying to make the configuration more actionable to end users.
2022-02-07 12:41:26 +00:00
Marco Cirillo
eb8c5e08b4 Update legacy antispam plugin with newer types.
Or it'll just ignore 1.3.1 rules.
2022-02-07 10:57:38 +01:00
Jess Porter
58e228be7d
make roomIds param on replaceRoomIdsWithPills a Set<string> (#146) 2022-02-02 17:35:02 +00:00
Jess Porter
f70d97e4d9
enable noImplicitAny (#209) 2022-02-02 12:43:05 +00:00
gnuxie
fcf53d15b8 v1.3.1 2022-02-01 13:21:04 +00:00
Gnuxie
8a9ded80c1
do not require rule server config to be present. (#208) 2022-02-01 13:20:26 +00:00
gnuxie
767e1a5a7e v1.3.0 2022-02-01 10:55:21 +00:00
Gnuxie
e52b59df6e
Fix bad teardowns that hang in tests. (#202)
* Fix bad teardowns and hanging test.
2022-01-28 11:03:20 +00:00
Gnuxie
0cde70e846
Merge pull request #199 from matrix-org/gnuxie/remove-axios
Remove axios (from tests)
2022-01-27 09:25:32 +00:00
gnuxie
f481ec84d3 Make sure we stop clients after they have started, not before.
Yeah it's a long story.
2022-01-26 16:25:43 +00:00
gnuxie
17a1d02af8 Fix uses of old interface for registration helper in tests. 2022-01-25 18:23:14 +00:00
gnuxie
9e96d399c0 Remove axios from the test suite, it is unnecessary.
It's probably also got problems.
2022-01-25 18:22:34 +00:00
Jess Porter
423a34bebe
runtime persistent settings system (#158) 2022-01-25 14:47:50 +00:00
David Teller
c7a96a3afe
Retry requests in case of throttling (#178)
* Retry requests in case of throttling


Co-authored-by: gnuxie <gnuxie@element.io>
2022-01-25 12:19:44 +00:00
David Teller
baa9129fa5 [CI] We need to wait until Mjölnir's start is complete before proceeding with tests.
Hopefully, this should fix the (latest) race conditions we've been seeing during CI.
2022-01-24 16:13:18 +01:00
Gnuxie
13032413b2
Merge pull request #166 from matrix-org/gnuxie/ruleserver
Gnuxie/ruleserver
2022-01-21 13:07:58 +00:00
gnuxie
afb0fd5a23 Skip policy consumption test when the rule server is not enabled 2022-01-21 12:28:59 +00:00
gnuxie
4537cf0d8a Add test for ruleserver policy consumption.
Ensures that the consumer of the ruleserver rules is enforcing them.
2022-01-21 12:13:04 +00:00
gnuxie
7ee3ce1dd2 rename onReactionTo to getFirstReaction 2022-01-21 12:13:04 +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
Gnuxie
47e3d8ae2c
Merge pull request #191 from matrix-org/gnuxie/manual-test-cleanup
Improvements to manual testing with the test:manual script.
2022-01-21 10:23:17 +00:00
gnuxie
9048322709 Improvements to manual testing with the test:manual script.
- Use the configured username & password when registering the test user to run Mjolnir with (was hardcoded).
- Remove bogus imports from the helper that have accidentally been introduced with VSCode.
- Keep `enable_registration: true` in the homeserver config to save time.
2022-01-21 10:11:01 +00:00