diff --git a/CHANGES.md b/CHANGES.md index cdde4e35..f244af8c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,7 +15,19 @@ [Unreleased](https://github.com/bird-house/birdhouse-deploy/tree/master) (latest) ------------------------------------------------------------------------------------------------------------------ -[//]: # (list changes here, using '-' for each new entry, remove this when items are added) +## Fixes + +- Jupyterhub: allow users created before Cowbird was enabled to spawn jupyterlab + + Users created before Cowbird was enabled will not have a "workspace directory" created. A workspace directory + is a symlink to the directory that contains their Jupyterhub data. + + When Cowbird is enabled, Jupyterhub checks if the workspace directory exists and raises an error if it doesn't. + + This change allows Jupyterhub to create the symlink if it doesn't exist instead of raising an error. + This means that users without a "workspace directory" will be able to continue using Jupyterhub as they did + before without the need for manual intervention by a system administrator who would otherwise need to manually + create the symlink for them. [2.6.1](https://github.com/bird-house/birdhouse-deploy/tree/2.6.1) (2024-11-22) ------------------------------------------------------------------------------------------------------------------ diff --git a/birdhouse/components/jupyterhub/jupyterhub_config.py.template b/birdhouse/components/jupyterhub/jupyterhub_config.py.template index 0fce675b..ff06c988 100644 --- a/birdhouse/components/jupyterhub/jupyterhub_config.py.template +++ b/birdhouse/components/jupyterhub/jupyterhub_config.py.template @@ -159,8 +159,7 @@ def create_dir_hook(spawner): # to have working volume mounts with the DockerSpawner. workspace_user_dir = join(os.environ['WORKSPACE_DIR'], username) if not os.path.exists(workspace_user_dir): - raise FileNotFoundError(f"The user {username}'s workspace doesn't exist in the workspace directory, " - "but should have been created by Cowbird already.") + os.symlink(jupyterhub_user_dir, workspace_user_dir, target_is_directory=True) subprocess.call(["chown", f"{os.environ['USER_WORKSPACE_UID']}:{os.environ['USER_WORKSPACE_GID']}", workspace_user_dir])