Compare commits

...

7 Commits

Author SHA1 Message Date
Kjeld Schouten
73714a029e Update charts/incubator/webdav/values.yaml
Signed-off-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
2023-05-24 19:51:49 +02:00
Kjeld Schouten
42a69014f0 Update charts/incubator/webdav/values.yaml
Signed-off-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
2023-05-24 19:51:49 +02:00
Kjeld Schouten
4b8e8108b0 Update _helper.tpl
Signed-off-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
2023-05-24 19:51:49 +02:00
Kjeld Schouten
30bfeecc4c Update values.yaml
Signed-off-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
2023-05-24 19:51:49 +02:00
Kjeld Schouten
33ce8cbdd2 Update _webdav.tpl
Signed-off-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
2023-05-24 19:51:49 +02:00
Kjeld Schouten
0d5fcdaaa0 Update charts/incubator/webdav/values.yaml
Signed-off-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
2023-05-24 19:51:49 +02:00
Kjeld Schouten-Lebbing
6f07719d24 add(webdav): add webdav chart 2023-05-24 19:51:49 +02:00
14 changed files with 694 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
apiVersion: v2
appVersion: "1.1.3.2982"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 12.8.1
deprecated: false
description: WebDAV is a set of extensions to the HTTP protocol which allows users to collaboratively edit and manage files on remote web servers.
home: https://truecharts.org/charts/incubator/webdav
icon: https://truecharts.org/img/hotlink-ok/chart-icons/webdav-logo.jpg
keywords:
- webdav
- file-sharing
kubeVersion: ">=1.16.0-0"
maintainers:
- email: info@truecharts.org
name: TrueCharts
url: https://truecharts.org
name: webdav
sources:
- http://www.webdav.org/
- https://github.com/truenas/charts/tree/master/community/webdav
type: application
version: 7.0.35
annotations:
truecharts.org/catagories: |
- metrics
truecharts.org/SCALE-support: "true"
truecharts.org/grade: U

View File

