Skip to content

Commit

Permalink
local-binder-local-hub: use jupyterhub-singleuser if AUTHENTICATOR set
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Jul 13, 2024
1 parent f25ee22 commit b145155
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion testing/local-binder-local-hub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ class LocalContainerSpawner(BinderSpawnerMixin, DockerSpawner):
c.JupyterHub.spawner_class = LocalContainerSpawner
c.DockerSpawner.remove = True
c.DockerSpawner.allowed_images = "*"
c.LocalContainerSpawner.cmd = "jupyter-notebook"

c.Application.log_level = "DEBUG"
c.Spawner.debug = True
c.JupyterHub.authenticator_class = os.getenv("AUTHENTICATOR", "null")

auth_enabled = c.JupyterHub.authenticator_class != "null"
if auth_enabled:
c.LocalContainerSpawner.auth_enabled = True
c.LocalContainerSpawner.cmd = "jupyterhub-singleuser"
c.JupyterHub.load_roles = [
{
"name": "user",
Expand All @@ -44,6 +45,8 @@ class LocalContainerSpawner(BinderSpawnerMixin, DockerSpawner):
],
}
]
else:
c.LocalContainerSpawner.cmd = "jupyter-notebook"

c.JupyterHub.hub_ip = "0.0.0.0"
c.JupyterHub.hub_connect_ip = hostip
Expand Down

0 comments on commit b145155

Please sign in to comment.