diff --git a/Dockerfile b/Dockerfile index 8e7209752774762b4736d859bd4463433bffe658..0fe9c7bec529d346436e5f280a4cf4a9b3d10a37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,25 @@ -FROM nextcloud:20.0.11-fpm +FROM nextcloud:20.0.12-fpm ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="20.0.11" -ARG NEWS_VERSION="16.0.0" +ARG THEME_VERSION="20.1.0-rc3" +ARG THEME_HELPER_VERSION="1.0.0-rc3" +ARG NEWS_VERSION="16.0.1" ARG QUOTA_WARN_VERSION="1.9.1" -ARG NOTES_VERSION="4.1.0" -ARG CONTACTS_VERSION="4.0.1" -ARG CALENDAR_VERSION="2.3.1" +ARG NOTES_VERSION="4.1.1" +ARG CONTACTS_VERSION="4.0.2" +ARG CALENDAR_VERSION="2.3.3" ARG USER_BACKEND_RAW_SQL_VERSION="1.1.0" -ARG EMAIL_RECOVERY_JOB_ID="162557" +ARG EMAIL_RECOVERY_JOB_ID="199763" ARG RAINLOOP_VERSION="7.1.2" ARG RAINLOOP_COMMIT_SHA="aa5c57a7" -ARG USC_VERSION="1.0.0" ARG EDA_TAG="nc-20" +ARG ECLOUD_LAUNCHER_JOB_ID="199516" RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images COPY patches/ ${TMP_PATCH_DIR}/ COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh -RUN sed -i 's/20,0,11,1/20,0,11,5/' ${BASE_DIR}/version.php +RUN sed -i 's/20,0,12,1/20,0,12,9/' ${BASE_DIR}/version.php # Install unzip for unzipping artifacts RUN apt-get update && apt-get install unzip @@ -72,11 +73,23 @@ RUN curl -fsSL -o ecloud_drop_account.tar.gz \ mv "${BASE_DIR}/custom_apps/ecloud-drop-account-${EDA_TAG}" "${BASE_DIR}/custom_apps/ecloud_drop_account" && \ rm ecloud_drop_account.tar.gz; +RUN curl -fsSL -o ecloud-theme-helper.tar.gz \ + "https://gitlab.e.foundation/e/infra/selfhost/nextcloud-apps/ecloud-theme-helper/-/archive/${THEME_HELPER_VERSION}/ecloud-theme-helper-${THEME_HELPER_VERSION}.tar.gz" && \ + tar -xf ecloud-theme-helper.tar.gz -C ${BASE_DIR}/custom_apps/ && \ + mv "${BASE_DIR}/custom_apps/ecloud-theme-helper-${THEME_HELPER_VERSION}" "${BASE_DIR}/custom_apps/ecloud-theme-helper" && \ + rm ecloud-theme-helper.tar.gz; + +RUN curl -fsSL -o ecloud-launcher.zip \ + "https://gitlab.e.foundation/e/infra/selfhost/nextcloud-apps/launcher/-/jobs/${ECLOUD_LAUNCHER_JOB_ID}/artifacts/download" && \ + unzip ecloud-launcher.zip && \ + mv dist/ecloud-launcher ${BASE_DIR}/custom_apps/ && \ + rm ecloud-launcher.zip; + # Remove unzip when unzipping is done RUN apt-get -y remove unzip -# force eelo theme not to be disabled even when there is an upgrade process launched -RUN sed -i "s/\$systemConfig->setValue('theme', '');/\$systemConfig->setValue('theme', 'eelo');/g" ${BASE_DIR}/lib/base.php +# force eCloud theme not to be disabled even when there is an upgrade process launched +RUN sed -i "s/\$systemConfig->setValue('theme', '');/\$systemConfig->setValue('theme', 'eCloud');/g" ${BASE_DIR}/lib/base.php # Patches RUN patch -u ${BASE_DIR}/core/Controller/LoginController.php -i ${TMP_PATCH_DIR}/002-login-without-domain.patch @@ -88,6 +101,9 @@ RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/006-recovery-email-changes.pa RUN patch -u ${BASE_DIR}/apps/settings/lib/Settings/Personal/ServerDevNotice.php -i ${TMP_PATCH_DIR}/007-remove-dev-notice.patch RUN patch -u ${BASE_DIR}/lib/private/Template/IconsCacher.php -i ${TMP_PATCH_DIR}/008-icons-cacher-theme-svgs.patch RUN patch -u ${BASE_DIR}/core/Controller/SvgController.php -i ${TMP_PATCH_DIR}/008-svg-controller-theme-svgs.patch +RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/009-help-links.patch +RUN patch -u ${BASE_DIR}/lib/private/Updater.php -i ${TMP_PATCH_DIR}/010-disable-app-store-upgrade.patch +RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/011-privacy-settings.patch RUN rm -rf ${TMP_PATCH_DIR} # autocomplete leak tweak apps frontend with sed, disable group suggestion @@ -96,13 +112,19 @@ RUN cd ${BASE_DIR}/custom_apps/contacts && sed -i 's/"GROUP","INDIVIDUAL"/"INDIV RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/"GROUP","INDIVIDUAL"/"INDIVIDUAL"/g' js/calendar.js RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/anyof/allof/g' js/calendar.js +# Set default widgets to calendar, tasks and notes +RUN sed -i 's/recommendations,spreed,mail,calendar/calendar,tasks,notes/' ${BASE_DIR}/apps/dashboard/lib/Controller/DashboardController.php + +# Remove colored background from email template logo +RUN sed -i 's/$this->header, \[$this->themingDefaults->getColorPrimary()/$this->header, \["none"/' ${BASE_DIR}/lib/private/Mail/EMailTemplate.php + # Custom theme -RUN curl -fsSL -o eelo-theme.tar.gz \ +RUN curl -fsSL -o eCloud-theme.tar.gz \ "https://gitlab.e.foundation/e/infra/nextcloud-theme/-/archive/${THEME_VERSION}/nextcloud-theme-${THEME_VERSION}.tar.gz" && \ - tar -xf eelo-theme.tar.gz -C /tmp/ && \ - mv /tmp/nextcloud-theme-${THEME_VERSION}/eelo ${BASE_DIR}/themes/ && \ - chown -R www-data:www-data ${BASE_DIR}/themes/eelo/ && \ - rm -rf eelo-theme.tar.gz /tmp/nextcloud-theme-* ${BASE_DIR}/themes/example/ + tar -xf eCloud-theme.tar.gz -C /tmp/ && \ + mv /tmp/nextcloud-theme-${THEME_VERSION}/ ${BASE_DIR}/themes/eCloud && \ + chown -R www-data:www-data ${BASE_DIR}/themes/eCloud/ && \ + rm -rf eCloud-theme.tar.gz ${BASE_DIR}/themes/example/ ENTRYPOINT ["/custom_entrypoint.sh"] CMD ["php-fpm"] diff --git a/custom_entrypoint.sh b/custom_entrypoint.sh index 892723e2ff5ea557cf49bdffe4cc46e04fa42bf0..36dfb301e73e299cfb0b877fd29cc00c7ffdc4a0 100644 --- a/custom_entrypoint.sh +++ b/custom_entrypoint.sh @@ -11,6 +11,7 @@ SRC_DIR="/usr/src/nextcloud" DST_DIR="/var/www/html" installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" fi @@ -23,13 +24,29 @@ if version_greater "$image_version" "$installed_version"; then rsync $rsync_options --include "/calendar/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ rsync $rsync_options --include "/contacts/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ rsync $rsync_options --include "/user_backend_sql_raw/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ - rsync $rsync_options --include "/rainloop" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ - rsync $rsync_options --include "/email-recovery" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ - rsync $rsync_options --include "/ecloud_drop_account" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ + rsync $rsync_options --include "/rainloop/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ + rsync $rsync_options --include "/email-recovery/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ + rsync $rsync_options --include "/ecloud_drop_account/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ + rsync $rsync_options --include "/ecloud-theme-helper/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ + rsync $rsync_options --include "/ecloud-launcher/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ - rsync $rsync_options --include "/eelo/" --exclude '/*' $SRC_DIR/themes/ $DST_DIR/themes/ + rsync $rsync_options --include "/eCloud/" --exclude '/*' $SRC_DIR/themes/ $DST_DIR/themes/ else echo "Skipping rsync step as version not updated!" fi -/entrypoint.sh "$@" \ No newline at end of file +if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:disable apporder" + su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:enable ecloud-launcher" + su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:enable ecloud-theme-helper" + su -p www-data -s /bin/sh -c "php $DST_DIR/occ config:system:set integrity.check.disabled --value='true' --type=boolean" + su -p www-data -s /bin/sh -c "php $DST_DIR/occ config:system:set theme --value='eCloud'" +else + sh -c "php $DST_DIR/occ app:disable apporder" + sh -c "php $DST_DIR/occ app:enable ecloud-launcher" + sh -c "php $DST_DIR/occ app:disable ecloud-theme-helper" + sh -c "php $DST_DIR/occ config:system:set integrity.check.disabled --value='true' --type=boolean" + sh -c "php $DST_DIR/occ config:system:set theme --value='eCloud'" +fi + +/entrypoint.sh "$@" diff --git a/patches/009-help-links.patch b/patches/009-help-links.patch new file mode 100644 index 0000000000000000000000000000000000000000..6d5032f7c25df2d92991c70442ded14ee75edd4b --- /dev/null +++ b/patches/009-help-links.patch @@ -0,0 +1,83 @@ +From: Akhil +Date: Thu, 10 Aug 2021 17:30:00 +0530 +Subject: [PATCH] Changes help links to point to the correct links + +This patch adds changes to the "Settings" app's help template, controller and stylesheet to make sure the correct +help links are shown + +--- ./apps/settings/lib/Controller/HelpController.php 2021-08-10 16:54:15.844898527 +0530 ++++ ./apps/settings/lib/Controller/HelpController-new.php 2021-08-10 16:54:42.541807384 +0530 +@@ -89,7 +89,8 @@ + 'url' => $documentationUrl, + 'urlUserDocs' => $urlUserDocs, + 'urlAdminDocs' => $urlAdminDocs, +- 'mode' => $mode, ++ 'mode' => $mode, ++ 'ncVersion' => \OCP\Util::getVersion()[0] + ]); + $policy = new ContentSecurityPolicy(); + $policy->addAllowedFrameDomain('\'self\''); +--- ./apps/settings/templates/help.php 2021-07-01 15:13:08.000000000 +0530 ++++ ./apps/settings/templates/help-new.php 2021-08-10 17:22:42.771569854 +0530 +@@ -3,38 +3,21 @@ + ?> +
+
+ +-
+- +-
+ +--- ./apps/settings/css/help.css 2021-08-20 14:16:57.951439620 +0530 ++++ ./apps/settings/css/help-new.css 2021-08-20 17:02:43.549016337 +0530 +@@ -10,3 +10,12 @@ + border: 0; + overflow: auto; + } ++ ++#content #app-navigation { ++ transform: none; ++ width: max-content; ++} ++ ++#app-navigation:not(.vue) > ul > li > a { ++ padding: 0 12px 0 44px; ++} diff --git a/patches/010-disable-app-store-upgrade.patch b/patches/010-disable-app-store-upgrade.patch new file mode 100644 index 0000000000000000000000000000000000000000..0810c6e2e186ac4acc2886e28a67dabbad0ce3c1 --- /dev/null +++ b/patches/010-disable-app-store-upgrade.patch @@ -0,0 +1,21 @@ +From: Akhil +Date: Thu, 12 Aug 2021 19:45:00 +0530 +Subject: [PATCH] Disables app store checking during "occ upgrade" + +This patch disables checking the app store for app updates during "occ upgrade" + +--- ./lib/private/Updater.php 2021-08-11 19:46:04.607195791 +0530 ++++ ./lib/private/Updater-new.php 2021-08-11 19:46:15.173946740 +0530 +@@ -261,9 +261,9 @@ + \OC::$server->getAppFetcher()->setVersion($currentVersion); + + // upgrade appstore apps +- $this->upgradeAppStoreApps(\OC::$server->getAppManager()->getInstalledApps()); +- $autoDisabledApps = \OC::$server->getAppManager()->getAutoDisabledApps(); +- $this->upgradeAppStoreApps($autoDisabledApps, true); ++ //$this->upgradeAppStoreApps(\OC::$server->getAppManager()->getInstalledApps()); ++ //$autoDisabledApps = \OC::$server->getAppManager()->getAutoDisabledApps(); ++ //$this->upgradeAppStoreApps($autoDisabledApps, true); + + // install new shipped apps on upgrade + $errors = Installer::installShippedApps(true); diff --git a/patches/011-privacy-settings.patch b/patches/011-privacy-settings.patch new file mode 100644 index 0000000000000000000000000000000000000000..26647694ece66b442c952a757415d530b5cbe148 --- /dev/null +++ b/patches/011-privacy-settings.patch @@ -0,0 +1,37 @@ +--- ./apps/privacy/lib/Settings/MissionSettings.php 2021-09-07 17:38:08.650902445 +0530 ++++ ./apps/privacy/lib/Settings/MissionSettings-new.php 2021-09-07 17:40:30.078256502 +0530 +@@ -41,8 +41,8 @@ + /** + * @return string + */ +- public function getSection():string { +- return 'privacy'; ++ public function getSection() { ++ return null; + } + + /** +--- ./apps/privacy/lib/Settings/UserDataManifestoSettings.php 2021-09-07 17:38:06.284224253 +0530 ++++ ./apps/privacy/lib/Settings/UserDataManifestoSettings-new.php 2021-09-07 17:40:42.288315736 +0530 +@@ -41,8 +41,8 @@ + /** + * @return string + */ +- public function getSection():string { +- return 'privacy'; ++ public function getSection() { ++ return null; + } + + /** +--- ./apps/privacy/templates/who-has-access.php 2021-09-07 17:40:05.704804878 +0530 ++++ ./apps/privacy/templates/who-has-access-new.php 2021-09-07 17:40:02.714790363 +0530 +@@ -1,3 +1,8 @@ ++ ++ +
+

t('Who has access to your data?')) ?>

+

t('Administrators')); ?>