Commit Graph

42 Commits

Author SHA1 Message Date
Gnuxie
704bb660c2
Refactor how we listen for matrix events. (#446)
* Refactor Matrix event listener in Mjolnir and ManagedMjolnir.

closes https://github.com/matrix-org/mjolnir/issues/411.

Issue #411 says that we have to be careful about room.join,
but this was before we figured how to make matrix-appservice-bridge
echo events sent by its own intents.

* Remove MatrixClientListener since it isn't actually needed.

* Protect which config values can be used for ManagedMjolnirs.

* Introduce MatrixSendClient

so listeners aren't accidentally added to a MatrixClient instead
of MatrixEmitter.

* doc

* Move provisioned mjolnir config to src/config.

This just aids maintance so whenever someone goes to change the config
of the bot they will see this and update it.

* doc for matrix intent listener.
2022-12-06 17:17:40 +00:00
David Teller
2915757b7d
Very basic support for Sentry. (#398)
The Sentry package is very useful for monitoring runtime errors. With this PR,
we simply add the necessary mechanism to:

- log to sentry any uncaught error that reaches the toplevel, including startup errors.
2022-11-30 16:06:02 +01:00
Gnuxie
333c55e18c
Config fixes (#432)
* Use the npm package `config` to load the config.

This is what was used prior to https://github.com/matrix-org/mjolnir/pull/347.
It was a nice idea motivated to drop a dependency that was confusing.
It was just never followed through and was underestimated how much disruption it would cause.
It was also believed that the library would mean there could only ever be one global copy of the config,
It was followed up by:
https://github.com/matrix-org/mjolnir/pull/369
https://github.com/matrix-org/mjolnir/pull/357
https://github.com/matrix-org/mjolnir/pull/429
https://github.com/matrix-org/mjolnir/pull/397/files
https://github.com/matrix-org/mjolnir/issues/365

For simplicity sake I am reinstating the library.
The practice of loading default.yaml by default is also dangerous
and has led to issues multiple times in #mjolnir:matrix.org.
It is a sample and not a default.

In a following commit I will be adding the ability to specify the
config to use from the cli.

* Allow config to be specified with an explicit cli argument.

* Update doc to transition away from old config handling
2022-11-23 10:55:22 +00:00
Jess Porter
625b62ce6d
use requested path to configs (#357) 2022-08-17 16:17:23 +01:00
Gnuxie
9bcb0b7a59
Replace acceptInvitesFromGroup with acceptInvitesFromSpace. (#338)
Replace acceptInvitesFromGroup with acceptInvitesFromSpace.

https://github.com/matrix-org/mjolnir/issues/125
https://github.com/matrix-org/mjolnir/issues/99

acceptInvitesFromGroup was implemented with an experimental api
that was a precursor to spaces which was refereed to
as either communities or groups.
Support for communities/groups ended in Synapse 1.61.0
https://github.com/matrix-org/synapse/releases/tag/v1.61.0.

To test we just edit the config dynamically which changes how the join room listener functions
though idk, shouldn't we have just made a new mjolnir instance
for this test, or changed the config before the test started somehow?


Co-authored-by: jesopo <github@lolnerd.net>
2022-08-17 10:05:23 +01:00
Jess Porter
4376679b99
load config yaml manually, remove more references to static config (#347) 2022-08-16 15:51:18 +01:00
Gnuxie
21aabc879a
Stop the config being global (in almost all contexts). (#334)
* Stop the config being global (in almost all contexts).

* make sure unit test has a config

* Make failing word list more visible

* Only use Healthz from index.ts

Not really sure how useful it is anyways?
2022-08-09 11:29:27 +01:00
Jess Porter
b03d81dcc4
ability to disable displaying new reports in moderation room (#320) 2022-07-07 12:55:03 +01:00
Jess Porter
ed68e02c4e
implement polling reports in synapse (#259) 2022-07-04 15:06:36 +01:00
David Teller
0eea04bd69
A background queue for kicking (#296)
A background queue for kicking
2022-06-08 11:49:43 +02: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
Gnuxie
8a9ded80c1
do not require rule server config to be present. (#208) 2022-02-01 13:20:26 +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
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
David Teller
2e22154870 Lint: Enabling 'strictNullChecks' 2021-07-22 08:40:29 +02:00
J. Ryan Stinnett
46192ac6f7 Add confirmation for wildcard bans
This adds a default enabled option to require confirmation for wildcard bans
(e.g. those containing `*` or `?`). Users will need to also add `--force` for
the commands to be accepted.
2021-02-05 16:09:11 +00:00
Emi Tatsuo
4c0bbd845d
Removed default words from word list in favor of more neutral words 2020-10-31 09:23:18 -04:00
Emi Simpson
c2fbf0934a
Added configuration for wordlist protection 2020-06-21 15:18:34 -04:00
Travis Ralston
4751b093a5 Add Healthz support 2020-06-12 08:03:08 -06:00
Travis Ralston
45a8f2899b Fully remove ban list server support 2020-05-11 21:33:28 -06:00
Travis Ralston
ecc7674422 Add optional reporting of invites that won't be accepted 2020-03-05 15:38:09 -07:00
Travis Ralston
7314df7379 Re-work invite settings to better support practical use cases 2020-03-05 15:29:30 -07:00
Travis Ralston
f7448564be Load a default config when a default can't be located
The config package will use default.yaml for us, but most deployments won't have set that up correctly so instead we offer sensible defaults in addition to the thing from config.
2020-02-12 15:38:52 -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
fa6a6547ee Add very basic subscription server for Synapse module 2020-01-25 20:34:15 -07:00
Travis Ralston
c0365416fa Add an option to protect all joined rooms 2020-01-21 15:19:03 -07:00
Travis Ralston
97d02b3816 Add an option to only autojoin invites from bot managers 2020-01-21 13:53:02 -07:00
Travis Ralston
959162c4a3 Support automatically redacting users for certain ban reasons 2019-12-09 19:56:12 -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
0575c56b74 Add a config flag to reduce logging noise 2019-10-31 09:55:34 -06:00
Travis Ralston
adec9f58a6 Add a no-op mode 2019-10-09 14:51:30 +01:00
Travis Ralston
05ab8f60c6 Add watch and unwatch commands 2019-10-08 20:58:31 +01:00
Travis Ralston
aecc6e4882 Support multiple ban lists 2019-10-08 17:57:03 +01:00
Travis Ralston
7bd23a17d9 Optionally perform permission checks on startup 2019-10-04 21:22:51 -06:00
Travis Ralston
5e081e2246 Add an option to sync rooms on startup 2019-10-04 21:02:37 -06:00
Travis Ralston
e69f0e6940 Improve/change logging to management room 2019-10-04 20:59:30 -06:00
Travis Ralston
517025b6c2 Support Pantalaimon for encryption support
Requires a special build of the bot-sdk and pantalaimon currently
2019-10-02 22:20:37 -06:00
Travis Ralston
39b59dbee1 Add commands for managing a personal ban list 2019-09-27 15:44:28 -06:00
Travis Ralston
3a567edc38 Add a config option to pick the protected rooms 2019-09-27 14:36:23 -06:00
Travis Ralston
23c6c20768 Early ban list processing (parsing, specifically) 2019-09-27 13:57:36 -06:00
Travis Ralston
ed6f37be2b Absolute bare minimum for a bot 2019-09-25 20:13:20 -06:00