From cd83db6a560f1e7c27f9668b2f276d9072c86c58 Mon Sep 17 00:00:00 2001 From: akhil Date: Mon, 27 Sep 2021 14:19:15 +0530 Subject: [PATCH 1/5] Added changes to recovery email patch to allow username without domain suffix --- patches/006-recovery-email-changes.patch | 27 ++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/patches/006-recovery-email-changes.patch b/patches/006-recovery-email-changes.patch index a44e13f7..be661bc7 100644 --- a/patches/006-recovery-email-changes.patch +++ b/patches/006-recovery-email-changes.patch @@ -7,7 +7,21 @@ This patch adds the necessary changes to core NC controller and template for "em diff --git ./core/Controller/LostController.php ./core/Controller/LostController.new.php --- ./core/Controller/LostController.php 2021-03-26 09:51:09.317785801 +0530 +++ ./core/Controller/LostController.new.php 2021-03-26 09:51:35.490073707 +0530 -@@ -205,8 +205,9 @@ +@@ -194,6 +194,13 @@ + * @throws \Exception + */ + protected function checkPasswordResetToken($token, $userId) { ++ $domain = $this->config->getSystemValue("mail_domain"); ++ $domainSuffix = "@$domain"; ++ ++ if(stristr($userId, $domainSuffix) === FALSE ) { ++ $userId = $userId . $domainSuffix; ++ } ++ + $user = $this->userManager->get($userId); + if ($user === null || !$user->isEnabled()) { + throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid')); +@@ -205,8 +212,9 @@ } try { @@ -19,15 +33,24 @@ diff --git ./core/Controller/LostController.php ./core/Controller/LostController } catch (\Exception $e) { throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid')); } -@@ -334,7 +335,7 @@ +@@ -333,8 +341,15 @@ + * @throws \OCP\PreConditionNotMetException */ protected function sendEmail($input) { ++ $domain = $this->config->getSystemValue("mail_domain"); ++ $domainSuffix = "@$domain"; ++ ++ if(stristr($input, $domainSuffix) === FALSE ) { ++ $input = $input . $domainSuffix; ++ } ++ $user = $this->findUserByIdOrMail($input); - $email = $user->getEMailAddress(); + $email = $this->config->getUserValue($user->getUID(), 'email-recovery', 'recovery-email'); if (empty($email)) { throw new ResetPasswordException('Could not send reset e-mail since there is no email for username ' . $input); + diff --git ./apps/settings/templates/settings/personal/personal.info.php ./apps/settings/templates/settings/personal/personal.info.new.php --- ./apps/settings/templates/settings/personal/personal.info.php 2021-04-22 07:49:34.926418855 +0530 +++ ./apps/settings/templates/settings/personal/personal.info.new.php 2021-04-22 07:50:00.026660710 +0530 -- GitLab From 4261381d552ee4f1f756b229b366bbf69ee7273a Mon Sep 17 00:00:00 2001 From: akhil Date: Tue, 28 Sep 2021 17:58:17 +0530 Subject: [PATCH 2/5] Added google migration app --- Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4547d7e6..64aefe69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,12 +14,13 @@ ARG RAINLOOP_VERSION="7.1.2" ARG RAINLOOP_COMMIT_SHA="aa5c57a7" ARG EDA_TAG="nc-20" ARG ECLOUD_LAUNCHER_JOB_ID="200382" +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,12/' ${BASE_DIR}/version.php +RUN sed -i 's/20,0,12,1/20,0,12,13/' ${BASE_DIR}/version.php # Install unzip for unzipping artifacts RUN apt-get update && apt-get install unzip @@ -85,12 +86,21 @@ RUN curl -fsSL -o ecloud-launcher.zip \ mv dist/ecloud-launcher ${BASE_DIR}/custom_apps/ && \ rm ecloud-launcher.zip; +RUN curl -fsSL -o integration_google.tar.gz \ + "https://github.com/nextcloud/integration_google/releases/download/v${GOOGLE_INTEGRATION_VERSION}/integration_google-${GOOGLE_INTEGRATION_VERSION}.tar.gz" && \ + tar -xf integration_google.tar.gz -C ${BASE_DIR}/custom_apps/ && \ + chown -R www-data:www-data ${BASE_DIR}/custom_apps/integration_google && \ + rm integration_google.tar.gz; + # Remove unzip when unzipping is done RUN apt-get -y remove unzip # 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 +# 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 -- GitLab From 6d12a00e7f40550ab14e31f84a26be298c5fcd4b Mon Sep 17 00:00:00 2001 From: akhil Date: Tue, 28 Sep 2021 18:37:43 +0530 Subject: [PATCH 3/5] Updated versions for theme, helper and launcher --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64aefe69..b11a0fcd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM nextcloud:20.0.12-fpm ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="20.1.1" -ARG THEME_HELPER_VERSION="1.0.0" +ARG THEME_VERSION="20.1.2" +ARG THEME_HELPER_VERSION="1.0.1" ARG NEWS_VERSION="16.0.1" ARG QUOTA_WARN_VERSION="1.9.1" ARG NOTES_VERSION="4.1.1" @@ -13,7 +13,7 @@ ARG EMAIL_RECOVERY_JOB_ID="199763" ARG RAINLOOP_VERSION="7.1.2" ARG RAINLOOP_COMMIT_SHA="aa5c57a7" ARG EDA_TAG="nc-20" -ARG ECLOUD_LAUNCHER_JOB_ID="200382" +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 -- GitLab From 9c7ebd686ef022d0301e6754ff7b7d930a09e584 Mon Sep 17 00:00:00 2001 From: akhil Date: Tue, 28 Sep 2021 18:44:26 +0530 Subject: [PATCH 4/5] Added app enable step in custom entrypoint for google data migration tool --- custom_entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_entrypoint.sh b/custom_entrypoint.sh index 36dfb301..ec4a272b 100644 --- a/custom_entrypoint.sh +++ b/custom_entrypoint.sh @@ -40,12 +40,14 @@ if [ "$(id -u)" = 0 ]; then 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 app:enable integration_google" 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 app:enable integration_google" sh -c "php $DST_DIR/occ config:system:set theme --value='eCloud'" fi -- GitLab From 315e757e3bb84818b0c254d57daa44db65b84fa3 Mon Sep 17 00:00:00 2001 From: akhil Date: Wed, 29 Sep 2021 15:27:50 +0530 Subject: [PATCH 5/5] Not enabling google integration by default --- custom_entrypoint.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/custom_entrypoint.sh b/custom_entrypoint.sh index ec4a272b..36dfb301 100644 --- a/custom_entrypoint.sh +++ b/custom_entrypoint.sh @@ -40,14 +40,12 @@ if [ "$(id -u)" = 0 ]; then 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 app:enable integration_google" 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 app:enable integration_google" sh -c "php $DST_DIR/occ config:system:set theme --value='eCloud'" fi -- GitLab