2024-03-27 12:08:28 -04:00
|
|
|
"""
|
|
|
|
|
The schema against which the TLJH config file can be validated.
|
|
|
|
|
|
|
|
|
|
Validation occurs when changing values with tljh-config.
|
|
|
|
|
"""
|
|
|
|
|
|
2024-02-03 12:48:31 -05:00
|
|
|
config_schema = {
|
|
|
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
|
|
|
"title": "Littlest JupyterHub YAML config file",
|
|
|
|
|
"definitions": {
|
2024-02-03 13:08:27 -05:00
|
|
|
"BaseURL": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
},
|
2024-02-03 12:48:31 -05:00
|
|
|
"Users": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"properties": {
|
|
|
|
|
"extra_user_groups": {"type": "object", "items": {"type": "string"}},
|
|
|
|
|
"allowed": {"type": "array", "items": {"type": "string"}},
|
|
|
|
|
"banned": {"type": "array", "items": {"type": "string"}},
|
|
|
|
|
"admin": {"type": "array", "items": {"type": "string"}},
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-02-03 13:08:27 -05:00
|
|
|
"Services": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"cull": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"properties": {
|
|
|
|
|
"enabled": {"type": "boolean"},
|
|
|
|
|
"timeout": {"type": "integer"},
|
|
|
|
|
"every": {"type": "integer"},
|
|
|
|
|
"concurrency": {"type": "integer"},
|
2024-02-03 13:39:17 -05:00
|
|
|
"users": {"type": "boolean"},
|
2024-02-03 13:08:27 -05:00
|
|
|
"max_age": {"type": "integer"},
|
|
|
|
|
"remove_named_servers": {"type": "boolean"},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-02-03 12:48:31 -05:00
|
|
|
"HTTP": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"properties": {
|
|
|
|
|
"address": {"type": "string", "format": "ipv4"},
|
|
|
|
|
"port": {"type": "integer"},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"HTTPS": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"properties": {
|
|
|
|
|
"enabled": {"type": "boolean"},
|
|
|
|
|
"address": {"type": "string", "format": "ipv4"},
|
|
|
|
|
"port": {"type": "integer"},
|
|
|
|
|
"tls": {"$ref": "#/definitions/TLS"},
|
|
|
|
|
"letsencrypt": {"$ref": "#/definitions/LetsEncrypt"},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"LetsEncrypt": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"properties": {
|
|
|
|
|
"email": {"type": "string", "format": "email"},
|
|
|
|
|
"domains": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {"type": "string", "format": "hostname"},
|
|
|
|
|
},
|
2024-02-03 13:39:17 -05:00
|
|
|
"staging": {"type": "boolean"},
|
2024-02-03 12:48:31 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"TLS": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"properties": {"key": {"type": "string"}, "cert": {"type": "string"}},
|
|
|
|
|
},
|
|
|
|
|
"Limits": {
|
|
|
|
|
"description": "User CPU and memory limits.",
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
2024-11-14 12:07:35 -05:00
|
|
|
"properties": {
|
|
|
|
|
"memory": {"type": "string"},
|
|
|
|
|
"cpu": {
|
|
|
|
|
"anyOf": [
|
|
|
|
|
{"type": "number", "minimum": 0},
|
|
|
|
|
{"type": "string", "enum": ["None"]},
|
|
|
|
|
]
|
2024-11-14 11:49:54 -05:00
|
|
|
},
|
2024-11-14 12:07:35 -05:00
|
|
|
},
|
2024-02-03 12:48:31 -05:00
|
|
|
},
|
|
|
|
|
"UserEnvironment": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"properties": {
|
|
|
|
|
"default_app": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
"enum": ["jupyterlab", "classic"],
|
|
|
|
|
"default": "jupyterlab",
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-02-03 13:08:27 -05:00
|
|
|
"TraefikAPI": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"properties": {
|
|
|
|
|
"ip": {"type": "string", "format": "ipv4"},
|
|
|
|
|
"port": {"type": "integer"},
|
2024-02-03 13:39:17 -05:00
|
|
|
"username": {"type": "string"},
|
|
|
|
|
"password": {"type": "string"},
|
2024-02-03 13:08:27 -05:00
|
|
|
},
|
|
|
|
|
},
|
2024-02-03 12:48:31 -05:00
|
|
|
},
|
|
|
|
|
"properties": {
|
|
|
|
|
"additionalProperties": False,
|
2024-02-03 13:08:27 -05:00
|
|
|
"base_url": {"$ref": "#/definitions/BaseURL"},
|
2024-02-03 12:48:31 -05:00
|
|
|
"user_environment": {"$ref": "#/definitions/UserEnvironment"},
|
|
|
|
|
"users": {"$ref": "#/definitions/Users"},
|
|
|
|
|
"limits": {"$ref": "#/definitions/Limits"},
|
|
|
|
|
"https": {"$ref": "#/definitions/HTTPS"},
|
|
|
|
|
"http": {"$ref": "#/definitions/HTTP"},
|
2024-02-03 13:08:27 -05:00
|
|
|
"traefik_api": {"$ref": "#/definitions/TraefikAPI"},
|
|
|
|
|
"services": {"$ref": "#/definitions/Services"},
|
2024-02-03 12:48:31 -05:00
|
|
|
},
|
|
|
|
|
}
|