forked from jupyter/docker-notebook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotebook.sh
More file actions
18 lines (14 loc) · 668 Bytes
/
notebook.sh
File metadata and controls
18 lines (14 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
# Strict mode
set -euo pipefail
IFS=$'\n\t'
# Create a self signed certificate for the user if one doesn't exist
if [ ! -f $PEM_FILE ]; then
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $PEM_FILE -out $PEM_FILE \
-subj "/C=XX/ST=XX/L=XX/O=dockergenerated/CN=dockergenerated"
fi
# Create the hash to pass to the IPython notebook, but don't export it so it doesn't appear
# as an environment variable within IPython kernels themselves
HASH=$(python -c "from IPython.lib import passwd; print(passwd('${PASSWORD}'))")
unset PASSWORD
ipython notebook --no-browser --port 8888 --ip=* --certfile=$PEM_FILE --NotebookApp.password="$HASH"