From 1a35105afa08e30a38e615a70875fd5ae2777721 Mon Sep 17 00:00:00 2001
From: Thomas Mortagne <thomas.mortagne@gmail.com>
Date: Thu, 30 Nov 2017 16:05:45 +0100
Subject: [PATCH] XDOCKER-41: Docker image should enable filesystem storage for
 deleted document XDOCKER-40: Docker image use the wrong FS attachments setup

---
 template/xwiki/docker-entrypoint.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/template/xwiki/docker-entrypoint.sh b/template/xwiki/docker-entrypoint.sh
index d912a50..5568830 100755
--- a/template/xwiki/docker-entrypoint.sh
+++ b/template/xwiki/docker-entrypoint.sh
@@ -92,9 +92,13 @@ function configure() {
   echo '  Using filesystem-based attachments...'
   xwiki_set_cfg 'xwiki.store.attachment.hint' 'file'
   xwiki_set_cfg 'xwiki.store.attachment.versioning.hint' 'file'
-  xwiki_set_cfg 'xwiki.store.attachment.recyclebin.content.hint' 'file'
+<% if (xwikiVersion.startsWith('8.'))
+print '''  xwiki_set_cfg 'xwiki.store.attachment.recyclebin.hint' 'file'
+'''
+else if (xwikiVersion.startsWith('9.'))print '''  xwiki_set_cfg 'xwiki.store.attachment.recyclebin.content.hint' 'file'
   echo '  Using filesystem-based deleted documents...'
   xwiki_set_cfg 'xwiki.store.recyclebin.content.hint' 'file'
+'''%>
   echo '  Generating authentication validation and encryption keys...'
   xwiki_set_cfg 'xwiki.authentication.validationKey' "\$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
   xwiki_set_cfg 'xwiki.authentication.encryptionKey' "\$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
-- 
GitLab