From ca8de136e22ceaaf6c9cefd679ae85cfe60bfd24 Mon Sep 17 00:00:00 2001
From: Maarten de Waard <maarten@greenhost.nl>
Date: Wed, 14 Jul 2021 17:14:02 +0200
Subject: [PATCH] make a PVC for ONLYOFFICE and use it

---
 flux2/apps/nextcloud/pvc.yaml               | 13 +++++++++++++
 flux2/apps/nextcloud/release.yaml           |  4 ++++
 flux2/infrastructure/sources/nextcloud.yaml |  3 ++-
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/flux2/apps/nextcloud/pvc.yaml b/flux2/apps/nextcloud/pvc.yaml
index 6145d3d39..1b5a81143 100644
--- a/flux2/apps/nextcloud/pvc.yaml
+++ b/flux2/apps/nextcloud/pvc.yaml
@@ -37,3 +37,16 @@ spec:
     requests:
       storage: 512Mi
   storageClassName: local-path
+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: nextcloud-onlyoffice-data
+spec:
+  accessModes:
+    - ReadWriteOnce
+  volumeMode: Filesystem
+  resources:
+    requests:
+      storage: 512Mi
+  storageClassName: local-path
diff --git a/flux2/apps/nextcloud/release.yaml b/flux2/apps/nextcloud/release.yaml
index a458708d6..649ed2bbc 100644
--- a/flux2/apps/nextcloud/release.yaml
+++ b/flux2/apps/nextcloud/release.yaml
@@ -144,6 +144,10 @@ spec:
             secretName: oas-nextcloud-office
       jwtSecret: "${onlyoffice_jwt_secret}"
 
+      persistence:
+        enabled: true
+        existingClaim: "nextcloud-onlyoffice-data"
+
     postgresql:
       postgresqlPassword: "${onlyoffice_postgresql_password}"
       resources:
diff --git a/flux2/infrastructure/sources/nextcloud.yaml b/flux2/infrastructure/sources/nextcloud.yaml
index f135ed01d..01b9f6289 100644
--- a/flux2/infrastructure/sources/nextcloud.yaml
+++ b/flux2/infrastructure/sources/nextcloud.yaml
@@ -13,4 +13,5 @@ spec:
   # For all available options, see:
   # https://toolkit.fluxcd.io/components/source/api/#source.toolkit.fluxcd.io/v1beta1.GitRepositoryRef
   ref:
-    tag: 0.2.8
+    # tag: 0.2.8
+    branch: 967-prevent-loss-of-onlyoffice-documents
-- 
GitLab