JupyterLab 4 configuration override

I’m building an image from the Python 3.11 minimal notebook (quay.io/jupyter/minimal-notebook:python-3.11). The Jupyter versions on that image are the following:

jupyter-lsp               2.2.4              pyhd8ed1ab_0    conda-forge
jupyter_client            8.6.1              pyhd8ed1ab_0    conda-forge
jupyter_core              5.7.2           py311h38be061_0    conda-forge
jupyter_events            0.9.1              pyhd8ed1ab_0    conda-forge
jupyter_server            2.13.0             pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.5.3              pyhd8ed1ab_0    conda-forge
jupyter_telemetry         0.1.0              pyhd8ed1ab_1    conda-forge
jupyterhub                4.0.2              pyh31011fe_0    conda-forge
jupyterhub-base           4.0.2              pyh31011fe_0    conda-forge
jupyterlab                4.1.5              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.3.0              pyhd8ed1ab_1    conda-forge
jupyterlab_server         2.25.4             pyhd8ed1ab_0    conda-forge

I would like to configure the image so that the “View” > “Show Hidden Files” menu option is on by default. Same for the “Settings” > “Auto Close Brackets” option.

I’ve been looking through the documentation, mainly here. Here are the steps I followed:

First, I located my JupyterLab Application Directory:

$ jupyter lab path
Application directory:   /opt/conda/share/jupyter/lab

Next, I created an overrides.json file with the following text:

{
    "@jupyterlab/filebrowser-extension:browser": {
        "showHiddenFiles": true
    }
}

Then I wrote my Dockerfile:

FROM quay.io/jupyter/minimal-notebook:python-3.11

USER root

COPY ./overrides.json /opt/conda/share/jupyter/lab/settings/overrides.json

When I built the image and started it up, I still couldn’t see hidden files in the file browser. What’s more, the “View” > “Show Hidden Files” menu option had dissapeared!

Could someone help me with a little guidance?

Also, I’d love to know if there’s a place where I can explore all the extensions and their settings. Right now, I’m digging through the advanced settings in the JupyterLab GUI and combing through the code. Is there an easier way?

Thanks all!

to rule out a few use cases,
In jupyter lab instance, can you try top menu → settings → settings editor → update the relevant settings here and check if it works?

For finding the settings,
I use Common Extension Points — JupyterLab 4.2.0a1 documentation, to find the correct plugin, then open it in settings editor => json settings editor.

Hope anyone can pitch in for a better solution

1 Like

Figured it all out!

First, to show hidden files, there are two configuration files you need to add to thge docker image.

1a. /home/jovyan/.jupyter/jupyter_server_config.py

c = get_config()  #noqa

c.ContentsManager.allow_hidden = True

1b. /opt/conda/share/jupyter/lab/settings/overrides.json

{
    "@jupyterlab/console-extension:tracker": {
        "autoClosingBrackets": true
    },
    "@jupyterlab/filebrowser-extension:browser": {
        "showHiddenFiles": true
    },
    "@jupyterlab/fileeditor-extension:plugin": {
        "editorConfig": {
            "autoClosingBrackets": true
        }
    },
    "@jupyterlab/notebook-extension:tracker": {
        "codeCellConfig": {
            "autoClosingBrackets": true,
            "lineNumbers": true
        },
        "markdownCellConfig": {
            "autoClosingBrackets": true,
            "matchBrackets": true
        },
        "rawCellConfig": {
            "autoClosingBrackets": true,
            "matchBrackets": true
        }
    }
}

This file shows hidden files ("showHiddenFiles": true), and it also takes care of my second problem, turning on auto-closing brackets by default.

3 Likes