nextcloud: restore mimetype defaults for external app

This commit is contained in:
Brad Stein 2026-01-06 22:16:51 -03:00
parent a15a2ce923
commit 2d6883eb67

View File

@ -65,6 +65,17 @@ spec:
fi
installed="$(su -s /bin/sh www-data -c "php /var/www/html/occ status" 2>/dev/null | awk '/installed:/{print $3}' || true)"
if [ "${installed}" = "true" ]; then
ensure_mime_defaults() {
cfg_dir="/var/www/html/resources/config"
mkdir -p "${cfg_dir}"
if [ ! -s "${cfg_dir}/mimetypemapping.dist.json" ]; then
curl -fsSL https://raw.githubusercontent.com/nextcloud/server/v29.0.16/resources/config/mimetypemapping.dist.json -o "${cfg_dir}/mimetypemapping.dist.json" || true
fi
if [ ! -s "${cfg_dir}/mimetypealiases.dist.json" ]; then
curl -fsSL https://raw.githubusercontent.com/nextcloud/server/v29.0.16/resources/config/mimetypealiases.dist.json -o "${cfg_dir}/mimetypealiases.dist.json" || true
fi
chown -R 33:33 "${cfg_dir}" || true
}
install_app() {
app="$1"
url="$2"
@ -77,6 +88,7 @@ spec:
chown -R 33:33 "${target}"
su -s /bin/sh www-data -c "php /var/www/html/occ app:enable --force ${app}" || true
}
ensure_mime_defaults
install_app oidc_login https://github.com/pulsejet/nextcloud-oidc-login/releases/download/v3.2.2/oidc_login.tar.gz
install_app external https://github.com/nextcloud-releases/external/releases/download/v5.4.1/external-v5.4.1.tar.gz
install_app mail https://github.com/nextcloud-releases/mail/releases/download/v3.7.24/mail-stable3.7.tar.gz