mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-10-06 05:24:37 +08:00
fix clamav permissions
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
ec33279209
commit
feec123292
3 changed files with 39 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
name: nextcloud-aio-helm-chart
|
name: nextcloud-aio-helm-chart
|
||||||
description: A generated Helm Chart for Nextcloud AIO from Skippbox Kompose
|
description: A generated Helm Chart for Nextcloud AIO from Skippbox Kompose
|
||||||
version: 7.7.0-beta3
|
version: 7.7.0-beta4
|
||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
keywords:
|
keywords:
|
||||||
- latest
|
- latest
|
||||||
|
|
|
@ -24,11 +24,22 @@ spec:
|
||||||
io.kompose.service: nextcloud-aio-clamav
|
io.kompose.service: nextcloud-aio-clamav
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
initContainers:
|
||||||
|
- name: init-subpath
|
||||||
|
image: alpine
|
||||||
|
command:
|
||||||
|
- mkdir
|
||||||
|
- "-p"
|
||||||
|
- /nextcloud-aio-clamav/data
|
||||||
|
- /nextcloud-aio-clamav
|
||||||
|
volumeMounts:
|
||||||
|
- name: nextcloud-aio-clamav
|
||||||
|
mountPath: /nextcloud-aio-clamav
|
||||||
- name: init-volumes
|
- name: init-volumes
|
||||||
image: alpine
|
image: alpine
|
||||||
command:
|
command:
|
||||||
- chmod
|
- chown
|
||||||
- "777"
|
- 100:100
|
||||||
|
- "-R"
|
||||||
- /nextcloud-aio-clamav
|
- /nextcloud-aio-clamav
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: nextcloud-aio-clamav
|
- name: nextcloud-aio-clamav
|
||||||
|
@ -46,6 +57,7 @@ spec:
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /var/lib/clamav
|
- mountPath: /var/lib/clamav
|
||||||
|
subPath: data
|
||||||
name: nextcloud-aio-clamav
|
name: nextcloud-aio-clamav
|
||||||
volumes:
|
volumes:
|
||||||
- name: nextcloud-aio-clamav
|
- name: nextcloud-aio-clamav
|
||||||
|
|
|
@ -81,15 +81,34 @@ cat << EOL > /tmp/initcontainers.database
|
||||||
- "-R"
|
- "-R"
|
||||||
volumeMountsInitContainer:
|
volumeMountsInitContainer:
|
||||||
EOL
|
EOL
|
||||||
|
cat << EOL > /tmp/initcontainers.clamav
|
||||||
|
initContainers:
|
||||||
|
- name: init-subpath
|
||||||
|
image: alpine
|
||||||
|
command:
|
||||||
|
- mkdir
|
||||||
|
- "-p"
|
||||||
|
- /nextcloud-aio-clamav/data
|
||||||
|
volumeMountsInitContainer:
|
||||||
|
- name: init-volumes
|
||||||
|
image: alpine
|
||||||
|
command:
|
||||||
|
- chown
|
||||||
|
- 100:100
|
||||||
|
- "-R"
|
||||||
|
volumeMountsInitContainer:
|
||||||
|
EOL
|
||||||
# shellcheck disable=SC1083
|
# shellcheck disable=SC1083
|
||||||
DEPLOYMENTS="$(find ./ -name '*deployment.yaml')"
|
DEPLOYMENTS="$(find ./ -name '*deployment.yaml')"
|
||||||
mapfile -t DEPLOYMENTS <<< "$DEPLOYMENTS"
|
mapfile -t DEPLOYMENTS <<< "$DEPLOYMENTS"
|
||||||
for variable in "${DEPLOYMENTS[@]}"; do
|
for variable in "${DEPLOYMENTS[@]}"; do
|
||||||
if grep -q volumeMounts "$variable"; then
|
if grep -q volumeMounts "$variable"; then
|
||||||
if ! echo "$variable" | grep -q database; then
|
if echo "$variable" | grep -q database; then
|
||||||
sed -i "/^ spec:/r /tmp/initcontainers" "$variable"
|
|
||||||
else
|
|
||||||
sed -i "/^ spec:/r /tmp/initcontainers.database" "$variable"
|
sed -i "/^ spec:/r /tmp/initcontainers.database" "$variable"
|
||||||
|
elif echo "$variable" | grep -q clamav; then
|
||||||
|
sed -i "/^ spec:/r /tmp/initcontainers.clamav" "$variable"
|
||||||
|
else
|
||||||
|
sed -i "/^ spec:/r /tmp/initcontainers" "$variable"
|
||||||
fi
|
fi
|
||||||
volumeNames="$(grep -A1 mountPath "$variable" | grep -v mountPath | sed 's|.*name: ||' | sed '/^--$/d')"
|
volumeNames="$(grep -A1 mountPath "$variable" | grep -v mountPath | sed 's|.*name: ||' | sed '/^--$/d')"
|
||||||
mapfile -t volumeNames <<< "$volumeNames"
|
mapfile -t volumeNames <<< "$volumeNames"
|
||||||
|
@ -101,6 +120,8 @@ for variable in "${DEPLOYMENTS[@]}"; do
|
||||||
# Workaround for the database volume
|
# Workaround for the database volume
|
||||||
if [ "$volumeName" = nextcloud-aio-database ]; then
|
if [ "$volumeName" = nextcloud-aio-database ]; then
|
||||||
sed -i "/mountPath: \/var\/lib\/postgresql\/data/a\ \ \ \ \ \ \ \ \ \ \ \ \ \ subPath: data" "$variable"
|
sed -i "/mountPath: \/var\/lib\/postgresql\/data/a\ \ \ \ \ \ \ \ \ \ \ \ \ \ subPath: data" "$variable"
|
||||||
|
elif [ "$volumeName" = nextcloud-aio-clamav ]; then
|
||||||
|
sed -i "/mountPath: \/var\/lib\/clamav/a\ \ \ \ \ \ \ \ \ \ \ \ \ \ subPath: data" "$variable"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue