Added support for JUPYTER_TOKEN_FILE#5587
Conversation
kevin-bates
left a comment
There was a problem hiding this comment.
These changes look good and address a valid use case - one we're seeing more of these days with containerization. Thank you!
|
Hi @nemesisflx - I'm wondering if we should use this opportunity to extend the help test to reference both |
|
@kevin-bates I am unsure what you mean by your request. Both |
|
I'm referring to the help text relative to the I think it would be helpful to note that |
|
@kevin-bates I updated the description. What do you think? |
kevin-bates
left a comment
There was a problem hiding this comment.
This looks good - thanks for adding the help text.
Motivation
Currently, we use
JUPYTER_TOKENas an environment variable to pass a token to the jupyter notebook with which we can authenticate us later. This is a good practice, for a local environment, but in a docker environment the best practice is to usedocker secrets. Docker secrets uses instead of a string directly in the env variable, a file location where the string is stored. This file is stored in memory and only accessible by the container that has the correct access right.Changes
Added an env variable
JUPYTER_TOKEN_FILE, if it is available it will read the token from the given location and return it. Priority hasJUPYTER_TOKEN.Further information
Docker-compose with docker secret, best practices: https://docs.docker.com/engine/swarm/secrets/#build-support-for-docker-secrets-into-your-images