{
  "$id": "https://r3ply.com/schemas/v0.0.1/config/moderation.v0.0.1.json",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Moderation config",
  "description": "Control the various moderation channels",
  "$comment": "i.e. what should happen to comment after they've been processed.",
  "type": "object",
  "definitions": {
    "options": {
      "title": "Moderation options",
      "description": "Shared options across all moderation channels",
      "type": "object",
      "required": [],
      "properties": {
        "enabled": {
          "title": "Enable moderation",
          "description": "False completely turns off moderation for this channel.",
          "type": "boolean",
          "default": true,
          "$comment": "See `moderation.enabled`."
        },
        "allow*": {
          "title": "Allow list",
          "description": "Plain text email or pseudonym bypassing moderation.",
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[\\s\\S]*$",
            "maxLength": 256
          },
          "default": [],
          "examples": [
            "*@alice.com",
            "bob@example.com"
          ]
        },
        "comments": {
          "title": "Comment sources",
          "description": "Specify which commenting sources to allow for this moderation channel.",
          "type": "array",
          "items": {
            "enum": [
              "email"
            ]
          }
        },
        "filter*": {
          "title": "Filter site",
          "description": "Specifies which sites (by label) will be processed.",
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[\\s\\S]*$"
          },
          "examples": [
            "*",
            "!local"
          ]
        }
      }
    }
  },
  "required": [],
  "unevaluatedProperties": false,
  "properties": {
    "enabled": {
      "title": "Enable moderation",
      "description": "False completely disables moderation.",
      "type": "boolean",
      "default": true
    },
    "github": {
      "type": "array",
      "items": {
        "$ref": "https://r3ply.com/schemas/v0.0.1/config/moderation/github.v0.0.1.json"
      },
      "maxItems": 2,
      "default": []
    },
    "webhook": {
      "type": "array",
      "items": {
        "$ref": "https://r3ply.com/schemas/v0.0.1/config/moderation/webhook.v0.0.1.json"
      },
      "maxItems": 5,
      "default": []
    },
    "local": {
      "type": "array",
      "items": {
        "$ref": "https://r3ply.com/schemas/v0.0.1/config/moderation/local.v0.0.1.json"
      },
      "default": []
    }
  }
}