[buildout]

extends =
  ../../component/6tunnel/buildout.cfg
  ../../component/curl/buildout.cfg
  ../../component/dash/buildout.cfg
  ../../component/qemu-kvm/buildout.cfg
  ../../component/noVNC/buildout.cfg
  ../../component/openssl/buildout.cfg
  ../../component/netcat/buildout.cfg
  ../../component/lxml-python/buildout.cfg
  ../../component/pycurl/buildout.cfg
  ../../component/numpy/buildout.cfg
  ../../component/gzip/buildout.cfg
  ../../stack/slapos.cfg
  ../../stack/resilient/buildout.cfg
  buildout.hash.cfg

# stacks are listed from most generic to most specific,
# to avoid versioning issues
common-parts =
  template

# XXX: we have to manually add this for resilience
  pbs-recipe-egg


parts = ${:common-parts}

#XXX-Cedric : Currently, one can only access to KVM using noVNC.
#             Ideally one should be able to access KVM by using either NoVNC or VNC.
#             Problem is : no native crypto support in web browsers. So we have to disable ssl
#             In qemu builtin vnc server, and make it available only for localhost
#             so that only novnc can listen to it.

#XXX-Cedric: Check status of https://github.com/kanaka/noVNC/issues/13 to see
#            When qemu has builtin support for websockets in vnc server to get rid of
#            Websockify (socket <-> websocket proxy server) when it is ready.
#            May solve previous XXX depending on the implementation.

#XXX-Cedric : add list of keyboard layouts (azerty/us querty/...) parameter to qemu

[python-with-eggs]
recipe = zc.recipe.egg
interpreter = ${:_buildout_section_name_}
eggs =
  ${slapos-toolbox:eggs}
  ${python-cffi:egg}
  ${lxml-python:egg}
  websockify
  ${slapos-cookbook:eggs}
  erp5.util
# BBB: eggs used as recipe should be kept otherwise sections depending
# on it can't be uninstalled
  collective.recipe.shelloutput
scripts =
  websockify

# Create all templates that will be used to deploy instances
[download-base]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}

[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg

[template-kvm]
<= download-base

[template-kvm-cluster]
<= download-base

[template-kvm-resilient]
<= download-base

[template-kvm-import]
<= download-base

[template-kvm-import-script]
<= download-base

[template-kvm-export]
<= download-base

[template-kvm-export-script]
<= download-base

[template-nbd]
<= download-base

[template-ansible-promise]
<= download-base

[template-kvm-run]
<= download-base

[template-kvm-controller]
<= download-base

[template-apache-conf]
<= download-base

[template-content]
<= download-base

[template-qemu-ready]
<= download-base

[template-httpd]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance-kvm-http.cfg.in
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/instance-kvm-http.cfg
context =
    key apache_location apache:location
    raw openssl_executable_location ${openssl:location}/bin/openssl
    key template_apache_conf template-apache-conf:target

[image-download-controller]
<= download-base

[image-download-config-creator]
<= download-base

[whitelist-firewall-download-controller]
<= download-base

[whitelist-domains-default]
<= download-base

[versions]
websockify = 0.9.0
gitdb = 0.6.4
pycurl = 7.43.0
smmap = 0.9.0
