jupyter-labjupyterhub

Show hidden files in Jupyter Hub


I have just deployed a Jupyter Hub in Ubuntu 22.04 using The Littlest Jupyter Hub.

I want to show hidden files in File Explorer (and edit them later). Typical sample: .envfile

I have set in Settings/Settings Editor the option "Show Hidden Files" in "File explorer".

But now I have to set ContentsManager.allow_hidden to true, and I'm not able to set (or is not working for me.

I have tried:

sudo tljh-config set ContentsManager.allow_hidden True
sudo tljh-config reload

sudo tljh-config show
sudo systemctl restart jupyterhub
users:
  admin:
  - myuser@mydomain.com
https:
  enabled: true
  letsencrypt:
    email: myuser@mydomain.com
    domains:
    - jupyter-hub.mydomain.com
ContentsManager:
  allow_hidden: true

and also this

sudo nano /opt/tljh/config/jupyterhub_config.d/allow_hidden.py

with this content

# JMA: Allow access to hidden files
c.ContentsManager.allow_hidden = True

But it's not working (it's not showing the hidden file)


Solution

  • I got this finally working.

    My main error is not understanding that in JupyterHub every different user runs different server. So, we have to find how to configure the user server, not the hub itself.

    So, try to edit files in /opt/tljh/config/jupyterhub_config.d\ folder or using sudo tljh-config set IS NOT CORRECT.

    So, what I did was

    In my case

    
    config:
        /home/myuser/.jupyter
        /home/myuser/.local/etc/jupyter
        /opt/tljh/user/etc/jupyter
        /usr/local/etc/jupyter
        /etc/jupyter
    

    So, I prefer add in /etc/jupyter and add a file jupyter_notebook_config.py with the content c.ContentsManager.allow_hidden = True

    And then, in JupyterHub selected the menu File-> Hub Control Panel -> Restart myServer