For reasons not relevant here, I’m running jupyterlab in a docker instance, where /home/joyvan becomes a mount-point for the users home directory.
The base image is jupyter/minimal-notebook:2023-10-20 - which is
- Ubuntu 22:04,
- python 3.11.6,
- hub 4.0.2,
- lab 4.0.7,
- notebook 7.0.6
Paths:
$ jupyter --paths
config:
/home/jovyan/.jupyter
/home/jovyan/.local/etc/jupyter
/opt/conda/etc/jupyter
/usr/local/etc/jupyter
/etc/jupyter
data:
/home/jovyan/.local/share/jupyter
/opt/conda/share/jupyter
/usr/local/share/jupyter
/usr/share/jupyter
runtime:
/home/jovyan/.local/share/jupyter/runtime
I wish to pre-configure various settings (resource-usage; the “check for updates” & “news” popups; LSPs, code-folding, etc) including removing the “log out”/“shut down” items from the “file menu”
I know that I can configure it using “Advanced settings” - however that stores the config in the /home/jovyan
tree… which means it’s not actually pre-configured [and I can’t pre-configure: external persistent store]
For some, putting things in /etc/jupyter/lab/user-settings/
is working, but not everything - and the menu changes is one I’m just not able to change.
I know that /home/jovyan/.jupyter/lab/user-settings/@jupyterlab/mainmenu-extension/plugin.jupyterlab-settings
:
{
"menus": [
{
"disabled": false,
"id": "jp-mainmenu-file",
"items": [
{
"command": "filemenu:logout",
"disabled": true
},
{
"command": "filemenu:shutdown",
"disabled": true
}
]
}
]
}
works.
I’ve tried /etc/jupyter/lab/user-settings/@jupyterlab/mainmenu-extension/plugin.jupyterlab-settings
:
{
"menus": [
{
"id": "jp-mainmenu-file",
"items": [
{
"command": "filemenu:logout",
"disabled": true
},
{
"command": "filemenu:shutdown",
"disabled": true
}
]
}
]
}
I’ve tried /etc/jupyter/lab/settings/overrides.json
:
[
{
"@jupyterlab/apputils-extension:notification": {
"fetchNews": "false"
}
},
{
"@jupyterlab/fileeditor-extension:editorConfig": {
"autoClosingBrackets": true,
"codeFolding": true
}
},
{
"@jupyterlab/mainmenu-extension:menus": {
"id": "jp-mainmenu-file",
"items": [
{
"command": "filemenu:logout",
"disabled": true
},
{
"command": "filemenu:shutdown",
"disabled": true
}
]
}
}
]
I’ve even tried /etc/jupyter/labconfig/page_config.json
:
{
"disabledExtensions": {
"@jupyterlab/apputils-extension:announcements": true
},
"@jupyterlab/apputils-extension:notification": {
"fetchNews": "false"
},
"@jupyterlab/fileeditor-extension:editorConfig": {
"autoClosingBrackets": true,
"codeFolding": true
},
"@jupyterlab/mainmenu-extension:menus": [
{
"id": "jp-mainmenu-file",
"items": [
{
"command": "filemenu:logout",
"disabled": true
},
{
"command": "filemenu:shutdown",
"disabled": true
}
]
}
]
}
… and none of them hide the two menu items.
There are 2 questions:
- Specifically, how/where do I configure the mainmenu to disable those 2 entries in 'Lab 4
- Is there a consistent way to configure extensions/plugins (in 'lab 4)