Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chart: add customizations with http urls #14

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.8
version: 0.1.9
description: A helm chart for the docker-sogo docker image
type: application
keywords:
Expand Down
37 changes: 35 additions & 2 deletions charts/sogo/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,21 @@ spec:
readOnly: true
{{- end }}
{{- if .Values.sogo.theme.css }}
- name: sogo-custom-theme
- name: {{ template "sogo.fullname" . }}-customizations
mountPath: /usr/local/lib/GNUstep/SOGo/WebServerResources/js/theme-default.css
subPath: theme.css
subPath: helm.css
readOnly: true
{{- end }}
{{- if .Values.sogo.theme.logo }}
- name: {{ template "sogo.fullname" . }}-customizations
mountPath: /usr/local/lib/GNUstep/SOGo/WebServerResources/img/sogo-full.svg
subPath: helm.svg
readOnly: true
{{- end }}
{{- if .Values.sogo.theme.favicon }}
- name: {{ template "sogo.fullname" . }}-customizations
mountPath: /usr/local/lib/GNUstep/SOGo/WebServerResources/img/sogo.ico
subPath: helm.ico
readOnly: true
{{- end }}
{{- if .Values.sogo.secrets }}
Expand Down Expand Up @@ -222,9 +234,18 @@ spec:
- name: {{ .Chart.Name }}-ext-secrets
image: {{ include "sogo.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: CSS_URL
value: {{ .Values.sogo.theme.css }}
- name: LOGO_URL
value: {{ .Values.sogo.theme.logo }}
- name: FAVICON_URL
value: {{ .Values.sogo.theme.favicon }}
volumeMounts:
- name: {{ template "sogo.fullname" . }}-tmp
mountPath: /secrets
- name: {{ template "sogo.fullname" . }}-customizations
mountPath: /customizations
{{- if .Values.sogo.existingSecrets }}
{{- range .Values.sogo.existingSecrets }}
- name: {{ printf "existing-secrets-%s" (kebabcase .) }}
Expand Down Expand Up @@ -279,6 +300,16 @@ spec:
# Generation of config file
bash "$tmp_script"

if [ -n "$CSS_URL" ]; then
curl -L -o /customizations/helm.css "$CSS_URL"
fi
if [ -n "$LOGO_URL" ]; then
curl -L -o /customizations/helm.svg "$LOGO_URL"
fi
if [ -n "$FAVICON_URL" ]; then
curl -L -o /customizations/helm.ico "$FAVICON_URL"
fi

{{- 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 @@ -383,6 +414,8 @@ spec:
{{- end }}
- name: {{ template "sogo.fullname" . }}-tmp
emptyDir: {}
- name: {{ template "sogo.fullname" . }}-customizations
emptyDir: {}
{{- with .Values.sogo.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
6 changes: 4 additions & 2 deletions charts/sogo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ sogo:

## SOGo Custom Theming
## NOTE: SOGoUIxDebugEnabled is automatically set to YES when only .sogo.theme.js is set
## Setting .sogo.theme.js is only meant for debugging. Using .sogo.theme.css is preferred.
## ref: https://www.sogo.nu/support/faq/how-to-change-the-color-theme.html
theme: {}
# js: |
Expand All @@ -110,8 +111,9 @@ sogo:
# 'hue-3': 'A700'
# })
# .backgroundPalette('frost-grey');
# css: |
# <insert generated CSS here>
# css: <http url for css file (.css)>
# logo: <http url for logo file (.svg)>
# favicon: <http url for favicon file (.ico)>

# Vacation messages expiration
vacationExpiration:
Expand Down
Loading