the-littlest-jupyterhub icon indicating copy to clipboard operation
the-littlest-jupyterhub copied to clipboard

Injecting custom.js for all users

Open 6palace opened this issue 4 years ago • 4 comments

Proposed change

Right now, custom.js is the only way to customize features such as "shutdown kernel on window close" or "open notebooks in same window", or general UI customization of the directory page. However, custom.js is only injected in user .jupyter paths. Is there a way to pull custom.js from, for example, /opt/tljh/user/etc/jupyter/custom or /opt/tljh/config/custom?

Who would use this feature?

Jupyterhub admins

6palace avatar Feb 11 '21 07:02 6palace

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Feb 11 '21 07:02 welcome[bot]

In general this isn't possible in JupyterHub since there are a wide variety of spawners. You've mentioned you're using TLJH though, and it might be possible there. I'll transfer the issue to that repo so someone who knows more about it can make a decision.

manics avatar Feb 11 '21 22:02 manics

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Feb 11 '21 22:02 welcome[bot]

@6palace and @manics, I don't know anything about custom.js and don't understand what software interacts with a custom.js file.

I think jupyter --paths could be a relevant command to try on the user server though. This is an example of the output I got from running it on my local computer (not having TLJH installed etc there).

$ jupyter --paths

config:
    /home/erik/.jupyter
    /home/erik/miniforge3/etc/jupyter
    /usr/local/etc/jupyter
    /etc/jupyter
data:
    /home/erik/.local/share/jupyter
    /home/erik/miniforge3/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter
runtime:
    /home/erik/.local/share/jupyter/runtime

consideRatio avatar Oct 26 '21 12:10 consideRatio