diff --git a/charts/4allportal/Chart.yaml b/charts/4allportal/Chart.yaml index e6ebd7b4..f1eedab9 100644 --- a/charts/4allportal/Chart.yaml +++ b/charts/4allportal/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "3.10.37" description: A Helm chart for 4ALLPORTAL version 3.10.0 and up name: 4allportal -version: 19.3.1 +version: 19.3.2 icon: https://4allportal.com/wp-content/uploads/2022/07/cropped-4ap_logo.png keywords: - 4ALLPORTAL diff --git a/charts/4allportal/README.md b/charts/4allportal/README.md index d7515cb0..c9fd7d68 100644 --- a/charts/4allportal/README.md +++ b/charts/4allportal/README.md @@ -1,6 +1,6 @@ # 4allportal -![Version: 19.3.1](https://img.shields.io/badge/Version-19.3.1-informational?style=flat-square) ![AppVersion: 3.10.37](https://img.shields.io/badge/AppVersion-3.10.37-informational?style=flat-square) +![Version: 19.3.2](https://img.shields.io/badge/Version-19.3.2-informational?style=flat-square) ![AppVersion: 3.10.37](https://img.shields.io/badge/AppVersion-3.10.37-informational?style=flat-square) A Helm chart for 4ALLPORTAL version 3.10.0 and up diff --git a/charts/4allportal/templates/4allportal/deployment.yaml b/charts/4allportal/templates/4allportal/deployment.yaml index a97b132e..577d6ff5 100644 --- a/charts/4allportal/templates/4allportal/deployment.yaml +++ b/charts/4allportal/templates/4allportal/deployment.yaml @@ -142,6 +142,29 @@ spec: value: {{ .Values.fourAllPortal.mail.security | quote }} {{- end }} + {{- if .Values.fourAllPortal.database.operator.enabled }} + - name: DATABASE_USER + value: {{ required "You must set a database user when using the operator." .Values.fourAllPortal.database.operator.user | quote }} + - name: DATABASE_PASSWORD + value: {{ required "You must set a user password when using the operator." .Values.fourAllPortal.database.operator.password | quote }} + - name: DATABASE_TYPE + valueFrom: + configMapKeyRef: + name: {{ .Values.fourAllPortal.database.operator.databaseRef }}-configmap + key: "DATABASE_TYPE" + - name: DATABASE_HOST + valueFrom: + configMapKeyRef: + name: {{ .Values.fourAllPortal.database.operator.databaseRef }}-configmap + key: "DATABASE_HOST" + - name: DATABASE_PORT + valueFrom: + configMapKeyRef: + name: {{ .Values.fourAllPortal.database.operator.databaseRef }}-configmap + key: "DATABASE_PORT" + - name: DATABASE_DATABASE_NAME + value: {{ required "You must set a database name when using the operator." .Values.fourAllPortal.database.operator.databaseName | quote }} + {{ else }} - name: DATABASE_USER value: {{ include "4allportal.fourallportal.database.user" . | quote }} - name: DATABASE_PASSWORD @@ -157,6 +180,7 @@ spec: value: {{ include "4allportal.fourallportal.database.port" . | quote }} - name: DATABASE_DATABASE_NAME value: {{ include "4allportal.fourallportal.database.name" . | quote }} + {{- end }} - name: DATABASE_INITIAL_POOL_SIZE value: {{ .Values.fourAllPortal.database.initialPoolSize | quote }} - name: DATABASE_MAX_IDLE_TIME diff --git a/charts/4allportal/templates/webdav/configmap.yaml b/charts/4allportal/templates/webdav/configmap.yaml index 3a0246ea..c10325e5 100644 --- a/charts/4allportal/templates/webdav/configmap.yaml +++ b/charts/4allportal/templates/webdav/configmap.yaml @@ -129,81 +129,81 @@ data: BrowserMatch "^gvfs" redirect-carefully BrowserMatch "WebDAVLib" redirect-carefully {{- if $.Values.webdav.events.enabled }} -log-handler.sh: | - #!/bin/ash - MOUNT_POINT="{{ $.Values.webdav.events.mountPath }}" - MOUNT_POINT_LEN=$(echo "$MOUNT_POINT" | awk '{print length($1) + 1;}') - - while IFS= read -r line; do - status=$(echo "$line" | cut -d';' -f1) - type=$(echo "$line" | cut -d';' -f2) - path=$(echo "$line" | cut -d';' -f3) - dest=$(echo "$line" | cut -d';' -f4 | awk '{ - i = index($1,"/webdav/"); - out = substr($1, i); - for (i = 0x20; i < 0x40; ++i) { - repl = sprintf("%c", i); - if ((repl == "&") || (repl == "\\")) { - repl = "\\" repl; - } - out = gensub(sprintf("%%%02X", i), repl, "g", out); - out = gensub(sprintf("%%%02x", i), repl, "g", out); - }; - out = gensub(/\"/, "\\\"", "g", out); - print out}') - - matched=$(expr match "${path}" "$MOUNT_POINT.*") - if [ \( "${type}" == "PUT" -o "${type}" == "DELETE" -o "${type}" == "MKCOL" -o "${type}" == "MOVE" -o "${type}" == "COPY" \) -a ${matched} != 0 ] - then - path=$(echo "$path" | cut -c ${MOUNT_POINT_LEN}- ) - if [ "${dest}" != "-" -a "${dest}" != "" ] - then - dest=$(echo "$dest" | cut -c ${MOUNT_POINT_LEN}- ) - fi - - lastChar=$(echo "$path" | awk '{print substr($0,length,1)}') - if [ "$lastChar" = "/" ] - then - path=$(echo "$path" | awk '{print substr($0,0,length($0)-1)}') - fi - - OP="UNKNOWN" - if [ "${status}" == "201" -a "${type}" == "PUT" ] - then - OP="CREATE" - elif [ "${status}" == "201" -a "${type}" == "MKCOL" ] - then - OP="CREATE" - elif [ "${status}" == "201" -a "${type}" == "MOVE" ] - then - OP="MOVE" - elif [ "${status}" == "201" -a "${type}" == "COPY" ] - then - OP="CREATE" - elif [ "${status}" == "204" -a "${type}" == "PUT" ] - then - OP="UPDATE" - elif [ "${status}" == "204" -a "${type}" == "DELETE" ] - then - OP="DELETE" - fi - BODY="{}" - ENDPOINT="http://{{ include "common.names.fullname" . }}-backend/api/extensions/dam/mounts/${MOUNT_POINT}/events/${type}" - if [ "${dest}" == "-" -o "${dest}" == "" ] + log-handler.sh: | + #!/bin/ash + MOUNT_POINT="{{ $.Values.webdav.events.mountPath }}" + MOUNT_POINT_LEN=$(echo "$MOUNT_POINT" | awk '{print length($1) + 1;}') + + while IFS= read -r line; do + status=$(echo "$line" | cut -d';' -f1) + type=$(echo "$line" | cut -d';' -f2) + path=$(echo "$line" | cut -d';' -f3) + dest=$(echo "$line" | cut -d';' -f4 | awk '{ + i = index($1,"/webdav/"); + out = substr($1, i); + for (i = 0x20; i < 0x40; ++i) { + repl = sprintf("%c", i); + if ((repl == "&") || (repl == "\\")) { + repl = "\\" repl; + } + out = gensub(sprintf("%%%02X", i), repl, "g", out); + out = gensub(sprintf("%%%02x", i), repl, "g", out); + }; + out = gensub(/\"/, "\\\"", "g", out); + print out}') + + matched=$(expr match "${path}" "$MOUNT_POINT.*") + if [ \( "${type}" == "PUT" -o "${type}" == "DELETE" -o "${type}" == "MKCOL" -o "${type}" == "MOVE" -o "${type}" == "COPY" \) -a ${matched} != 0 ] then - BODY="{\"path\":\"${path}\"}" - echo "Send notification to ${ENDPOINT}: ${BODY}" > /proc/self/fd/1 - else - BODY="{\"path\":\"${path}\",\"destination\":\"${dest}\"}" - echo "Send notification to ${ENDPOINT}: ${BODY}" > /proc/self/fd/1 + path=$(echo "$path" | cut -c ${MOUNT_POINT_LEN}- ) + if [ "${dest}" != "-" -a "${dest}" != "" ] + then + dest=$(echo "$dest" | cut -c ${MOUNT_POINT_LEN}- ) + fi + + lastChar=$(echo "$path" | awk '{print substr($0,length,1)}') + if [ "$lastChar" = "/" ] + then + path=$(echo "$path" | awk '{print substr($0,0,length($0)-1)}') + fi + + OP="UNKNOWN" + if [ "${status}" == "201" -a "${type}" == "PUT" ] + then + OP="CREATE" + elif [ "${status}" == "201" -a "${type}" == "MKCOL" ] + then + OP="CREATE" + elif [ "${status}" == "201" -a "${type}" == "MOVE" ] + then + OP="MOVE" + elif [ "${status}" == "201" -a "${type}" == "COPY" ] + then + OP="CREATE" + elif [ "${status}" == "204" -a "${type}" == "PUT" ] + then + OP="UPDATE" + elif [ "${status}" == "204" -a "${type}" == "DELETE" ] + then + OP="DELETE" + fi + BODY="{}" + ENDPOINT="http://{{ include "common.names.fullname" . }}-backend/api/extensions/dam/mounts/${MOUNT_POINT}/events/${type}" + if [ "${dest}" == "-" -o "${dest}" == "" ] + then + BODY="{\"path\":\"${path}\"}" + echo "Send notification to ${ENDPOINT}: ${BODY}" > /proc/self/fd/1 + else + BODY="{\"path\":\"${path}\",\"destination\":\"${dest}\"}" + echo "Send notification to ${ENDPOINT}: ${BODY}" > /proc/self/fd/1 + fi + RES_CODE=$(curl -X POST -sw "%{http_code}\n" \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer { {{ include "4allportal.fourAllPortal.systemApiKey" . }} }" + -d "$BODY" \ + --connect-timeout 1 -o /dev/null ${ENDPOINT}) + echo "Response status: ${RES_CODE}" > /proc/self/fd/1 fi - RES_CODE=$(curl -X POST -sw "%{http_code}\n" \ - -H 'Content-Type: application/json' \ - -H "Authorization: Bearer { {{ include "4allportal.fourAllPortal.systemApiKey" . }} }" - -d "$BODY" \ - --connect-timeout 1 -o /dev/null ${ENDPOINT}) - echo "Response status: ${RES_CODE}" > /proc/self/fd/1 - fi - done + done {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/4allportal/values.schema.json b/charts/4allportal/values.schema.json index f7f6e7cf..00611331 100644 --- a/charts/4allportal/values.schema.json +++ b/charts/4allportal/values.schema.json @@ -109,33 +109,35 @@ "existing": { "type": "object" } + }, + { + "operator": { + "type": "object", + "description": "Options for the Credentials Operator", + "properties": { + "enabled": { + "type": "boolean", + "default": false + }, + "user": { + "type": "string" + }, + "password": { + "type": "string" + }, + "databaseName": { + "type": "string" + }, + "databaseRef": { + "type": "string" + } + } + } } ] }, { "properties": { - "operator": { - "type": "object", - "description": "Options for the Credentials Operator", - "properties": { - "enabled": { - "type": "boolean", - "default": false - }, - "user": { - "type": "string" - }, - "password": { - "type": "string" - }, - "databaseName": { - "type": "string" - }, - "databaseRef": { - "type": "string" - } - } - }, "acquireIncrement": { "type": "integer" }, @@ -391,7 +393,7 @@ "maxscale": { "type": "object", "description": "Refer to https://raw.githubusercontent.com/4ALLPORTAL/helm-charts/main/charts/maxscale/values.schema.json", - "$ref": "https://raw.githubusercontent.com/4ALLPORTAL/helm-charts/main/charts/maxscale/values.schema.json" + "$ref": "https://raw.githubusercontent.com/4ALLPORTAL/helm-charts/main/charts/maxscale/values.schema.json" }, "dreiDRenderer": { "type": "object",