mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-22 15:36:52 +00:00
Merge pull request #1934 from nextcloud/enh/noid/handle-talk-internal-ports
helm - handle talk internal ports correctly and fix permissions for Nextcloud container
This commit is contained in:
commit
be2df389ab
16 changed files with 59 additions and 22 deletions
|
|
@ -73,8 +73,11 @@ for variable in "${DEPLOYMENTS[@]}"; do
|
|||
volumeNames="$(grep -A1 mountPath "$variable" | grep -v mountPath | sed 's|.*name: ||' | sed '/^--$/d')"
|
||||
mapfile -t volumeNames <<< "$volumeNames"
|
||||
for volumeName in "${volumeNames[@]}"; do
|
||||
sed -i "/^.*volumeMountsInitContainer:/i\ \ \ \ \ \ \ \ \ \ \ \ - /$volumeName" "$variable"
|
||||
sed -i "/volumeMountsInitContainer:/a\ \ \ \ \ \ \ \ \ \ \ \ - name: $volumeName\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ mountPath: /$volumeName" "$variable"
|
||||
# The Nextcloud container runs as root user and sets the correct permissions automatically for the data-dir if the www-data user cannot write to it
|
||||
if [ "$volumeName" != "nextcloud-aio-nextcloud-data" ]; then
|
||||
sed -i "/^.*volumeMountsInitContainer:/i\ \ \ \ \ \ \ \ \ \ \ \ - /$volumeName" "$variable"
|
||||
sed -i "/volumeMountsInitContainer:/a\ \ \ \ \ \ \ \ \ \ \ \ - name: $volumeName\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ mountPath: /$volumeName" "$variable"
|
||||
fi
|
||||
done
|
||||
sed -i "s|volumeMountsInitContainer|volumeMounts|" "$variable"
|
||||
if grep -q claimName "$variable"; then
|
||||
|
|
@ -110,6 +113,22 @@ find ./ -name '*talk*' -exec sed -i "s|$TALK_PORT|{{ .Values.TALK_PORT }}|" \{}
|
|||
find ./ -name '*apache-service.yaml' -exec sed -i "/^spec:/a\ \ type: LoadBalancer" \{} \;
|
||||
# shellcheck disable=SC1083
|
||||
find ./ -name '*talk-service.yaml' -exec sed -i "/^spec:/a\ \ type: LoadBalancer" \{} \;
|
||||
echo '---' > /tmp/talk-service.copy
|
||||
# shellcheck disable=SC1083
|
||||
find ./ -name '*talk-service.yaml' -exec cat \{} \; >> /tmp/talk-service.copy
|
||||
sed -i 's|name: nextcloud-aio-talk|name: nextcloud-aio-talk-public|' /tmp/talk-service.copy
|
||||
# shellcheck disable=SC1083
|
||||
INTERNAL_TALK_PORTS="$(find ./ -name '*talk-deployment.yaml' -exec grep -oP 'containerPort: [0-9]+' \{} \;)"
|
||||
mapfile -t INTERNAL_TALK_PORTS <<< "$INTERNAL_TALK_PORTS"
|
||||
for port in "${INTERNAL_TALK_PORTS[@]}"; do
|
||||
port="$(echo "$port" | grep -oP '[0-9]+')"
|
||||
sed -i "/$port/d" /tmp/talk-service.copy
|
||||
done
|
||||
echo '---' >> /tmp/talk-service.copy
|
||||
# shellcheck disable=SC1083
|
||||
find ./ -name '*talk-service.yaml' -exec grep -v '{{ .Values.*}}\|protocol: UDP\|type: LoadBalancer' \{} \; >> /tmp/talk-service.copy
|
||||
# shellcheck disable=SC1083
|
||||
find ./ -name '*talk-service.yaml' -exec mv /tmp/talk-service.copy \{} \;
|
||||
# shellcheck disable=SC1083
|
||||
find ./ -name '*.yaml' -exec sed -i "s|'{{|\"{{|g;s|}}'|}}\"|g" \{} \;
|
||||
# shellcheck disable=SC1083
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue