webdav: allow modifying the request body limit (#2479)

* webdav: allow modifying the request body limit

* update description
This commit is contained in:
Stavros Kois
2024-05-16 12:51:21 +03:00
committed by GitHub
parent 10ca3f15fd
commit 7791659812
4 changed files with 15 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ description: WebDAV is a set of extensions to the HTTP protocol which allows use
annotations:
title: WebDAV
type: application
version: 1.0.23
version: 1.0.24
apiVersion: v2
appVersion: 2.4.59
kubeVersion: '>=1.16.0-0'

View File

@@ -17,6 +17,7 @@ webdavStorage:
description: My third disabled share
hostPath: /mnt/{{.Release.Name }}/share3
readOnly: true
maxRequestBodySizeInGB: 10
fixPermissions: false
webdavNetwork:

View File

@@ -180,8 +180,8 @@ questions:
Example: [share1] will be available at [http://<webdav-ip>:<webdav-port>/share1]
schema:
type: string
valid_chars: '^[a-zA-Z0-9_-]+$'
valid_chars_error: 'Share name can only consist of [Letters(a-z, A-Z), Numbers(0-9), Underscores(_), Dashes(-)]'
valid_chars: "^[a-zA-Z0-9_-]+$"
valid_chars_error: "Share name can only consist of [Letters(a-z, A-Z), Numbers(0-9), Underscores(_), Dashes(-)]"
required: true
- variable: description
label: Description
@@ -203,6 +203,15 @@ questions:
schema:
type: boolean
default: false
- variable: maxRequestBodySizeInGB
label: Max Request Body Size (in GB)
description: |
The maximum size of the request body in GB.
If the request body size exceeds this value, the request will fail.
Value of 0 means no limit.
schema:
type: int
default: 1
- variable: fixPermissions
label: Fix Permissions
description: |

View File

@@ -39,11 +39,13 @@ DavLockDB "/usr/local/apache2/var/DavLock"
Options Indexes FollowSymLinks
</Directory>
{{- range .Values.webdavStorage.shares }}
{{ $bytesGB := 1073741824 }}
{{- if .enabled }}
# WebDav Share - {{ .name }}
# Description: {{ .description }}
Alias /{{ .name }} "/{{ include "webdav.shares.prefix" $ }}/{{ .name }}"
<Directory "/{{ include "webdav.shares.prefix" $ }}/{{ .name }}">
LimitRequestBody {{ mul (.maxRequestBodySizeInGB | default 1) $bytesGB }}
</Directory>
{{- if .readOnly }}
<Location "/{{ .name }}">