{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/ctfd-setup-configuration-file/latest.json",
  "x-lintel": {
    "source": "https://www.schemastore.org/ctfd.json",
    "sourceSha256": "1637d2c7e92cbbcf2b602785cc1afb1682c9d896a15635803b654858c5796a88",
    "fileMatch": [
      ".ctfd.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "$ref": "#/$defs/Config",
  "$defs": {
    "Accounts": {
      "properties": {
        "domain_whitelist": {
          "type": "string",
          "description": "The domain whitelist (a list separated by colons) to allow users to have email addresses from"
        },
        "domain_blacklist": {
          "type": "string",
          "description": "The domain blacklist (a list separated by colons) to blocks users to have email addresses from"
        },
        "verify_emails": {
          "type": "boolean",
          "description": "Whether to verify emails once a user register or not"
        },
        "team_creation": {
          "type": "boolean",
          "description": "Whether to allow team creation by players or not"
        },
        "team_size": {
          "type": "integer",
          "description": "Maximum size (number of players) in a team"
        },
        "password_min_length": {
          "type": "integer",
          "description": "Minimal length of passwords"
        },
        "num_teams": {
          "type": "integer",
          "description": "The total number of teams allowed"
        },
        "num_users": {
          "type": "integer",
          "description": "The total number of users allowed"
        },
        "team_disbanding": {
          "type": "string",
          "description": "Whether to allow teams to be disbanded or not. Could be inactive_only or disabled"
        },
        "incorrect_submissions_per_minute": {
          "type": "integer",
          "description": "Maximum number of invalid submissions per minute (per user/team). We suggest you use it as part of an anti-brute-force strategy (rate limiting)"
        },
        "name_changes": {
          "type": "boolean",
          "description": "Whether a user can change its name or not"
        }
      },
      "description": "Accounts parameters, like rate limiting or default permissions",
      "type": "object",
      "additionalProperties": false
    },
    "Admin": {
      "properties": {
        "name": {
          "$ref": "#/$defs/FromEnv",
          "description": "The administrator name. Immutable, or need the administrator to change the CTFd data AND the configuration file"
        },
        "email": {
          "$ref": "#/$defs/FromEnv",
          "description": "The administrator email address. Immutable, or need the administrator to change the CTFd data AND the configuration file"
        },
        "password": {
          "$ref": "#/$defs/FromEnv",
          "description": "The administrator password, recommended to use the varenvs. Immutable, or need the administrator to change the CTFd data AND the configuration file"
        }
      },
      "description": "Admin accesses",
      "type": "object",
      "required": [
        "name",
        "email",
        "password"
      ],
      "additionalProperties": false
    },
    "Appearance": {
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of your CTF, displayed as is"
        },
        "description": {
          "type": "string",
          "description": "The description of your CTF, displayed as is"
        },
        "default_locale": {
          "type": "string",
          "description": "The default language for the users"
        }
      },
      "description": "Appearance of the CTFd",
      "type": "object",
      "required": [
        "name",
        "description"
      ],
      "additionalProperties": false
    },
    "Challenges": {
      "properties": {
        "view_self_submissions": {
          "type": "boolean",
          "description": "Whether a player can see itw own previous submissions"
        },
        "max_attempts_behavior": {
          "type": "string",
          "enum": [
            "lockout",
            "timeout"
          ],
          "description": "The behavior to adopt in case a player reached the submission rate limiting",
          "default": "lockout"
        },
        "max_attempts_timeout": {
          "type": "integer",
          "description": "The duration of the submission rate limit for further submissions"
        },
        "hints_free_public_access": {
          "type": "boolean",
          "description": "Control whether users must be logged in to see free hints"
        },
        "challenge_ratings": {
          "type": "string",
          "enum": [
            "public",
            "private",
            "disabled"
          ],
          "description": "Who can see and submit challenge ratings",
          "default": "public"
        }
      },
      "description": "Challenge-related configurations",
      "type": "object",
      "required": [
        "view_self_submissions",
        "max_attempts_behavior",
        "max_attempts_timeout",
        "hints_free_public_access",
        "challenge_ratings"
      ],
      "additionalProperties": false
    },
    "Config": {
      "properties": {
        "appearance": {
          "$ref": "#/$defs/Appearance"
        },
        "theme": {
          "$ref": "#/$defs/Theme"
        },
        "accounts": {
          "$ref": "#/$defs/Accounts"
        },
        "challenges": {
          "$ref": "#/$defs/Challenges"
        },
        "pages": {
          "$ref": "#/$defs/Pages"
        },
        "major_league_cyber": {
          "$ref": "#/$defs/MajorLeagueCyber"
        },
        "settings": {
          "$ref": "#/$defs/Settings"
        },
        "security": {
          "$ref": "#/$defs/Security"
        },
        "email": {
          "$ref": "#/$defs/Email"
        },
        "time": {
          "$ref": "#/$defs/Time"
        },
        "social": {
          "$ref": "#/$defs/Social"
        },
        "legal": {
          "$ref": "#/$defs/Legal"
        },
        "admin": {
          "$ref": "#/$defs/Admin"
        },
        "mode": {
          "type": "string",
          "enum": [
            "users",
            "teams"
          ],
          "description": "The mode of your CTFd, either users or teams",
          "default": "users"
        },
        "uploads": {
          "items": {
            "$ref": "#/$defs/Upload"
          },
          "type": "array"
        }
      },
      "required": [
        "appearance",
        "admin"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "Email": {
      "properties": {
        "registration": {
          "$ref": "#/$defs/EmailContent",
          "description": "The registration email"
        },
        "confirmation": {
          "$ref": "#/$defs/EmailContent",
          "description": "The confirmation email"
        },
        "new_account": {
          "$ref": "#/$defs/EmailContent",
          "description": "The new account email"
        },
        "password_reset": {
          "$ref": "#/$defs/EmailContent",
          "description": "The password reset email"
        },
        "password_reset_confirmation": {
          "$ref": "#/$defs/EmailContent",
          "description": "The password reset confirmation email"
        },
        "from": {
          "type": "string",
          "description": "The 'From:' to sent to mail with"
        },
        "server": {
          "type": "string",
          "description": "The mail server to use"
        },
        "port": {
          "type": "string",
          "description": "The mail server port to reach"
        },
        "username": {
          "type": "string",
          "description": "The username to log in to the mail server"
        },
        "password": {
          "type": "string",
          "description": "The password to log in to the mail server"
        },
        "tls_ssl": {
          "type": "boolean",
          "description": "Whether to turn on TLS/SSL or not"
        },
        "starttls": {
          "type": "boolean",
          "description": "Whether to turn on STARTTLS or not"
        }
      },
      "description": "Email rules and server credentials",
      "type": "object",
      "required": [
        "registration",
        "confirmation",
        "new_account",
        "password_reset",
        "password_reset_confirmation"
      ],
      "additionalProperties": false
    },
    "EmailContent": {
      "properties": {
        "subject": {
          "type": "string",
          "description": "Subject of the email"
        },
        "body": {
          "type": "string",
          "description": "Body (or content) or the email"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "ExternalReference": {
      "properties": {
        "url": {
          "type": "string",
          "description": "The URL to access the content"
        },
        "content": {
          "$ref": "#/$defs/File",
          "description": "The content of the reference"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "File": {
      "oneOf": [
        {
          "properties": {
            "from_file": {
              "type": "string",
              "description": "The file to import content from"
            }
          },
          "type": "object"
        },
        {
          "type": "string"
        }
      ]
    },
    "FromEnv": {
      "oneOf": [
        {
          "properties": {
            "from_env": {
              "type": "string",
              "description": "The environment variable to look at"
            }
          },
          "type": "object"
        },
        {
          "type": "string"
        }
      ]
    },
    "Legal": {
      "properties": {
        "tos": {
          "$ref": "#/$defs/ExternalReference",
          "description": "The Terms of Services"
        },
        "privacy_policy": {
          "$ref": "#/$defs/ExternalReference",
          "description": "The Privacy Policy"
        }
      },
      "description": "Legal contents for players",
      "type": "object",
      "required": [
        "tos",
        "privacy_policy"
      ],
      "additionalProperties": false
    },
    "MajorLeagueCyber": {
      "properties": {
        "client_id": {
          "type": "string",
          "description": "The MajorLeagueCyber OAuth ClientID"
        },
        "client_secret": {
          "type": "string",
          "description": "The MajorLeagueCyber OAuth Client Secret"
        }
      },
      "description": "MajorLeagueCyber credentials to register the CTF",
      "type": "object",
      "additionalProperties": false
    },
    "Page": {
      "properties": {
        "title": {
          "type": "string",
          "description": "Title of the page"
        },
        "route": {
          "type": "string",
          "description": "Route to serve"
        },
        "format": {
          "type": "string",
          "enum": [
            "markdown",
            "html"
          ],
          "description": "Format to consume the content",
          "default": "markdown"
        },
        "content": {
          "$ref": "#/$defs/File",
          "description": "The page content. If you need to use images, please use an external CDN to make sure the content is replicable"
        },
        "draft": {
          "type": "boolean",
          "description": "Set the page as a draft",
          "default": false
        },
        "hidden": {
          "type": "boolean",
          "description": "Hide or show the page to users",
          "default": false
        },
        "auth_required": {
          "type": "boolean",
          "description": "Configure whether the page require authentication or not",
          "default": false
        }
      },
      "description": "Page to configure and display on the CTFd",
      "type": "object",
      "required": [
        "title",
        "route",
        "content"
      ],
      "additionalProperties": false
    },
    "Pages": {
      "properties": {
        "robots_txt": {
          "$ref": "#/$defs/File",
          "description": "Define the /robots.txt file content, for web crawlers indexing"
        },
        "additional": {
          "items": {
            "$ref": "#/$defs/Page"
          },
          "type": "array"
        }
      },
      "description": "Pages global configuration",
      "type": "object",
      "additionalProperties": false
    },
    "Security": {
      "properties": {
        "html_sanitization": {
          "type": "boolean",
          "description": "Whether to turn on HTML sanitization or not"
        },
        "registration_code": {
          "type": "string",
          "description": "The registration code (secret) to join the CTF"
        }
      },
      "description": "Security of contents and accesses",
      "type": "object",
      "additionalProperties": false
    },
    "Settings": {
      "properties": {
        "challenge_visibility": {
          "type": "string",
          "enum": [
            "public",
            "private",
            "admins"
          ],
          "description": "The visibility for the challenges. Please refer to CTFd documentation (https://docs.ctfd.io/docs/settings/visibility-settings/)",
          "default": "private"
        },
        "account_visibility": {
          "type": "string",
          "enum": [
            "public",
            "private",
            "admins"
          ],
          "description": "The visibility for the accounts. Please refer to CTFd documentation (https://docs.ctfd.io/docs/settings/visibility-settings/)",
          "default": "public"
        },
        "score_visibility": {
          "type": "string",
          "enum": [
            "public",
            "private",
            "admins"
          ],
          "description": "The visibility for the scoreboard. Please refer to CTFd documentation (https://docs.ctfd.io/docs/settings/visibility-settings/)",
          "default": "public"
        },
        "registration_visibility": {
          "type": "string",
          "enum": [
            "public",
            "private",
            "admins"
          ],
          "description": "The visibility for the registration. Please refer to CTFd documentation (https://docs.ctfd.io/docs/settings/visibility-settings/)",
          "default": "public"
        },
        "paused": {
          "type": "boolean",
          "description": "Whether the CTFd is paused or not"
        }
      },
      "description": "Settings for resources visibility",
      "type": "object",
      "additionalProperties": false
    },
    "Social": {
      "properties": {
        "shares": {
          "type": "boolean",
          "description": "Whether to enable users share they solved a challenge or not"
        },
        "template": {
          "$ref": "#/$defs/File",
          "description": "A template for social shares"
        }
      },
      "description": "Social network configuration",
      "type": "object",
      "additionalProperties": false
    },
    "Theme": {
      "properties": {
        "logo": {
          "$ref": "#/$defs/File",
          "description": "The frontend logo"
        },
        "small_icon": {
          "$ref": "#/$defs/File",
          "description": "The frontend small icon"
        },
        "name": {
          "type": "string",
          "description": "The frontend theme name",
          "default": "core"
        },
        "color": {
          "type": "string",
          "description": "The frontend theme color"
        },
        "header": {
          "$ref": "#/$defs/File",
          "description": "The frontend header"
        },
        "footer": {
          "$ref": "#/$defs/File",
          "description": "The frontend footer"
        },
        "settings": {
          "$ref": "#/$defs/File",
          "description": "The frontend settings (JSON)"
        }
      },
      "description": "Theme displayed to end-users",
      "type": "object",
      "additionalProperties": false
    },
    "Time": {
      "properties": {
        "start": {
          "type": "string",
          "description": "The start timestamp at which the CTFd will open"
        },
        "end": {
          "type": "string",
          "description": "The end timestamp at which the CTFd will close"
        },
        "freeze": {
          "type": "string",
          "description": "The freeze timestamp at which the CTFd will remain open but won't accept any further submissions"
        },
        "view_after": {
          "type": "boolean",
          "description": "Whether allows users to view challenges after end or not"
        }
      },
      "description": "Time settings of the CTF",
      "type": "object",
      "additionalProperties": false
    },
    "Upload": {
      "properties": {
        "file": {
          "$ref": "#/$defs/File"
        },
        "location": {
          "type": "string",
          "description": "Where to upload it.\nThis enables to use a file at a static location in, e.g., custom pages"
        }
      },
      "description": "Upload defines a file or content to upload as per the setup",
      "type": "object",
      "required": [
        "file",
        "location"
      ],
      "additionalProperties": false
    }
  }
}
