mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Initial config setup
This commit is contained in:
1
tljh/config-schema.json
Normal file
1
tljh/config-schema.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
file:///home/bradfojb/Desktop/Personal-Repos/the-littlest-jupyterhub/schema.json
|
||||||
@@ -154,6 +154,13 @@ def remove_item_from_config(config, property_path, value):
|
|||||||
return config_copy
|
return config_copy
|
||||||
|
|
||||||
|
|
||||||
|
def validate_config(config):
|
||||||
|
import json
|
||||||
|
import jsonschema
|
||||||
|
config_schema = json.load("config-schema.json")
|
||||||
|
jsonschema.validate(instance=config, schema=config_schema)
|
||||||
|
|
||||||
|
|
||||||
def show_config(config_path):
|
def show_config(config_path):
|
||||||
"""
|
"""
|
||||||
Pretty print config from given config_path
|
Pretty print config from given config_path
|
||||||
@@ -180,6 +187,7 @@ def set_config_value(config_path, key_path, value):
|
|||||||
config = {}
|
config = {}
|
||||||
|
|
||||||
config = set_item_in_config(config, key_path, value)
|
config = set_item_in_config(config, key_path, value)
|
||||||
|
validate_config(config)
|
||||||
|
|
||||||
with open(config_path, "w") as f:
|
with open(config_path, "w") as f:
|
||||||
yaml.dump(config, f)
|
yaml.dump(config, f)
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ jupyterhub-tmpauthenticator>=1.0.0,<2
|
|||||||
oauthenticator[azuread]>=16.0.4,<17
|
oauthenticator[azuread]>=16.0.4,<17
|
||||||
jupyterhub-idle-culler>=1.2.1,<2
|
jupyterhub-idle-culler>=1.2.1,<2
|
||||||
|
|
||||||
|
jsonschema
|
||||||
|
|
||||||
# pycurl is installed to improve reliability and performance for when JupyterHub
|
# pycurl is installed to improve reliability and performance for when JupyterHub
|
||||||
# makes web requests. JupyterHub will use tornado's CurlAsyncHTTPClient when
|
# makes web requests. JupyterHub will use tornado's CurlAsyncHTTPClient when
|
||||||
# making requests over tornado's SimpleHTTPClient automatically if pycurl is
|
# making requests over tornado's SimpleHTTPClient automatically if pycurl is
|
||||||
|
|||||||
Reference in New Issue
Block a user