From c8d41130e69987d27fa65d274368c93b736a5a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=B6nckemeyer?= Date: Mon, 6 Jul 2020 19:09:58 +0200 Subject: [PATCH] Added support for JUPYTER_TOKEN_FILE --- notebook/notebookapp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index 57833caec..f72b222af 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -945,6 +945,10 @@ class NotebookApp(JupyterApp): if os.getenv('JUPYTER_TOKEN'): self._token_generated = False return os.getenv('JUPYTER_TOKEN') + if os.getenv('JUPYTER_TOKEN_FILE'): + self._token_generated = False + with io.open(os.getenv('JUPYTER_TOKEN_FILE'), "r") as token_file + return token_file.read() if self.password: # no token if password is enabled self._token_generated = False