Skip to content

Commit

Permalink
JHP-76 and JHP-111: Fix issue with websocket http 403 error in notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
andylassiter committed Aug 15, 2024
1 parent c9f172d commit 0270b02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dockerfiles/jupyterhub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
c.SwarmSpawner.environment.update(environment)
c.SwarmSpawner.extra_container_spec = {'user': '0'}

# Issue in JupyterHub 4.0 where cookie auth is not persisted from a token in url authenticated request
c.SwarmSpawner.environment.update({'JUPYTERHUB_SINGLEUSER_EXTENSION': '0'})

# Spawner config
c.JupyterHub.spawner_class = 'dockerspawner.SwarmSpawner'
c.Spawner.start_timeout = int(os.environ['JH_START_TIMEOUT'])
Expand Down
5 changes: 5 additions & 0 deletions xnat-jupyterhub-chart/files/pre_spawn_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ def pre_spawn_hook(spawner):
'NB_USER': f'{spawner.user.name}'
})

# Issue in JupyterHub 4.0 where cookie auth is not persisted from a token in url authenticated request
spawner.environment.update({
'JUPYTERHUB_SINGLEUSER_EXTENSION': '0'
})

if 'mounts' in container_spec:
logger.debug(
f'Adding mounts to user {spawner.user.name} server {spawner.name} from XNAT. Mounts: {container_spec["mounts"]}')
Expand Down

0 comments on commit 0270b02

Please sign in to comment.