README.md 1.71 KB
Newer Older
Chocobozzz's avatar
Chocobozzz committed
1
2
3
4
# Auto mute plugin for PeerTube

Auto mute accounts or instances based on public blocklists.

5
6
7
8
## Mute lists

**Add your public list here**

Chocobozzz's avatar
Chocobozzz committed
9
10
## Settings

11
12
13
14
15
16
You can choose to expose your mute list that will be available on `https://example.com/plugins/plugins/auto-mute/router/api/v1/mute-list`.
Other instances can follow your mute list, but muting removal is not supported yet. For example, if you subscribe to the mute list of `example.com`:
 * `example.com` mutes `account1`
 * Your instance automatically mutes `account1`
 * `example.com` unmutes `account1`
 * You instance **will not** unmute `account1`
Chocobozzz's avatar
Chocobozzz committed
17
18

## Blocklist URL format
Chocobozzz's avatar
Chocobozzz committed
19

Chocobozzz's avatar
Typo    
Chocobozzz committed
20
This plugin expects the following JSON format from public blocklists:
Chocobozzz's avatar
Chocobozzz committed
21
22
23
24
25
26

```
{
  data: {
    value: string
    action?: 'add' | 'remove' // Default is 'add'
27
    updatedAt?: string // ISO 8601
Chocobozzz's avatar
Chocobozzz committed
28
29
30
31
32
33
34
  }[]
}
```

For example:

```
Chocobozzz's avatar
Chocobozzz committed
35
36
37
38
39
40
41
{
  data: [
    {
      value: 'peertube.cpy.re'
    },
    {
      value: 'root@peertube.cpy.re'
42
43
44
45
    },
    {
      value: 'chocobozzz@peertube2.cpy.re',
      updatedAt: '2020-05-07T14:42:48.954Z'
Chocobozzz's avatar
Chocobozzz committed
46
47
48
    }
  ]
}
Chocobozzz's avatar
Chocobozzz committed
49
50
51
52
53
54
55
```

This plugin does not apply a diff, so if you want to remove an entity from the blocklist, add `action: 'remove'` to the object.

For example, to revert `peertube.cpy.re` from the blocklist, update the JSON:

```
Chocobozzz's avatar
Chocobozzz committed
56
57
58
59
60
61
62
63
64
65
66
67
{
  data: [
    {
      value: 'peertube.cpy.re',
      action: 'remove'
    },
    {
      value: 'root@peertube.cpy.re'
    }
  ]
}
```
68
69

The purpose of the `updatedAt` field is to not override admin mutes/unmutes:
Chocobozzz's avatar
Typos    
Chocobozzz committed
70
71
72
 * Plugin auto mutes account A with an `updatedAt: '2020-05-07T14:42:48.954Z'`
 * Admin thinks this account is fine so it unmutes account A
 * On another check, the plugin won't re-mute the account A because the `updatedAt` is before the last check