From dd0f564ba74f51e3bc97240d83ffa3faa5c14414 Mon Sep 17 00:00:00 2001 From: akhil Date: Thu, 16 Dec 2021 17:30:52 +0530 Subject: [PATCH] Added patch to revert token password update --- Dockerfile | 3 ++- .../013-revert-token-password-update.patch | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 patches/013-revert-token-password-update.patch diff --git a/Dockerfile b/Dockerfile index 40bf6bcf..a4bb107d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="222001" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" COPY patches/ ${TMP_PATCH_DIR}/ -RUN sed -i 's/21,0,7,0/21,0,7,11/' ${BASE_DIR}/version.php +RUN sed -i 's/21,0,7,0/21,0,7,12/' ${BASE_DIR}/version.php # Install unzip for unzipping artifacts RUN apt-get update && apt-get install unzip @@ -109,6 +109,7 @@ 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 patch -u ${BASE_DIR}/lib/private/Authentication/Token/PublicKeyTokenProvider.php -i ${TMP_PATCH_DIR}/013-revert-token-password-update.patch RUN rm -rf ${TMP_PATCH_DIR} # autocomplete leak tweak apps frontend with sed, disable group suggestion diff --git a/patches/013-revert-token-password-update.patch b/patches/013-revert-token-password-update.patch new file mode 100644 index 00000000..c0432077 --- /dev/null +++ b/patches/013-revert-token-password-update.patch @@ -0,0 +1,21 @@ +From: Akhil +Date: Fri, 16 Dec 2021 17:30 +0530 +Subject: [PATCH] Reverts token password update on each login + +NC 21 started updating password of each and every token on each login. This introduces a huge load on database. +This patch reverts to only update when there are expired tokens. + +--- ./lib/private/Authentication/Token/PublicKeyTokenProvider.php 2021-11-16 01:32:54.000000000 +0530 ++++ ./lib/private/Authentication/Token/PublicKeyTokenProvider-new.php 2021-12-16 17:13:48.893560398 +0530 +@@ -414,6 +414,11 @@ + public function updatePasswords(string $uid, string $password) { + $this->cache->clear(); + ++ if (!$this->mapper->hasExpiredTokens($uid)) { ++ // Nothing to do here ++ return; ++ } ++ + // prevent setting an empty pw as result of pw-less-login + if ($password === '') { + return; -- GitLab