diff --git a/services/nextcloud-mail-sync/cronjob.yaml b/services/nextcloud-mail-sync/cronjob.yaml index 9973ab0..e0705c5 100644 --- a/services/nextcloud-mail-sync/cronjob.yaml +++ b/services/nextcloud-mail-sync/cronjob.yaml @@ -66,6 +66,8 @@ spec: cpu: 500m memory: 512Mi volumeMounts: + - name: nextcloud-web + mountPath: /var/www/html - name: nextcloud-config-pvc mountPath: /var/www/html/config - name: nextcloud-custom-apps @@ -85,6 +87,9 @@ spec: - name: nextcloud-user-data persistentVolumeClaim: claimName: nextcloud-user-data + - name: nextcloud-web + persistentVolumeClaim: + claimName: nextcloud-web - name: sync-script configMap: name: nextcloud-mail-sync-script diff --git a/services/nextcloud/cronjob.yaml b/services/nextcloud/cronjob.yaml index 53772a5..721a494 100644 --- a/services/nextcloud/cronjob.yaml +++ b/services/nextcloud/cronjob.yaml @@ -24,6 +24,8 @@ spec: args: - "cd /var/www/html && php -f cron.php" volumeMounts: + - name: nextcloud-web + mountPath: /var/www/html - name: nextcloud-config-pvc mountPath: /var/www/html/config - name: nextcloud-custom-apps @@ -40,3 +42,6 @@ spec: - name: nextcloud-user-data persistentVolumeClaim: claimName: nextcloud-user-data + - name: nextcloud-web + persistentVolumeClaim: + claimName: nextcloud-web diff --git a/services/nextcloud/deployment.yaml b/services/nextcloud/deployment.yaml index 9c63191..0d34e45 100644 --- a/services/nextcloud/deployment.yaml +++ b/services/nextcloud/deployment.yaml @@ -23,6 +23,26 @@ spec: runAsUser: 33 runAsGroup: 33 initContainers: + - name: seed-nextcloud-web + image: nextcloud:29-apache + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /var/www/html/version.php ]; then + echo "Seeding Nextcloud webroot..." + tar -C /usr/src/nextcloud -cf - \ + --exclude=./config \ + --exclude=./data \ + --exclude=./custom_apps \ + . | tar -C /var/www/html -xf - + chown -R 33:33 /var/www/html || true + fi + securityContext: + runAsUser: 0 + runAsGroup: 0 + volumeMounts: + - name: nextcloud-web + mountPath: /var/www/html - name: fix-perms image: alpine:3.20 command: ["/bin/sh", "-c"] @@ -166,6 +186,8 @@ spec: name: nextcloud-oidc key: client-secret volumeMounts: + - name: nextcloud-web + mountPath: /var/www/html - name: nextcloud-config-pvc mountPath: /var/www/html/config - name: nextcloud-custom-apps @@ -257,6 +279,8 @@ spec: - containerPort: 80 name: http volumeMounts: + - name: nextcloud-web + mountPath: /var/www/html - name: nextcloud-config-pvc mountPath: /var/www/html/config - name: nextcloud-custom-apps @@ -274,6 +298,9 @@ spec: cpu: 1 memory: 3Gi volumes: + - name: nextcloud-web + persistentVolumeClaim: + claimName: nextcloud-web - name: nextcloud-config-pvc persistentVolumeClaim: claimName: nextcloud-config diff --git a/services/nextcloud/maintenance-cronjob.yaml b/services/nextcloud/maintenance-cronjob.yaml index a3d0bb6..a6fad0a 100644 --- a/services/nextcloud/maintenance-cronjob.yaml +++ b/services/nextcloud/maintenance-cronjob.yaml @@ -34,6 +34,8 @@ spec: name: nextcloud-admin key: admin-password volumeMounts: + - name: nextcloud-web + mountPath: /var/www/html - name: nextcloud-config-pvc mountPath: /var/www/html/config - name: nextcloud-custom-apps @@ -60,6 +62,9 @@ spec: - name: nextcloud-user-data persistentVolumeClaim: claimName: nextcloud-user-data + - name: nextcloud-web + persistentVolumeClaim: + claimName: nextcloud-web - name: maintenance-script configMap: name: nextcloud-maintenance-script diff --git a/services/nextcloud/pvc.yaml b/services/nextcloud/pvc.yaml index d34e151..a934732 100644 --- a/services/nextcloud/pvc.yaml +++ b/services/nextcloud/pvc.yaml @@ -27,6 +27,19 @@ spec: --- apiVersion: v1 kind: PersistentVolumeClaim +metadata: + name: nextcloud-web + namespace: nextcloud +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 5Gi + storageClassName: astreae +--- +apiVersion: v1 +kind: PersistentVolumeClaim metadata: name: nextcloud-user-data namespace: nextcloud