Skip to content

Commit

Permalink
Add client_push configuration #109
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Köpke <[email protected]>
  • Loading branch information
AndreKoepke committed Apr 2, 2024
1 parent 7a9687f commit 9d79183
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 13 deletions.
45 changes: 32 additions & 13 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ spec:
livenessProbe:
httpGet:
path: /status.php
port: {{ $.Values.nextcloud.containerPort }}
port: {{ $.Values.nextcloud.containerPort }}
httpHeaders:
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
Expand All @@ -101,10 +101,10 @@ spec:
readinessProbe:
httpGet:
path: /status.php
port: {{ $.Values.nextcloud.containerPort }}
port: {{ $.Values.nextcloud.containerPort }}
httpHeaders:
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
Expand All @@ -117,10 +117,10 @@ spec:
startupProbe:
httpGet:
path: /status.php
port: {{ $.Values.nextcloud.containerPort }}
port: {{ $.Values.nextcloud.containerPort }}
httpHeaders:
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
Expand Down Expand Up @@ -158,7 +158,7 @@ spec:
livenessProbe:
httpGet:
path: /status.php
port: {{ $.Values.nextcloud.containerPort }}
port: {{ $.Values.nextcloud.containerPort }}
httpHeaders:
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
Expand All @@ -174,7 +174,7 @@ spec:
readinessProbe:
httpGet:
path: /status.php
port: {{ $.Values.nextcloud.containerPort }}
port: {{ $.Values.nextcloud.containerPort }}
httpHeaders:
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
Expand All @@ -190,7 +190,7 @@ spec:
startupProbe:
httpGet:
path: /status.php
port: {{ $.Values.nextcloud.containerPort }}
port: {{ $.Values.nextcloud.containerPort }}
httpHeaders:
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
Expand Down Expand Up @@ -274,6 +274,25 @@ spec:
volumeMounts:
{{- include "nextcloud.volumeMounts" . | trim | nindent 12 }}
{{- end }}{{/* end-if cronjob.enabled */}}
{{ if .Values.clientPush.enabled }}
- name: {{ .Chart.Name }}-client-push
image: {{ include "nextcloud.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- custom_apps/notify_push/bin/x86_64/notify_push
args:
- config/config.php
env:
- name: NEXTCLOUD_URL
value: http://localhost:80
volumeMounts:
- name: nextcloud-main
mountPath: /var/www/html/custom_apps
subPath: {{ ternary "custom_apps" (printf "%s/custom_apps" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
- name: nextcloud-main
mountPath: /var/www/html/config
subPath: {{ ternary "config" (printf "%s/config" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
{{- end }}{{/* end-if clientPush.enabled */}}
{{- with .Values.nextcloud.extraSidecarContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -335,7 +354,7 @@ spec:
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }}
{{- else }}
emptyDir: {}
emptyDir: { }
{{- end }}
{{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }}
- name: nextcloud-data
Expand Down
14 changes: 14 additions & 0 deletions charts/nextcloud/templates/nginx-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@
location / {
try_files $uri $uri/ /index.php$request_uri;
}


{{ if .Values.clientPush.enabled }}
# client-push application
# https://github.com/nextcloud/notify_push?tab=readme-ov-file#nginx
location ^~ /push/ {
proxy_pass http://127.0.0.1:7867/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
{{ end }}{{/* end-if clientPush.enabled */}}
}
{{- end }}

Expand Down
3 changes: 3 additions & 0 deletions charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ rbac:
name: nextcloud-serviceaccount
annotations: {}

clientPush:
enabled: true


## @param securityContext for nextcloud pod @deprecated Use `nextcloud.podSecurityContext` instead
securityContext: {}

0 comments on commit 9d79183

Please sign in to comment.