Skip to content

Commit

Permalink
🐛(nextcloud): fix logging and s3 storage
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-w committed Aug 21, 2024
1 parent 350529d commit 3cbbb1e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 50 deletions.
2 changes: 1 addition & 1 deletion charts/apps/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: nextcloud
description: Nextcloud with SSO and some useful extras
type: application
version: "0.11.1"
version: "0.11.2"
appVersion: "29.0.4"

dependencies:
Expand Down
39 changes: 16 additions & 23 deletions charts/apps/nextcloud/templates/nextcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,28 +262,6 @@ spec:
'overwriteprotocol' => 'https',
);
?>
{{- if .Values.s3.enabled }}
s3.config.php: |-
<?php
$CONFIG = array (
'objectstore' => array(
'class' => '\\OC\\Files\\ObjectStore\\S3',
'arguments' => array(
'bucket' => {{ .Values.s3.bucket | quote }},
'hostname' => {{ .Values.s3.endpoint | quote }},
'autocreate' => true,
'key' => {{ .Values.s3.access_key_id | quote }},
'secret' => getenv('S3_SECRET'),
'region' => {{ .Values.s3.region | quote }},
'use_ssl' => true,
{{- if .Values.s3.encryption.enabled }}
'sse_c_key' => getenv('S3_ENC_KEY'),
{{- end }}
)
)
);
?>
{{- end }}
mail.config.php: |
<?php
$CONFIG = array (
Expand All @@ -297,13 +275,28 @@ spec:
'maintenance_window_start' => 2,
);
?>
{{- if .Values.s3.enabled }}
objectStore:
s3:
enabled: true
region: {{ .Values.s3.region }}
autoCreate: true
existingSecret: s3-storage
secretKeys:
host: host
accessKey: id
secretKey: secret
bucket: bucket
sse_c_key: sse_c_key
{{- end }}
extraSidecarContainers:
- name: nextcloud-logger
image: busybox
command: [/bin/sh, -c, 'while ! test -f "/var/www/html/data/nextcloud.log"; do sleep 1; done; tail -n+1 -f /var/www/html/data/nextcloud.log']
command: [/bin/sh, -c, 'while ! test -f "/var/www/html/data/nextcloud.log"; do sleep 1; done; tail -n 0 -f /var/www/html/data/nextcloud.log']
volumeMounts:
- name: nextcloud-main
mountPath: /var/www/html/data
subPath: data
{{- if .Values.autoconfig.enabled }}
extraVolumes:
- name: autoconfig
Expand Down
26 changes: 5 additions & 21 deletions charts/apps/nextcloud/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,17 @@
apiVersion: v1
kind: Secret
metadata:
name: s3-access-key
name: s3-storage
type: Opaque
data:
{{- $secretRef2 := .Values.s3.access_key_secret }}
id: {{ .Values.s3.access_key_id | b64enc }}
host: {{ .Values.s3.endpoint | b64enc }}
bucket: {{ .Values.s3.bucket | b64enc }}
secret: {{ get ((lookup "v1" "Secret" (default .Release.Namespace $secretRef2.namespace) $secretRef2.name).data) $secretRef2.key }}
---
{{- if .Values.s3.encryption.enabled }}
{{- if not .Values.s3.encryption.existingSecret.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: nextcloud-s3-enc
type: Opaque
data:
key: {{ include "common.secrets.passwords.manage" (dict "secret" "nextcloud-s3-enc" "key" "key" "providedValues" (list "") "length" 16 "context" $) | b64enc }}
sse_c_key: {{ include "common.secrets.passwords.manage" (dict "secret" "s3-storage" "key" "sse_c_key" "providedValues" (list "") "length" 16 "context" $) | b64enc }}
---
{{- else -}}
apiVersion: v1
kind: Secret
metadata:
name: nextcloud-s3-enc
type: Opaque
data:
{{- $secretRef3 := .Values.s3.encryption.existingSecret }}
key: {{ get ((lookup "v1" "Secret" (default .Release.Namespace $secretRef3.namespace) $secretRef3.name).data) $secretRef3.key }}
---
{{- end }}
{{- end }}
{{- end }}
apiVersion: v1
Expand Down
5 changes: 0 additions & 5 deletions charts/apps/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ s3:
bucket: "" # Name of bucket
encryption:
enabled: false
existingSecret:
enabled: false # Set to true to use existing key instead of generating one.
namespace: null # Set to null to use current namespace
name: ""
key: key

smtp: # For admin notifications
host: ""
Expand Down

0 comments on commit 3cbbb1e

Please sign in to comment.