Commit 435e06b2 authored by Jérome Perrin's avatar Jérome Perrin

ipython notebook: SSL

parent 70b7f1e1
...@@ -18,10 +18,38 @@ cert = $${slap_connection:cert_file} ...@@ -18,10 +18,38 @@ cert = $${slap_connection:cert_file}
[instance-parameter] [instance-parameter]
port = 8888 port = 8888
host = $${slapconfiguration:ipv4-random} host = $${slapconfiguration:ipv4-random}
cert_file = $${generate-certificate:cert_file}
key_file = $${generate-certificate:key_file}
logfile = $${directory:log}/ipython_notebook.log
notebook_dir = $${directory:notebook_dir}
[generate-certificate]
recipe = plone.recipe.command
command =
if [ ! -e $${instance-parameter:key_file} ]
then
${openssl-output:openssl} req -x509 -nodes -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=$${instance-parameter:host}" \
-newkey rsa:1024 -keyout $${instance-parameter:key_file} \
-out $${instance-parameter:cert_file}
fi
update-command = $${:command}
cert_file = $${directory:etc}/ipython_notebook_cert.crt
key_file = $${directory:etc}/ipython_notebook_cert.key
[instance] [instance]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = ${buildout:bin-directory}/ipython notebook --no-browser --matplotlib=inline --pylab --ip=$${instance-parameter:host} --port $${instance-parameter:port} command-line =
${buildout:bin-directory}/ipython notebook
--no-browser
--matplotlib=inline
--ip=$${instance-parameter:host}
--port=$${instance-parameter:port}
--port-retries=0
--certfile=$${instance-parameter:cert_file}
--keyfile=$${instance-parameter:key_file}
--notebook-dir=$${instance-parameter:notebook_dir}
--logfile=$${instance-parameter:logfile}
wrapper-path = $${directory:service}/ipython_notebook wrapper-path = $${directory:service}/ipython_notebook
parameters-extra = true parameters-extra = true
...@@ -34,8 +62,9 @@ script = $${:etc}/run/ ...@@ -34,8 +62,9 @@ script = $${:etc}/run/
service = $${:etc}/service service = $${:etc}/service
promise = $${:etc}/promise/ promise = $${:etc}/promise/
log = $${:var}/log log = $${:var}/log
notebook_dir = $${:var}/notebooks
[publish-connection-parameter] [publish-connection-parameter]
recipe = slapos.cookbook:publishurl recipe = slapos.cookbook:publishurl
url = http://$${instance-parameter:host}:$${instance-parameter:port} url = https://$${instance-parameter:host}:$${instance-parameter:port}
...@@ -6,6 +6,7 @@ extends = ...@@ -6,6 +6,7 @@ extends =
../../component/scikit-learn/buildout.cfg ../../component/scikit-learn/buildout.cfg
../../component/pandas/buildout.cfg ../../component/pandas/buildout.cfg
../../component/manpy/buildout.cfg ../../component/manpy/buildout.cfg
../../component/openssl/buildout.cfg
parts = parts =
slapos-cookbook slapos-cookbook
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment