mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Add hook for custom jupyterhub_config.py content
This lets extensions directly control how JupyterHub is configured
This commit is contained in:
@@ -6,7 +6,7 @@ from glob import glob
|
||||
import os
|
||||
|
||||
from systemdspawner import SystemdSpawner
|
||||
from tljh import configurer, user
|
||||
from tljh import configurer, user, hooks
|
||||
from tljh.config import INSTALL_PREFIX, USER_ENV_PREFIX, CONFIG_DIR
|
||||
from tljh.normalize import generate_system_username
|
||||
from tljh.yaml import yaml
|
||||
@@ -57,6 +57,9 @@ c.SystemdSpawner.unit_name_template = 'jupyter-{USERNAME}'
|
||||
tljh_config = configurer.load_config()
|
||||
configurer.apply_config(tljh_config, c)
|
||||
|
||||
# Let TLJH hooks modify `c` if they want
|
||||
hooks.tljh_custom_jupyterhub_config(c)
|
||||
|
||||
# Load arbitrary .py config files if they exist.
|
||||
# This is our escape hatch
|
||||
extra_configs = sorted(glob(os.path.join(CONFIG_DIR, 'jupyterhub_config.d', '*.py')))
|
||||
|
||||
Reference in New Issue
Block a user