Skip to content
Snippets Groups Projects
Verified Commit 21aac190 authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

make which apps to install and enable configurable

parent 0849bafb
No related branches found
No related tags found
1 merge request!12Resolve "Restrict list of installable Nextcloud "apps""
......@@ -3,7 +3,7 @@
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Release.Name }}-register-onlyoffice"
name: "{{ .Release.Name }}-setup-apps"
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
......@@ -24,11 +24,11 @@ spec:
restartPolicy: Never
securityContext: {{- include "nextcloud-onlyoffice.securityContext" . | indent 8 }}
containers:
- name: {{ .Release.Name }}-register-onlyoffice-job
- name: {{ .Release.Name }}-setup-apps-job
image: {{ .Values.nextcloud.image.repository }}:{{ .Values.nextcloud.image.tag }}
command:
- "/bin/bash"
- "/var/local/onlyoffice-setup.sh"
- "/var/local/setup-apps.sh"
volumeMounts: {{- include "nextcloud-onlyoffice.volumeMounts" . | indent 8 }}
env: {{- include "nextcloud-onlyoffice.env" . | indent 8 }}
volumes: {{- include "nextcloud-onlyoffice.volumes" . | indent 6 }}
......@@ -26,18 +26,23 @@ data:
}
}
}
onlyoffice-setup.sh: |
setup-apps.sh: |
#!/bin/bash
set -ev
# Debug: place the json file in a persistent location for reuse
cp /var/local/onlyoffice-config.json /var/www/html/
# Only install onlyoffice if it's not installed already
if ! php occ app:list | grep -q onlyoffice; then
php occ app:install onlyoffice
{{- range .Values.apps }}
# -- Begin {{ .name }}
# Only install {{ .name }} if it's not installed already
if ! php occ app:list | grep -q {{ .name }}; then
php occ app:install {{ .name }}
fi
# Enable onlyoffice app
php occ app:enable onlyoffice
{{- if .enabled }}
php occ app:enable {{ .name }}
{{ end }} # -- end {{ .name }}
{{ end }} # end range {{ .Values.apps }}
# Config settings from the configmap above
php occ config:import /var/local/onlyoffice-config.json
......
......@@ -17,6 +17,15 @@ nextcloud:
cronjob:
enabled: true
apps:
# OIDC consumer
- name: sociallogin
enabled: false
# List of applications that are installed *and enabled*
- name: onlyoffice
enabled: true
# Necessary so the chart gets installed (because the requirements.yaml has a
# condition: `condition: mariadb.enabled`). Follow
# https://github.com/helm/helm/issues/5135 for more info.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment