This repository has been archived on 2025-05-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
truecharts-catalog/premium/nextcloud/30.0.7/templates/_initPerms.tpl
TrueCharts-Bot 851ebdbcf1 Commit new Chart releases for TrueCharts
Signed-off-by: TrueCharts-Bot <bot@truecharts.org>
2024-05-01 22:02:05 +00:00

32 lines
928 B
Smarty

{{- define "nextcloud.init.perms" -}}
{{- $uid := .Values.securityContext.container.runAsUser -}}
{{- $gid := .Values.securityContext.container.runAsGroup -}}
{{- $path := .Values.persistence.data.targetSelector.main.main.mountPath }}
enabled: true
type: install
imageSelector: alpineImage
resources:
excludeExtra: true
securityContext:
runAsUser: 0
runAsGroup: 0
runAsNonRoot: false
capabilities:
disableS6Caps: true
add:
- DAC_OVERRIDE
- FOWNER
- CHOWN
command: /bin/sh
args:
- -c
- |
echo "Setting permissions to 700 on data directory [{{ $path }}] ..."
chmod 770 {{ $path }} | echo "Failed to set permissions on data directory [{{ $path }}]"
echo "Setting ownership to {{ $uid }}:{{ $gid }} on data directory [{{ $path }}] ..."
chown {{ $uid }}:{{ $gid }} {{ $path }} | echo "Failed to set ownership on data directory [{{ $path }}]"
echo "Finished."
{{- end -}}