✨(helm) allow to load custom theme file in a configMap
In order to load a custom theme file with our helm chart, we allow to load the content of a file into a config map and then use this configmap as a volume in the backend deployment
This commit is contained in:
@@ -87,10 +87,6 @@ RUN wget https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
|
|||||||
# Copy entrypoint
|
# Copy entrypoint
|
||||||
COPY ./docker/files/usr/local/bin/entrypoint /usr/local/bin/entrypoint
|
COPY ./docker/files/usr/local/bin/entrypoint /usr/local/bin/entrypoint
|
||||||
|
|
||||||
# Copy configuration
|
|
||||||
VOLUME [ "/configuration" ]
|
|
||||||
COPY ./configuration /configuration
|
|
||||||
|
|
||||||
# Give the "root" group the same permissions as the "root" user on /etc/passwd
|
# Give the "root" group the same permissions as the "root" user on /etc/passwd
|
||||||
# to allow a user belonging to the root group to add new users; typically the
|
# to allow a user belonging to the root group to add new users; typically the
|
||||||
# docker user (see entrypoint).
|
# docker user (see entrypoint).
|
||||||
|
|||||||
@@ -87,6 +87,10 @@ backend:
|
|||||||
python manage.py createsuperuser --email admin@example.com --password admin
|
python manage.py createsuperuser --email admin@example.com --password admin
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
|
||||||
|
themeCustomization:
|
||||||
|
enabled: true
|
||||||
|
file_content: {{ readFile "./configuration/theme/demo.json" }}
|
||||||
|
|
||||||
# Extra volume mounts to manage our local custom CA and avoid to set ssl_verify: false
|
# Extra volume mounts to manage our local custom CA and avoid to set ssl_verify: false
|
||||||
extraVolumeMounts:
|
extraVolumeMounts:
|
||||||
- name: certs
|
- name: certs
|
||||||
@@ -101,7 +105,6 @@ backend:
|
|||||||
items:
|
items:
|
||||||
- key: cacert.pem
|
- key: cacert.pem
|
||||||
path: cacert.pem
|
path: cacert.pem
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
envVars:
|
envVars:
|
||||||
PORT: 8080
|
PORT: 8080
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
### General configuration
|
### General configuration
|
||||||
|
|
||||||
| Name | Description | Value |
|
| Name | Description | Value |
|
||||||
| -------------------------------------------------------------------------------------- | ---------------------------------------------------- | -------------------------------------------------------------------- |
|
| ----------------------------------------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------ |
|
||||||
| `image.repository` | Repository to use to pull impress's container image | `lasuite/impress-backend` |
|
| `image.repository` | Repository to use to pull impress's container image | `lasuite/impress-backend` |
|
||||||
| `image.tag` | impress's container tag | `latest` |
|
| `image.tag` | impress's container tag | `latest` |
|
||||||
| `image.pullPolicy` | Container image pull policy | `IfNotPresent` |
|
| `image.pullPolicy` | Container image pull policy | `IfNotPresent` |
|
||||||
@@ -35,8 +35,6 @@
|
|||||||
| `ingressCollaborationWS.tls.additional[].secretName` | Secret name for additional TLS config | |
|
| `ingressCollaborationWS.tls.additional[].secretName` | Secret name for additional TLS config | |
|
||||||
| `ingressCollaborationWS.tls.additional[].hosts[]` | Hosts for additional TLS config | |
|
| `ingressCollaborationWS.tls.additional[].hosts[]` | Hosts for additional TLS config | |
|
||||||
| `ingressCollaborationWS.customBackends` | Add custom backends to ingress | `[]` |
|
| `ingressCollaborationWS.customBackends` | Add custom backends to ingress | `[]` |
|
||||||
| `ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/auth-response-headers` | | `Authorization, X-Can-Edit, X-User-Id` |
|
|
||||||
| `ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/auth-url` | | `https://impress.example.com/api/v1.0/documents/collaboration-auth/` |
|
|
||||||
| `ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/enable-websocket` | | `true` |
|
| `ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/enable-websocket` | | `true` |
|
||||||
| `ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/proxy-read-timeout` | | `86400` |
|
| `ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/proxy-read-timeout` | | `86400` |
|
||||||
| `ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/proxy-send-timeout` | | `86400` |
|
| `ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/proxy-send-timeout` | | `86400` |
|
||||||
@@ -73,6 +71,8 @@
|
|||||||
| `ingressMedia.annotations.nginx.ingress.kubernetes.io/auth-url` | | `https://impress.example.com/api/v1.0/documents/media-auth/` |
|
| `ingressMedia.annotations.nginx.ingress.kubernetes.io/auth-url` | | `https://impress.example.com/api/v1.0/documents/media-auth/` |
|
||||||
| `ingressMedia.annotations.nginx.ingress.kubernetes.io/auth-response-headers` | | `Authorization, X-Amz-Date, X-Amz-Content-SHA256` |
|
| `ingressMedia.annotations.nginx.ingress.kubernetes.io/auth-response-headers` | | `Authorization, X-Amz-Date, X-Amz-Content-SHA256` |
|
||||||
| `ingressMedia.annotations.nginx.ingress.kubernetes.io/upstream-vhost` | | `minio.impress.svc.cluster.local:9000` |
|
| `ingressMedia.annotations.nginx.ingress.kubernetes.io/upstream-vhost` | | `minio.impress.svc.cluster.local:9000` |
|
||||||
|
| `ingressMedia.annotations.nginx.ingress.kubernetes.io/configuration-snippet` | | `add_header Content-Security-Policy "default-src 'none'" always;
|
||||||
|
` |
|
||||||
| `serviceMedia.host` | | `minio.impress.svc.cluster.local` |
|
| `serviceMedia.host` | | `minio.impress.svc.cluster.local` |
|
||||||
| `serviceMedia.port` | | `9000` |
|
| `serviceMedia.port` | | `9000` |
|
||||||
| `serviceMedia.annotations` | | `{}` |
|
| `serviceMedia.annotations` | | `{}` |
|
||||||
@@ -132,6 +132,8 @@
|
|||||||
| `backend.extraVolumeMounts` | Additional volumes to mount on the backend. | `[]` |
|
| `backend.extraVolumeMounts` | Additional volumes to mount on the backend. | `[]` |
|
||||||
| `backend.extraVolumes` | Additional volumes to mount on the backend. | `[]` |
|
| `backend.extraVolumes` | Additional volumes to mount on the backend. | `[]` |
|
||||||
| `backend.pdb.enabled` | Enable pdb on backend | `true` |
|
| `backend.pdb.enabled` | Enable pdb on backend | `true` |
|
||||||
|
| `backend.themeCustomization.enabled` | Enable theme customization | `false` |
|
||||||
|
| `backend.themeCustomization.file_content` | Content of the theme customization file. Must be a json object. | `""` |
|
||||||
|
|
||||||
### frontend
|
### frontend
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,11 @@ spec:
|
|||||||
subPath: {{ .subPath | default "" }}
|
subPath: {{ .subPath | default "" }}
|
||||||
readOnly: {{ .readOnly }}
|
readOnly: {{ .readOnly }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.backend.themeCustomization.enabled }}
|
||||||
|
- name: theme-customization
|
||||||
|
mountPath: {{ .Values.backend.themeCustomization.mount_path }}
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.backend.nodeSelector }}
|
{{- with .Values.backend.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
@@ -117,6 +122,11 @@ spec:
|
|||||||
claimName: "{{ $fullName }}-{{ $name }}"
|
claimName: "{{ $fullName }}-{{ $name }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.backend.themeCustomization.enabled }}
|
||||||
|
- name: theme-customization
|
||||||
|
configMap:
|
||||||
|
name: docs-theme-customization
|
||||||
|
{{- end }}
|
||||||
{{- range .Values.backend.extraVolumes }}
|
{{- range .Values.backend.extraVolumes }}
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
{{- if .existingClaim }}
|
{{- if .existingClaim }}
|
||||||
|
|||||||
10
src/helm/impress/templates/theme_customization_file_cm.yaml
Normal file
10
src/helm/impress/templates/theme_customization_file_cm.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{{- if .Values.backend.themeCustomization.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: docs-theme-customization
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
data:
|
||||||
|
default.json: |
|
||||||
|
{{ .Values.backend.themeCustomization.file_content | toJson | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
@@ -162,6 +162,7 @@ ingressMedia:
|
|||||||
## @param ingressMedia.annotations.nginx.ingress.kubernetes.io/auth-url
|
## @param ingressMedia.annotations.nginx.ingress.kubernetes.io/auth-url
|
||||||
## @param ingressMedia.annotations.nginx.ingress.kubernetes.io/auth-response-headers
|
## @param ingressMedia.annotations.nginx.ingress.kubernetes.io/auth-response-headers
|
||||||
## @param ingressMedia.annotations.nginx.ingress.kubernetes.io/upstream-vhost
|
## @param ingressMedia.annotations.nginx.ingress.kubernetes.io/upstream-vhost
|
||||||
|
## @param ingressMedia.annotations.nginx.ingress.kubernetes.io/configuration-snippet
|
||||||
annotations:
|
annotations:
|
||||||
nginx.ingress.kubernetes.io/auth-url: https://impress.example.com/api/v1.0/documents/media-auth/
|
nginx.ingress.kubernetes.io/auth-url: https://impress.example.com/api/v1.0/documents/media-auth/
|
||||||
nginx.ingress.kubernetes.io/auth-response-headers: "Authorization, X-Amz-Date, X-Amz-Content-SHA256"
|
nginx.ingress.kubernetes.io/auth-response-headers: "Authorization, X-Amz-Date, X-Amz-Content-SHA256"
|
||||||
@@ -310,6 +311,16 @@ backend:
|
|||||||
pdb:
|
pdb:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
## @param backend.themeCustomization.enabled Enable theme customization
|
||||||
|
## @param backend.themeCustomization.file_content Content of the theme customization file. Must be a json object.
|
||||||
|
## @param backend.themeCustomization.mount_path Path where the customization file will be mounted in the backend deployment.
|
||||||
|
themeCustomization:
|
||||||
|
enabled: false
|
||||||
|
file_content: ""
|
||||||
|
mount_path: /app/configuration/theme/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## @section frontend
|
## @section frontend
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
|
|||||||
Reference in New Issue
Block a user