Added support for JUPYTER_TOKEN_FILE

This commit is contained in:
Felix Mönckemeyer 2020-07-06 19:09:58 +02:00 committed by GitHub
parent 3941004e68
commit c8d41130e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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