mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Move jupyterhub_config.py inside the package
This is where it's referred to from the systemd package
This commit is contained in:
26
tljh/jupyterhub_config.py
Normal file
26
tljh/jupyterhub_config.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
JupyterHub config for the littlest jupyterhub.
|
||||
|
||||
This is run on startup & restarts. This file has the following
|
||||
responsibilities:
|
||||
|
||||
1. Set up & maintain user conda environment
|
||||
2. Configure JupyterHub from YAML file
|
||||
|
||||
This code will run as an unprivileged user, but with unlimited
|
||||
sudo access. Code here can block, since it all runs before JupyterHub
|
||||
starts.
|
||||
"""
|
||||
from tljh import conda
|
||||
import os
|
||||
|
||||
INSTALL_PREFIX = os.environ.get('TLJH_INSTALL_PREFIX', '/opt/tljh')
|
||||
USER_ENV_PREFIX = os.path.join(INSTALL_PREFIX, 'user')
|
||||
|
||||
c.JupyterHub.spawner_class = 'systemdspawner.SystemdSpawner'
|
||||
c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator'
|
||||
|
||||
c.SystemdSpawner.extra_paths = [os.path.join(USER_ENV_PREFIX, 'bin')]
|
||||
c.SystemdSpawner.use_sudo = True
|
||||
|
||||
c.SystemdSpawner.dynamic_users = True
|
||||
Reference in New Issue
Block a user