Skip to content
Snippets Groups Projects
Commit b4f15a31 authored by Arie Peterson's avatar Arie Peterson
Browse files

Merge branch '1106-fix-security-and-setup-warnings' into 'main'

Resolve "Fix security and setup warnings"

Closes #1106

See merge request !571
parents e677442c ae485021
No related branches found
No related tags found
1 merge request!571Resolve "Fix security and setup warnings"
Pipeline #43270 passed with stages
in 6 minutes and 52 seconds
...@@ -13,7 +13,9 @@ data: ...@@ -13,7 +13,9 @@ data:
setup-apps.sh: | setup-apps.sh: |
#!/bin/bash #!/bin/bash
# This script gets executed as a postStart command inside the Nextcloud pod. # This script gets executed by the Kubernetes Job `{{ .Release.Name }}-setup-apps`,
# which gets created by Helm after every chart install and upgrade.
#
# The script: # The script:
# #
# * Installs all apps declared in the `apps` helm values array # * Installs all apps declared in the `apps` helm values array
...@@ -23,7 +25,7 @@ data: ...@@ -23,7 +25,7 @@ data:
# * Runs upgrade routines after installation of a new release or new # * Runs upgrade routines after installation of a new release or new
# pinned apps. # pinned apps.
# * Configures single-sign-on # * Configures single-sign-on
# * Persists and loads the config.json config file # * Loads Nextcloud config from the config.json
# * Updates database indices, columns, keys, etc needed after NC upgrade # * Updates database indices, columns, keys, etc needed after NC upgrade
# Copied from the NC docker entrypoint to run OCC commands # Copied from the NC docker entrypoint to run OCC commands
...@@ -37,8 +39,22 @@ data: ...@@ -37,8 +39,22 @@ data:
echo "STARTING SETUP-APPS.SH" echo "STARTING SETUP-APPS.SH"
# Debug: place the json file in a persistent location for reuse # Starting in version 0.15.18 of this chart (Stackspin 2.10), we no longer
cp /var/local/config.json /var/www/html/ # copy config.json from /var/local to the web root. We remove the copied
# file if we think we can safely do so.
if [ -f /var/www/html/config.json ]
then
echo "Found copy of config.json in web root."
if diff -q /var/www/html/config.json /var/local/config.json >/dev/null
then
echo "It's identical to the current config from the configmap."
echo "Deleting it from the web root."
rm /var/www/html/config.json
else
echo "It's different from the current config from the configmap."
echo "Keeping it around for manual reconciliation."
fi
fi
occ="/var/www/html/occ" occ="/var/www/html/occ"
count=0 count=0
...@@ -115,6 +131,9 @@ data: ...@@ -115,6 +131,9 @@ data:
# Extract app into target directory. The app tars usually contain a folder # Extract app into target directory. The app tars usually contain a folder
# named after the app name # named after the app name
tar -xf "{{ .name }}.tar.gz" -C "$target_directory" tar -xf "{{ .name }}.tar.gz" -C "$target_directory"
# Ownership in the archive can be anything. Nextcloud wants it to be
# www-data.
chown -R 33:33 "$target_directory"
rm "{{ .name }}.tar.gz" rm "{{ .name }}.tar.gz"
fi fi
{{- else }} {{- else }}
...@@ -209,7 +228,7 @@ data: ...@@ -209,7 +228,7 @@ data:
}, },
"oidc_login_disable_registration": false, "oidc_login_disable_registration": false,
"oidc_login_webdav_enabled": true, "oidc_login_webdav_enabled": true,
"debug": {{ .Values.nextcloud.debug | quote }} "debug": {{ .Values.nextcloud.debug }}
}, },
"apps":{ "apps":{
"core":{ "core":{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment