Skip to content

Commit

Permalink
Allow JUPYTER_LAB_PASSWORD to be set, but still default to not using …
Browse files Browse the repository at this point in the history
…a password
  • Loading branch information
ashleykleynhans committed Mar 14, 2024
1 parent 9dc798b commit fbe3745
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ export_env_vars() {
}

start_jupyter() {
# Default to not using a password
JUPYTER_PASSWORD=""

# Allow a password to be set by providing the JUPYTER_PASSWORD environment variable
if [[ ${JUPYTER_LAB_PASSWORD} ]]; then
JUPYTER_PASSWORD=${JUPYTER_LAB_PASSWORD}
fi

echo "Starting Jupyter Lab..."
mkdir -p /workspace/logs
cd / && \
Expand All @@ -73,7 +81,7 @@ start_jupyter() {
--FileContentsManager.delete_to_trash=False \
--ContentsManager.allow_hidden=True \
--ServerApp.terminado_settings='{"shell_command":["/bin/bash"]}' \
--ServerApp.token="" \
--ServerApp.token=${JUPYTER_PASSWORD} \
--ServerApp.allow_origin=* \
--ServerApp.preferred_dir=/workspace &> /workspace/logs/jupyter.log &
echo "Jupyter Lab started"
Expand Down

0 comments on commit fbe3745

Please sign in to comment.