[buildout]
extends =
  buildout.hash.cfg
  ../../component/redis/buildout.cfg
  ../../stack/lamp/buildout.cfg

[nc-download]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}

[application]
url = https://download.nextcloud.com/server/releases/nextcloud-16.0.3.tar.bz2
md5sum = d81902d2dec5d547779bec6336a438be

[template-nextcloud-install.sh]
<= nc-download

[template-apache-httpd]
<= nc-download

[template-nextcloud-config.json]
<= nc-download

[template-nextcloud-instance]
recipe = slapos.recipe.template:jinja2
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance-nextcloud.cfg
extensions = jinja2.ext.do
context =
          key gzip_location          gzip:location
          key python3_location       python3:location
          key news_updater_location  news-updater:location
          key php_location           apache-php:location
          raw redis_bin              ${redis:location}/bin/redis-server
          raw redis_cli              ${redis:location}/bin/redis-cli
          key nextcloud_install_sh   template-nextcloud-install.sh:target
          key nextcloud_apache_httpd template-apache-httpd:target
          key nextcloud_parameter_json template-nextcloud-config.json:target
          section nextcloud_apps     nextcloud-apps

[custom-application-deployment]
path = ${template-nextcloud-instance:output}
part-list = nextcloud-install.sh
db-name = nextcloud
db-user = nextcloud
db-password = insecure

[nc-download-unpacked]
recipe = slapos.recipe.build:download-unpacked
shared = true

[news-updater]
<= nc-download-unpacked
url = https://github.com/nextcloud/news-updater/archive/10.0.1.tar.gz
md5sum = 37387199c0482e08d01e9294cd95eaad

[nextcloud-app-spreed]
<= nc-download-unpacked
url = https://github.com/nextcloud/spreed/releases/download/v6.0.5/spreed-6.0.5.tar.gz
md5sum = 002c09e543edc141f6ca848782573376

[nextcloud-app-richdocuments]
<= nc-download-unpacked
url = https://github.com/nextcloud/richdocuments/releases/download/v3.7.17/richdocuments.tar.gz
md5sum = 5559cd14a4a0a93d2a39b260538839f8

[nextcloud-app-calendar]
<= nc-download-unpacked
url = https://github.com/nextcloud/calendar/releases/download/v1.7.3/calendar.tar.gz
md5sum = ab398d943eb6939e3e71df5b1a1abf87

[nextcloud-app-rainloop]
<= nc-download-unpacked
url = https://github.com/pierre-alain-b/rainloop-nextcloud/releases/download/6.1.4/rainloop.tar.gz
md5sum = 7cefc3dd3bd52b42d381de7d7447691f

[nextcloud-app-news]
<= nc-download-unpacked
url = https://github.com/nextcloud/news/releases/download/14.2.2/news.tar.gz
md5sum = f48d4b5dcbc078131bb86a4ae619da99

[nextcloud-apps]
spreed = ${nextcloud-app-spreed:location}
richdocuments = ${nextcloud-app-richdocuments:location}
calendar = ${nextcloud-app-calendar:location}
rainloop = ${nextcloud-app-rainloop:location}
news = ${nextcloud-app-news:location}