Skip to content

Commit dc8b95a

Browse files
authored
Update documentation in the wake of v2.4.1 (#85)
- Synapse-http-antispam do_ping and troubleshooting guide has been added. - RoomTakedownProtection updated to no longer depend on synapse-http-antispam.
1 parent 9e87e56 commit dc8b95a

File tree

2 files changed

+71
-49
lines changed

2 files changed

+71
-49
lines changed

docs/bot/synapse-http-antispam.md

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,52 @@ modules:
3434
# http://`<draupnir host>:<port>/api/1/spam_check`
3535
base_url: http://localhost:8080/api/1/spam_check
3636
authorization: YOUR_SECRET_TOKEN
37+
do_ping: true
3738
enabled_callbacks:
38-
- check_event_for_spam
3939
- user_may_invite
4040
- user_may_join_room
4141
fail_open:
42-
check_event_for_spam: true
4342
user_may_invite: true
4443
user_may_join_room: true
45-
async:
46-
check_event_for_spam: true
4744
```
4845
49-
Currently we only support the `check_event_for_spam`, `user_may_invite`, and
50-
`user_may_join_room` callbacks. We strongly recommend that these endpoints are
51-
configured to `fail_open` so that your homeserver's service is not degraded
52-
should Draupnir fail or go offline.
53-
54-
Additionally it is important that `check_event_for_spam` is configured to be
55-
`async`. This means that Synapse will not wait for a response from Draupnir.
56-
Draupnir only uses this check to source information about the matrix rooms your
57-
server is participating in.
58-
59-
If your server has a very high maximum PDU rate (50PDU/s or above) you may wish
60-
to consider disabling the `check_event_for_spam` callback entirely. It is
61-
unlikely that your server will unless you are offering a service on the scale of
62-
matrix.org.
46+
Currently we only support the `user_may_invite`, and `user_may_join_room`
47+
callbacks. We strongly recommend that these endpoints are configured to
48+
`fail_open` so that your homeserver's service is not degraded should Draupnir
49+
fail or go offline.
6350

6451
### Draupnir Configuration
6552

6653
You will also need to enable `synapseHTTPAntispam` under the `web` property in
6754
Draupnir's config (see
6855
[default.yaml](https://github.com/the-draupnir-project/Draupnir/blob/main/config/default.yaml)).
56+
57+
## Troubleshooting or verifying connection from Synapse
58+
59+
:::info
60+
61+
Support for `do_ping` is available from Draupnir v2.4.0.
62+
63+
:::
64+
65+
In order to verify that Synapse, or any of its workers, are able to reach the
66+
draupnir antispam server, you can look for the following messages in Synapse
67+
logs.
68+
69+
1. Verify that the Synapse module is loaded by searching for `Loaded module`.
70+
You should find a line that looks like this:
71+
`synapse.app._base - 584 - INFO - sentinel - Loaded module <synapse_http_antispam.HTTPAntispam object at 0x79613db08b00>`
72+
73+
2. Verify that synapse-http-antispam is able to reach Draupnir by searching for
74+
`Successfully pinged antispam server`. You should be able to see a line that
75+
looks like this:
76+
`synapse_http_antispam - 65 - INFO - sentinel - Successfully pinged antispam server with request ID UAhDvDkv`
77+
78+
3. Verify that synapse-http-antispam is unable to reach Draupnir by searching
79+
for `Failed to ping antispam server`. You should be able to see a line that
80+
looks like this:
81+
`synapse_http_antispam - 68 - ERROR - sentinel - Failed to ping antispam server (POST http://draupnir:localhost:8082/api/1/spam_check/ping)`
82+
83+
4. Verify that Draupnir's configuration is correct by looking for the message
84+
`There are unknown configuration properties` in Draupnir's log, and checking
85+
if any properties are relevant.

docs/protections/room-takedown-protection.md

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,57 @@
22

33
:::info
44

5-
You need to be using Draupnir v2.3.0 or above to use this protection
5+
You need to be using Draupnir v2.3.0 or above to use this protection. Since
6+
Draupnir v2.4.1, this protection no longer depends upon synapse-http-antispam.
67

7-
You also need to follow the [instructions](../bot/synapse-http-antispam) for adding the synapse-http-antispam module.
8+
:::
9+
10+
:::tip
11+
12+
While this protection does not depend on synapse-http-antispam. You may wish to
13+
install the protection if you want to preemptively block invitations as soon as
14+
possible. You should follow our [instructions](../bot/synapse-http-antispam) for
15+
adding the synapse-http-antispam module.
816

917
:::
1018

11-
The room takedown protection matches policies from Draupnir's watched
12-
lists against the rooms your homeserver is joined to.
19+
The room takedown protection matches policies from Draupnir's watched lists
20+
against the rooms your homeserver is joined to.
1321

14-
This protection is useful when you are administrating a server with
15-
open registration and need to protect yourself and your users from
16-
two scenarios:
22+
This protection is useful when you are administrating a server with open
23+
registration and need to protect yourself and your users from two scenarios:
1724

18-
1. Spam invitations targetting your local users that have already been
19-
sent and need to be rejected automatically.
25+
1. Spam invitations targetting your local users that have already been sent and
26+
need to be rejected automatically.
2027

21-
2. Preventing local users from joining rooms with intolerable or
22-
illegal content, and removing these rooms if they are detected
23-
on the homeserver.
28+
2. Preventing local users from joining rooms with intolerable or illegal
29+
content, and removing these rooms if they are detected on the homeserver.
2430

25-
If the protection discovers a room is marked with the `takedown`
26-
recommendation, then the protection will instruct your homeserver to
27-
shutdown the room. This will force all local participants to leave the
28-
room, purge the history from your database, and block the room.
31+
If the protection discovers a room is marked with the `takedown` recommendation,
32+
then the protection will instruct your homeserver to shutdown the room. This
33+
will force all local participants to leave the room, purge the history from your
34+
database, and block the room.
2935

3036
## Room Discovery
3137

32-
The protection provides a means of oversight into the rooms your
33-
homeserver is participating within. When a room is discovered no your
34-
homeserver, a notification is sent to a configured room with details
35-
about the room: the title, description, creator, and member count.
38+
The protection provides a means of oversight into the rooms your homeserver is
39+
participating within. When a room is discovered no your homeserver, a
40+
notification is sent to a configured room with details about the room: the
41+
title, description, creator, and member count.
3642

37-
The protection includes a threshold
38-
`discoveryNotificationMembershipThreshold` that must be met before
39-
displaying the notification. By default, a room needs to have `20`
40-
members before its details will be displayed. This is a privacy
41-
concious default to balance between alerting the server admins of all
42-
rooms, and those that are large enough to be of concern.
43+
The protection includes a threshold `discoveryNotificationMembershipThreshold`
44+
that must be met before displaying the notification. By default, a room needs to
45+
have `20` members before its details will be displayed. This is a privacy
46+
concious default to balance between alerting the server admins of all rooms, and
47+
those that are large enough to be of concern.
4348

4449
## Configuration
4550

46-
See [configuring protections](./configuring-protections) for a guide
47-
on how to configure this protection.
51+
See [configuring protections](./configuring-protections) for a guide on how to
52+
configure this protection.
4853

4954
## Taking down a room
5055

51-
To takedown a room yourself, you will need to use the `!draupnir
52-
takedown` command. You will be prompted for confirmation, and will be
53-
required to read the details very carefully.
56+
To takedown a room yourself, you will need to use the `!draupnir takedown`
57+
command. You will be prompted for confirmation, and will be required to read the
58+
details very carefully.

0 commit comments

Comments
 (0)