{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://govoplan.add-ideas.de/schemas/installation-spec-v1.json", "title": "GovOPlaN installation specification", "type": "object", "additionalProperties": false, "required": [ "schema_version", "installation_id", "profile", "public_url", "listen", "network_subnet", "release", "components", "enabled_modules" ], "properties": { "schema_version": { "const": 1 }, "installation_id": { "type": "string", "pattern": "^[a-z][a-z0-9-]{1,47}$" }, "profile": { "enum": [ "evaluation", "self-hosted" ] }, "public_url": { "type": "string", "format": "uri", "pattern": "^https?://" }, "listen": { "type": "object", "additionalProperties": false, "required": [ "address", "port" ], "properties": { "address": { "type": "string" }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 } } }, "network_subnet": { "type": "string" }, "release": { "type": "object", "additionalProperties": false, "required": [ "channel", "version", "manifest_url", "manifest_sha256", "api_image", "web_image" ], "properties": { "channel": { "type": "string", "pattern": "^[a-z][a-z0-9-]{1,31}$" }, "version": { "type": "string", "minLength": 1, "maxLength": 80 }, "manifest_url": { "type": "string" }, "manifest_sha256": { "type": "string", "pattern": "^$|^[0-9a-f]{64}$" }, "api_image": { "type": "string", "minLength": 1, "maxLength": 300 }, "web_image": { "type": "string", "minLength": 1, "maxLength": 300 } } }, "components": { "type": "object", "additionalProperties": false, "required": [ "postgres", "redis", "mail", "storage" ], "properties": { "postgres": { "$ref": "#/$defs/postgres" }, "redis": { "$ref": "#/$defs/redis" }, "mail": { "$ref": "#/$defs/mail" }, "storage": { "type": "object", "additionalProperties": false, "required": [ "mode" ], "properties": { "mode": { "enum": [ "local", "s3" ] } } } } }, "enabled_modules": { "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z][a-z0-9_]{1,63}$" } } }, "$defs": { "service": { "type": "object", "additionalProperties": false, "required": [ "mode", "image", "url_env" ], "properties": { "mode": { "type": "string" }, "image": { "type": "string" }, "url_env": { "type": "string" } } }, "postgres": { "allOf": [ { "$ref": "#/$defs/service" }, { "properties": { "mode": { "enum": [ "managed", "external" ] }, "url_env": { "const": "DATABASE_URL" } } } ] }, "redis": { "allOf": [ { "$ref": "#/$defs/service" }, { "properties": { "mode": { "enum": [ "managed", "external", "disabled" ] }, "url_env": { "const": "REDIS_URL" } } } ] }, "mail": { "allOf": [ { "$ref": "#/$defs/service" }, { "properties": { "mode": { "enum": [ "disabled", "external-relay", "test-mail" ] }, "url_env": { "const": "" } } } ] } }, "allOf": [ { "if": { "properties": { "profile": { "const": "self-hosted" } } }, "then": { "properties": { "public_url": { "pattern": "^https://" }, "components": { "properties": { "redis": { "properties": { "mode": { "enum": [ "managed", "external" ] } } }, "mail": { "properties": { "mode": { "enum": [ "disabled", "external-relay" ] } } } } } } } } ] }