Merge pull request #2166 from minrk/testing-config

add sample configuration that loads dummyauthenticator and simplespawner
This commit is contained in:
Yuvi Panda
2018-09-21 10:58:44 -07:00
committed by GitHub
2 changed files with 27 additions and 0 deletions

View File

@@ -114,6 +114,12 @@ To simplify testing of JupyterHub,
it's helpful to use DummyAuthenticator instead of the default JupyterHub authenticator it's helpful to use DummyAuthenticator instead of the default JupyterHub authenticator
and SimpleSpawner instead of the default spawner. and SimpleSpawner instead of the default spawner.
There is a sample configuration file that does this in `testing.jupyterhub_config.py`.
To launch jupyterhub with this configuration:
pip install jupyterhub-simplespawner jupyterhub-dummyauthenticator
jupyterhub -f testing/jupyterhub_config.py
The default JupyterHub [authenticator](https://jupyterhub.readthedocs.io/en/stable/reference/authenticators.html#the-default-pam-authenticator) The default JupyterHub [authenticator](https://jupyterhub.readthedocs.io/en/stable/reference/authenticators.html#the-default-pam-authenticator)
& [spawner](https://jupyterhub.readthedocs.io/en/stable/api/spawner.html#localprocessspawner) & [spawner](https://jupyterhub.readthedocs.io/en/stable/api/spawner.html#localprocessspawner)
require your system to have user accounts for each user you want to log in to require your system to have user accounts for each user you want to log in to

View File

@@ -0,0 +1,21 @@
"""sample jupyterhub config file for testing
configures jupyterhub with dummyauthenticator and simplespawner
to enable testing without administrative privileges.
"""
c = get_config() # noqa
try:
from dummyauthenticator import DummyAuthenticator
except ImportError:
print("dummyauthenticator not available. Try: `pip install jupyterhub-dummyauthenticator`")
else:
c.JupyterHub.authenticator_class = DummyAuthenticator
try:
from simplespawner import SimpleLocalProcessSpawner
except ImportError:
print("simplespawner not available. Try: `pip install jupyterhub-simplespawner`")
else:
c.JupyterHub.spawner_class = SimpleLocalProcessSpawner