diff --git a/charts/planka/README.md b/charts/planka/README.md index 66dc44e3..142a3f9b 100644 --- a/charts/planka/README.md +++ b/charts/planka/README.md @@ -227,6 +227,28 @@ extraEnv: key: api-key ``` +### Custom Terms of Service + +You can provide your own End User Terms of Service by passing the markdown files directly via `values.yaml` in the `terms` configuration block. This automates the creation of a corresponding ConfigMap and volume mount. + +```yaml +terms: + enabled: true + customFiles: + en-US.md: | + # End User Terms of Service + ... + [confirmations]:: + --- + ✔️ **I have read and accept these End User Terms of Service** + de-DE.md: | + # Nutzungsbedingungen + ... + [confirmations]:: + --- + ✔️ **Ich habe diese Nutzungsbedingungen gelesen und akzeptiere sie** +``` + ### Image Digest Pinning For enhanced security and reproducibility, you can pin the container image using its SHA256 digest instead of relying solely on tags. This ensures you always deploy the exact same image, preventing tag mutations or accidental updates. @@ -291,3 +313,4 @@ image: ### Complete Example See `values-example.yaml` for a comprehensive example that demonstrates all the advanced features including OIDC configuration with custom CA certificates. +```` diff --git a/charts/planka/templates/configmap-terms.yaml b/charts/planka/templates/configmap-terms.yaml new file mode 100644 index 00000000..02f810ea --- /dev/null +++ b/charts/planka/templates/configmap-terms.yaml @@ -0,0 +1,13 @@ +{{- if .Values.terms.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "planka.fullname" . }}-terms + labels: + {{- include "planka.labels" . | nindent 4 }} +data: + {{- range $key, $value := .Values.terms.customFiles }} + {{ $key }}: | + {{- $value | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/planka/templates/deployment.yaml b/charts/planka/templates/deployment.yaml index 2dcffb9c..63fdecb5 100644 --- a/charts/planka/templates/deployment.yaml +++ b/charts/planka/templates/deployment.yaml @@ -77,6 +77,10 @@ spec: subPath: tmp name: emptydir {{- end }} + {{- if .Values.terms.enabled }} + - mountPath: /app/terms/custom + name: planka-terms + {{- end }} {{- /* Extra volume mounts */}} {{- range .Values.extraMounts }} - name: {{ .name }} @@ -222,6 +226,11 @@ spec: {{- if .Values.securityContext.readOnlyRootFilesystem }} - name: emptydir emptyDir: {} + {{- end }} + {{- if .Values.terms.enabled }} + - name: planka-terms + configMap: + name: {{ include "planka.fullname" . }}-terms {{- end }} {{- /* Extra volumes */}} {{- range .Values.extraMounts }} diff --git a/charts/planka/values.yaml b/charts/planka/values.yaml index 5e84065f..9cc38696 100644 --- a/charts/planka/values.yaml +++ b/charts/planka/values.yaml @@ -248,6 +248,22 @@ extraEnv: [] ## - name: SMTP_FROM ## value: "your_email@example.com" +## End User Terms of Service configuration +## Mount custom terms of service markdown files into the Planka deployment +## +terms: + enabled: false + # Provide individual language files as key-value pairs + # e.g., + # customFiles: + # en-US.md: | + # # End User Terms of Service + # ... + # de-DE.md: | + # # Nutzungsbedingungen + # ... + customFiles: {} + ## Extra volume mounts configuration ## Mount ConfigMaps, Secrets, and arbitrary volumes to the PLANKA container ## This allows mounting any pre-existing ConfigMaps, Secrets, or other volume types diff --git a/server/api/hooks/terms/index.js b/server/api/hooks/terms/index.js index 5295fa17..ef11e220 100644 --- a/server/api/hooks/terms/index.js +++ b/server/api/hooks/terms/index.js @@ -32,7 +32,9 @@ module.exports = function defineTermsHook(sails) { }); return entries - .filter((entry) => entry.isFile() && path.extname(entry.name) === '.md') + .filter( + (entry) => (entry.isFile() || entry.isSymbolicLink()) && path.extname(entry.name) === '.md', + ) .map((entry) => path.basename(entry.name, '.md')) .sort(); };