cherry-pick 010a04bf conflicts solved

main
Evilham 2023-01-11 18:19:09 +01:00 committed by Antoni Bertran
parent 29737dc3c5
commit 74b850191a
3 changed files with 63 additions and 48 deletions

View File

@ -82,9 +82,11 @@ COPY saml.sh /
COPY template.docx / COPY template.docx /
## Save current forms plugin hash ## Save current forms plugin hash
RUN sh -c 'curl -sL https://api.github.com/repos/3iPunt/nextcloud_forms/commits/STABLE_25 | jq -r .sha > /forms.hash' #RUN sh -c 'curl -sL https://api.github.com/repos/3iPunt/nextcloud_forms/commits/STABLE_25 | jq -r .sha > /forms.hash'
## And current forms code ## And current forms code
RUN sh -c 'curl -sL "https://github.com/3iPunt/nextcloud_forms/archive/$(cat /forms.hash).zip" > /forms.zip' #RUN sh -c 'curl -sL "https://github.com/3iPunt/nextcloud_forms/archive/$(cat /forms.hash).zip" > /forms.zip'
# Mail app patches. To remove in NC 25
COPY nc_mail/ /nc_mail/
# Setup cron as documented in: # Setup cron as documented in:
# https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/cron/fpm-alpine/Dockerfile # https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/cron/fpm-alpine/Dockerfile

View File

@ -2,4 +2,7 @@
# file license author source # file license author source
nginx.conf AGPL-3.0-or-later https://github.com/nextcloud/ https://raw.githubusercontent.com/nextcloud/docker/04ab3157e4f1197a9f8f4b91cf2430586356dd9a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf nginx.conf AGPL-3.0-or-later https://github.com/nextcloud/ https://raw.githubusercontent.com/nextcloud/docker/04ab3157e4f1197a9f8f4b91cf2430586356dd9a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf
supervisord.conf AGPL-3.0-or-later https://github.com/nextcloud/ https://raw.githubusercontent.com/nextcloud/docker/04ab3157e4f1197a9f8f4b91cf2430586356dd9a/.examples/dockerfiles/cron/fpm-alpine/supervisord.conf supervisord.conf AGPL-3.0-or-later https://github.com/nextcloud/ https://raw.githubusercontent.com/nextcloud/docker/04ab3157e4f1197a9f8f4b91cf2430586356dd9a/.examples/dockerfiles/cron/fpm-alpine/supervisord.conf
src/themes/dd/core/templates/layout.user.php AGPL-3.0-or-later https://github.com/nextcloud/ https://raw.githubusercontent.com/nextcloud/server/v25.0.4/core/templates/layout.user.php nc_mail/appinfo/info.xml AGPL-3.0-or-later https://github.com/nextcloud/ https://raw.githubusercontent.com/nextcloud/mail/v1.15.2/appinfo/info.xml
nc_mail/lib/Command/UpdateAccount.php AGPL-3.0-or-later https://github.com/nextcloud/ https://raw.githubusercontent.com/nextcloud/mail/1e777a1783254bd4b7f69f39a6c5123323f8b701/lib/Command/UpdateAccount.php
nc_mail/lib/Db/MailAccountMapper.php AGPL-3.0-or-later https://github.com/nextcloud/ https://raw.githubusercontent.com/nextcloud/mail/1e777a1783254bd4b7f69f39a6c5123323f8b701/lib/Db/MailAccountMapper.php
src/themes/dd/core/templates/layout.user.php AGPL-3.0-or-later https://github.com/nextcloud/ https://raw.githubusercontent.com/nextcloud/server/v21.0.9/core/templates/layout.user.php

View File

