Skip to content

TLJH plugin which automatically populates the user directories with a repository

License

Notifications You must be signed in to change notification settings

LTluttmann/tljh-repo2user-dir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tljh-repo2user-dir

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.

Install

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

Adding new Users

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"

Example

An example usage of this plugin can be found here

License

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.

About

TLJH plugin which automatically populates the user directories with a repository

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages