Initial public commit

This commit is contained in:
Jon
2022-02-20 14:43:11 +00:00
commit 0f3b5a6bac
17 changed files with 969 additions and 0 deletions

109
scripts/schema/config.yaml Normal file
View File

@@ -0,0 +1,109 @@
title: config.yaml
type: object
required: [ access_token, user_id, base_url, synapse_base_url, keyring, policy_rooms, actions ]
properties:
base_url:
type: string
example: http://127.0.0.1:3080/_matrix
format: uri
pattern: ^https?://.+/_matrix$
synapse_base_url:
type: string
example: http://127.0.0.1:3880/_synapse
format: uri
pattern: ^https?://.+/_synapse$
keyring:
type: string
example: ./keyring.gpg
access_token:
type: string
dry_run:
type: boolean
user_id:
comment: 'The user_id tied to the access_token. Used for room shutdowns'
type: string
pattern: '@[\w\-]+:.+'
policy_rooms:
type: array
items:
type: string
pattern: '![\w\-]+:.+'
actions:
type: array
items:
type: object
oneOf:
- required: [ tag ]
properties:
tag: { type: string, pattern: ^\w+$ }
- required: [ tags ]
properties:
tags:
type: array
items: [ { type: string, pattern: ^\w+$ } ]
anyOf:
- required: [ user ]
- required: [ room ]
properties:
user:
properties:
archive:
properties:
media:
comment: 'Save a copy of the identifiers for the last 255 media uploads by this user to disk. This does not save the actual uploads'
type: boolean
rooms:
comment: 'Save a copy of all rooms this user was participating in to disk.'
type: boolean
deactivate:
type: boolean
comment: 'Deactivate the User'
notify:
comment: 'Create an audit log in the audit room about the user.'
type: boolean
quarantine:
comment: 'Quarantine all media uploaded by the user.'
type: boolean
# TODO: Add mjolnir list forwarding
room:
properties:
archive:
properties:
media:
comment: 'Save a copy of the identifiers for the last 255 media uploads in this room to disk. This does not save the actual uploads'
type: boolean
members:
comment: 'Save a copy of all users that were participating in this room to disk.'
type: boolean
delist:
comment: 'Remove the room from the room directory.'
type: boolean
notify:
comment: 'Create an audit log in the audit room about this room.'
type: boolean
reason:
comment: 'For shutdown. A publically visible reason.'
type: string
shutdown:
comment: 'Shutdown the room'
type: boolean
silent:
comment: 'For shutdown. If a notice room should not be created for the closed room.'
type: boolean
quarantine:
comment: 'Quarantine all media uploaded in the room.'
type: boolean

View File

@@ -0,0 +1,15 @@
{
"rules": [
{
"type": "m.room",
"entity": "!id:example.com",
"tags": [ "csam" ]
},
{
"type": "m.user",
"entity": "@user-_:example.com",
"tag": "high_risk"
}
],
"signature": "-----BEGIN PUBLIC KEY SIGNATURE-----..."
}

View File

@@ -0,0 +1,28 @@
title: policy.yaml
type: object
required: [ signature, rules ]
properties:
signature:
type: string
rules:
type: array
items:
type: object
required: [ type, entity ]
allOf:
- oneOf:
- properties:
type: { type: string, const: m.room }
entity: { type: string, pattern: '^![\w\-]+:.+$' }
- properties:
type: { type: string, const: m.user }
entity: { type: string, pattern: '^@[\w\-]+:.+$' }
- oneOf:
- required: [ tag ]
properties:
tag: { type: string, pattern: ^\w+$ }
- required: [ tags ]
properties:
tags:
type: array
items: [ { type: string, pattern: ^\w+$ } ]

View File

@@ -0,0 +1,22 @@
# This file contains a list of "tag aliases", called topics.
# If any entry values are found, the entry key is added to the tags.
# This is mainly used for making actions less verbose
high_risk_porn:
- 3d_loli
- csam
- beastiality
high_risk:
- anarchy
- jailbait
- high_risk_porn
porn:
- drawn_porn
- high_risk_porn
- irl_porn
- loli
nsfl:
- gore
- high_risk
nsfw:
- porn
- nsfl