Last active
November 28, 2024 12:55
-
-
Save bmmalone/b5a0f44412d693d332b3e319f369bb06 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_home_dir(*fn): | |
import os.path | |
return os.path.join(os.path.expanduser('~'), *fn) | |
c.ServerApp.ip = '*' | |
c.ServerApp.port = 9999 | |
c.ServerApp.certfile = add_home_dir('certs', 'mycert.pem') | |
c.ServerApp.keyfile = add_home_dir('certs', 'mykey.key') | |
c.NotebookApp.open_browser = False | |
c.LabApp.open_browser = False | |
c.ServerApp.open_browser = False | |
c.PasswordIdentityProvider.hashed_password = u'sha1:5f2cf85d2872:e9b52b2240cbcde307b5907e5c3848f3f9fd8a92' # 31KT | |
#------------------------------------------------------------------------------ | |
# Configurable configuration | |
#------------------------------------------------------------------------------ | |
# templates | |
c.JupyterLabTemplates.template_dirs = [add_home_dir('jupyter-templates')] | |
c.JupyterLabTemplates.include_default = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda create --name "jupyterlab" pip wheel jupyter ipykernel | |
conda activate jupyterlab | |
conda install -c conda-forge jupyterlab | |
conda install -c conda-forge nodejs | |
conda install -c conda-forge jupyterlab_templates | |
#jupyter serverextension enable --py jupyterlab_templates |
The certificate and key are self-signed using the method described here. Namely, the following command is used:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem
The config file expects these to be located in $HOME/certs
.
Update:
The following command also specifies the certificate details from the command line and requires no user input:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem -subj "/C=DE/ST= /L= /O= /OU= /CN= "
The password specified in the template to access the server is 31KT
.
The config file should be located in $HOME/.jupyter
The following error message (and similar) is common when using Chrome to access the server:
SSL Error on 8 ('::1', 53988, 0, 0): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] ssl/tls alert certificate unknown (_ssl.c:1000)
This appears to be specific to Chrome. If it does not appear when using some other browser, then it can be safely ignored.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The template should likely be placed at
$HOME/jupyter-templates/templates
.