mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Update schema based on values in configurer.py
This commit is contained in:
@@ -156,7 +156,8 @@ def remove_item_from_config(config, property_path, value):
|
||||
|
||||
def validate_config(config):
|
||||
import jsonschema
|
||||
from config_schema import config_schema
|
||||
|
||||
from .config_schema import config_schema
|
||||
|
||||
try:
|
||||
jsonschema.validate(instance=config, schema=config_schema)
|
||||
|
||||
@@ -2,6 +2,9 @@ config_schema = {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Littlest JupyterHub YAML config file",
|
||||
"definitions": {
|
||||
"BaseURL": {
|
||||
"type": "string",
|
||||
},
|
||||
"Users": {
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
@@ -12,6 +15,26 @@ config_schema = {
|
||||
"admin": {"type": "array", "items": {"type": "string"}},
|
||||
},
|
||||
},
|
||||
"Services": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cull": {
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
"properties": {
|
||||
"enabled": {"type": "boolean"},
|
||||
"timeout": {"type": "integer"},
|
||||
"every": {"type": "integer"},
|
||||
"concurrency": {"type": "integer"},
|
||||
"users": {
|
||||
"type": "boolean",
|
||||
},
|
||||
"max_age": {"type": "integer"},
|
||||
"remove_named_servers": {"type": "boolean"},
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
"HTTP": {
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
@@ -65,13 +88,30 @@ config_schema = {
|
||||
}
|
||||
},
|
||||
},
|
||||
"TraefikAPI": {
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
"properties": {
|
||||
"ip": {"type": "string", "format": "ipv4"},
|
||||
"port": {"type": "integer"},
|
||||
"username": {
|
||||
"type": "string",
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"properties": {
|
||||
"additionalProperties": False,
|
||||
"base_url": {"$ref": "#/definitions/BaseURL"},
|
||||
"user_environment": {"$ref": "#/definitions/UserEnvironment"},
|
||||
"users": {"$ref": "#/definitions/Users"},
|
||||
"limits": {"$ref": "#/definitions/Limits"},
|
||||
"https": {"$ref": "#/definitions/HTTPS"},
|
||||
"http": {"$ref": "#/definitions/HTTP"},
|
||||
"traefik_api": {"$ref": "#/definitions/TraefikAPI"},
|
||||
"services": {"$ref": "#/definitions/Services"},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user