@@ -0,0 +1,9 @@
# WebDAV
[WebDAV](http://webdav.org/) is a set of extensions to the HTTP protocol which allows users to collaboratively edit and manage files on remote web servers.
> When application is installed and `Fix Permissions` is selected on at least 1 share
> a container will be launched with **root** privileges. This is required in order to apply
> the correct permissions to the selected `WebDAV` shares/directories.
> Afterward, the `WebDAV` container will run as a **non**-root user (Default: `568`).
> Note that `chown` will only apply if the parent directory does not match the configured user and group.

View File

@@ -0,0 +1,33 @@
webdavStorage:
shares:
- name: share1
enabled: true
description: My first share
hostPath: /mnt/{{.Release.Name }}/share1
readOnly: true
fixPermissions: true
- name: share2
enabled: true
description: My second share
hostPath: /mnt/{{.Release.Name }}/share2
readOnly: false
fixPermissions: true
- name: share3
enabled: false
description: My third disabled share
hostPath: /mnt/{{.Release.Name }}/share3
readOnly: true
fixPermissions: false
webdavNetwork:
http: true
httpPort: 30000
webdavRunAs:
user: 1000
group: 1000
webdavConfig:
authType: basic
username: some-username
password: some-secret-password

View File

@@ -0,0 +1,29 @@
webdavStorage:
shares:
- name: share1
enabled: true
description: My first share
hostPath: /mnt/{{.Release.Name }}/share1
readOnly: true
fixPermissions: true
- name: share2
enabled: true
description: My second share
hostPath: /mnt/{{.Release.Name }}/share2
readOnly: false
fixPermissions: true
- name: share3
enabled: false
description: My third disabled share
hostPath: /mnt/{{.Release.Name }}/share3
readOnly: true
fixPermissions: false
webdavNetwork:
http: true
httpPort: 30000
webdavConfig:
authType: basic
username: some-username
password: some-secret-password

View File

@@ -0,0 +1,28 @@
webdavStorage:
shares:
- name: share1
enabled: true
description: My first share
hostPath: /mnt/{{.Release.Name }}/share1
readOnly: true
fixPermissions: true
- name: share2
enabled: true
description: My second share
hostPath: /mnt/{{.Release.Name }}/share2
readOnly: false
fixPermissions: true
- name: share3
enabled: false
description: My third disabled share
hostPath: /mnt/{{.Release.Name }}/share3
readOnly: true
fixPermissions: false
webdavNetwork:
http: true
httpPort: 30000
webdavRunAs:
user: 1000
group: 1000

View File

@@ -0,0 +1,24 @@
webdavStorage:
shares:
- name: share1
enabled: true
description: My first share
hostPath: /mnt/{{.Release.Name }}/share1
readOnly: true
fixPermissions: true
- name: share2
enabled: true
description: My second share
hostPath: /mnt/{{.Release.Name }}/share2
readOnly: false
fixPermissions: true
- name: share3
enabled: false
description: My third disabled share
hostPath: /mnt/{{.Release.Name }}/share3
readOnly: true
fixPermissions: false
webdavNetwork:
http: true
httpPort: 30000

View File

@@ -0,0 +1,171 @@
# Include{groups}
portals:
open:
# Include{portalLink}
questions:
# Include{global}
# Include{workload}
# Include{workloadDeployment}
# Include{replicas1}
# Include{podSpec}
# Include{containerMain}
- variable: env
group: "App Configuration"
label: "Image Environment"
schema:
additional_attrs: true
type: dict
attrs:
- variable: GF_SECURITY_ADMIN_USER
label: "Admin User"
schema:
type: string
required: true
default: "admin"
- variable: GF_SECURITY_ADMIN_PASSWORD
label: "Admin Password"
schema:
type: string
required: true
private: true
default: "REPLACETHIS"
- variable: GF_INSTALL_PLUGINS
label: "Extra Plugins to Install"
description: "comma seperated"
schema:
type: string
default: ""
- variable: GF_AUTH_LDAP_ENABLED
label: "enable LDAP"
schema:
type: boolean
default: false
- variable: GF_AUTH_LDAP_ALLOW_SIGN_UP
label: "Allow LDAP Signup"
schema:
type: boolean
default: false
- variable: GF_AUTH_LDAP_CONFIG_FILE
label: "LDAP Config Path"
schema:
type: string
default: "/opt/bitnami/grafana/conf/ldap.toml"
# Include{containerBasic}
# Include{containerAdvanced}
- variable: webdavConfig
label: "WebDev Configuration"
group: App Configuration
schema:
type: dict
attrs:
- variable: authType
label: Authentication Type
description: Select the authentication type for WebDAV.
schema:
type: string
default: "none"
enum:
- value: "none"
description: No Authentication
- value: "basic"
description: Basic Authentication
- variable: username
label: Username
description: The username for basic authentication.
schema:
type: string
show_if: [["authType", "=", "basic"]]
required: true
- variable: password
label: Password
description: The password for basic authentication.
schema:
type: string
show_if: [["authType", "=", "basic"]]
required: true
# Include{containerConfig}
# Include{podOptions}
# Include{serviceRoot}
- variable: main
label: "Main Service"
description: "The Primary service on which the healthcheck runs, often the webUI"
schema:
additional_attrs: true
type: dict
attrs:
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
- variable: main
label: "Main Service Port Configuration"
schema:
additional_attrs: true
type: dict
attrs:
- variable: port
label: "Port"
description: "This port exposes the container port on the service"
schema:
type: int
default: 10038
required: true
# Include{serviceExpertRoot}
default: false
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceRoot}
- variable: config
label: "App Config Storage"
description: "Stores the Application Configuration."
schema:
additional_attrs: true
type: dict
attrs:
# Include{persistenceBasic}
# Include{persistenceList}
# Include{ingressRoot}
- variable: main
label: "Main Ingress"
schema:
additional_attrs: true
type: dict
attrs:
# Include{ingressDefault}
# Include{ingressTLS}
# Include{ingressTraefik}
# Include{ingressList}
# Include{securityContextRoot}
- variable: runAsUser
label: "runAsUser"
description: "The UserID of the user running the application"
schema:
type: int
default: 568
- variable: runAsGroup
label: "runAsGroup"
description: "The groupID of the user running the application"
schema:
type: int
default: 568
# Include{securityContextContainer}
# Include{securityContextAdvanced}
# Include{securityContextPod}
- variable: fsGroup
label: "fsGroup"
description: "The group that should own ALL storage."
schema:
type: int
default: 568
# Include{resources}
# Include{metrics}
# Include{prometheusRule}
# Include{advanced}
# Include{addons}
# Include{codeserver}
# Include{netshoot}
# Include{vpn}
# Include{documentation}

