{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/ddev-project/latest.json",
  "title": "DDEV project config",
  "description": "Schema for DDEV project's config.yaml",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/ddev/ddev/master/pkg/ddevapp/schema.json",
    "sourceSha256": "d8816437d63ea0add36ba285ab4fb01306951da34ef888a5e2d3c771799a929c",
    "fileMatch": [
      "**/.ddev/config*.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "additional_fqdns": {
      "description": "List of FQDNs for the project.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "additional_hostnames": {
      "description": "List of hostnames for the project.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "bind_all_interfaces": {
      "description": "Bind host ports on all interfaces, not only on the localhost network interface.",
      "type": "boolean"
    },
    "composer_root": {
      "description": "The relative path, from the project root, to the directory containing composer.json. (This is where all Composer-related commands are executed.)",
      "type": "string"
    },
    "composer_version": {
      "description": "Composer version for the web container and the ddev composer command.",
      "type": "string",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "2",
            "2.2",
            "stable",
            "preview",
            "snapshot"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "corepack_enable": {
      "description": "Whether to run \"corepack enable\" on Node.js configuration.",
      "type": "boolean"
    },
    "database": {
      "description": "Specify the database type and version to use.",
      "type": "object",
      "properties": {
        "type": {
          "description": "Specify the database type to use.",
          "type": "string",
          "enum": [
            "mariadb",
            "mysql",
            "postgres"
          ]
        },
        "version": {
          "description": "Specify the database version to use.",
          "type": "string"
        }
      },
      "if": {
        "properties": {
          "type": {
            "const": "mariadb"
          }
        }
      },
      "then": {
        "properties": {
          "version": {
            "enum": [
              "5.5",
              "10.0",
              "10.1",
              "10.2",
              "10.3",
              "10.4",
              "10.5",
              "10.6",
              "10.7",
              "10.8",
              "10.11",
              "11.4",
              "11.8"
            ]
          }
        }
      },
      "else": {
        "if": {
          "properties": {
            "type": {
              "const": "mysql"
            }
          }
        },
        "then": {
          "properties": {
            "version": {
              "enum": [
                "5.5",
                "5.6",
                "5.7",
                "8.0",
                "8.4"
              ]
            }
          }
        },
        "else": {
          "if": {
            "properties": {
              "type": {
                "const": "postgres"
              }
            }
          },
          "then": {
            "properties": {
              "version": {
                "enum": [
                  "9",
                  "10",
                  "11",
                  "12",
                  "13",
                  "14",
                  "15",
                  "16",
                  "17",
                  "18"
                ]
              }
            }
          },
          "else": {
            "not": {
              "required": [
                "version"
              ]
            }
          }
        }
      }
    },
    "dbimage_extra_packages": {
      "description": "List of Debian packages that should be added to db container when the project is started.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "ddev_version_constraint": {
      "description": "Validate that ddev version being used is valid within this constraint.",
      "type": "string"
    },
    "default_container_timeout": {
      "description": "Seconds DDEV will wait for all containers to become ready.",
      "type": [
        "integer",
        "string"
      ],
      "anyOf": [
        {
          "type": [
            "integer",
            "string"
          ],
          "enum": [
            120,
            "120"
          ]
        },
        {
          "type": [
            "integer",
            "string"
          ]
        }
      ]
    },
    "disable_settings_management": {
      "description": "Prevent ddev from creating or updating CMS settings files.",
      "type": "boolean"
    },
    "disable_upload_dirs_warning": {
      "description": "Whether to disable the standard warning issued when a project is using performance_mode: mutagen but upload_dirs is not configured.",
      "type": "boolean"
    },
    "docroot": {
      "description": "Provide the relative docroot of the project, like 'docroot' or 'htdocs' or 'web', defaults to empty, the current directory.",
      "type": "string"
    },
    "fail_on_hook_fail": {
      "description": "Decide whether 'ddev start' should be interrupted by a failing hook.",
      "type": "boolean"
    },
    "hooks": {
      "description": "Run tasks before or after main DDEV commands are executed.",
      "type": "object",
      "properties": {
        "pre-start": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-start": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-import-db": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-import-db": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-import-files": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-import-files": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-composer": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-composer": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-stop": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-config": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-config": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-exec": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-exec": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-pause": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-pause": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-pull": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-pull": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-push": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-push": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-share": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-share": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-snapshot": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-snapshot": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-delete-snapshot": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-delete-snapshot": {
          "$ref": "#/$defs/DdevTask"
        },
        "pre-restore-snapshot": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-restore-snapshot": {
          "$ref": "#/$defs/DdevTask"
        },
        "post-stop": {
          "$ref": "#/$defs/DdevTask"
        }
      }
    },
    "host_db_port": {
      "description": "The db container's localhost-bound port.",
      "type": "string"
    },
    "host_https_port": {
      "description": "The web container's localhost-bound https port.",
      "type": "string"
    },
    "host_xhgui_port": {
      "description": "XHGui localhost-bound port.",
      "type": "string"
    },
    "host_mailpit_port": {
      "description": "Mailpit localhost-bound port.",
      "type": "string"
    },
    "host_webserver_port": {
      "description": "The web container's localhost-bound port.",
      "type": "string"
    },
    "mailpit_http_port": {
      "description": "Router port to be used for Mailpit HTTP access.",
      "type": "string",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "8025"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "mailpit_https_port": {
      "description": "Router port to be used for Mailpit HTTPS access.",
      "type": "string",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "8026"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "name": {
      "description": "Provide the name of the project to configure (normally the same as the last part of directory name).",
      "type": "string"
    },
    "ngrok_args": {
      "description": "(Deprecated) Use share_provider_args instead, provide extra args to ngrok in \"ddev share\".",
      "type": "string"
    },
    "no_project_mount": {
      "description": "Whether to skip mounting project into web container.",
      "type": "boolean"
    },
    "nodejs_version": {
      "description": "Node.js version for the web container's \"system\" version.",
      "type": "string",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "6",
            "8",
            "10",
            "12",
            "14",
            "16",
            "18",
            "20",
            "22",
            "24",
            "auto",
            "lts",
            "latest",
            "current",
            "engine",
            "nightly"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "omit_containers": {
      "description": "A list of container types that should not be started when the project is started.",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "db",
          "ddev-ssh-agent"
        ]
      },
      "uniqueItems": true
    },
    "override_config": {
      "description": "Whether to override config values instead of merging.",
      "type": "boolean"
    },
    "performance_mode": {
      "description": "Define the performance optimization mode to be used. Currently Mutagen asynchronous caching is supported. Mutagen is enabled by default on Mac and Windows.",
      "type": "string",
      "enum": [
        "global",
        "none",
        "mutagen"
      ]
    },
    "php_version": {
      "description": "The PHP version the project should use.",
      "type": "string",
      "enum": [
        "5.6",
        "7.0",
        "7.1",
        "7.2",
        "7.3",
        "7.4",
        "8.0",
        "8.1",
        "8.2",
        "8.3",
        "8.4",
        "8.5"
      ]
    },
    "project_tld": {
      "description": "Set the top-level domain to be used for projects, defaults to ddev.site (default \"ddev.site\").",
      "type": "string",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "ddev.site"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "router_http_port": {
      "description": "Router HTTP port for this project.",
      "type": "string",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "80"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "router_https_port": {
      "description": "Router HTTPS port for this project.",
      "type": "string",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "443"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "share_default_provider": {
      "description": "Default share provider for the project. Overrides global configuration.",
      "type": "string",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "ngrok",
            "cloudflared"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "share_provider_args": {
      "description": "Arguments to pass to the share provider when starting a share session.",
      "type": "string"
    },
    "timezone": {
      "description": "Specify timezone for containers and PHP. If unset, DDEV will attempt to derive it from the host system timezone.",
      "type": "string"
    },
    "type": {
      "description": "Provide the project type.",
      "type": "string",
      "enum": [
        "backdrop",
        "cakephp",
        "codeigniter",
        "craftcms",
        "drupal",
        "drupal6",
        "drupal7",
        "drupal8",
        "drupal9",
        "drupal10",
        "drupal11",
        "drupal12",
        "generic",
        "laravel",
        "magento",
        "magento2",
        "php",
        "shopware6",
        "silverstripe",
        "symfony",
        "typo3",
        "wordpress"
      ]
    },
    "upload_dirs": {
      "description": "Set multiple project upload directories, the first is taken as the destination directory of the \"ddev import-files\" command.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "use_dns_when_possible": {
      "description": "Use DNS for hostname resolution instead of /etc/hosts when possible.",
      "type": "boolean"
    },
    "web_environment": {
      "description": "Add environment variables to the web container.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "web_extra_daemons": {
      "description": "Additional daemons that should automatically be started in the web container.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "directory": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "web_extra_exposed_ports": {
      "description": "Additional named sets of ports to expose via ddev-router.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "container_port": {
            "type": "integer"
          },
          "http_port": {
            "type": "integer"
          },
          "https_port": {
            "type": "integer"
          }
        },
        "additionalProperties": false
      }
    },
    "webimage": {
      "description": "Set the web container image.",
      "type": "string"
    },
    "webimage_extra_packages": {
      "description": "List of Debian packages that should be added to web container when the project is started.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "webserver_type": {
      "description": "Set the project's desired webserver type.",
      "type": "string",
      "enum": [
        "nginx-fpm",
        "apache-fpm",
        "generic"
      ]
    },
    "working_dir": {
      "description": "Override default project working directories for db and web service.",
      "type": "object",
      "properties": {
        "web": {
          "description": "Override the default working directory for the web service.",
          "type": "string"
        },
        "db": {
          "description": "Override the default working directory for the db service.",
          "type": "string"
        }
      }
    },
    "xdebug_enabled": {
      "description": "Whether Xdebug is enabled in the web container.",
      "type": "boolean"
    },
    "xhgui_http_port": {
      "description": "Router port to be used for XHGui HTTP access.",
      "type": "string",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "8143"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "xhgui_https_port": {
      "description": "Router port to be used for XHGui HTTPS access.",
      "type": "string",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "8142"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "xhprof_mode": {
      "description": "Define the XHProf usage mode used by the project.",
      "type": "string",
      "enum": [
        "global",
        "prepend",
        "xhgui"
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "DdevTask": {
      "type": "array",
      "items": {
        "type": "object",
        "oneOf": [
          {
            "required": [
              "exec"
            ],
            "properties": {
              "exec": {
                "type": "string"
              }
            },
            "type": "object"
          },
          {
            "required": [
              "exec",
              "exec_raw"
            ],
            "properties": {
              "exec": {
                "type": "null"
              }
            },
            "type": "object"
          },
          {
            "required": [
              "exec-host"
            ]
          },
          {
            "required": [
              "composer"
            ],
            "properties": {
              "composer": {
                "type": "string"
              }
            },
            "type": "object"
          },
          {
            "required": [
              "composer",
              "exec_raw"
            ],
            "properties": {
              "composer": {
                "type": "null"
              }
            },
            "type": "object"
          }
        ],
        "properties": {
          "exec": {
            "oneOf": [
              {
                "type": "string",
                "description": "Command to execute in a container"
              },
              {
                "type": "null",
                "description": "Use exec_raw for command array"
              }
            ]
          },
          "exec-host": {
            "type": "string",
            "description": "Command to execute on the host"
          },
          "composer": {
            "oneOf": [
              {
                "type": "string",
                "description": "Composer command to execute in the web container"
              },
              {
                "type": "null",
                "description": "Use exec_raw for command array"
              }
            ]
          },
          "service": {
            "type": "string",
            "description": "Service to run the exec command in (defaults to 'web')"
          },
          "user": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ],
            "description": "User to run the exec command as (username or UID)"
          },
          "exec_raw": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Raw command arguments array (used with exec or composer)"
          }
        },
        "additionalProperties": false
      }
    }
  }
}
