From 2337b299692f87892a900c5766c7dd4a927ecac9 Mon Sep 17 00:00:00 2001 From: akhil Date: Fri, 15 Oct 2021 15:31:35 +0530 Subject: [PATCH 1/7] Rsync integration_google dir --- custom_entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_entrypoint.sh b/custom_entrypoint.sh index 36dfb301..6513df42 100644 --- a/custom_entrypoint.sh +++ b/custom_entrypoint.sh @@ -29,6 +29,8 @@ if version_greater "$image_version" "$installed_version"; then 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 "/integration_google/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/ + rsync $rsync_options --include "/eCloud/" --exclude '/*' $SRC_DIR/themes/ $DST_DIR/themes/ else -- GitLab From 8f217c914ebf89dc42c607eff2820c89dba1043a Mon Sep 17 00:00:00 2001 From: akhil Date: Thu, 28 Oct 2021 14:18:57 +0530 Subject: [PATCH 2/7] added sed to remove OS dependent dark mode css --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a786563f..feed495b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM nextcloud:20.0.12-fpm ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="20.1.2" +ARG THEME_VERSION="20.1.3" ARG THEME_HELPER_VERSION="1.0.1" ARG NEWS_VERSION="16.0.1" ARG QUOTA_WARN_VERSION="1.9.1" @@ -20,7 +20,7 @@ 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,12,1/20,0,12,14/' ${BASE_DIR}/version.php +RUN sed -i 's/20,0,12,1/20,0,12,15/' ${BASE_DIR}/version.php # Install unzip for unzipping artifacts RUN apt-get update && apt-get install unzip @@ -129,6 +129,11 @@ RUN sed -i 's/recommendations,spreed,mail,calendar/calendar,tasks,notes/' ${BASE # 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 +# Ignore OS dark mode for all users +# Don't use user-specific dark theme css for non-logged in users +RUN sed -i 's/OCA.Accessibility.theme="dark"/OCA.Accessibility.theme="light"/' ${BASE_DIR}/apps/accessibility/js/accessibilityoca.js +RUN sed -i "s/$userValues = ['dark']/$userValues = []/" ${BASE_DIR}/apps/accessibility/lib/Controller/AccessibilityController.php + # Custom theme 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" && \ -- GitLab From 176c41823f0a0c554fe9053b27f61b55e6161226 Mon Sep 17 00:00:00 2001 From: akhil Date: Thu, 28 Oct 2021 17:19:58 +0530 Subject: [PATCH 3/7] Fixed sed for non-logged in css --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index feed495b..61c0301f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -132,7 +132,7 @@ RUN sed -i 's/$this->header, \[$this->themingDefaults->getColorPrimary()/$this-> # Ignore OS dark mode for all users # Don't use user-specific dark theme css for non-logged in users RUN sed -i 's/OCA.Accessibility.theme="dark"/OCA.Accessibility.theme="light"/' ${BASE_DIR}/apps/accessibility/js/accessibilityoca.js -RUN sed -i "s/$userValues = ['dark']/$userValues = []/" ${BASE_DIR}/apps/accessibility/lib/Controller/AccessibilityController.php +RUN sed -i "s/$userValues = \['dark'\]/$userValues = \[\]/" ${BASE_DIR}/apps/accessibility/lib/Controller/AccessibilityController.php # Custom theme RUN curl -fsSL -o eCloud-theme.tar.gz \ -- GitLab From 42ec87113f11a972d18a7aefb3d59c9d8374bb87 Mon Sep 17 00:00:00 2001 From: akhil Date: Thu, 28 Oct 2021 17:41:14 +0530 Subject: [PATCH 4/7] Bumped version number to 16 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 61c0301f..1a9b332b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ 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,12,1/20,0,12,15/' ${BASE_DIR}/version.php +RUN sed -i 's/20,0,12,1/20,0,12,16/' ${BASE_DIR}/version.php # Install unzip for unzipping artifacts RUN apt-get update && apt-get install unzip -- GitLab From 12f7ab6b01470fa8c291065fd078b380505cdec4 Mon Sep 17 00:00:00 2001 From: akhil Date: Mon, 8 Nov 2021 19:03:01 +0530 Subject: [PATCH 5/7] Lowercase admin username before checking against input --- patches/002-login-without-domain.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/002-login-without-domain.patch b/patches/002-login-without-domain.patch index 6e670628..477bd803 100644 --- a/patches/002-login-without-domain.patch +++ b/patches/002-login-without-domain.patch @@ -17,7 +17,7 @@ diff --git files/LoginController.php files/LoginController-new.php + $user = mb_strtolower($user, 'UTF-8'); + $domain = $this->config->getSystemValue("mail_domain"); + $domain_suffix = "@$domain"; -+ $admin_username = $_ENV["NEXTCLOUD_ADMIN_USER"]; ++ $admin_username = mb_strtolower($_ENV["NEXTCLOUD_ADMIN_USER"], 'UTF-8'); + if (stristr($user, $domain_suffix) === FALSE && strcmp($user, $admin_username) != 0) { + $user = $user . $domain_suffix; + } -- GitLab From feba79422698f616d408658451b786dfdd8014c1 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 15 Apr 2024 21:45:03 -0700 Subject: [PATCH 6/7] UserConfigChangedEvent Event patch --- Dockerfile | 76 +++++++++++++--------- patches/035-user-config-change-event.patch | 59 +++++++++++++++++ 2 files changed, 106 insertions(+), 29 deletions(-) create mode 100644 patches/035-user-config-change-event.patch diff --git a/Dockerfile b/Dockerfile index 1a9b332b..b0720b8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ -FROM nextcloud:20.0.12-fpm +FROM nextcloud:20.0.12-fpm as base ARG BASE_DIR="/usr/src/nextcloud" -ARG TMP_PATCH_DIR="/tmp/build_patches" ARG THEME_VERSION="20.1.3" ARG THEME_HELPER_VERSION="1.0.1" ARG NEWS_VERSION="16.0.1" @@ -17,10 +16,9 @@ ARG ECLOUD_LAUNCHER_JOB_ID="204816" ARG GOOGLE_INTEGRATION_VERSION="1.0.5-1-nightly" 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,12,1/20,0,12,16/' ${BASE_DIR}/version.php +RUN sed -i 's/20,0,12,1/20,0,12,17/' ${BASE_DIR}/version.php # Install unzip for unzipping artifacts RUN apt-get update && apt-get install unzip @@ -101,31 +99,6 @@ RUN sed -i "s/\$systemConfig->setValue('theme', '');/\$systemConfig->setValue('t # fix min version of google data migration app RUN sed -i "s/min-version=\"22\"/min-version=\"20\"/" ${BASE_DIR}/custom_apps/integration_google/appinfo/info.xml -# Patches -RUN patch -u ${BASE_DIR}/core/Controller/LoginController.php -i ${TMP_PATCH_DIR}/002-login-without-domain.patch -RUN patch -u ${BASE_DIR}/core/templates/layout.user.php -i ${TMP_PATCH_DIR}/003-contact-search-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}/custom_apps && patch -p0 < ${TMP_PATCH_DIR}/005-autocomplete-user-leak-custom-app.patch -RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/006-recovery-email-changes.patch -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 cd ${BASE_DIR} && patch -u ${BASE_DIR}/apps/dashboard/lib/Controller/DashboardController.php -i ${TMP_PATCH_DIR}/012-remove-user-status-widget.patch -RUN rm -rf ${TMP_PATCH_DIR} - -# autocomplete leak tweak apps frontend with sed, disable group suggestion - -RUN cd ${BASE_DIR}/custom_apps/contacts && sed -i 's/"GROUP","INDIVIDUAL"/"INDIVIDUAL"/g' js/contacts-main.js -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 @@ -147,3 +120,48 @@ RUN sed -i 's/https:\/\/nextcloud.com\/signup\//https:\/\/e\.foundation\/executeStatement(); + + $this->userCache[$userId][$appName][$key] = (string)$value; ++ $this->triggerUserValueChange($userId, $appName, $key, $value, $prevValue); + return; + } + } +@@ -304,8 +307,15 @@ + } + $this->userCache[$userId][$appName][$key] = (string)$value; + } ++ $this->triggerUserValueChange($userId, $appName, $key, $value, $prevValue); + } + ++ private function triggerUserValueChange($userId, $appId, $key, $value, $oldValue = null) { ++ if (\OC::$server instanceof \OCP\IServerContainer) { ++ $dispatcher = \OC::$server->get(IEventDispatcher::class); ++ $dispatcher->dispatchTyped(new UserConfigChangedEvent($userId, $appId, $key, $value, $oldValue)); ++ } ++ } + /** + * Getting a user defined value + * + + +--- ./lib/composer/composer/autoload_static.php 2024-03-28 01:02:39 ++++ ./lib/composer/composer/autoload_static-new.php 2024-04-15 16:34:18 +@@ -710,6 +710,7 @@ + 'OCP\\User\\Events\\PasswordUpdatedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/PasswordUpdatedEvent.php', + 'OCP\\User\\Events\\PostLoginEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/PostLoginEvent.php', + 'OCP\\User\\Events\\UserChangedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserChangedEvent.php', ++ 'OCP\\User\\Events\\UserConfigChangedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserConfigChangedEvent.php', + 'OCP\\User\\Events\\UserCreatedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserCreatedEvent.php', + 'OCP\\User\\Events\\UserDeletedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserDeletedEvent.php', + 'OCP\\User\\Events\\UserLiveStatusEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserLiveStatusEvent.php', + + +--- ./lib/composer/composer/autoload_classmap.php 2024-03-28 01:02:39 ++++ ./lib/composer/composer/autoload_classmap-new.php 2024-04-15 16:33:19 +@@ -683,6 +683,7 @@ + 'OCP\\User\\Events\\UserLoggedInEvent' => $baseDir . '/lib/public/User/Events/UserLoggedInEvent.php', + 'OCP\\User\\Events\\UserLoggedInWithCookieEvent' => $baseDir . '/lib/public/User/Events/UserLoggedInWithCookieEvent.php', + 'OCP\\User\\Events\\UserLoggedOutEvent' => $baseDir . '/lib/public/User/Events/UserLoggedOutEvent.php', ++ 'OCP\\User\\Events\\UserConfigChangedEvent' => $baseDir . '/lib/public/User/Events/UserConfigChangedEvent.php', + 'OCP\\User\\GetQuotaEvent' => $baseDir . '/lib/public/User/GetQuotaEvent.php', + 'OCP\\Util' => $baseDir . '/lib/public/Util.php', + 'OCP\\WorkflowEngine\\EntityContext\\IContextPortation' => $baseDir . '/lib/public/WorkflowEngine/EntityContext/IContextPortation.php', -- GitLab From 51be3e99bccce1105bcdc05df8b42a1f73d409b5 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Tue, 16 Apr 2024 13:33:43 -0700 Subject: [PATCH 7/7] added patch to add new file --- Dockerfile | 3 +- ...6-user-config-changed-event-new-file.patch | 70 +++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 patches/036-user-config-changed-event-new-file.patch diff --git a/Dockerfile b/Dockerfile index b0720b8d..e0fae0e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -160,7 +160,8 @@ RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/anyof/allof/g' js/calendar. # UserConfigChangedEvent Ref: https://github.com/nextcloud/server/pull/42039 -RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/035-user-config-change-event.patch +RUN cd ${BASE_DIR} && patch -p1 < ${TMP_PATCH_DIR}/035-user-config-change-event.patch +RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/036-user-config-changed-event-new-file.patch # 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 diff --git a/patches/036-user-config-changed-event-new-file.patch b/patches/036-user-config-changed-event-new-file.patch new file mode 100644 index 00000000..9b9d664b --- /dev/null +++ b/patches/036-user-config-changed-event-new-file.patch @@ -0,0 +1,70 @@ +--- /dev/null ++++ ./lib/public/User/Events/UserConfigChangedEvent.php +@@ -0,0 +1 @@ ++ ++ * ++ * @author Murena SAS ++ * ++ * @license GNU AGPL version 3 or any later version ++ * ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Affero General Public License as ++ * published by the Free Software Foundation, either version 3 of the ++ * License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Affero General Public License for more details. ++ * ++ * You should have received a copy of the GNU Affero General Public License ++ * along with this program. If not, see . ++ * ++ */ ++ ++namespace OCP\User\Events; ++ ++use OCP\EventDispatcher\Event; ++ ++class UserConfigChangedEvent extends Event { ++ private string $userId; ++ private string $appId; ++ private string $key; ++ private mixed $value; ++ private mixed $oldValue; ++ ++ public function __construct(string $userId, string $appId, string $key, mixed $value, mixed $oldValue = null) { ++ parent::__construct(); ++ $this->userId = $userId; ++ $this->appId = $appId; ++ $this->key = $key; ++ $this->value = $value; ++ $this->oldValue = $oldValue; ++ } ++ ++ public function getUserId(): string { ++ return $this->userId; ++ } ++ ++ public function getAppId(): string { ++ return $this->appId; ++ } ++ ++ public function getKey(): string { ++ return $this->key; ++ } ++ ++ public function getValue() { ++ return $this->value; ++ } ++ ++ public function getOldValue() { ++ return $this->oldValue; ++ } ++} +\ No newline at end of file -- GitLab