View File

@@ -0,0 +1 @@
{{ include "tc.v1.common.lib.chart.notes" $ }}

View File

@@ -0,0 +1,146 @@
{{- define "webdav.configuration" -}}
{{- include "webdav.validation" $ }}
{{- if ne .Values.webdavConfig.authType "none" }}
secret:
htauth:
enabled: true
data:
htauth: |
{{- include "webdav.htauth" $ | nindent 8 }}
{{- end }}
configmap:
config:
enabled: true
data:
{{- if ne .Values.webdavConfig.authType "none" }}
htauth: |
{{- include "webdav.htauth" $ | nindent 8 }}
{{- end }}
webdav.conf: |
{{- include "webdav.http.config" $ | nindent 8 }}
{{- $modulePath := "/usr/local/apache2/modules" }}
httpd.conf: |
# This path is a emptyDir in memory
PidFile "/usr/local/apache2/var/httpd.pid"
# The absolutely necessary modules
LoadModule authn_file_module {{ $modulePath }}/mod_authn_file.so
LoadModule authn_core_module {{ $modulePath }}/mod_authn_core.so
LoadModule authz_user_module {{ $modulePath }}/mod_authz_user.so
LoadModule authz_core_module {{ $modulePath }}/mod_authz_core.so
LoadModule alias_module {{ $modulePath }}/mod_alias.so
LoadModule mpm_event_module {{ $modulePath }}/mod_mpm_event.so
LoadModule auth_basic_module {{ $modulePath }}/mod_auth_basic.so
LoadModule auth_digest_module {{ $modulePath }}/mod_auth_digest.so
LoadModule setenvif_module {{ $modulePath }}/mod_setenvif.so
LoadModule dav_module {{ $modulePath }}/mod_dav.so
LoadModule dav_fs_module {{ $modulePath }}/mod_dav_fs.so
LoadModule allowmethods_module {{ $modulePath }}/mod_allowmethods.so
LoadModule ssl_module {{ $modulePath }}/mod_ssl.so
LoadModule socache_shmcb_module {{ $modulePath }}/mod_socache_shmcb.so
LoadModule unixd_module {{ $modulePath }}/mod_unixd.so
LoadModule rewrite_module {{ $modulePath }}/mod_rewrite.so
# Still deciding whether or not to keep these modules or not
LoadModule authz_host_module {{ $modulePath }}/mod_authz_host.so
LoadModule authz_groupfile_module {{ $modulePath }}/mod_authz_groupfile.so
LoadModule access_compat_module {{ $modulePath }}/mod_access_compat.so
LoadModule reqtimeout_module {{ $modulePath }}/mod_reqtimeout.so
LoadModule filter_module {{ $modulePath }}/mod_filter.so
LoadModule mime_module {{ $modulePath }}/mod_mime.so
LoadModule env_module {{ $modulePath }}/mod_env.so
LoadModule headers_module {{ $modulePath }}/mod_headers.so
LoadModule status_module {{ $modulePath }}/mod_status.so
LoadModule autoindex_module {{ $modulePath }}/mod_autoindex.so
LoadModule dir_module {{ $modulePath }}/mod_dir.so
ServerName localhost
<IfModule dir_module>
DirectoryIndex disabled
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "/proc/self/fd/2"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "/proc/self/fd/1" common
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
</IfModule>
<IfModule mime_module>
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
TypesConfig /usr/local/apache2/conf/mime.types
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
# AddType application/x-gzip .tgz
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# AddEncoding x-compress .Z
# AddEncoding x-gzip .gz .tgz
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
# AddHandler cgi-script .cgi
# For type maps (negotiated resources):
# AddHandler type-map var
# Filters allow you to process content before it is sent to the client.
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
# AddType text/html .shtml
# AddOutputFilter INCLUDES .shtml
</IfModule>
# Secure (SSL/TLS) connections
# Include etc/apache24/extra/httpd-ssl.conf
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLProtocol +TLSv1.2 +TLSv1.3
</IfModule>
Include /usr/local/apache2/conf/Includes/*.conf
{{- end -}}

View File

@@ -0,0 +1,76 @@
{{/* Webdav HTTP Config */}}
{{- define "webdav.http.config" -}}
Listen {{ $.Values.service.main.ports.main.port }}
<VirtualHost *:{{ $.Values.service.main.ports.main.port }}>
{{- include "webdav.health.config" $ | nindent 2 }}
{{- include "webdav.core.config" $ | nindent 2 }}
</VirtualHost>
{{- end -}}
{{/* WebDav Core Config */}}
{{- define "webdav.core.config" -}}
DavLockDB "/usr/local/apache2/var/DavLock"
<Directory />
{{- if ne .Values.webdavConfig.authType "none" }}
{{- include "webdav.auth.config" $ | nindent 2 }}
{{- end }}
Dav On
IndexOptions Charset=utf-8
AddDefaultCharset UTF-8
AllowOverride None
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
</Directory>
{{- range .Values.persistenceList }}
{{- if .enabled }}
# WebDav Share - {{ .name }}
# Description: {{ .description }}
Alias /{{ .name }} "/shares/{{ .name }}"
<Directory "/shares/{{ .name }}">
</Directory>
{{- if .readOnly }}
<Location "/{{ .name }}">
AllowMethods GET OPTIONS PROPFIND
</Location>
{{- end }}
{{- end }}
{{- end }}
# The following directives disable redirects on non-GET requests for
# a directory that does not include the trailing slash. This fixes a
# problem with several clients that do not appropriately handle
# redirects for folders with DAV methods.
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[01234]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
BrowserMatch " Konqueror/4" redirect-carefully
RequestReadTimeout handshake=0 header=20-40,MinRate=500 body=20,MinRate=500
{{- end -}}
{{/* Included when authType is not "none" */}}
{{- define "webdav.auth.config" -}}
AuthType {{ .Values.webdavConfig.authType }}
AuthName webdav
AuthUserFile "/etc/apache2/webdavht{{ .Values.webdavConfig.authType }}"
Require valid-user
{{- end -}}
{{/* Included in one of the configs (webdav or webdav-ssl)
Used as a healthcheck endpoint */}}
{{- define "webdav.health.config" -}}
<Location "/health">
RewriteEngine On
RewriteRule .* - [R=200]
</Location>
{{- end -}}
{{/* Creates the basic auth password */}}
{{- define "webdav.htauth" -}}
{{- if eq .Values.webdavConfig.authType "basic" -}}
{{- htpasswd .Values.webdavConfig.username .Values.webdavConfig.password -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,34 @@
{{- define "webdav.validation" -}}
{{- $authTypes := (list "none" "basic") -}}
{{- if not (mustHas .Values.webdavConfig.authType $authTypes) -}}
{{- fail (printf "WebDAV - Expected [Auth Type] to be one of [%v], but got [%v]" (join ", " $authTypes) .Values.webdavConfig.authType) -}}
{{- end -}}
{{- if eq .Values.webdavConfig.authType "basic" -}}
{{- if not .Values.webdavConfig.username -}}
{{- fail "WebDAV - Expected [Username] to be configured when [Auth Type] is set to [Basic Auth]" -}}
{{- end -}}
{{- if not .Values.webdavConfig.password -}}
{{- fail "WebDAV - Expected [Password] to be configured when [Auth Type] is set to [Basic Auth]" -}}
{{- end -}}
{{- end -}}
{{- if and (not .Values.webdavNetwork.http) (not .Values.webdavNetwork.https) -}}
{{- fail "WebDAV - Expected at least one protocol [HTTP, HTTPS] to be enabled" -}}
{{- end -}}
{{- if and .Values.webdavNetwork.https (not .Values.webdavNetwork.certificateID) -}}
{{- fail "WebDAV - Expected a certificate to be configured when HTTPS is enabled" -}}
{{- end -}}
{{- if not .Values.webdavStorage.shares -}}
{{- fail "WebDAV - Expected at least 1 [Share] to be configured" -}}
{{- end -}}
{{- range .Values.webdavStorage.shares -}}
{{- if not (mustRegexMatch "^[a-zA-Z0-9_-]+$" .name) -}}
{{- fail "WebDAV - Expected [Share] name to only consist of [Letters(a-z, A-Z), Numbers(0-9), Underscores(_), Dashes(-)]" -}}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,38 @@
{{- define "webdav.workload" -}}
workload:
main:
enabled: true
primary: true
type: Deployment
podSpec:
containers:
main:
imageSelector: image
envList:
probes:
{{ $port := $.Values.service.main.ports.main.port }}
liveness:
enabled: true
path: /health
port: {{ $port }}
{{ if eq .Values.webdavConfig.authType "basic" }}
httpHeaders:
Authorization: Basic {{ (printf "%s:%s" .Values.webdavConfig.username .Values.webdavConfig.password) | b64enc }}
{{ end }}
readiness:
enabled: true
path: /health
port: {{ $port }}
{{ if eq .Values.webdavConfig.authType "basic" }}
httpHeaders:
Authorization: Basic {{ (printf "%s:%s" .Values.webdavConfig.username .Values.webdavConfig.password) | b64enc }}
{{ end }}
startup:
enabled: true
path: /health
port: {{ $port }}
{{ if eq .Values.webdavConfig.authType "basic" }}
httpHeaders:
Authorization: Basic {{ (printf "%s:%s" .Values.webdavConfig.username .Values.webdavConfig.password) | b64enc }}
{{ end }}
{{- end -}}

View File

@@ -0,0 +1,7 @@
{{- include "tc.v1.common.loader.init" . -}}
{{/* Merge the templates with Values */}}
{{- $_ := mustMergeOverwrite .Values (include "webdav.configuration" $ | fromYaml) -}}
{{- $_ := mustMergeOverwrite .Values (include "webdav.workload" $ | fromYaml) -}}
{{- include "tc.v1.common.loader.apply" . -}}

View File

@@ -0,0 +1,69 @@
image:
repository: tccr.io/truecharts/httpd
pullPolicy: IfNotPresent
tag: "v2.8.2@sha256:48d0534b03444519b74dd231926f234bde2bdf6c5c5f01b650e1a0dc6d0375ff"
service:
main:
ports:
main:
port: 8080
persistence:
httpd-conf:
enabled: true
type: configmap
objectName: config
targetSelector:
webdav:
webdav:
mountPath: /usr/local/apache2/conf/httpd.conf
subPath: httpd.conf
readOnly: true
webdav-conf:
# Mount config only if http is enabled
enabled: true
type: configmap
objectName: config
targetSelector:
webdav:
webdav:
mountPath: /usr/local/apache2/conf/Includes/webdav.conf
readOnly: true
subPath: webdav.conf
htauth:
# Mount config only if auth is enabled
enabled: '{{ ne .Values.webdavConfig.authType "none" }}'
type: secret
objectName: htauth
targetSelector:
webdav:
webdav:
mountPath: "/etc/apache2/webdavht{{ .Values.webdavConfig.authType }}"
subPath: htauth
readOnly: true
apachelock:
# Stores PID file and DavLockDB file
enabled: true
type: emptyDir
medium: Memory
size: 500Mi
targetSelector:
webdav:
webdav:
mountPath: /usr/local/apache2/var
shares:
enabled: true
type: hostPath
hostPath: /tmp
targetSelector:
webdav:
webdav:
# This path is used in the Alias directive in the webdav.conf
mountPath: /shares
webdavConfig:
authType: none
username: ""
password: ""
additionalEnvs: []