Files
chart/library/ix-dev/community/filebrowser/templates/_filebrowser.tpl
Stavros Kois c47542a99a NAS-122653 / 23.10 / Adds filebrowser to community train (#1299)
* initial commit

* some fixes

* add TODO

* update metadata and ui

* add cert support

* add default item in additional storage, add validation, extend readme
2023-07-03 14:50:35 +03:00

88 lines
3.2 KiB
Smarty

{{- define "filebrowser.workload" -}}
{{- $configBasePath := "/config" -}}
{{- $scheme := "http" }}
workload:
filebrowser:
enabled: true
primary: true
type: Deployment
podSpec:
hostNetwork: {{ .Values.filebrowserNetwork.hostNetwork }}
containers:
filebrowser:
enabled: true
primary: true
imageSelector: image
securityContext:
runAsUser: {{ .Values.filebrowserRunAs.user }}
runAsGroup: {{ .Values.filebrowserRunAs.group }}
args:
- --config
- {{ $configBasePath }}/filebrowser.json
- --database
- {{ $configBasePath }}/filebrowser.db
- --port
- "{{ .Values.filebrowserNetwork.webPort }}"
- --address
- "0.0.0.0"
- --root
- /data
{{- if .Values.filebrowserNetwork.certificateID }}
- --cert
- {{ $configBasePath }}/certs/tls.crt
- --key
- {{ $configBasePath }}/certs/tls.key
{{- $scheme = "https" -}}
{{- end -}}
{{ with .Values.filebrowserConfig.additionalEnvs }}
envList:
{{ range $env := . }}
- name: {{ $env.name }}
value: {{ $env.value }}
{{ end }}
{{ end }}
probes:
liveness:
enabled: true
type: {{ $scheme }}
port: "{{ .Values.filebrowserNetwork.webPort }}"
path: /health
readiness:
enabled: true
type: {{ $scheme }}
port: "{{ .Values.filebrowserNetwork.webPort }}"
path: /health
startup:
enabled: true
type: {{ $scheme }}
port: "{{ .Values.filebrowserNetwork.webPort }}"
path: /health
initContainers:
{{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
"UID" .Values.filebrowserRunAs.user
"GID" .Values.filebrowserRunAs.group
"mode" "check"
"type" "init") | nindent 8 }}
02-init-config:
enabled: true
type: init
imageSelector: image
securityContext:
runAsUser: {{ .Values.filebrowserRunAs.user }}
runAsGroup: {{ .Values.filebrowserRunAs.group }}
# Creating the config file if it doesn't exist
# This will make the container to log
# "Using config file: {{ $configBasePath }}/filebrowser.json"
# on startup, so users know where the config is, in case they need it.
# Arguments will take precedence over the config file always.
# (Like the port, paths, etc we set above.)
command:
- /bin/sh
- -c
- |
if [ ! -f {{ $configBasePath }}/filebrowser.json ]; then
echo "Creating an empty config file"
echo '{}' > {{ $configBasePath }}/filebrowser.json
fi
{{- end -}}