diff --git a/validator/schema/upsun.json b/validator/schema/upsun.json index 630b103..012c408 100644 --- a/validator/schema/upsun.json +++ b/validator/schema/upsun.json @@ -8,157 +8,35 @@ "additionalProperties": { "type": "object", "properties": { - "resources": {"$ref": "#/definitions/deprecated/resources"}, - "container_profile": {"$ref": "#/definitions/container_profile"}, - "access": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "Access control for roles accessing app environments", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/access/", - "default": { - "ssh": "contributor" - } - }, - "relationships": {"$ref": "#/definitions/relationships"}, - "mounts": {"$ref": "#/definitions/mounts"}, - "timezone": { - "type": "string", - "title": "The timezone of the application", - "description": "This primarily affects the timezone in which cron tasks will run. It will not affect the application itself. Defaults to UTC if not specified. \nSee also: \nhttps://docs.upsun.com/anchors/app/timezone/", - "default": null - }, - "variables": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": {} - }, - "title": "Variables to control the environment", - "description": "Variables provide environment-sensitive information to control how your application behaves. To set a Unix environment variable, specify a key of `env:`, and then each sub-item of that is a key/value pair that will be injected into the environment. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/variables/", - "default": {} - }, - "firewall": {"$ref": "#/definitions/firewall"}, "type": { "type": "string", "title": "The base runtime (language) and version to use for this application", "description": "The base image to use with a specific app language. \nFormat: runtime:version. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/type/" }, - "runtime": { - "type": "object", - "title": "Runtime-specific configuration", - "description": "Customizations to your PHP or Lisp runtime. \nContains a runtime dictionary: \nhttps://docs.upsun.com/anchors/app/reference/runtime/", - "properties": { - "extensions": { - "type": "array", - "title": "PHP extensions to enable", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/extensions/", - "default": [] - }, - "disabled_extensions": { - "type": "array", - "title": "PHP extensions to disable", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/extensions/", - "default": [] - }, - "request_terminate_timeout": { - "type": "integer", - "title": "PHP timeout to terminate requests", - "description": "The timeout in seconds for serving a single request after which the PHP-FPM worker process is killed." - }, - "sizing_hints": { - "type": "object", - "title": "A sizing hints definition", - "description": "The assumptions for setting the number of workers in your PHP-FPM runtime. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/runtime/sizing-hints/", - "properties": { - "request_memory": { - "type": "integer", - "title": "The average memory consumed per request in MB", - "description": "Minimum to 10", - "default": 45, - "minimum": 10 - }, - "reserved_memory": { - "type": "integer", - "title": "The amount of memory reserved in MB", - "description": "Minimum to 70", - "default": 70, - "minimum": 70 - } - }, - "additionalProperties": false - }, - "xdebug": { - "type": "object", - "title": "An Xdebug definition", - "description": "The setting to turn on Xdebug. \nMore information: \nhttps://docs.upsun.com/anchors/languages/php/xdebug/", - "properties": { - "idekey": { - "type": "string", - "title": "Your Xdebug key" - } - } + "stack": { + "oneOf": [ + { + "type": "string" }, - "quicklisp": { - "type": "object", - "title": "Distributions for QuickLisp to use", - "description": "More information: \nhttps://docs.upsun.com/anchors/languages/lisp/", - "deprecationMessage": "Lisp image no longer exists, please see \nhttps://devcenter.upsun.com/posts/deploying-with-lisp/ \n for more information" - } - } - }, - "preflight": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "title": "Whether the preflight security blocks are enabled", - "description": "Must be a boolean" + { + "type": "object" }, - "ignored_rules": { + { "type": "array", "items": { - "type": "string" - }, - "title": "Specific rules to ignore during preflight security checks", - "default": [] + "oneOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } } - }, - "required": [ - "enabled" ], - "additionalProperties": false, - "description": "Configuration for pre-flight checks", - "default": { - "enabled": true, - "ignored_rules": [] - } - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "type": "object" - }, - "title": "External global dependencies of this application", - "description": "What global dependencies to install before the build `hook` is run. They will be downloaded by the language's package manager. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/dependencies/", - "default": {} - }, - "build": { - "type": "object", - "properties": { - "flavor": { - "type": "string", - "description": "The pre-set build tasks to use for this application", - "default": null - } - }, - "additionalProperties": false, - "title": "The build configuration of the application", - "description": "It contains a build dictionary. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/build/", - "default": { - "flavor": null - } + "title": "Composable Image definition", + "description": "A list of packages from the Upsun collection of supported runtimes and/or from NixPkgs. \nMore information: \nhttps://docs.upsun.com/anchors/app/composable/" }, "source": { "type": "object", @@ -197,6 +75,9 @@ "root": null } }, + "resources": {"$ref": "#/definitions/deprecated/resources"}, + "relationships": {"$ref": "#/definitions/relationships"}, + "mounts": {"$ref": "#/definitions/mounts"}, "web": { "type": "object", "title": "How the web application is served", @@ -445,42 +326,161 @@ "locations": {} } }, - "operations": { + "workers": { "type": "object", "additionalProperties": { "type": "object", "properties": { + "firewall": {"$ref": "#/definitions/firewall"}, + "variables": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": {} + }, + "title": "Variables to control the environment", + "description": "Variables provide environment-sensitive information to control how your application behaves. To set a Unix environment variable, specify a key of `env:`, and then each sub-item of that is a key/value pair that will be injected into the environment. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/variables/", + "default": {} + }, + "timezone": { + "type": "string", + "title": "The timezone of the application", + "description": "This primarily affects the timezone in which cron tasks will run. It will not affect the application itself. Defaults to UTC if not specified. \nSee also: \nhttps://docs.upsun.com/anchors/app/timezone/", + "default": null + }, + "mounts": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "source": { + "type": "string", + "title": "The type of mount that will provide the data", + "description": "- By design, `storage` mounts can be shared between instances of the same app \n- `instance` mounts are local mounts \n- `tmp` (or `temporary`) mounts are local ephemeral mounts \n- `service` mounts can be useful if you want to explicitly define and use a Network Storage service", + "enum": [ + "instance", + "service", + "storage", + "temporary", + "tmp" + ] + }, + "source_path": { + "type": "string", + "title": "The path to be mounted", + "description": "Path relative to the root directory of the volume that's being mounted from. \nWARNING: Changing the name of your mount affects the source_path when it’s undefined. See how to ensure continuity and maintain access to your files \nhttps://docs.upsun.com/anchors/app/reference/mounts/change-name/" + }, + "service": { + "type": "string", + "title": "The name of the service that the volume will be mounted from", + "description": "Must be a service in `services.yaml` of type `network-storage`." + } + }, + "required": [ + "source" + ], + "additionalProperties": false + }, + "title": "Filesystem mounts of this application", + "description": "Directories that are writable even after the app is built. Allocated disk for mounts is defined with a separate resource configuration call using `upsun resources:set`. \nContains a dictionary of mounts: \nhttps://docs.upsun.com/anchors/app/reference/mounts/", + "default": {} + }, + "relationships": {"$ref": "#/definitions/relationships"}, + "access": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Access control for roles accessing app environments", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/access/", + "default": { + "ssh": "contributor" + } + }, + "size": {"$ref": "#/definitions/deprecated/size"}, + "resources": {"$ref": "#/definitions/deprecated/resources"}, + "container_profile": {"$ref": "#/definitions/container_profile"}, "commands": { "type": "object", "properties": { + "pre_start": { + "type": "string", + "title": "The command used to run before starting the application", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/workers/" + }, "start": { "type": "string", "title": "The command used to start the application", - "description": "It will be restarted if it terminates. Do not use on PHP unless using a custom persistent process like React PHP." + "description": "It will be restarted if it terminates. Do not use on PHP unless using a custom persistent process like React PHP. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/workers/" + }, + "post_start": { + "type": "string", + "title": "A command executed after the application is started", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/workers/" } }, "required": [ "start" - ] - }, - "role": { - "type": "string", - "title": "which users can trigger it according to their user role", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/runtime-operations/define/", - "enum": [ - "viewer", - "contributor", - "admin" - ] - } + ], + "additionalProperties": false, + "title": "The commands to manage the worker", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/workers/" + } }, "required": [ "commands" ], "additionalProperties": false }, - "title": "Runtime operations that can be executed in the application container", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/runtime-operations/", + "title": "Alternate copies of the application to run as background processes", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/workers/", + "default": {} + }, + "access": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Access control for roles accessing app environments", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/access/", + "default": { + "ssh": "contributor" + } + }, + "variables": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": {} + }, + "title": "Variables to control the environment", + "description": "Variables provide environment-sensitive information to control how your application behaves. To set a Unix environment variable, specify a key of `env:`, and then each sub-item of that is a key/value pair that will be injected into the environment. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/variables/", + "default": {} + }, + "firewall": {"$ref": "#/definitions/firewall"}, + "build": { + "type": "object", + "properties": { + "flavor": { + "type": "string", + "description": "The pre-set build tasks to use for this application", + "default": null + } + }, + "additionalProperties": false, + "title": "The build configuration of the application", + "description": "It contains a build dictionary. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/build/", + "default": { + "flavor": null + } + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "title": "External global dependencies of this application", + "description": "What global dependencies to install before the build `hook` is run. They will be downloaded by the language's package manager. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/dependencies/", "default": {} }, "hooks": { @@ -569,105 +569,138 @@ "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/crons/", "default": {} }, - "workers": { + "runtime": { "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "firewall": {"$ref": "#/definitions/firewall"}, - "variables": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": {} - }, - "title": "Variables to control the environment", - "description": "Variables provide environment-sensitive information to control how your application behaves. To set a Unix environment variable, specify a key of `env:`, and then each sub-item of that is a key/value pair that will be injected into the environment. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/variables/", - "default": {} - }, - "timezone": { - "type": "string", - "title": "The timezone of the application", - "description": "This primarily affects the timezone in which cron tasks will run. It will not affect the application itself. Defaults to UTC if not specified. \nSee also: \nhttps://docs.upsun.com/anchors/app/timezone/", - "default": null - }, - "mounts": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "source": { - "type": "string", - "title": "The type of mount that will provide the data", - "description": "- By design, `storage` mounts can be shared between instances of the same app \n- `instance` mounts are local mounts \n- `tmp` (or `temporary`) mounts are local ephemeral mounts \n- `service` mounts can be useful if you want to explicitly define and use a Network Storage service", - "enum": [ - "instance", - "service", - "storage", - "temporary", - "tmp" - ] - }, - "source_path": { - "type": "string", - "title": "The path to be mounted", - "description": "Path relative to the root directory of the volume that's being mounted from. \nWARNING: Changing the name of your mount affects the source_path when it’s undefined. See how to ensure continuity and maintain access to your files \nhttps://docs.upsun.com/anchors/app/reference/mounts/change-name/" - }, - "service": { - "type": "string", - "title": "The name of the service that the volume will be mounted from", - "description": "Must be a service in `services.yaml` of type `network-storage`." - } - }, - "required": [ - "source" - ], - "additionalProperties": false + "title": "Runtime-specific configuration", + "description": "Customizations to your PHP or Lisp runtime. \nContains a runtime dictionary: \nhttps://docs.upsun.com/anchors/app/reference/runtime/", + "properties": { + "extensions": { + "type": "array", + "title": "PHP extensions to enable", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/extensions/", + "default": [] + }, + "disabled_extensions": { + "type": "array", + "title": "PHP extensions to disable", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/extensions/", + "default": [] + }, + "request_terminate_timeout": { + "type": "integer", + "title": "PHP timeout to terminate requests", + "description": "The timeout in seconds for serving a single request after which the PHP-FPM worker process is killed." + }, + "sizing_hints": { + "type": "object", + "title": "A sizing hints definition", + "description": "The assumptions for setting the number of workers in your PHP-FPM runtime. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/runtime/sizing-hints/", + "properties": { + "request_memory": { + "type": "integer", + "title": "The average memory consumed per request in MB", + "description": "Minimum to 10", + "default": 45, + "minimum": 10 }, - "title": "Filesystem mounts of this application", - "description": "Directories that are writable even after the app is built. Allocated disk for mounts is defined with a separate resource configuration call using `upsun resources:set`. \nContains a dictionary of mounts: \nhttps://docs.upsun.com/anchors/app/reference/mounts/", - "default": {} + "reserved_memory": { + "type": "integer", + "title": "The amount of memory reserved in MB", + "description": "Minimum to 70", + "default": 70, + "minimum": 70 + } }, - "relationships": {"$ref": "#/definitions/relationships"}, - "access": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "Access control for roles accessing app environments", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/access/", - "default": { - "ssh": "contributor" + "additionalProperties": false + }, + "xdebug": { + "type": "object", + "title": "An Xdebug definition", + "description": "The setting to turn on Xdebug. \nMore information: \nhttps://docs.upsun.com/anchors/languages/php/xdebug/", + "properties": { + "idekey": { + "type": "string", + "title": "Your Xdebug key" } + } + }, + "quicklisp": { + "type": "object", + "title": "Distributions for QuickLisp to use", + "description": "More information: \nhttps://docs.upsun.com/anchors/languages/lisp/", + "deprecationMessage": "Lisp image no longer exists, please see \nhttps://devcenter.upsun.com/posts/deploying-with-lisp/ \n for more information" + } + } + }, + "container_profile": {"$ref": "#/definitions/container_profile"}, + "additional_hosts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Maps of hostnames to IP addresses", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/additional-hosts/" + }, + "timezone": { + "type": "string", + "title": "The timezone of the application", + "description": "This primarily affects the timezone in which cron tasks will run. It will not affect the application itself. Defaults to UTC if not specified. \nSee also: \nhttps://docs.upsun.com/anchors/app/timezone/", + "default": null + }, + "preflight": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "title": "Whether the preflight security blocks are enabled", + "description": "Must be a boolean" + }, + "ignored_rules": { + "type": "array", + "items": { + "type": "string" }, - "size": {"$ref": "#/definitions/deprecated/size"}, - "resources": {"$ref": "#/definitions/deprecated/resources"}, - "container_profile": {"$ref": "#/definitions/container_profile"}, + "title": "Specific rules to ignore during preflight security checks", + "default": [] + } + }, + "required": [ + "enabled" + ], + "additionalProperties": false, + "description": "Configuration for pre-flight checks", + "default": { + "enabled": true, + "ignored_rules": [] + } + }, + "operations": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { "commands": { "type": "object", "properties": { - "pre_start": { - "type": "string", - "title": "The command used to run before starting the application", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/workers/" - }, "start": { "type": "string", "title": "The command used to start the application", - "description": "It will be restarted if it terminates. Do not use on PHP unless using a custom persistent process like React PHP. \nMore information: \nhttps://docs.upsun.com/anchors/app/reference/workers/" - }, - "post_start": { - "type": "string", - "title": "A command executed after the application is started", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/workers/" + "description": "It will be restarted if it terminates. Do not use on PHP unless using a custom persistent process like React PHP." } }, "required": [ "start" - ], - "additionalProperties": false, - "title": "The commands to manage the worker", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/workers/" + ] + }, + "role": { + "type": "string", + "title": "which users can trigger it according to their user role", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/runtime-operations/define/", + "enum": [ + "viewer", + "contributor", + "admin" + ] } }, "required": [ @@ -675,42 +708,9 @@ ], "additionalProperties": false }, - "title": "Alternate copies of the application to run as background processes", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/workers/", + "title": "Runtime operations that can be executed in the application container", + "description": "More information: \nhttps://docs.upsun.com/anchors/app/runtime-operations/", "default": {} - }, - "additional_hosts": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "Maps of hostnames to IP addresses", - "description": "More information: \nhttps://docs.upsun.com/anchors/app/reference/additional-hosts/" - }, - "stack": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object" - }, - { - "type": "array", - "items": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object" - } - ] - } - } - ], - "title": "Composable Image definition", - "description": "A list of packages from the Upsun collection of supported runtimes and/or from NixPkgs. \nMore information: \nhttps://docs.upsun.com/anchors/app/composable/" } }, "anyOf": [ @@ -725,7 +725,30 @@ ] } ], - "additionalProperties": false + "additionalProperties": false, + "x-order": [ + "type", + "stack", + "source", + "resources", + "relationships", + "mounts", + "web", + "workers", + "access", + "variables", + "firewall", + "build", + "dependencies", + "hooks", + "crons", + "runtime", + "container_profile", + "additional_hosts", + "timezone", + "preflight", + "operations" + ] } }, "routes": {