From 5b0063096a70335fc5234dd2d33acb4595450b3f Mon Sep 17 00:00:00 2001
From: Arie Peterson <arie@greenhost.nl>
Date: Wed, 21 Aug 2024 13:55:55 +0200
Subject: [PATCH] Remove our cronjob setting

---
 templates/nextcloud-onlyoffice-config.yaml | 3 ---
 templates/setup-apps-configmap.yaml        | 5 -----
 values-local.yaml.example                  | 5 -----
 values.yaml                                | 9 +++++++++
 4 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/templates/nextcloud-onlyoffice-config.yaml b/templates/nextcloud-onlyoffice-config.yaml
index 2eb97cda..1b43bf21 100644
--- a/templates/nextcloud-onlyoffice-config.yaml
+++ b/templates/nextcloud-onlyoffice-config.yaml
@@ -31,9 +31,6 @@ data:
   # system.bulkupload.enabled is set to false to disable bulkupload. Bulkupload
   #   has led to failures while using the desktop client for some of our
   #   customers.
-  # apps.core.backgroundjobs_mode set to cron disables the unreliable ajax
-  #   scheduling that is enabled by default. Ajax scheduling is not needed
-  #   because cronjobs are regularly executed by a kubernetes resource.
   config.json: |
     {
         "system":{
diff --git a/templates/setup-apps-configmap.yaml b/templates/setup-apps-configmap.yaml
index aa8ef7c8..557f1372 100644
--- a/templates/setup-apps-configmap.yaml
+++ b/templates/setup-apps-configmap.yaml
@@ -162,11 +162,6 @@ data:
 
     # Config settings from the configmap above
     run_as "php $occ config:import /var/local/config.json"
-    # We used to set this in `config.json` too, but ran into a nextcloud bug:
-    # https://github.com/nextcloud/server/issues/45083
-    # The `echo "yes"` is necessary because in some cases nextcloud will warn
-    # about the string type and ask for confirmation.
-    echo "yes" | run_as "php $occ config:app:set --value webcron --type string core backgroundjobs_mode"
 
     echo "Updating database indices, columns, keys, etc."
     run_as "php $occ db:add-missing-indices --no-interaction"
diff --git a/values-local.yaml.example b/values-local.yaml.example
index a3fa4a21..0897bc97 100644
--- a/values-local.yaml.example
+++ b/values-local.yaml.example
@@ -33,11 +33,6 @@ nextcloud:
       # Shared redis password for Nextcloud and OnlyOffice
       # password: CHANGE_ME
 
-  # Creates a kubernetes cronJob object that runs nextcloud's cron.php
-  # every 5 minutes (*/5 * * * *)
-  # cronjob:
-  #   enabled: true
-
   # persistence:
   #   enabled: true
   #   size: 2Gi
diff --git a/values.yaml b/values.yaml
index 6abb9548..659bd194 100644
--- a/values.yaml
+++ b/values.yaml
@@ -25,6 +25,15 @@ nextcloud:
     enabled: true
     architecture: standalone
 
+  cronjob:
+    enabled: true
+    resources:
+      requests:
+        cpu: 10m
+        memory: 128Mi
+      limits:
+        memory: 1Gi
+
   # Use 2 GB of storage for NC storage (maybe make configurable later?)
   persistence:
     enabled: true
-- 
GitLab