diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b3383cc --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +venv/* +*.pyc +*.ipynb +.ipynb_checkpoints/* +.idea/ +.python-version diff --git a/notebook/jupyter_notebook_config.py b/notebook/jupyter_notebook_config.py index f5fe10a..f3bcd38 100644 --- a/notebook/jupyter_notebook_config.py +++ b/notebook/jupyter_notebook_config.py @@ -1,11 +1,5 @@ # Copyright (c) Jupyter Development Team. -from jupyter_core.paths import jupyter_data_dir -import subprocess import os -import errno -import stat - -PEM_FILE = os.path.join(jupyter_data_dir(), 'notebook.pem') c = get_config() c.NotebookApp.ip = '0.0.0.0' @@ -27,26 +21,6 @@ 'text/plain' ] -# Set a certificate if USE_HTTPS is set to any value -if 'USE_HTTPS' in os.environ: - if not os.path.isfile(PEM_FILE): - # Ensure PEM_FILE directory exists - dir_name = os.path.dirname(PEM_FILE) - try: - os.makedirs(dir_name) - except OSError as exc: # Python >2.5 - if exc.errno == errno.EEXIST and os.path.isdir(dir_name): - pass - else: raise - # Generate a certificate if one doesn't exist on disk - subprocess.check_call(['openssl', 'req', '-new', - '-newkey', 'rsa:2048', '-days', '365', '-nodes', '-x509', - '-subj', '/C=XX/ST=XX/L=XX/O=generated/CN=generated', - '-keyout', PEM_FILE, '-out', PEM_FILE]) - # Restrict access to PEM_FILE - os.chmod(PEM_FILE, stat.S_IRUSR | stat.S_IWUSR) - c.NotebookApp.certfile = PEM_FILE - # Set a password if PASSWORD is set if 'PASSWORD' in os.environ: from IPython.lib import passwd