{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"VDI Plugin Configuration Schema","type":"object","properties":{"vdi":{"$ref":"#/$defs/vdi;plugin-service.json"}},"required":["vdi"],"$defs":{"vdi;components;plugin-map.json":{"title":"Plugin Registration","description":"Map of plugin definitions.\n\nThese map keys are not significant to VDI, they are only used for logging and human reference.","type":"object","additionalProperties":{"$ref":"#/$defs/vdi;components;plugin.json"},"minProperties":1,"unevaluatedItems":false},"vdi;components;plugin.json;scriptConfig":{"type":"object","properties":{"maxDuration":{"title":"Maximum Script Execution Time","$ref":"#/$defs/common.json;duration"},"pathOverride":{"title":"Script Path Override","$ref":"#/$defs/vdi;components;plugin.json;scriptPath"}},"additionalProperties":false},"vdi;components;plugin.json;scriptPath":{"type":"string","format":"uri-reference","examples":["/opt/vpdb/bin/import.sh"]},"vdi;components;plugin.json":{"title":"VDI Plugin Config","type":"object","properties":{"server":{"title":"Plugin Server Host Address","description":"Address of the plugin HTTP server.  Most likely the VDI-internal network alias of the container.","oneOf":[{"$ref":"#/$defs/common.json;addressString"},{"$ref":"#/$defs/common.json;addressObject"}]},"dataTypes":{"title":"Data Types","description":"Types and versions of dataset data handled by the plugin being defined.","type":"array","items":{"$ref":"#/$defs/vdi;components;data-type.json"},"minItems":1,"uniqueItems":true,"unevaluatedItems":false},"customPath":{"title":"PATH Extension","description":"Allows adding additional paths to the PATH environment variable passed to plugin scripts on execution in the typical colon (`:`) divided format.\nLeading or trailing colon characters are not required.","type":"string","examples":["/opt/something/bin:/opt/other/bin"]},"installRoot":{"title":"Dataset File Install Root","description":"The root mount path INSIDE THE CONTAINER which will contain the site build directory hierarchy into which dataset files will be installed.  The build directory itself MUST NOT be part of this path.","type":"string","format":"uri-reference","default":"/datasets","examples":["/datasets"]},"scripts":{"type":"object","properties":{"checkCompatibility":{"title":"Data Compatibility Test","$ref":"#/$defs/vdi;components;plugin.json;scriptConfig"},"dataCleaning":{"title":"Data Import/Cleanup","$ref":"#/$defs/vdi;components;plugin.json;scriptConfig"},"dataInstall":{"title":"Data Installation","$ref":"#/$defs/vdi;components;plugin.json;scriptConfig"},"metaUpdate":{"title":"Dataset Metadata Upsert","$ref":"#/$defs/vdi;components;plugin.json;scriptConfig"},"uninstall":{"title":"Dataset Uninstallation","$ref":"#/$defs/vdi;components;plugin.json;scriptConfig"}},"additionalProperties":false}},"required":["server","dataTypes"],"additionalProperties":false},"vdi;components;install-target.json":{"title":"Dataset Installation Target","type":"object","properties":{"enabled":{"title":"Enabled","description":"Whether the install target should be enabled for use in the VDI service.","type":"boolean","default":true},"targetId":{"$ref":"#/$defs/common.json;installTarget"},"targetName":{"title":"Install Target Display Name","description":"Optional display name for an install target, used when the install target ID differs from the name users should see.\n\nDefaults to the same value as `targetId`","type":"string","minLength":3,"maxLength":128},"datasetFileRoot":{"title":"Dataset File Root","description":"Alternative dataset file installation root directory to be used instead of `siteBuild` when constructing dataset directory paths.","type":"string","minLength":3},"dataTypes":{"title":"Supported Data Types","description":"Optional list of data types that the install target supports.\n\nDefaults to supporting all data types from any plugins enabled for the install target.","oneOf":[{"title":"Specific Data Types","type":"array","items":{"$ref":"#/$defs/vdi;components;data-type.json;baseDataType","unevaluatedProperties":false},"unevaluatedItems":false,"uniqueItems":true,"minItems":1},{"title":"Catch-All","type":"array","items":{"const":"*"},"minItems":1,"maxItems":1,"unevaluatedItems":false}],"default":["*"]},"controlDb":{"$comment":"type defined in 'allOf' block below","title":"Dataset Control Database/Schema"},"dataDb":{"$comment":"type defined in 'allOf' block below","title":"Dataset Data Database/Schema"},"metaValidation":{"description":"Additional JSON schema validation to apply to metadata for this install target.","$ref":"https://json-schema.org/draft/2020-12/schema"}},"allOf":[{"if":{"oneOf":[{"title":"Explicitly Enabled","description":"The `enabled` field is explicitly set to `true`.","properties":{"enabled":{"const":true}}},{"title":"Enabled by Default","description":"The `enabled` field is omitted, using the default value of `true`.","not":{"properties":{"enabled":{}}}}]},"then":{"properties":{"controlDb":{"$ref":"#/$defs/common.json;database"},"dataDb":{"$ref":"#/$defs/common.json;database"}},"required":["targetId","controlDb","dataDb"]}}],"unevaluatedProperties":false},"vdi;components;data-type.json;baseDataType":{"type":"object","properties":{"name":{"title":"Internal Name","type":"string","minLength":3},"version":{"oneOf":[{"type":"string","minLength":1},{"type":"number","minimum":0}]}},"required":["name","version"]},"vdi;components;data-type.json":{"title":"VDI Data-Type Config","type":"object","allOf":[{"$ref":"#/$defs/vdi;components;data-type.json;baseDataType"}],"properties":{"name":{"title":"Internal Name","type":"string","minLength":3},"version":{"oneOf":[{"type":"string","minLength":1},{"type":"number","minimum":0}]},"category":{"title":"Data Type Category/Display Name","type":"string","minLength":3},"typeChangesEnabled":{"description":"Whether datasets can be revised from this data type to another.","type":"boolean","default":false},"maxFileSize":{"title":"Maximum File Size","description":"Maximum permitted file size in bytes.\n\nIf this value exceeds the global max upload size configuration option, that value will be used instead.","type":"integer","minimum":0,"maximum":9223372036854775807},"allowedFileExtensions":{"title":"Permitted File Extensions","description":"File extensions that are allowed on raw uploaded files, or on the content files of archive uploads.\n\nThis list should not include the supported vdi archive extensions.","type":"array","items":{"type":"string","pattern":"\\..+"},"uniqueItems":true,"unevaluatedItems":false},"usesDataProperties":{"title":"Enable Data Properties Files","description":"Flag indicating whether the data type allows the use of additional data properties/metadata files.","type":"boolean","default":false},"projectIds":{"type":"array","items":{"$ref":"#/$defs/common.json;installTarget"},"unevaluatedItems":false}},"required":["category"],"unevaluatedProperties":false},"common.json;addressCsv":{"title":"Comma Separated Address List","type":"string","pattern":"^(?:(?=[\\da-zA-Z.-]{1,253}(?::|,|$))([\\da-zA-Z][\\da-zA-Z-]{0,62}(?:\\.[\\da-zA-Z][\\da-zA-Z-]{0,62})*)(?::([1-9]\\d{0,3}|[1-5]\\d{4}|6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))))?(?:,(?=.+)|$))+$","examples":["something:8080,foo.com","foo.com,apple-service:9001"]},"common.json;addressObject":{"title":"Address Config Object","type":"object","properties":{"host":{"$ref":"#/$defs/common.json;host"},"port":{"$ref":"#/$defs/common.json;port"}},"unevaluatedProperties":false,"examples":[{"host":"abc.def.com","port":1234},{"host":"abc.def.com"}],"required":["host"]},"common.json;addressString":{"title":"Host Address String","type":"string","pattern":"^(?=[\\da-zA-Z.-]{1,253}(?::|$))([\\da-zA-Z][\\da-zA-Z-]{0,62}(?:\\.[\\da-zA-Z][\\da-zA-Z-]{0,62})*)(?::([1-9]\\d{0,3}|[1-5]\\d{4}|6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))))?$","examples":["something:8080","foo.com:1234","portless.host.string"]},"common.json;database":{"title":"Database Connection Config","type":"object","allOf":[{"title":"Basic Options","properties":{"username":{"type":"string","minLength":3},"password":{"type":"string","minLength":8},"poolSize":{"type":"integer","minimum":5,"maximum":32,"default":5},"schema":{"description":"Target database schema name.  If not provided, the username value is used.","type":"string","minLength":3},"idleTimeout":{"title":"Idle Connection Timeout","description":"Maximum time an idle connection is allowed to live before being removed from the pool.","$ref":"#/$defs/common.json;duration","default":"10m"}},"required":["username","password"]},{"title":"Connection Details","oneOf":[{"title":"LDAP Common Name","properties":{"lookupCn":{"type":"string","minLength":3}},"required":["lookupCn"]},{"title":"Direct Connection Config","properties":{"server":{"title":"Database Host Details","oneOf":[{"$ref":"#/$defs/common.json;addressString"},{"$ref":"#/$defs/common.json;addressObject"}]},"name":{"title":"Database/Userspace Name","type":"string"},"platform":{"enum":["oracle","postgres"],"default":null}},"required":["server","name","platform"]}]}],"unevaluatedProperties":false},"common.json;duration":{"title":"Duration String","type":"string","pattern":"^(?=.{2,})((?:\\d+d)? ?(?:(?<!\\S)\\d+h)? ?(?:(?<!\\S)\\d+m)? ?(?:(?<!\\S)\\d+(?:\\.\\d+s$|s))? ?(?:(?<!\\S)\\d+(?:\\.\\d+ms$|ms))? ?(?:(?<!\\S)\\d+(?:\\.\\d+us$|us))? ?(?:(?<!\\S)\\d+ns)?)$","examples":["1d 12h 32m 30.340s","12s","1h 22us 5ns"]},"common.json;host":{"title":"Hostname String","type":"string","pattern":"^(?=[\\da-zA-Z.-]{1,253}$)([\\da-zA-Z][\\da-zA-Z-]{0,62}(?:\\.[\\da-zA-Z][\\da-zA-Z-]{0,62})*)$","minLength":1,"maxLength":253},"common.json;installTarget":{"title":"Dataset Installation Target","enum":["AmoebaDB","ClinEpiDB","CryptoDB","DataExplorer","FungiDB","GiardiaDB","HostDB","MicrobiomeDB","MicrosporidiaDB","OrthoMCL","PiroplasmaDB","PlasmoDB","ToxoDB","TrichDB","TriTrypDB","VectorBase","UniDB"]},"common.json;ldap":{"title":"LDAP Connection Configuration","type":"object","properties":{"servers":{"title":"LDAP Server List","description":"List of servers that container core will use to lookup database details.  Servers will be tried in the order they are defined.","oneOf":[{"title":"Host Strings","type":"array","items":{"$ref":"#/$defs/common.json;addressString"},"unevaluatedItems":false},{"title":"Host Details","type":"array","items":{"$ref":"#/$defs/common.json;addressObject"},"unevaluatedItems":false},{"$ref":"#/$defs/common.json;addressCsv"}]},"baseDn":{"type":"string"}},"required":["servers","baseDn"],"unevaluatedProperties":false},"common.json;port":{"title":"Connection Port","type":"integer","minimum":1,"maximum":65535},"common.json":{},"vdi;plugin-service.json":{"title":"VDI Plugin Configuration Schema","type":"object","properties":{"ldap":{"$ref":"#/$defs/common.json;ldap"},"plugins":{"$ref":"#/$defs/vdi;components;plugin-map.json"},"siteBuild":{"title":"Site Build Directory Name","description":"Name of the parent directory containing the per-project dataset files subdirectories.\n\nThis directory name will be used to form paths such as `{siteBuild}/{installTarget}/{datasetId}`.","type":"string","examples":["build-65"]},"installTargets":{"title":"Dataset Installation Targets","type":"array","items":{"$ref":"#/$defs/vdi;components;install-target.json"},"minItems":1,"unevaluatedItems":false,"uniqueItems":true}},"required":["plugins","siteBuild","installTargets"]}}}