Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c9b5799 authored by Florent VINCENT's avatar Florent VINCENT 👾
Browse files

Merge branch 'nextcloud-20' into 'master'

Nextcloud 20

See merge request !25
parents cf27ab77 13405308
Loading
Loading
Loading
Loading
Loading
+20 −12
Original line number Original line Diff line number Diff line
FROM nextcloud:19.0.12-fpm
FROM nextcloud:20.0.11-fpm
ARG BASE_DIR="/usr/src/nextcloud"
ARG BASE_DIR="/usr/src/nextcloud"
ARG TMP_PATCH_DIR="/tmp/build_patches"
ARG TMP_PATCH_DIR="/tmp/build_patches"
ARG THEME_VERSION="19.0.9.6"
ARG THEME_VERSION="19.0.9.6"
ARG NEWS_VERSION="14.2.2"
ARG NEWS_VERSION="16.0.0"
ARG QUOTA_WARN_VERSION="1.8.0"
ARG QUOTA_WARN_VERSION="1.9.1"
ARG NOTES_VERSION="3.6.4"
ARG NOTES_VERSION="4.1.0"
ARG CONTACTS_VERSION="3.5.1"
ARG CONTACTS_VERSION="3.5.1"
ARG CALENDAR_VERSION="2.0.5"
ARG CALENDAR_VERSION="2.3.0"
ARG USER_BACKEND_RAW_SQL_VERSION="1.0.12"
ARG USER_BACKEND_RAW_SQL_VERSION="1.1.0"
ARG EMAIL_RECOVERY_JOB_ID="162557"
ARG EMAIL_RECOVERY_JOB_ID="162557"
ARG RAINLOOP_VERSION="7.1.0"
ARG RAINLOOP_VERSION="7.1.2"
ARG RAINLOOP_COMMIT_SHA="c21dfcab"
ARG RAINLOOP_COMMIT_SHA="aa5c57a7"
ARG USC_VERSION="1.0.0"
ARG USC_VERSION="1.0.0"
ARG EDA_TAG="nc-20"


RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images
RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images
COPY patches/ ${TMP_PATCH_DIR}/
COPY patches/ ${TMP_PATCH_DIR}/
COPY custom_entrypoint.sh /
COPY custom_entrypoint.sh /
RUN chmod +x /custom_entrypoint.sh
RUN chmod +x /custom_entrypoint.sh
# RUN sed -i 's/19,0,12,0/19,0,12,1/' ${BASE_DIR}/version.php
RUN sed -i 's/20,0,11,1/20,0,11,2/' ${BASE_DIR}/version.php


# Install unzip for unzipping artifacts
# Install unzip for unzipping artifacts
RUN apt-get update && apt-get install unzip 
RUN apt-get update && apt-get install unzip 
@@ -44,7 +45,7 @@ RUN curl -fsSL -o contacts.tar.gz \
    rm contacts.tar.gz;
    rm contacts.tar.gz;


RUN curl -fsSL -o calendar.tar.gz \
RUN curl -fsSL -o calendar.tar.gz \
    "https://github.com/nextcloud/calendar/releases/download/v${CALENDAR_VERSION}/calendar.tar.gz" && \
    "https://github.com/nextcloud-releases/calendar/releases/download/v${CALENDAR_VERSION}/calendar.tar.gz" && \
    tar -xf calendar.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    tar -xf calendar.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    rm calendar.tar.gz;
    rm calendar.tar.gz;


@@ -65,6 +66,12 @@ RUN curl -fsSL -o rainloop.tar.gz \
    mv "${BASE_DIR}/custom_apps/rainloop-nextcloud-${RAINLOOP_VERSION}-${RAINLOOP_COMMIT_SHA}" "${BASE_DIR}/custom_apps/rainloop" && \
    mv "${BASE_DIR}/custom_apps/rainloop-nextcloud-${RAINLOOP_VERSION}-${RAINLOOP_COMMIT_SHA}" "${BASE_DIR}/custom_apps/rainloop" && \
    rm rainloop.tar.gz;
    rm rainloop.tar.gz;


RUN curl -fsSL -o ecloud_drop_account.tar.gz \
    "https://gitlab.e.foundation/e/infra/selfhost/nextcloud-apps/ecloud-drop-account/-/archive/${EDA_TAG}/ecloud-drop-account-${EDA_TAG}.tar.gz" && \
    tar -xf ecloud_drop_account.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    mv "${BASE_DIR}/custom_apps/ecloud-drop-account-${EDA_TAG}" "${BASE_DIR}/custom_apps/ecloud_drop_account" && \
    rm ecloud_drop_account.tar.gz;

# Remove unzip when unzipping is done
# Remove unzip when unzipping is done
RUN apt-get -y remove unzip
RUN apt-get -y remove unzip