@ -20,10 +20,7 @@ plugin_status() {
printf "%s\t%s" "enabled" "${version}" printf "%s\t%s" "enabled" "${version}"
else else
version="$(echo "${plugins_state}" | jq -r ".disabled.${plugin}")" version="$(echo "${plugins_state}" | jq -r ".disabled.${plugin}")"
is_available="$(echo "${plugins_state}" | jq -r \ if [ "${version}" != "null" ]; then
--arg plugin "${plugin}" \
'.disabled | to_entries[] | select(.key == $plugin) | .key')"
if [ "${is_available}" = "${plugin}" ]; then
printf "%s\t%s" "disabled" "${version}" printf "%s\t%s" "disabled" "${version}"
else else
printf "%s\t%s" "n/a" "n/a" printf "%s\t%s" "n/a" "n/a"
@ -52,20 +49,6 @@ cat > "${STATIC_CFG}" <<EOF
'skeletondirectory' => '', 'skeletondirectory' => '',
'theme' => 'dd', 'theme' => 'dd',
'allow_local_remote_servers' => true, 'allow_local_remote_servers' => true,
'enabledPreviewProviders' => [
'OC\\Preview\\PNG',
'OC\\Preview\\JPEG',
'OC\\Preview\\GIF',
'OC\\Preview\\BMP',
'OC\\Preview\\XBitmap',
'OC\\Preview\\MP3',
'OC\\Preview\\TXT',
'OC\\Preview\\MarkDown',
'OC\\Preview\\OpenDocument',
'OC\\Preview\\Krita',
'OC\\Preview\\Movie',
'OC\\Preview\\MP4',
],
); );
EOF EOF
@ -74,8 +57,8 @@ occupgrade
# These cannot be edited from outside of the DD project # These cannot be edited from outside of the DD project
# Operators should instead rely on the environment variables to ease deployment # Operators should instead rely on the environment variables to ease deployment
# EXTRA_PLUGINS_ENABLE and EXTRA_PLUGINS_DISABLE # EXTRA_PLUGINS_ENABLE and EXTRA_PLUGINS_DISABLE
CORE_PLUGINS_ENABLE="user_saml,bruteforcesettings,polls,calendar,spreed,bbb,mail,onlyoffice" CORE_PLUGINS_ENABLE="user_saml,bruteforcesettings,polls,calendar,spreed,bbb,mail,ownpad,onlyoffice"
CORE_PLUGINS_DISABLE="firstrunwizard,recommendations,dashboard,circles,ownpad" CORE_PLUGINS_DISABLE="firstrunwizard,recommendations,dashboard,circles,forms"
if [ "${DISABLE_CLAMAV:-true}" = "false" ]; then if [ "${DISABLE_CLAMAV:-true}" = "false" ]; then
CORE_PLUGINS_ENABLE="${CORE_PLUGINS_ENABLE},files_antivirus" CORE_PLUGINS_ENABLE="${CORE_PLUGINS_ENABLE},files_antivirus"
@ -90,7 +73,7 @@ PLUGINS="${CORE_PLUGINS_ENABLE},${CORE_PLUGINS_DISABLE},${EXTRA_PLUGINS_ENABLE:-
# Install all plugins # Install all plugins
# shellcheck disable=SC2086 # We do want multiple arguments # shellcheck disable=SC2086 # We do want multiple arguments
for plugin in $(echo "${PLUGINS}" | tr ',' '\n'); do for plugin in $(echo "${PLUGINS}" | tr ',' '\n'); do
if plugin_status "${plugin}" | grep -qE "^n/a"; then if plugin_status "${plugin}" | grep -q "n/a"; then
echo "--> Installing ${plugin}" echo "--> Installing ${plugin}"
./occ --no-warnings app:install "${plugin}" ./occ --no-warnings app:install "${plugin}"
fi fi
@ -135,32 +118,40 @@ done
occupgrade occupgrade
# Temporary patch while upstream lands our changes
# See: https://github.com/nextcloud/mail/pull/6908
for f in appinfo/info.xml lib/Command/UpdateAccount.php lib/Db/MailAccountMapper.php; do
install -m 0644 -o www-data -g www-data "/nc_mail/$f" "/var/www/html/custom_apps/mail/$f"
done
occupgrade
## Forms ## Forms
## This should be upstreamed, see: # TODO: This is broken in NC 24 due to:
## https://github.com/juanan3ip/form/issues/76 # https://github.com/nextcloud/forms/pull/1149/files
## This is what is being used: https://github.com/3iPunt/nextcloud_forms ## TODO: request explanations and reduce upstream diff
FORMS_EXPECTED_HASH="$(cat /forms.hash)" ## This is what is being used: https://github.com/juanan3ip/form
FORMS_DIR="/var/www/html/custom_apps/forms" #FORMS_EXPECTED_HASH="$(cat /forms.hash)"
FORMS_HASH="" #FORMS_DIR="/var/www/html/custom_apps/forms"
if [ -f "${FORMS_DIR}.hash" ]; then #FORMS_HASH=""
FORMS_HASH="$(cat "${FORMS_DIR}.hash")" #if [ -f "${FORMS_DIR}.hash" ]; then
fi # FORMS_HASH="$(cat "${FORMS_DIR}.hash")"
if [ "${FORMS_EXPECTED_HASH}" != "${FORMS_HASH}" ]; then #fi
# Remove old plugin #if [ "${FORMS_EXPECTED_HASH}" != "${FORMS_HASH}" ]; then
rm -rf "${FORMS_DIR}" # # Remove old plugin
# Install new one # rm -rf "${FORMS_DIR}"
unzip -o /forms.zip -d /tmp # # Install new one
mv "/tmp/nextcloud_forms-${FORMS_EXPECTED_HASH}" "${FORMS_DIR}" # unzip -o /forms.zip -d /tmp
# Perform config / install # mv "/tmp/form-${FORMS_EXPECTED_HASH}" "${FORMS_DIR}"
npm --prefix "${FORMS_DIR}" install # # Perform config / install
composer --ignore-platform-req=ext-dom -d"${FORMS_DIR}" install --no-dev -o # npm --prefix "${FORMS_DIR}" install
# Place hash marker # composer --ignore-platform-req=ext-dom -d"${FORMS_DIR}" install --no-dev -o
cp /forms.hash "${FORMS_DIR}.hash" # # Place hash marker
fi # cp /forms.hash "${FORMS_DIR}.hash"
if plugin_status "${plugin}" | grep -qE "^disabled"; then #fi
./occ app:enable forms #if plugin_status "${plugin}" | grep -qE "^disabled"; then
fi # ./occ app:enable forms
#fi
# #
#occupgrade #occupgrade
@ -188,8 +179,27 @@ sed -i.orig \
-e 's/\(^\s*"Let.s go!" : [^¡]*\)¡\?\([^!]*\)!\(.*\)$/\1\2\3/' \ -e 's/\(^\s*"Let.s go!" : [^¡]*\)¡\?\([^!]*\)!\(.*\)$/\1\2\3/' \
/var/www/html/custom_apps/bbb/l10n/*.json /var/www/html/custom_apps/bbb/l10n/*.json
# Patches / fixes for Ownpad
## Fix mimetypemapping for ownpad
MIMETYPEMAPPINGJSON="/var/www/html/config/mimetypemapping.json"
if ! grep -q "application/x-ownpad" "${MIMETYPEMAPPINGJSON}"; then
jq '. + {"pad": ["application/x-ownpad"], "calc": ["application/x-ownpad"]}' \
/var/www/html/resources/config/mimetypemapping.dist.json > "${MIMETYPEMAPPINGJSON}"
# We have to tell NC about this change as documented here:
# https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#maintenance-commands
./occ maintenance:mimetype:update-db
fi
## Open pads on new tab/window
OWNPADJS="/var/www/html/custom_apps/ownpad/js/ownpad.js"
if ! grep -q viewerDD "${OWNPADJS}"; then
## TODO: Upstream this as a toggeable setting
sed -i.orig 's/^\(\s*\)var viewer = \(OC.generateUrl.*\)/\1var viewerDD = \2; window.open(viewerDD); return;/' "${OWNPADJS}"
fi
# Settings # Settings
echo "--> Applying custom settings" echo "--> Applying custom settings"
./occ --no-warnings config:app:set -n ownpad ownpad_etherpad_enable --value="yes"
./occ --no-warnings config:app:set -n ownpad ownpad_etherpad_host --value="https://pad.$DOMAIN"
./occ --no-warnings config:app:set -n onlyoffice DocumentServerUrl --value="https://oof.$DOMAIN" ./occ --no-warnings config:app:set -n onlyoffice DocumentServerUrl --value="https://oof.$DOMAIN"
./occ --no-warnings config:app:set -n onlyoffice jwt_secret --value="secret" ./occ --no-warnings config:app:set -n onlyoffice jwt_secret --value="secret"