Skip to content
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
6 changes: 6 additions & 0 deletions charts/sus/assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Bundled portal assets

- `logo.png` — "face with raised eyebrow" (U+1F928), from the
[Noto Emoji](https://github.com/googlefonts/noto-emoji) project, licensed
Apache-2.0. Used as the default Authelia login-portal logo. Operators can
override it via `auth.authelia.branding.logoPngBase64`.
Binary file added charts/sus/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions charts/sus/templates/authelia/assets-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if and .Values.auth.enabled .Values.auth.authelia.branding.enabled }}
# Authelia server-asset override mounted at server.asset_path (/config/assets):
# logo.png -> the login-portal logo (replaces Authelia's default icon)
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "sus.authelia.fullname" . }}-assets
namespace: {{ .Values.namespaces.platform }}
labels:
{{- include "sus.labels" . | nindent 4 }}
app.kubernetes.io/component: authelia
binaryData:
logo.png: {{ .Values.auth.authelia.branding.logoPngBase64 | default (.Files.Get "assets/logo.png" | b64enc) }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A line-wrapped logoPngBase64 breaks the render with an opaque error. The value is interpolated unquoted, so any newline in it corrupts the YAML. This is easy to hit because the guidance in values.yaml is base64 -i logo.png, and on GNU coreutils -i is --ignore-garbage (not "input file"), so encoding still wraps at 76 columns. Reproduced locally with a two-line value:

Error: YAML parse error on sus/templates/authelia/assets-configmap.yaml:
error converting YAML to JSON: yaml: line 19: could not find expected ':'

The error points at the template, not at the operator's value, so it's a rough debugging experience.

Separately, if assets/logo.png ever goes missing (or gets .helmignored), .Files.Get returns "" and this renders logo.png: — a null value that applies cleanly and mounts a 0-byte logo.png, i.e. a silently broken image on the login page rather than a loud failure.

Both are covered by normalizing whitespace, quoting, and requiring a non-empty result:

Suggested change
logo.png: {{ .Values.auth.authelia.branding.logoPngBase64 | default (.Files.Get "assets/logo.png" | b64enc) }}
logo.png: {{ .Values.auth.authelia.branding.logoPngBase64 | default (.Files.Get "assets/logo.png" | b64enc) | nospace | required "auth.authelia.branding: no logo available — set auth.authelia.branding.logoPngBase64 or restore charts/sus/assets/logo.png" | quote }}

Worth updating the values.yaml hint to base64 -w0 logo.png too (or base64 < logo.png | tr -d '\n' for portability across GNU/BSD).

{{- end }}
6 changes: 5 additions & 1 deletion charts/sus/templates/authelia/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ metadata:
app.kubernetes.io/component: authelia
data:
configuration.yml: |
theme: light
theme: {{ .Values.auth.authelia.branding.theme | default "light" }}
server:
address: 'tcp://:9091'
{{- if .Values.auth.authelia.branding.enabled }}
# Override the portal logo/favicon and text (see the -assets ConfigMap).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment from the earlier draft: the assets ConfigMap carries only logo.png, so neither the favicon nor the portal text is overridden here (the PR body says the text override was intentionally dropped). As written this sends a future reader looking for a locales/ entry that doesn't exist.

Suggested change
# Override the portal logo/favicon and text (see the -assets ConfigMap).
# Override the portal logo (see the -assets ConfigMap).

asset_path: /config/assets
{{- end }}
log:
level: info
totp:
Expand Down
16 changes: 16 additions & 0 deletions charts/sus/templates/authelia/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ spec:
# used — rotate/roll that yourself.)
checksum/authelia-config: {{ include (print $.Template.BasePath "/authelia/configmap.yaml") . | sha256sum }}
checksum/authelia-secret: {{ include (print $.Template.BasePath "/authelia/secret.yaml") . | sha256sum }}
{{- if .Values.auth.authelia.branding.enabled }}
checksum/authelia-assets: {{ include (print $.Template.BasePath "/authelia/assets-configmap.yaml") . | sha256sum }}
{{- end }}
spec:
containers:
- name: authelia
Expand Down Expand Up @@ -76,10 +79,23 @@ spec:
readOnly: true
- name: data
mountPath: /data
{{- if .Values.auth.authelia.branding.enabled }}
# subPath mount places the logo into the asset tree
# (server.asset_path = /config/assets) without shadowing the rest of it.
- name: assets
mountPath: /config/assets/logo.png
subPath: logo.png
readOnly: true
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "sus.authelia.fullname" . }}
{{- if .Values.auth.authelia.branding.enabled }}
- name: assets
configMap:
name: {{ include "sus.authelia.fullname" . }}-assets
{{- end }}
- name: users
secret:
secretName: {{ $secretName }}
Expand Down
10 changes: 10 additions & 0 deletions charts/sus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ auth:
# Pinned minor tag — Authelia's config schema is version-sensitive.
tag: "4.38"
pullPolicy: IfNotPresent
# -- Login-portal branding. Replaces Authelia's default icon with the SUS 🤨
# logo by default; the rest of the portal (including the "Sign in" text) is
# left as Authelia ships it.
branding:
enabled: true
# Portal color scheme: light | dark | grey | auto.
theme: light
Comment on lines +117 to +120

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor wiring surprise: theme sits under branding but is consumed unconditionally in configmap.yaml, so it still takes effect with branding.enabled: false. Confirmed via helm template --set auth.authelia.branding.enabled=false — the render drops the assets ConfigMap, the volume, and asset_path, but keeps theme. Either hoist theme up a level next to image, or note in the comment that it applies regardless of enabled (which reads as "logo override on/off").

Also worth a one-line note that Authelia only accepts light | dark | grey | auto — an invalid value passes helm template/helm lint and only fails at container startup with a config-validation error.

# -- Override the bundled 🤨 logo with your own PNG (base64-encoded, e.g.
# `base64 -i logo.png`). Empty = use the bundled SUS logo.
logoPngBase64: ""
# Memory limit must accommodate argon2id password verification, which is
# memory-hard by design (default parameters use 64MiB per concurrent login)
# on top of Authelia's baseline — too low a limit OOM-kills the container
Expand Down
Loading