mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Load user lists & auth config from a YAML file
- Load config only once at startup. A lot of jupyterhub config (like user lists) take effect only at startup, so live reload is not super useful. It will make the software more complex, so let's not do it. - Add pyyaml as a dependency of tljh. - Remove escapism dependency since it is not actually used
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
"""
|
||||
JupyterHub config for the littlest jupyterhub.
|
||||
"""
|
||||
from escapism import escape
|
||||
import os
|
||||
from systemdspawner import SystemdSpawner
|
||||
from tljh import user
|
||||
from tljh import user, configurer
|
||||
|
||||
INSTALL_PREFIX = os.environ.get('TLJH_INSTALL_PREFIX')
|
||||
USER_ENV_PREFIX = os.path.join(INSTALL_PREFIX, 'user')
|
||||
@@ -23,9 +22,9 @@ class CustomSpawner(SystemdSpawner):
|
||||
user.remove_user_group(self.user.name, 'jupyterhub-admins')
|
||||
return super().start()
|
||||
|
||||
|
||||
c.JupyterHub.spawner_class = CustomSpawner
|
||||
c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator'
|
||||
|
||||
c.SystemdSpawner.extra_paths = [os.path.join(USER_ENV_PREFIX, 'bin')]
|
||||
c.SystemdSpawner.use_sudo = True
|
||||
|
||||
configurer.apply_yaml_config('/etc/jupyterhub/jupyterhub.yaml', c)
|
||||
|
||||
Reference in New Issue
Block a user