Skip to content

Commit

Permalink
fix(notify-push): add autoSetup support
Browse files Browse the repository at this point in the history
  • Loading branch information
wrenix committed Jun 14, 2024
1 parent 6ed673a commit 65046cb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/nextcloud/files/notify_push.sh.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
/var/www/html/occ app:install notify_push
/var/www/html/occ notify_push:setup https://{{ .Values.nextcloud.host }}{{ .Values.notifyPush.ingress.path }}
15 changes: 15 additions & 0 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ spec:
{{- end }}
volumeMounts:
{{- include "nextcloud.volumeMounts" . | trim | nindent 12 }}
{{- if and .Values.notifyPush.enabled .Values.notifyPush.autoSetup }}
- name: nextcloud-notify-hooks
mountPath: /docker-entrypoint-hooks.d/before-starting/notify_push.sh
subPath: notify_push.sh
readOnly: true
{{- end }}
{{- range $hook, $shell := .Values.nextcloud.hooks }}
{{- if $shell }}
- name: nextcloud-hooks
Expand Down Expand Up @@ -361,6 +367,15 @@ spec:
configMap:
name: {{ template "nextcloud.fullname" . }}-nginxconfig
{{- end }}
{{- if and .Values.notifyPush.enabled .Values.notifyPush.autoSetup }}
- name: nextcloud-notify-hooks
configMap:
name: {{ template "nextcloud.fullname" . }}-notify-push
defaultMode: 0o755
items:
- key: hook.sh
path: notify_push.sh
{{- end }}
{{- if not (values .Values.nextcloud.hooks | compact | empty) }}
- name: nextcloud-hooks
configMap:
Expand Down
15 changes: 15 additions & 0 deletions charts/nextcloud/templates/notify_push/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and .Values.notifyPush.enabled .Values.notifyPush.autoSetup }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "nextcloud.fullname" . }}-notify-push
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
helm.sh/chart: {{ include "nextcloud.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
hook.sh: |-
{{- tpl (.Files.Get "files/notify_push.sh.gotmpl" ) . | nindent 4 }}
{{- end }}
1 change: 1 addition & 0 deletions charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ affinity: {}
# Notify Push (Clientpush)
notifyPush:
enabled: false
autoSetup: false

replicaCount: 1

Expand Down

0 comments on commit 65046cb

Please sign in to comment.