A plugin for The Littlest JupyterHub (TLJH) through which one can easily populate user directories with the content of a github repository. This is accomplished with the tljh_new_user_create hook. One only needs to specify a link to a github repo by setting a REPO_URL environment variable.
To deploy a new TLJH instance with this plugin installed simply call
#!/bin/bash
curl -L https://tljh.jupyter.org/bootstrap.py \
| sudo python3 - \
--admin <USER> --plugin git+https://github.com/LTluttmann/tljh-repo2user-dir.git
and define the env variable REPO_URL with the repo of your choice. Setting up the environment variable can be a little cumbersome since it is needed in the root environment. One way is to override the jupyterhub
settings as specified here
In short, provide a custom /etc/systemd/system/jupyterhub.service.d/override.conf
file with following content
[Service]
Environment=REPO_URL="<YOUR REPO>"
Then make sure to reload the daemon and the jupyterhub
service:
sudo systemctl daemon-reload
sudo systemctl restart jupyterhub
To add a new user:
sudo tljh-config add-item users.allowed <NEW USER>
sudo tljh-config reload
When logging in with this new user, the repo should be available in the home directory of the user within a subfolder "repos"
An example usage of this plugin can be found here
We use a shared copyright model that enables all contributors to maintain the copyright on their contributions.
This software is licensed under the BSD-3-Clause license. See the LICENSE file for details.