diff --git a/charts/radar-appserver/Chart.yaml b/charts/radar-appserver/Chart.yaml index c128097..92a9df4 100644 --- a/charts/radar-appserver/Chart.yaml +++ b/charts/radar-appserver/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "2.4.3" description: A Helm chart for the backend application of RADAR-base Appserver name: radar-appserver -version: 0.5.2 +version: 0.6.0 icon: "http://radar-base.org/wp-content/uploads/2022/09/Logo_RADAR-Base-RGB.png" sources: - https://github.com/RADAR-base/radar-helm-charts/tree/main/charts/radar-appserver diff --git a/charts/radar-appserver/README.md b/charts/radar-appserver/README.md index d16e302..6ecb788 100644 --- a/charts/radar-appserver/README.md +++ b/charts/radar-appserver/README.md @@ -3,7 +3,7 @@ # radar-appserver [![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/radar-appserver)](https://artifacthub.io/packages/helm/radar-base/radar-appserver) -![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.4.3](https://img.shields.io/badge/AppVersion-2.4.3-informational?style=flat-square) +![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.4.3](https://img.shields.io/badge/AppVersion-2.4.3-informational?style=flat-square) A Helm chart for the backend application of RADAR-base Appserver @@ -93,3 +93,12 @@ A Helm chart for the backend application of RADAR-base Appserver | smtp.from | string | `"noreply@example.com"` | Email address which should be used to send activation emails | | smtp.starttls | bool | `false` | set to true,if TTLS should be enabled | | smtp.auth | bool | `true` | set to true, if the account should be authenticated before sending emails | +| upload.enabled | bool | `false` | if set to true, file upload endpoint will be enabled | +| upload.max_file_size | string | `"20MB"` | Maximum file size for upload | +| upload.storage.type | string | `"s3"` | Type of storage to use for file upload (s3) | +| upload.storage.url | string | `"http://minio-headless:9000"` | Internal url to storage | +| upload.storage.bucket_name | string | `"radar-output-storage"` | Bucket name of the S3 storage | +| upload.storage.access_key | string | `"secret"` | Access key of the S3 storage | +| upload.storage.secret_key | string | `"secret"` | Secret key of the S3 storage | +| upload.storage.path.prefix | string | `"output"` | Prefix for the path in the storage; will become //// | +| upload.storage.path.collection_per_day | bool | `false` | if set to true, a new folder will be created for each day | diff --git a/charts/radar-appserver/templates/deployment.yaml b/charts/radar-appserver/templates/deployment.yaml index b61ed23..202424e 100644 --- a/charts/radar-appserver/templates/deployment.yaml +++ b/charts/radar-appserver/templates/deployment.yaml @@ -107,6 +107,36 @@ spec: key: smtpPassword {{- end }} {{- end }} + {{- if .Values.upload.enabled }} + - name: RADAR_FILE_UPLOAD_ENABLED + value: {{ .Values.upload.enabled | quote }} + - name: SPRING_SERVLET_MULTIPART_MAXFILESIZE + value: {{ .Values.upload.max_file_size | quote }} + - name: SPRING_SERVLET_MULTIPART_ENABLED + value: "true" + - name: RADAR_STORAGE_TYPE + value: {{ .Values.upload.storage.type | quote }} + {{- if eq .Values.upload.storage.type "s3" }} + - name: RADAR_STORAGE_S3_URL + value: {{ .Values.upload.storage.url | quote }} + - name: RADAR_STORAGE_S3_BUCKETNAME + value: {{ .Values.upload.storage.bucket_name | quote }} + - name: RADAR_STORAGE_S3_PATH_PREFIX + value: {{ .Values.upload.storage.path.prefix | quote }} + - name: RADAR_STORAGE_S3_PATH_COLLECTPERDAY + value: {{ .Values.upload.storage.path.collection_per_day | quote }} + - name: RADAR_STORAGE_S3_ACCESSKEY + valueFrom: + secretKeyRef: + name: {{ template "radar-appserver.secretName" . }} + key: s3AccessKey + - name: RADAR_STORAGE_S3_SECRETKEY + valueFrom: + secretKeyRef: + name: {{ template "radar-appserver.secretName" . }} + key: s3SecretKey + {{- end }} + {{- end }} {{- with .Values.extraEnvVars }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/charts/radar-appserver/templates/secrets.yaml b/charts/radar-appserver/templates/secrets.yaml index 83a7707..18b377c 100644 --- a/charts/radar-appserver/templates/secrets.yaml +++ b/charts/radar-appserver/templates/secrets.yaml @@ -16,5 +16,9 @@ data: {{- if and .Values.smtp.enabled .Values.smtp.auth }} smtpUsername: {{ .Values.smtp.username | b64enc | quote }} smtpPassword: {{ .Values.smtp.password | b64enc | quote }} - {{ end }} -{{- end -}} + {{- end }} + {{- if and .Values.upload.enabled (eq .Values.upload.storage.type "s3") }} + s3AccessKey: {{ .Values.upload.storage.access_key | b64enc | quote }} + s3SecretKey: {{ .Values.upload.storage.secret_key | b64enc | quote }} + {{- end }} +{{- end }} diff --git a/charts/radar-appserver/values.yaml b/charts/radar-appserver/values.yaml index 6493fc5..72cf09d 100644 --- a/charts/radar-appserver/values.yaml +++ b/charts/radar-appserver/values.yaml @@ -234,3 +234,26 @@ smtp: starttls: false # -- set to true, if the account should be authenticated before sending emails auth: true + +upload: + # -- if set to true, file upload endpoint will be enabled + enabled: false + # -- Maximum file size for upload + max_file_size: "20MB" + # Settings for file storage + storage: + # -- Type of storage to use for file upload (s3) + type: s3 + # -- Internal url to storage + url: http://minio-headless:9000 + # -- Bucket name of the S3 storage + bucket_name: radar-output-storage + # -- Access key of the S3 storage + access_key: secret + # -- Secret key of the S3 storage + secret_key: secret + path: + # -- Prefix for the path in the storage; will become //// + prefix: output + # -- if set to true, a new folder will be created for each day + collection_per_day: false