Default workspace(s)

I have managed to figure out a solution based on a previous question about launching user shell scripts on environment startup.

I created a custom script to call jupyterhub-singleuser that also imports the necessary workspace JSON files:

/usr/local/bin/custom_startup.sh

#!/bin/bash

jupyter lab workspaces import {workspace.json file}
exec /opt/tljh/user/bin/jupyterhub-singleuser "$@"

And added a c.Spawner.cmd configuration option so that it uses this script to launch the server by adding the line…

c.Spawner.cmd = "custom_startup.sh"

…to /opt/tljh/hub/lib/python3.6/site-packages/tljh/jupyterhub_config.py.

The workspace file(s) are then imported before the server is launched and are valid targets for a default_url config setting that tries to load them as the default landing page.

2 Likes