{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Backend Config",
    "description": "A configuration file for the PrairieLearn server.",
    "type": "object",
    "properties": {
        "courseDirs": {
            "description": "Paths of the course directories.",
            "type": "array",
            "items": {
                "description": "A single course directory path.",
                "type": "string"
            }
        },
        "secretKey": {
            "description": "Secret key for authenticating users (should be a long random string).",
            "type": "string"
        },
        "postgresqlUser": {
            "description": "The user for connecting to the PostgreSQL database.",
            "type": "string"
        },
        "postgresqlDatabase": {
            "description": "The database for connecting to the PostgreSQL database.",
            "type": "string"
        },
        "postgresqlHost": {
            "description": "The host for connecting to the PostgreSQL database.",
            "type": "string"
        },
        "redisUrl": {
            "description": "The url for connecting to Redis.",
            "type": "string"
        },
        "logFilename": {
            "description": "Filename to use for server logging.",
            "type": "string"
        },
        "authType": {
            "description": "The type of authentication to use.",
            "enum": [
                "none",
                "x-auth",
                "eppn",
                "x-trust-auth"
            ]
        },
        "serverType": {
            "description": "The type of server to start.",
            "enum": [
                "http",
                "https"
            ]
        },
        "sslCertificateFile": {
            "description": "Path to SSL certificate",
            "type": "string"
        },
        "sslKeyFile": {
            "description": "Path to SSL certificate key file",
            "type": "string"
        },
        "sslCAFile": {
            "description": "Path to SSL CA chain file",
            "type": "string"
        },
        "serverPort": {
            "description": "The TCP port number for the server.",
            "type": "string"
        },
        "groupName": {
            "description": "The group of servers we belong to, used for load reporting and autoscaling.",
            "type": "string"
        },
        "blockedWarnEnable": {
            "description": "Whether to detect and warn on blockages in the event loop.",
            "type": "boolean"
        },
        "blockedAtWarnEnable": {
            "description": "Whether to use more expensive event-loop-blocking detection that includes stack traces (not for routine use in production).",
            "type": "boolean"
        },
        "blockedWarnThresholdMS": {
            "description": "The threshold (in milliseconds) for detecting event-loop blockages.",
            "type": "integer"
        },
        "checkAccessRulesExamUuid": {
            "description": "On sync, check if assessment access rules examUuid exists in database (default false)",
            "type": "boolean"
        },
        "cronIntervalMS": {
            "description": "Time between cron job runs (milliseconds).",
            "type": "integer"
        },
        "autoFinishAgeMins": {
            "description": "Time after last activity when exams are auto-closed (minutes).",
            "type": "integer"
        },
        "runningInEc2": {
            "description": "Whether PL is running as an AWS EC2 instance",
            "type": "boolean"
        },
        "externalGradingUseAws": {
            "description": "If the external grader should use AWS (production) or not (local dev).",
            "type": "boolean"
        },
        "externalGradingS3Bucket": {
            "description": "The S3 bucket that externally graded jobs should be stored in.",
            "type": "string"
        },
        "externalGradingResultsS3Bucket": {
            "description": "The S3 bucket where externally graded job results will be stored.",
            "type": "string"
        },
        "externalGradingJobQueue": {
            "description": "The name of the job queue where externally graded jobs will be submitted.",
            "type": "string"
        },
        "externalGradingJobRole": {
            "description": "The ARN of the role that should be provided to external grading containers for resource access.",
            "type": "string"
        },
        "externalGradingWebhookUrl": {
            "description": "The endpoint that should be hit when a grading result is updated. Should be null when running locally.",
            "type": "string"
        },
        "externalGradingDefaultTimeout": {
            "description": "The default timeout to use for external grading if none is specified by a question.",
            "type": "integer"
        },
        "externalGradingPullImagesFromDockerHub": {
            "description": "Whether externally graded questions should automatically pull container images from Docker Hub (true) or use only locally cached images (false)",
            "type": "boolean"
        },
        "awsRegion": {
            "description": "The region for AWS resources.",
            "type": "string"
        },
        "hasShib": {
            "description": "Enables Shibboleth authentication",
            "type": "boolean"
        },
        "hasAzure": {
            "description": "Enables Azure authentication",
            "type": "boolean"
        },
        "hasOauth": {
            "description": "Enables OAuth authentication",
            "type": "boolean"
        },
        "useWorkers": {
            "description": "Enable persistent, forking Python workers",
            "type": "boolean"
        },
        "workersCount": {
            "description": "The number of workers to use (or null to use workersPerCpu).",
            "type": "integer"
        },
        "workersPerCpu": {
            "description": "The number of workers per CPU (if workersCount is null).",
            "type": "number"
        }
    }
}