Filter environment variables by a whitelist to hide internal values from a notebook. It's useful when you provide notebooks on JupyterHub w/ KubeSpawner because it puts many internal values in environment variables such as the Kubernetes API endpoint. This extension can be used in Enterprise Gateway as well.
$ pip install jupyter-env-whitelist
You can enabled the server extension by the following command.
$ jupyter serverextension enable --py jupyter-env-whitelist
Alternatively, you can enable it by adding the following setting in your jupyter_notebook_config.py
.
c.NotebookApp.nbserver_extensions = {
'jupyter_env_whitelist': True,
}
You can enable it by adding the following setting in your ipython_kernel_config.py
.
c.InteractiveShellApp.extensions = [
'jupyter_env_whitelist',
]