start-singleuser.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. # Copyright (c) Jupyter Development Team.
  3. # Distributed under the terms of the Modified BSD License.
  4. set -e
  5. # set default ip to 0.0.0.0
  6. if [[ "$NOTEBOOK_ARGS $@" != *"--ip="* ]]; then
  7. NOTEBOOK_ARGS="--ip=0.0.0.0 $NOTEBOOK_ARGS"
  8. fi
  9. # handle some deprecated environment variables
  10. # from DockerSpawner < 0.8.
  11. # These won't be passed from DockerSpawner 0.9,
  12. # so avoid specifying --arg=empty-string
  13. # if [ ! -z "$NOTEBOOK_DIR" ]; then
  14. # NOTEBOOK_ARGS="--notebook-dir='$NOTEBOOK_DIR' $NOTEBOOK_ARGS"
  15. # fi
  16. if [ ! -z "$JPY_PORT" ]; then
  17. NOTEBOOK_ARGS="--port=$JPY_PORT $NOTEBOOK_ARGS"
  18. fi
  19. if [ ! -z "$JPY_USER" ]; then
  20. NOTEBOOK_ARGS="--user=$JPY_USER $NOTEBOOK_ARGS"
  21. fi
  22. if [ ! -z "$JPY_COOKIE_NAME" ]; then
  23. NOTEBOOK_ARGS="--cookie-name=$JPY_COOKIE_NAME $NOTEBOOK_ARGS"
  24. fi
  25. if [ ! -z "$JPY_BASE_URL" ]; then
  26. NOTEBOOK_ARGS="--base-url=$JPY_BASE_URL $NOTEBOOK_ARGS"
  27. fi
  28. if [ ! -z "$JPY_HUB_PREFIX" ]; then
  29. NOTEBOOK_ARGS="--hub-prefix=$JPY_HUB_PREFIX $NOTEBOOK_ARGS"
  30. fi
  31. if [ ! -z "$JPY_HUB_API_URL" ]; then
  32. NOTEBOOK_ARGS="--hub-api-url=$JPY_HUB_API_URL $NOTEBOOK_ARGS"
  33. fi
  34. NOTEBOOK_ARGS=" --allow-root --notebook-dir='/notebooks' $NOTEBOOK_ARGS"
  35. . /usr/local/bin/start.sh jupyterhub-singleuser $NOTEBOOK_ARGS $@