@@ -74,8 +81,9 @@ RUN patch -u ${BASE_DIR}/core/templates/layout.user.php -i ${TMP_PATCH_DIR}/003-
RUN patch -u ${BASE_DIR}/core/Controller/ContactsMenuController.php -i ${TMP_PATCH_DIR}/004-contact-search-controller-removal.patch
RUN patch -u ${BASE_DIR}/core/Controller/ContactsMenuController.php -i ${TMP_PATCH_DIR}/004-contact-search-controller-removal.patch
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/005-autocomplete-user-leak-core.patch
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/005-autocomplete-user-leak-core.patch
RUN cd ${BASE_DIR}/custom_apps && patch -p0 < ${TMP_PATCH_DIR}/005-autocomplete-user-leak-custom-app.patch
RUN cd ${BASE_DIR}/custom_apps && patch -p0 < ${TMP_PATCH_DIR}/005-autocomplete-user-leak-custom-app.patch
RUN patch -u ${BASE_DIR}/custom_apps/notes/lib/Service/NoteUtil.php -i ${TMP_PATCH_DIR}/006-notes-url-fix.patch
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/006-recovery-email-changes.patch
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/007-recovery-email-changes.patch
# RUN patch -u ${BASE_DIR}/apps/files_trashbin/lib/Storage.php -i ${TMP_PATCH_DIR}/007-files-trashbin-parent-wrapper.patch
RUN patch -u ${BASE_DIR}/apps/settings/lib/Settings/Personal/ServerDevNotice.php -i ${TMP_PATCH_DIR}/008-remove-dev-notice.patch
RUN rm -rf ${TMP_PATCH_DIR}
RUN rm -rf ${TMP_PATCH_DIR}


# autocomplete leak tweak apps frontend with sed, disable group suggestion
# autocomplete leak tweak apps frontend with sed, disable group suggestion
+1 −0
Original line number Original line Diff line number Diff line
@@ -14,6 +14,7 @@ rsync $rsync_options --include "/contacts/" --exclude '/*' $SRC_DIR/custom_apps/
rsync $rsync_options --include "/user_backend_sql_raw/" --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 "/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 "/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 "/eelo/" --exclude '/*' $SRC_DIR/themes/ $DST_DIR/themes/
rsync $rsync_options --include "/eelo/" --exclude '/*' $SRC_DIR/themes/ $DST_DIR/themes/


+6 −6
Original line number Original line Diff line number Diff line
@@ -5,12 +5,12 @@ Subject: [PATCH] remove user search icon in header tab
This patch removes the top right icon enabling the global user search function available to all in nextcloud.
This patch removes the top right icon enabling the global user search function available to all in nextcloud.


diff --git layout.user.php layout.user.php-new
diff --git layout.user.php layout.user.php-new
--- layout.user.php	2021-02-02 16:47:17.348572250 +0100
--- layout.user.php	2021-06-22 14:06:34.786843164 +0530
+++ layout.user.php-new	2021-02-02 16:47:33.128646878 +0100
+++ layout.user.php-new	2021-06-22 14:07:45.938569109 +0530
@@ -111,14 +111,6 @@
@@ -103,14 +103,6 @@
 						autocomplete="off">

 					<button class="icon-close-white" type="reset"><span class="hidden-visually"><?php p($l->t('Reset search'));?></span></button>
 			<div class="header-right">
 				</form>
 				<div id="unified-search"></div>
