Skip to content

Commit

Permalink
Merge pull request #8 from sonroyaalmerol/dev
Browse files Browse the repository at this point in the history
Chart: Improve pre-1.29 k8s version compatibility
  • Loading branch information
sonroyaalmerol authored May 20, 2024
2 parents c7fa644 + d183e27 commit 7ed7575
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/sogo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: sogo
version: 0.1.3
version: 0.1.4
description: A helm chart for the docker-sogo docker image
type: application
keywords:
Expand Down
26 changes: 26 additions & 0 deletions charts/sogo/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,32 @@ metadata:
data:
configs: |
{{- .Values.sogo.configs | toYaml | nindent 4 }}
{{- if .Values.sogo.enableVerboseLogs }}
GCSFolderDebugEnabled: true
GCSFolderStoreDebugEnabled: true
LDAPDebugEnabled: true
MySQL4DebugEnabled: true
NGImap4DisableIMAP4Pooling: true
ImapDebugEnabled: true
SMTPDebugEnabled: true
OCSFolderManagerSQLDebugEnabled: true
PGDebugEnabled: true
SOGoDebugRequests: true
SOGoMailKeepDraftsAfterSend: true
SOGoUIxDebugEnabled: true
SoDebugObjectTraversal: true
SoSecurityManagerDebugEnabled: true
WODontZipResponse: true
WODebugZipResponse: true
{{- if and .Values.sogo.theme.js (not .Values.sogo.theme.css) }}
SOGoUIxDebugEnabled: true
{{- end }}
{{- end }}
{{- if .Values.sogo.theme.js }}
SOGoUIAdditionalJSFiles: [js/helm-theme.js]
{{- end }}
init-theme-configs: |
SOGoUIxDebugEnabled: true
{{- if or .Values.mariadb.enabled .Values.postgresql.enabled }}
internal-db: |
{{- include "sogo.db.configs" . | nindent 4 }}
Expand Down
20 changes: 20 additions & 0 deletions charts/sogo/templates/custom-theme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if or .Values.sogo.theme.js .Values.sogo.theme.css -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "sogo.fullname" . }}-theme
labels:
app.kubernetes.io/name: {{ include "sogo.name" . }}
helm.sh/chart: {{ include "sogo.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
{{- if .Values.sogo.theme.js }}
theme.js: |
{{- .Values.sogo.theme.js | nindent 4 }}
{{- end }}
{{- if .Values.sogo.theme.css }}
theme.css: |
{{- .Values.sogo.theme.css | nindent 4 }}
{{- end }}
{{- end }}
27 changes: 20 additions & 7 deletions charts/sogo/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,18 @@ spec:
subPath: configs
readOnly: true
{{- end }}
{{- if .Values.sogo.theme.js }}
- name: sogo-custom-theme
mountPath: /usr/local/lib/GNUstep/SOGo/WebServerResources/js/helm-theme.js
subPath: theme.js
readOnly: true
{{- end }}
{{- if .Values.sogo.theme.css }}
- name: sogo-custom-theme
mountPath: /usr/local/lib/GNUstep/SOGo/WebServerResources/js/theme-default.css
subPath: theme.css
readOnly: true
{{- end }}
{{- if .Values.sogo.secrets }}
- name: sogo-secrets
mountPath: /etc/sogo/sogo.conf.d/99-secrets.yaml
Expand Down Expand Up @@ -174,8 +186,8 @@ spec:
{{- end }}
{{- end }}
- name: {{ .Chart.Name }}-ext-secrets
image: alpine:3.19
restartPolicy: Always
image: {{ include "sogo.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: {{ template "sogo.fullname" . }}-tmp
mountPath: /secrets
Expand Down Expand Up @@ -213,13 +225,9 @@ spec:
chmod +x "$tmp_script"
# Initial generation of file
# Generation of config file
sh "$tmp_script"
echo "Watching existing secrets..."
# Run inotifyd to watch for changes and regenerate the YAML file
inotifyd "$tmp_script" /existing-secrets:cwm
{{- if or .Values.mariadb.enabled (eq (include "sogo.db.parsed.type" .) "mysql") }}
- name: mariadb-isalive
image: {{ .Values.mariadb.image.registry | default "docker.io" }}/{{ .Values.mariadb.image.repository }}:{{ .Values.mariadb.image.tag }}
Expand Down Expand Up @@ -274,6 +282,11 @@ spec:
configMap:
name: {{ template "sogo.fullname" . }}-config
{{- end }}
{{- if or .Values.sogo.theme.js .Values.sogo.theme.css }}
- name: sogo-custom-theme
configMap:
name: {{ template "sogo.fullname" . }}-theme
{{- end }}
{{- if .Values.sogo.secrets }}
- name: sogo-secrets
secret:
Expand Down
24 changes: 24 additions & 0 deletions charts/sogo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ sogo:
# If web server is not binding default port, you can define it
containerPort: 80

# Enable all logs from SOGo
enableVerboseLogs: false

# SOGo configuration options
# ref: https://www.sogo.nu/files/docs/SOGoInstallationGuide.html
configs:
Expand All @@ -84,6 +87,27 @@ sogo:
# Name of Secret containing the configurations
existingSecrets:

## SOGo Custom Theming
## NOTE: SOGoUIxDebugEnabled is automatically set to YES when only .sogo.theme.js is set
## ref: https://www.sogo.nu/support/faq/how-to-change-the-color-theme.html
theme: {}
# js: |
# $mdThemingProvider.theme('default')
# .primaryPalette('green-cow', {
# 'default': '400', // background color of top toolbars
# 'hue-1': '400',
# 'hue-2': '600', // background color of sidebar toolbar
# 'hue-3': 'A700'
# })
# .accentPalette('green', {
# 'default': '600', // background color of fab buttons and login screen
# 'hue-1': '300', // background color of center list toolbar
# 'hue-2': '300', // highlight color for selected mail and current day calendar
# 'hue-3': 'A700'
# })
# .backgroundPalette('frost-grey');
# css: |
# <insert generated CSS here>
## Strategy used to replace old pods
## IMPORTANT: use with care, it is suggested to leave as that for upgrade purposes
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
Expand Down

0 comments on commit 7ed7575

Please sign in to comment.