-				<div id="contactsmenu">
-				<div id="contactsmenu">
-					<div class="icon-contacts menutoggle" tabindex="0" role="button"
-					<div class="icon-contacts menutoggle" tabindex="0" role="button"
-					aria-haspopup="true" aria-controls="contactsmenu-menu" aria-expanded="false">
-					aria-haspopup="true" aria-controls="contactsmenu-menu" aria-expanded="false">
+9 −10
Original line number Original line Diff line number Diff line
@@ -24,15 +24,15 @@ diff --git lib/private/Collaboration/Collaborators/UserPlugin.php lib/private/Co
 			) {
 			) {
 				if (strtolower($uid) === $lowerSearch) {
 				if (strtolower($uid) === $lowerSearch) {
diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Collaboration/Collaborators/MailPlugin-new.php
diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Collaboration/Collaborators/MailPlugin-new.php
--- lib/private/Collaboration/Collaborators/MailPlugin.php	2021-02-16 14:55:37.281914086 +0100
--- lib/private/Collaboration/Collaborators/MailPlugin.php	2021-06-22 14:53:24.451402977 +0530
+++ lib/private/Collaboration/Collaborators/MailPlugin-new.php	2021-02-19 16:22:07.662189199 +0100
+++ lib/private/Collaboration/Collaborators/MailPlugin-new.php	2021-06-22 14:56:31.201379020 +0530
@@ -36,6 +36,7 @@
@@ -36,6 +36,7 @@
 use OCP\IConfig;
 use OCP\IConfig;
 use OCP\IGroupManager;
 use OCP\IGroupManager;
 use OCP\IUser;
 use OCP\IUser;
+use OCP\IUserManager;
+use OCP\IUserManager;
 use OCP\IUserSession;
 use OCP\IUserSession;
 use OCP\Share;
 use OCP\Share\IShare;
 
 
@@ -56,12 +57,13 @@
@@ -56,12 +57,13 @@
 	/** @var IUserSession */
 	/** @var IUserSession */
@@ -49,7 +49,7 @@ diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Co
 
 
 		$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
 		$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
 		$this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
 		$this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
@@ -185,43 +187,79 @@
@@ -185,43 +187,78 @@
 						if ($exactEmailMatch) {
 						if ($exactEmailMatch) {
 							$searchResult->markExactIdMatch($emailType);
 							$searchResult->markExactIdMatch($emailType);
 						}
 						}
@@ -59,11 +59,10 @@ diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Co
-							'name' => $contact['FN'],
-							'name' => $contact['FN'],
-							'type' => $emailAddressType ?? '',
-							'type' => $emailAddressType ?? '',
-							'value' => [
-							'value' => [
-								'shareType' => Share::SHARE_TYPE_EMAIL,
-								'shareType' => IShare::TYPE_EMAIL,
-								'shareWith' => $emailAddress,
-								'shareWith' => $emailAddress,
-							],
-							],
-						];
-						];
+						
+						$isUserinInstance = $this->userManager->get($emailAddress);
+						$isUserinInstance = $this->userManager->get($emailAddress);
+						if ($isUserinInstance === null) {
+						if ($isUserinInstance === null) {
+							// /e/ user is not in ecloud
+							// /e/ user is not in ecloud
@@ -99,7 +98,7 @@ diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Co
-							'name' => $contact['FN'],
-							'name' => $contact['FN'],
-							'type' => $emailAddressType ?? '',
-							'type' => $emailAddressType ?? '',
-							'value' => [
-							'value' => [
-								'shareType' => Share::SHARE_TYPE_EMAIL,
-								'shareType' => IShare::TYPE_EMAIL,
-								'shareWith' => $emailAddress,
-								'shareWith' => $emailAddress,
-							],
-							],
-						];
-						];

patches/006-notes-url-fix.patch

deleted100644 → 0
+0 −52
Original line number Original line Diff line number Diff line
From: Akhil <akhil@e.email>
Date: Mon, 21 Dec 2020 13:47:24 +0530
Subject: [PATCH] Changes for notes with long filenames that generate endless recursion and memory issues

This patch replaces a buggy recursion method with an iterative procedure. When there is a very long filename the recursion doesn't end. An iterative procedure works well.

diff --git ../../notes-3.6.4/lib/Service/NoteUtilOriginal.php ../../notes-3.6.4/lib/Service/NoteUtil.php
--- ../../notes-3.6.4/lib/Service/NoteUtilOriginal.php	2020-12-21 13:45:50.215222624 +0530
+++ ../../notes-3.6.4/lib/Service/NoteUtil.php	2020-12-21 13:47:24.277418659 +0530
@@ -86,23 +86,25 @@
 
 		// if file does not exist, that name has not been taken. Similar we don't
 		// need to handle file collisions if it is the filename did not change
-		if (!$folder->nodeExists($filename) || $folder->get($filename)->getId() === $id) {
-			return $filename;
-		} else {
-			// increments name (2) to name (3)
-			$match = preg_match('/\((?P<id>\d+)\)$/u', $title, $matches);
-			if ($match) {
-				$newId = ((int) $matches['id']) + 1;
-				$newTitle = preg_replace(
-					'/(.*)\s\((\d+)\)$/u',
-					'$1 (' . $newId . ')',
-					$title
-				);
-			} else {
-				$newTitle = $title . ' (2)';
-			}
-			return $this->generateFileName($folder, $newTitle, $suffix, $id);
-		}
+		while($folder->nodeExists($filename) ) {
+                        $file = $folder->get($filename);
+                        if($file && $file->getId() === $id) {
+                           return $filename;
+                        }
+                        $match = preg_match('/\((?P<id>\d+)\)$/u', $title, $matches);
+                                        if ($match) {
+                                                        $newId = ((int) $matches['id']) + 1;
+                                                        $title = preg_replace(
+                                                                        '/(.*)\s\((\d+)\)$/u',
+                                                                        '$1 (' . $newId . ')',
+                                                                        $title
+                                                        );
+                                        } else {
+                                                        $title = $title . ' (2)';
+                                        }
+                        $filename = $title . $suffix;
+                }
+                return $filename;
 	}
 
 	public function getSafeTitle(string $content) : string {
Loading