From e3c86e5865d26d51b43ce089079a675614160b49 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 22 Jul 2022 13:57:56 +0530 Subject: [PATCH 01/42] Add selfhost CI/CD and selfhost Dockerfile steps --- .gitlab-ci.yml | 55 +++++++++++++++++++++++++++++------ Dockerfile | 79 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 93 insertions(+), 41 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e9fa46e..75dd630b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,23 +10,60 @@ default: services: - docker:19.03.12-dind before_script: - - docker info - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY tags: - generic_privileged build-branch: - except: - - tags stage: build + variables: + TARGET: ecloud + SUBPATH: '' + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: $CI_COMMIT_TAG != null + when: never + - if: $CI_COMMIT_REF_SLUG =~ /^selfhost/ + variables: + TARGET: "selfhost" + SUBPATH: "/selfhost" + - if: $CI_COMMIT_REF_SLUG != null + when: on_success + allow_failure: true script: - - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . - - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" + - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" + - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" build-tag: - only: - - tags stage: build + variables: + TARGET: ecloud + SUBPATH: '' + allow_failure: true + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: $CI_COMMIT_TAG == null + when: never + - if: $CI_COMMIT_REF_SLUG =~ /^selfhost/ + variables: + TARGET: "selfhost" + SUBPATH: "/selfhost" + - if: $CI_COMMIT_TAG != null + when: on_success script: - - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" . - - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" + - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" + - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + +docker-tag: + stage: .post + rules: + - when: manual + script: + - echo "SOURCE $SOURCE, TARGET $TARGET" + - docker pull $CI_REGISTRY_IMAGE:$SOURCE + - docker tag $CI_REGISTRY_IMAGE:$SOURCE $CI_REGISTRY_IMAGE:$TARGET + - docker push $CI_REGISTRY_IMAGE:$TARGET diff --git a/Dockerfile b/Dockerfile index 5581b82e..dd303eeb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,9,1/22,2,9,2/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,9,1/22,2,9,3/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images @@ -106,20 +106,45 @@ 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 +# 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 + +RUN sed -i 's/ in Nextcloud/ /' ${BASE_DIR}/custom_apps/integration_google/js/integration_google-personalSettings.js +RUN sed -i 's/Nextcloud administrator/administrator/' ${BASE_DIR}/custom_apps/integration_google/js/integration_google-personalSettings.js + +# Remove changeAvatar in changeUserHook of ldap_write_support as it throws errors +RUN sed -i 's/$this->changeAvatar/\/\/ $this->changeAvatar/' ${BASE_DIR}/custom_apps/ldap_write_support/lib/LDAPUserManager.php + +# 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 + +# Custom theme +RUN curl -fsSL -o eCloud-theme.tar.gz \ + "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/nextcloud-theme/-/archive/${THEME_VERSION}/nextcloud-theme-${THEME_VERSION}.tar.gz" && \ + 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/ + +# Replace "Get your own free account" NC link with /e/ Account link in public pages +RUN sed -i 's/https:\/\/nextcloud.com\/signup\//https:\/\/e\.foundation\/\/e-email-invite\//' ${BASE_DIR}/core/templates/layout.public.php + +ENTRYPOINT ["/custom_entrypoint.sh"] +CMD ["php-fpm"] + +From nextcloud as selfhost +ARG BASE_DIR="/usr/src/nextcloud" +ARG TMP_PATCH_DIR="/tmp/build_patches" # Patches COPY patches/ ${TMP_PATCH_DIR}/ + RUN cd ${BASE_DIR} && patch -p0 < ${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 patch -u ${BASE_DIR}/lib/private/Authentication/Token/PublicKeyTokenProvider.php -i ${TMP_PATCH_DIR}/013-revert-token-password-update.patch @@ -127,36 +152,26 @@ RUN patch -u ${BASE_DIR}/lib/private/legacy/OC_Helper.php -i ${TMP_PATCH_DIR}/01 RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/015-email-mail-template.patch RUN patch -u ${BASE_DIR}/core/templates/layout.guest.php -i ${TMP_PATCH_DIR}/016-login-screen.patch RUN patch -u ${BASE_DIR}/core/Command/User/Setting.php -i ${TMP_PATCH_DIR}/018-occ-user-setting.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-main.js -RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/{name:\[a,"displayname"\]},//' js/calendar-main.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 - -RUN sed -i 's/ in Nextcloud/ /' ${BASE_DIR}/custom_apps/integration_google/js/integration_google-personalSettings.js -RUN sed -i 's/Nextcloud administrator/administrator/' ${BASE_DIR}/custom_apps/integration_google/js/integration_google-personalSettings.js - -# Remove changeAvatar in changeUserHook of ldap_write_support as it throws errors -RUN sed -i 's/$this->changeAvatar/\/\/ $this->changeAvatar/' ${BASE_DIR}/custom_apps/ldap_write_support/lib/LDAPUserManager.php +From selfhost as ecloud +ARG BASE_DIR="/usr/src/nextcloud" +ARG TMP_PATCH_DIR="/tmp/build_patches" -# Custom theme -RUN curl -fsSL -o eCloud-theme.tar.gz \ - "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/nextcloud-theme/-/archive/${THEME_VERSION}/nextcloud-theme-${THEME_VERSION}.tar.gz" && \ - 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/ +# Patches +COPY patches/ ${TMP_PATCH_DIR}/ +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 patch -u ${BASE_DIR}/lib/private/Updater.php -i ${TMP_PATCH_DIR}/010-disable-app-store-upgrade.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 -# Replace "Get your own free account" NC link with /e/ Account link in public pages -RUN sed -i 's/https:\/\/nextcloud.com\/signup\//https:\/\/e\.foundation\/\/e-email-invite\//' ${BASE_DIR}/core/templates/layout.public.php +RUN rm -rf ${TMP_PATCH_DIR} -ENTRYPOINT ["/custom_entrypoint.sh"] -CMD ["php-fpm"] +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-main.js +RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/{name:\[a,"displayname"\]},//' js/calendar-main.js -- GitLab From cd5175d06f5b199b942caeb0683d7619fe003991 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 22 Jul 2022 15:23:28 +0530 Subject: [PATCH 02/42] make selfhost build manual for branches and automatic for tags --- .gitlab-ci.yml | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 75dd630b..358cf9d1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,10 +24,6 @@ build-branch: when: never - if: $CI_COMMIT_TAG != null when: never - - if: $CI_COMMIT_REF_SLUG =~ /^selfhost/ - variables: - TARGET: "selfhost" - SUBPATH: "/selfhost" - if: $CI_COMMIT_REF_SLUG != null when: on_success allow_failure: true @@ -36,6 +32,24 @@ build-branch: - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" +build-branch-selfhost: + stage: build + variables: + TARGET: selfhost + SUBPATH: '/selfhost' + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: $CI_COMMIT_TAG != null + when: never + - if: $CI_COMMIT_REF_SLUG != null + when: manual + allow_failure: true + script: + - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" + - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + build-tag: stage: build variables: @@ -47,10 +61,6 @@ build-tag: when: never - if: $CI_COMMIT_TAG == null when: never - - if: $CI_COMMIT_REF_SLUG =~ /^selfhost/ - variables: - TARGET: "selfhost" - SUBPATH: "/selfhost" - if: $CI_COMMIT_TAG != null when: on_success script: @@ -58,6 +68,25 @@ build-tag: - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" +build-tag-selfhost: + stage: build + variables: + TARGET: selfhost + SUBPATH: '/selfhost' + allow_failure: true + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: $CI_COMMIT_TAG == null + when: never + - if: $CI_COMMIT_TAG != null + when: on_success + script: + - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" + - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + + docker-tag: stage: .post rules: -- GitLab From bfb5a8292b72fe524051794d8c874e1fa2fee28b Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 22 Jul 2022 15:31:06 +0530 Subject: [PATCH 03/42] Remove repeated patch --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dd303eeb..bb3d666c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -168,7 +168,6 @@ RUN patch -u ${BASE_DIR}/core/Controller/ContactsMenuController.php -i ${TMP_PAT 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 patch -u ${BASE_DIR}/lib/private/Updater.php -i ${TMP_PATCH_DIR}/010-disable-app-store-upgrade.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} -- GitLab From 7d9bf7f56d6f55220bc89a2f033d38fb68ed5b5b Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Wed, 27 Jul 2022 14:23:16 +0530 Subject: [PATCH 04/42] improve CI --- .gitlab-ci.yml | 78 ++++++++++++-------------------------------------- 1 file changed, 19 insertions(+), 59 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 358cf9d1..3be72010 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,85 +14,45 @@ default: tags: - generic_privileged +.build-docker: + script: + - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" + - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + build-branch: stage: build variables: TARGET: ecloud SUBPATH: '' - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - when: never - - if: $CI_COMMIT_TAG != null - when: never - - if: $CI_COMMIT_REF_SLUG != null - when: on_success - allow_failure: true - script: - - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" - - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . - - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + only: + - branches + extends: .build-docker build-branch-selfhost: stage: build variables: TARGET: selfhost SUBPATH: '/selfhost' - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - when: never - - if: $CI_COMMIT_TAG != null - when: never - - if: $CI_COMMIT_REF_SLUG != null - when: manual - allow_failure: true - script: - - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" - - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . - - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + only: + - branches + when: manual + extends: .build-docker build-tag: stage: build variables: TARGET: ecloud SUBPATH: '' - allow_failure: true - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - when: never - - if: $CI_COMMIT_TAG == null - when: never - - if: $CI_COMMIT_TAG != null - when: on_success - script: - - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" - - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . - - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + only: + - tags + extends: .build-docker build-tag-selfhost: stage: build variables: TARGET: selfhost SUBPATH: '/selfhost' - allow_failure: true - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - when: never - - if: $CI_COMMIT_TAG == null - when: never - - if: $CI_COMMIT_TAG != null - when: on_success - script: - - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" - - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . - - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" - - -docker-tag: - stage: .post - rules: - - when: manual - script: - - echo "SOURCE $SOURCE, TARGET $TARGET" - - docker pull $CI_REGISTRY_IMAGE:$SOURCE - - docker tag $CI_REGISTRY_IMAGE:$SOURCE $CI_REGISTRY_IMAGE:$TARGET - - docker push $CI_REGISTRY_IMAGE:$TARGET + only: + - tags + extends: .build-docker -- GitLab From 4530d5ee502a4f3d6ee4c32e7911f105c5e7d66a Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 27 Jul 2022 15:28:17 +0530 Subject: [PATCH 05/42] Re-add app store upgrade patch --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index bb3d666c..ca76a59f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,9,1/22,2,9,3/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,9,1/22,2,9,4/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images @@ -145,6 +145,7 @@ RUN patch -u ${BASE_DIR}/apps/settings/lib/Settings/Personal/ServerDevNotice.php 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 patch -u ${BASE_DIR}/lib/private/Authentication/Token/PublicKeyTokenProvider.php -i ${TMP_PATCH_DIR}/013-revert-token-password-update.patch @@ -167,7 +168,6 @@ 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 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 patch -u ${BASE_DIR}/lib/private/Updater.php -i ${TMP_PATCH_DIR}/010-disable-app-store-upgrade.patch RUN rm -rf ${TMP_PATCH_DIR} -- GitLab From 593f57ba7d8f34fcedc0a247e0de3b47035e44e5 Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 11 Aug 2022 08:26:37 +0000 Subject: [PATCH 06/42] performance fix, replace alt domain suffix in client login --- patches/002-login-without-domain.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/patches/002-login-without-domain.patch b/patches/002-login-without-domain.patch index faefb4a7..ff52c4c0 100644 --- a/patches/002-login-without-domain.patch +++ b/patches/002-login-without-domain.patch @@ -66,3 +66,19 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll Util::emitHook( '\OCA\Files_Sharing\API\Server2Server', 'preLoginNameUsedAsUserName', + +--- ./lib/private/User/Session.php 2022-08-10 15:39:33.131890282 +0530 ++++ ./lib/private/User/Session-new.php 2022-08-10 15:48:23.236165783 +0530 +@@ -438,7 +438,11 @@ + IRequest $request, + OC\Security\Bruteforce\Throttler $throttler) { + $currentDelay = $throttler->sleepDelay($request->getRemoteAddress(), 'login'); +- ++ ++ $altDomain = $this->config->getSystemValue('alt_mail_domain', ''); ++ $altDomainSuffix = !empty($altDomain) ? '@' . $altDomain : ''; ++ $user = str_replace($altDomainSuffix, '', $user); ++ + if ($this->manager instanceof PublicEmitter) { + $this->manager->emit('\OC\User', 'preLogin', [$user, $password]); + } -- GitLab From 5342842a00f60d64a86a78e4eb8ce5041afab0ee Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 16 Aug 2022 20:24:14 +0530 Subject: [PATCH 07/42] Fix web authn login regression --- patches/002-login-without-domain.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/002-login-without-domain.patch b/patches/002-login-without-domain.patch index ff52c4c0..847c5635 100644 --- a/patches/002-login-without-domain.patch +++ b/patches/002-login-without-domain.patch @@ -45,9 +45,9 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll $uid = $loginName; + $uid = trim($uid); + $uid = mb_strtolower($uid, 'UTF-8'); -+ $domain = $this->config->getSystemValue('mail_domain', ''); ++ $domain = \OC::$server->getConfig()->getSystemValue('mail_domain', ''); + $domain_suffix = !empty($domain) ? '@' . $domain : ''; -+ $alt_domain = $this->config->getSystemValue('alt_mail_domain', ''); ++ $alt_domain = \OC::$server->getConfig()->getSystemValue('alt_mail_domain', ''); + $alt_domain_suffix = !empty($alt_domain) ? '@' . $alt_domain : ''; + $admin_username = $_ENV["NEXTCLOUD_ADMIN_USER"]; + $is_admin = strcmp($uid, $admin_username) === 0; -- GitLab From 68922f3554a028aa3a737d192d9be439e31b87e0 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 18 Aug 2022 09:34:26 +0530 Subject: [PATCH 08/42] login with device fix --- patches/002-login-without-domain.patch | 31 +++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/patches/002-login-without-domain.patch b/patches/002-login-without-domain.patch index 847c5635..8f34f35c 100644 --- a/patches/002-login-without-domain.patch +++ b/patches/002-login-without-domain.patch @@ -12,7 +12,7 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll @@ -303,6 +303,27 @@ return $this->generateRedirect($redirect_url); } - + + $user = trim($user); + $user = mb_strtolower($user, 'UTF-8'); + $domain = $this->config->getSystemValue('mail_domain', ''); @@ -37,10 +37,18 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll $data = new LoginData( $this->request, trim($user), ---- ./core/Controller/WebAuthnController.php 2022-05-11 11:11:55.469731468 +0530 -+++ ./core/Controller/WebAuthnController-new.php 2022-05-30 19:34:53.540848852 +0530 -@@ -73,6 +73,26 @@ - +--- ./core/Controller/WebAuthnController.php 2022-08-18 09:19:54.820199100 +0530 ++++ ./core/Controller/WebAuthnController-new.php 2022-08-18 09:29:53.340199100 +0530 +@@ -37,6 +37,7 @@ + use OCP\ISession; + use OCP\Util; + use Webauthn\PublicKeyCredentialRequestOptions; ++use OCP\IUserManager; + + class WebAuthnController extends Controller { + private const WEBAUTHN_LOGIN = 'webauthn_login'; +@@ -73,6 +74,26 @@ + $this->logger->debug('Converting login name to UID'); $uid = $loginName; + $uid = trim($uid); @@ -59,13 +67,20 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll + $uid = str_replace($alt_domain_suffix, '', $uid); + } + -+ if(!$this->userManager->userExists($uid)) { ++ if(!\OC::$server->get(IUserManager::class)->userExists($uid)) { + $uid = $uid . $domain_suffix; + } + Util::emitHook( '\OCA\Files_Sharing\API\Server2Server', 'preLoginNameUsedAsUserName', +@@ -115,4 +136,4 @@ + + return new JSONResponse([]); + } +-} +\ No newline at end of file ++} --- ./lib/private/User/Session.php 2022-08-10 15:39:33.131890282 +0530 +++ ./lib/private/User/Session-new.php 2022-08-10 15:48:23.236165783 +0530 @@ -74,11 +89,11 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll OC\Security\Bruteforce\Throttler $throttler) { $currentDelay = $throttler->sleepDelay($request->getRemoteAddress(), 'login'); - -+ ++ + $altDomain = $this->config->getSystemValue('alt_mail_domain', ''); + $altDomainSuffix = !empty($altDomain) ? '@' . $altDomain : ''; + $user = str_replace($altDomainSuffix, '', $user); -+ ++ if ($this->manager instanceof PublicEmitter) { $this->manager->emit('\OC\User', 'preLogin', [$user, $password]); } -- GitLab From 2596646dd350e85d1af2bf012630aaab62e1376b Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 18 Aug 2022 09:45:06 +0530 Subject: [PATCH 09/42] login with device fix --- 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 8f34f35c..f50a34c0 100644 --- a/patches/002-login-without-domain.patch +++ b/patches/002-login-without-domain.patch @@ -37,7 +37,7 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll $data = new LoginData( $this->request, trim($user), ---- ./core/Controller/WebAuthnController.php 2022-08-18 09:19:54.820199100 +0530 +--- ./core/Controller/WebAuthnController.php 2022-08-18 09:41:40.030199100 +0530 +++ ./core/Controller/WebAuthnController-new.php 2022-08-18 09:29:53.340199100 +0530 @@ -37,6 +37,7 @@ use OCP\ISession; -- GitLab From 81ebbadd98a3e300f457bf8da41a4bc5469c2e18 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 18 Aug 2022 09:57:28 +0530 Subject: [PATCH 10/42] login with device fix --- patches/002-login-without-domain.patch | 48 +++++++++----------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/patches/002-login-without-domain.patch b/patches/002-login-without-domain.patch index f50a34c0..363cefe9 100644 --- a/patches/002-login-without-domain.patch +++ b/patches/002-login-without-domain.patch @@ -37,7 +37,7 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll $data = new LoginData( $this->request, trim($user), ---- ./core/Controller/WebAuthnController.php 2022-08-18 09:41:40.030199100 +0530 +--- ./core/Controller/WebAuthnController.php 2022-08-18 09:54:41.180199100 +0530 +++ ./core/Controller/WebAuthnController-new.php 2022-08-18 09:29:53.340199100 +0530 @@ -37,6 +37,7 @@ use OCP\ISession; @@ -47,40 +47,26 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll class WebAuthnController extends Controller { private const WEBAUTHN_LOGIN = 'webauthn_login'; -@@ -73,6 +74,26 @@ - - $this->logger->debug('Converting login name to UID'); +@@ -75,9 +76,9 @@ $uid = $loginName; -+ $uid = trim($uid); -+ $uid = mb_strtolower($uid, 'UTF-8'); + $uid = trim($uid); + $uid = mb_strtolower($uid, 'UTF-8'); +- $domain = $this->config->getSystemValue('mail_domain', ''); + $domain = \OC::$server->getConfig()->getSystemValue('mail_domain', ''); -+ $domain_suffix = !empty($domain) ? '@' . $domain : ''; + $domain_suffix = !empty($domain) ? '@' . $domain : ''; +- $alt_domain = $this->config->getSystemValue('alt_mail_domain', ''); + $alt_domain = \OC::$server->getConfig()->getSystemValue('alt_mail_domain', ''); -+ $alt_domain_suffix = !empty($alt_domain) ? '@' . $alt_domain : ''; -+ $admin_username = $_ENV["NEXTCLOUD_ADMIN_USER"]; -+ $is_admin = strcmp($uid, $admin_username) === 0; -+ -+ if(!$is_admin && stristr($uid, $domain_suffix) !== FALSE) { -+ $uid = str_replace($domain_suffix, '', $uid); -+ } -+ if (!$is_admin && stristr($uid, $alt_domain_suffix) !== FALSE) { -+ $uid = str_replace($alt_domain_suffix, '', $uid); -+ } -+ -+ if(!\OC::$server->get(IUserManager::class)->userExists($uid)) { -+ $uid = $uid . $domain_suffix; -+ } -+ - Util::emitHook( - '\OCA\Files_Sharing\API\Server2Server', - 'preLoginNameUsedAsUserName', -@@ -115,4 +136,4 @@ + $alt_domain_suffix = !empty($alt_domain) ? '@' . $alt_domain : ''; + $admin_username = $_ENV["NEXTCLOUD_ADMIN_USER"]; + $is_admin = strcmp($uid, $admin_username) === 0; +@@ -89,7 +90,7 @@ + $uid = str_replace($alt_domain_suffix, '', $uid); + } - return new JSONResponse([]); - } --} -\ No newline at end of file -+} +- if(!$this->userManager->userExists($uid)) { ++ if(!\OC::$server->get(IUserManager::class)->userExists($uid)) { + $uid = $uid . $domain_suffix; + } --- ./lib/private/User/Session.php 2022-08-10 15:39:33.131890282 +0530 +++ ./lib/private/User/Session-new.php 2022-08-10 15:48:23.236165783 +0530 -- GitLab From e2668ede6c7ceb5d3e1905f42697fdac3ae5d23f Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 18 Aug 2022 10:15:38 +0530 Subject: [PATCH 11/42] login with device fix --- patches/002-login-without-domain.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/patches/002-login-without-domain.patch b/patches/002-login-without-domain.patch index 363cefe9..a97a737f 100644 --- a/patches/002-login-without-domain.patch +++ b/patches/002-login-without-domain.patch @@ -37,8 +37,8 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll $data = new LoginData( $this->request, trim($user), ---- ./core/Controller/WebAuthnController.php 2022-08-18 09:54:41.180199100 +0530 -+++ ./core/Controller/WebAuthnController-new.php 2022-08-18 09:29:53.340199100 +0530 +--- ./core/Controller/WebAuthnController.php 2022-08-18 10:14:10.940199100 +0530 ++++ ./core/Controller/WebAuthnController-new.php 2022-08-18 10:14:17.280199100 +0530 @@ -37,6 +37,7 @@ use OCP\ISession; use OCP\Util; @@ -68,6 +68,7 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll $uid = $uid . $domain_suffix; } + --- ./lib/private/User/Session.php 2022-08-10 15:39:33.131890282 +0530 +++ ./lib/private/User/Session-new.php 2022-08-10 15:48:23.236165783 +0530 @@ -438,7 +438,11 @@ -- GitLab From a3e1752779e3605990ee0a658edf1f13d2ddc25a Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 18 Aug 2022 10:35:31 +0530 Subject: [PATCH 12/42] login with device fix --- patches/002-login-without-domain.patch | 42 +++++++++++++++----------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/patches/002-login-without-domain.patch b/patches/002-login-without-domain.patch index a97a737f..b8575978 100644 --- a/patches/002-login-without-domain.patch +++ b/patches/002-login-without-domain.patch @@ -37,8 +37,8 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll $data = new LoginData( $this->request, trim($user), ---- ./core/Controller/WebAuthnController.php 2022-08-18 10:14:10.940199100 +0530 -+++ ./core/Controller/WebAuthnController-new.php 2022-08-18 10:14:17.280199100 +0530 +--- ./core/Controller/WebAuthnController.php 2022-08-18 10:33:16.150199100 +0530 ++++ ./core/Controller/WebAuthnController-new.php 2022-08-18 10:34:31.880199100 +0530 @@ -37,6 +37,7 @@ use OCP\ISession; use OCP\Util; @@ -47,26 +47,32 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll class WebAuthnController extends Controller { private const WEBAUTHN_LOGIN = 'webauthn_login'; -@@ -75,9 +76,9 @@ +@@ -73,6 +74,25 @@ + + $this->logger->debug('Converting login name to UID'); $uid = $loginName; - $uid = trim($uid); - $uid = mb_strtolower($uid, 'UTF-8'); -- $domain = $this->config->getSystemValue('mail_domain', ''); ++ $uid = trim($uid); ++ $uid = mb_strtolower($uid, 'UTF-8'); + $domain = \OC::$server->getConfig()->getSystemValue('mail_domain', ''); - $domain_suffix = !empty($domain) ? '@' . $domain : ''; -- $alt_domain = $this->config->getSystemValue('alt_mail_domain', ''); ++ $domain_suffix = !empty($domain) ? '@' . $domain : ''; + $alt_domain = \OC::$server->getConfig()->getSystemValue('alt_mail_domain', ''); - $alt_domain_suffix = !empty($alt_domain) ? '@' . $alt_domain : ''; - $admin_username = $_ENV["NEXTCLOUD_ADMIN_USER"]; - $is_admin = strcmp($uid, $admin_username) === 0; -@@ -89,7 +90,7 @@ - $uid = str_replace($alt_domain_suffix, '', $uid); - } - -- if(!$this->userManager->userExists($uid)) { ++ $alt_domain_suffix = !empty($alt_domain) ? '@' . $alt_domain : ''; ++ $admin_username = $_ENV["NEXTCLOUD_ADMIN_USER"]; ++ $is_admin = strcmp($uid, $admin_username) === 0; ++ ++ if(!$is_admin && stristr($uid, $domain_suffix) !== FALSE) { ++ $uid = str_replace($domain_suffix, '', $uid); ++ } ++ if (!$is_admin && stristr($uid, $alt_domain_suffix) !== FALSE) { ++ $uid = str_replace($alt_domain_suffix, '', $uid); ++ } ++ + if(!\OC::$server->get(IUserManager::class)->userExists($uid)) { - $uid = $uid . $domain_suffix; - } ++ $uid = $uid . $domain_suffix; ++ } + Util::emitHook( + '\OCA\Files_Sharing\API\Server2Server', + 'preLoginNameUsedAsUserName', --- ./lib/private/User/Session.php 2022-08-10 15:39:33.131890282 +0530 -- GitLab From 2e2c7fecf595f43108c45993b30c87bbc6d40eeb Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 7 Jul 2022 09:49:27 +0530 Subject: [PATCH 13/42] changes for email template modification on update --- patches/015-email-mail-template.patch | 205 ++++++++++++++++++-------- 1 file changed, 141 insertions(+), 64 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 6db695c7..4b6691b7 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -1,83 +1,160 @@ ---- apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-04-27 09:57:34.955523100 +0530 -+++ apps/dav/lib/CalDAV/Schedule/IMipPlugin_Modifiednew.php 2022-04-27 09:57:09.345523100 +0530 -@@ -659,7 +659,7 @@ - Message $iTipMessage, $lastOccurrence) { - $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); - -- $template->addBodyButtonGroup( -+ $template->addBodyButtonGroupTentative( - $l10n->t('Accept'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ - 'token' => $token, -@@ -667,18 +667,11 @@ - $l10n->t('Decline'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ - 'token' => $token, -- ]) -+ ]), -+ $l10n->t('Maybe'), -+ $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) - ); +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-07 09:40:41.675627600 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-07 09:45:48.035627600 +0530 +@@ -151,15 +151,6 @@ + */ + public function schedule(Message $iTipMessage) { -- $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ -- 'token' => $token, -- ]); -- $html = vsprintf('%s', [ -- $moreOptionsURL, $l10n->t('More options …') -- ]); -- $text = $l10n->t('More options at %s', [$moreOptionsURL]); +- // Not sending any emails if the system considers the update +- // insignificant. +- if (!$iTipMessage->significantChange) { +- if (!$iTipMessage->scheduleStatus) { +- $iTipMessage->scheduleStatus = '1.0;We got the message, but it\'s not significant enough to warrant an email'; +- } +- return; +- } - -- $template->addBodyText($html, $text); - } + $summary = $iTipMessage->message->VEVENT->SUMMARY; - /** + if (parse_url($iTipMessage->sender, PHP_URL_SCHEME) !== 'mailto') { +@@ -414,7 +405,7 @@ + return false; + } ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-04 12:41:03.228533600 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-04 14:42:56.208533600 +0530 -@@ -419,23 +419,33 @@ +- /** ++ /** + * @param IL10N $l10n * @param VEvent $vevent */ - private function generateWhenString(IL10N $l10n, VEvent $vevent) { -- $dtstart = $vevent->DTSTART; -- if (isset($vevent->DTEND)) { -- $dtend = $vevent->DTEND; -- } elseif (isset($vevent->DURATION)) { -- $isFloating = $vevent->DTSTART->isFloating(); -- $dtend = clone $vevent->DTSTART; +@@ -542,21 +533,57 @@ + * @param VEVENT $vevent + */ + private function addBulletList(IEMailTemplate $template, IL10N $l10n, $vevent) { +- if ($vevent->SUMMARY) { +- $template->addBodyListItem($vevent->SUMMARY, $l10n->t('Title:'), +- $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + $lastmodified=0; -+ $selectedEvent = $vevent; ++ $selectedEvent = $parentevent = $vevent; + foreach( $vevent as $currentevent){ + $dtstamp= $currentevent->{'LAST-MODIFIED'}; + $dtstampTime = strtotime($dtstamp); + if($dtstampTime>$lastmodified){ + $lastmodified=$dtstampTime; + $selectedEvent = $currentevent; ++ } + } +- $meetingWhen = $this->generateWhenString($l10n, $vevent); ++ ++ if ($selectedEvent->SUMMARY) { ++ ++ if(trim($selectedEvent->SUMMARY)==trim($parentevent->SUMMARY)){ ++ $template->addBodyListItem($selectedEvent->SUMMARY, $l10n->t('Title:'), ++ $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); ++ }else{ ++ $template->addBodyListItemModified($selectedEvent->SUMMARY, $l10n->t('Updated Title:'), ++ $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + } + } -+ $dtstart = $selectedEvent->DTSTART; -+ if (isset($selectedEvent->DTEND)) { -+ $dtend = $selectedEvent->DTEND; -+ } elseif (isset($selectedEvent->DURATION)) { -+ $isFloating = $selectedEvent->DTSTART->isFloating(); -+ $dtend = clone $selectedEvent->DTSTART; - $endDateTime = $dtend->getDateTime(); -- $endDateTime = $endDateTime->add(DateTimeParser::parse($vevent->DURATION->getValue())); -+ $endDateTime = $endDateTime->add(DateTimeParser::parse($selectedEvent->DURATION->getValue())); - $dtend->setDateTime($endDateTime, $isFloating); -- } elseif (!$vevent->DTSTART->hasTime()) { -- $isFloating = $vevent->DTSTART->isFloating(); -- $dtend = clone $vevent->DTSTART; -+ } elseif (!$selectedEvent->DTSTART->hasTime()) { -+ $isFloating = $selectedEvent->DTSTART->isFloating(); -+ $dtend = clone $selectedEvent->DTSTART; - $endDateTime = $dtend->getDateTime(); - $endDateTime = $endDateTime->modify('+1 day'); - $dtend->setDateTime($endDateTime, $isFloating); - } else { -- $dtend = clone $vevent->DTSTART; -+ $dtend = clone $selectedEvent->DTSTART; ++ $meetingWhen = $this->generateWhenString($l10n, $selectedEvent); + if ($meetingWhen) { +- $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), +- $this->getAbsoluteImagePath('caldav/time.png'),'','',self::IMIP_INDENT); ++ $selectedtimestart= substr(($selectedEvent->DTSTART), strpos(($selectedEvent->DTSTART), "T") + 1); ++ $parenttimestart= substr(($parentevent->DTSTART), strpos(($parentevent->DTSTART), "T") + 1); ++ $selectedtimeend= substr(($selectedEvent->DTEND), strpos(($selectedEvent->DTEND), "T") + 1); ++ $parenttimeend= substr(($parentevent->DTEND), strpos(($parentevent->DTEND), "T") + 1); ++ ++ if(trim($selectedtimestart)==trim($parenttimestart) && trim($selectedtimeend)==trim($parenttimeend)){ ++ $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), ++ $this->getAbsoluteImagePath('caldav/time.png'),'','',self::IMIP_INDENT); ++ }else{ ++ $template->addBodyListItemModified($meetingWhen, $l10n->t('Updated Time:'), ++ $this->getAbsoluteImagePath('caldav/time.png'),'','',self::IMIP_INDENT); ++ } ++ ++ + } +- if ($vevent->LOCATION) { +- $template->addBodyListItem($vevent->LOCATION, $l10n->t('Location:'), +- $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); ++ if ($selectedEvent->LOCATION) { ++ if(trim($selectedEvent->LOCATION)==trim($parentevent->LOCATION)){ ++ $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), ++ $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); ++ }else{ ++ $template->addBodyListItemModified($selectedEvent->LOCATION, $l10n->t('Updated Location:'), ++ $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); ++ } ++ ++ } +- if ($vevent->URL) { +- $url = $vevent->URL->getValue(); ++ if ($selectedEvent->URL) { ++ $url = $selectedEvent->URL->getValue(); + $template->addBodyListItem(sprintf('%s', + htmlspecialchars($url), + htmlspecialchars($url)), +@@ -565,12 +592,18 @@ + $url,'',self::IMIP_INDENT); + } + +- $this->addAttendees($template, $l10n, $vevent); ++ $this->addAttendees($template, $l10n, $selectedEvent); + + /* Put description last, like an email body, since it can be arbitrarily long */ +- if ($vevent->DESCRIPTION) { +- $template->addBodyListItem($vevent->DESCRIPTION->getValue(), $l10n->t('Description:'), +- $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); ++ if ($selectedEvent->DESCRIPTION) { ++ if(trim($selectedEvent->DESCRIPTION)==trim($parentevent->DESCRIPTION)){ ++ $template->addBodyListItem($selectedEvent->DESCRIPTION->getValue(), $l10n->t('Description:'), ++ $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); ++ }else{ ++ $template->addBodyListItemModified($selectedEvent->DESCRIPTION, $l10n->t('Updated Description:'), ++ $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); ++ } ++ + } + } + +@@ -659,7 +692,7 @@ + Message $iTipMessage, $lastOccurrence) { + $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); + +- $template->addBodyButtonGroupTentative( ++ $template->addBodyButtonGroup( + $l10n->t('Accept'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ + 'token' => $token, +@@ -667,11 +700,18 @@ + $l10n->t('Decline'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ + 'token' => $token, +- ]), +- $l10n->t('Maybe'), +- $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ++ ]) + ); + ++ $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ ++ 'token' => $token, ++ ]); ++ $html = vsprintf('%s', [ ++ $moreOptionsURL, $l10n->t('More options …') ++ ]); ++ $text = $l10n->t('More options at %s', [$moreOptionsURL]); ++ ++ $template->addBodyText($html, $text); + } + + /** +@@ -716,4 +756,4 @@ + + return $token; + } +-} ++} +\ No newline at end of file - $isAllDay = $dtstart instanceof Property\ICalendar\Date; -- GitLab From 5024c55938564a896cec868a42699a2fbd8911ca Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 7 Jul 2022 09:52:13 +0530 Subject: [PATCH 14/42] changes for email template modification on update --- patches/015-email-mail-template.patch | 3 --- 1 file changed, 3 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 4b6691b7..accc2d85 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -155,6 +155,3 @@ -} +} \ No newline at end of file - - - -- GitLab From 0d5f6688650eb5f3a56c12cceeb32aa29d4c7a5a Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 7 Jul 2022 09:57:44 +0530 Subject: [PATCH 15/42] changes for email template modification on update --- patches/015-email-mail-template.patch | 41 ++++----------------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index accc2d85..2fbfc462 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -1,4 +1,4 @@ ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-07 09:40:41.675627600 +0530 +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-07 09:56:28.335627600 +0530 +++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-07 09:45:48.035627600 +0530 @@ -151,15 +151,6 @@ */ @@ -41,8 +41,7 @@ + $lastmodified=$dtstampTime; + $selectedEvent = $currentevent; + } - } -- $meetingWhen = $this->generateWhenString($l10n, $vevent); ++ } + + if ($selectedEvent->SUMMARY) { + @@ -53,7 +52,8 @@ + $template->addBodyListItemModified($selectedEvent->SUMMARY, $l10n->t('Updated Title:'), + $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + } -+ } + } +- $meetingWhen = $this->generateWhenString($l10n, $vevent); + $meetingWhen = $this->generateWhenString($l10n, $selectedEvent); if ($meetingWhen) { - $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), @@ -117,38 +117,7 @@ } } -@@ -659,7 +692,7 @@ - Message $iTipMessage, $lastOccurrence) { - $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); - -- $template->addBodyButtonGroupTentative( -+ $template->addBodyButtonGroup( - $l10n->t('Accept'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ - 'token' => $token, -@@ -667,11 +700,18 @@ - $l10n->t('Decline'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ - 'token' => $token, -- ]), -- $l10n->t('Maybe'), -- $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) -+ ]) - ); - -+ $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ -+ 'token' => $token, -+ ]); -+ $html = vsprintf('%s', [ -+ $moreOptionsURL, $l10n->t('More options …') -+ ]); -+ $text = $l10n->t('More options at %s', [$moreOptionsURL]); -+ -+ $template->addBodyText($html, $text); - } - - /** -@@ -716,4 +756,4 @@ +@@ -723,4 +756,4 @@ return $token; } -- GitLab From a09d73c04d7e0f44d790701c457932ddc773c9f3 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 7 Jul 2022 10:06:09 +0530 Subject: [PATCH 16/42] changes for email template modification on update --- patches/015-email-mail-template.patch | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 2fbfc462..79ac9b29 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -1,3 +1,37 @@ +--- apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-04-27 09:57:34.955523100 +0530 ++++ apps/dav/lib/CalDAV/Schedule/IMipPlugin_Modifiednew.php 2022-04-27 09:57:09.345523100 +0530 +@@ -659,7 +659,7 @@ + Message $iTipMessage, $lastOccurrence) { + $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); + +- $template->addBodyButtonGroup( ++ $template->addBodyButtonGroupTentative( + $l10n->t('Accept'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ + 'token' => $token, +@@ -667,18 +667,11 @@ + $l10n->t('Decline'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ + 'token' => $token, +- ]) ++ ]), ++ $l10n->t('Maybe'), ++ $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) + ); + +- $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ +- 'token' => $token, +- ]); +- $html = vsprintf('%s', [ +- $moreOptionsURL, $l10n->t('More options …') +- ]); +- $text = $l10n->t('More options at %s', [$moreOptionsURL]); +- +- $template->addBodyText($html, $text); + } + + /** + --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-07 09:56:28.335627600 +0530 +++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-07 09:45:48.035627600 +0530 @@ -151,15 +151,6 @@ -- GitLab From 60c9274dfee2eacd7ee0fc685899de913d692109 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 27 Jul 2022 13:47:55 +0530 Subject: [PATCH 17/42] added new messages and guest --- patches/015-email-mail-template.patch | 119 +++++++++++++++++++++++--- 1 file changed, 107 insertions(+), 12 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 79ac9b29..d96507b0 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -30,10 +30,8 @@ - $template->addBodyText($html, $text); } - /** - ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-07 09:56:28.335627600 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-07 09:45:48.035627600 +0530 +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-27 13:21:50.294113800 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-27 12:56:55.734113800 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { @@ -50,7 +48,34 @@ $summary = $iTipMessage->message->VEVENT->SUMMARY; if (parse_url($iTipMessage->sender, PHP_URL_SCHEME) !== 'mailto') { -@@ -414,7 +405,7 @@ +@@ -252,9 +243,25 @@ + + $summary = ((string) $summary !== '') ? (string) $summary : $l10n->t('Untitled event'); + +- $this->addSubjectAndHeading($template, $l10n, $method, $summary); ++ if( count($vevent)>1){ ++ $this->addSubjectAndHeadingUpdated($template, $l10n, $method, $summary); ++ ++ }else{ ++ $this->addSubjectAndHeading($template, $l10n, $method, $summary); ++ } ++ if ($method === self::METHOD_CANCEL) { ++ $template->addHeadingBanner('#FFC2B9','#7D1000',$l10n->t('The invitation has been cancelled')); ++ } ++ if ($method !== self::METHOD_CANCEL && $method !== self::METHOD_REPLY && count($vevent)>1) { ++ $template->addHeadingBanner('#EFFFDB','#293618',$l10n->t('This recurring event has been updated, please review the information below:')); ++ } ++ $sequence = $vevent->SEQUENCE->getValue(); ++ if ($method !== self::METHOD_CANCEL && $method !== self::METHOD_REPLY && count($vevent)==1 && ($sequence > 2)) { ++ $template->addHeadingBanner('#EFFFDB','#293618',$l10n->t('This event has been updated, please review the information below:')); ++ } + $this->addBulletList($template, $l10n, $vevent); + ++ + // Only add response buttons to invitation requests: Fix Issue #11230 + if (($method == self::METHOD_REQUEST) && $this->getAttendeeRsvpOrReqForParticipant($attendee)) { + +@@ -414,7 +421,7 @@ return false; } @@ -59,7 +84,33 @@ * @param IL10N $l10n * @param VEvent $vevent */ -@@ -542,21 +533,57 @@ +@@ -535,28 +542,85 @@ + $template->addHeading($l10n->t('Invitation')); + } + } +- ++ /** ++ * @param IEMailTemplate $template ++ * @param IL10N $l10n ++ * @param string $method ++ * @param string $summary ++ */ ++ private function addSubjectAndHeadingUpdated(IEMailTemplate $template, IL10N $l10n, ++ $method, $summary) { ++ if ($method === self::METHOD_CANCEL) { ++ $template->setSubject('Canceled: ' . $summary); ++ $template->addHeading($l10n->t('Invitation canceled')); ++ } elseif ($method === self::METHOD_REPLY) { ++ $template->setSubject('Re: ' . $summary); ++ $template->addHeading($l10n->t('Invitation updated')); ++ } else { ++ $template->setSubject('Invitation: ' . $summary); ++ $template->addHeading($l10n->t('Invitation Update')); ++ } ++ } + /** + * @param IEMailTemplate $template + * @param IL10N $l10n * @param VEVENT $vevent */ private function addBulletList(IEMailTemplate $template, IL10N $l10n, $vevent) { @@ -75,7 +126,9 @@ + $lastmodified=$dtstampTime; + $selectedEvent = $currentevent; + } -+ } + } +- $meetingWhen = $this->generateWhenString($l10n, $vevent); ++ + + if ($selectedEvent->SUMMARY) { + @@ -86,8 +139,7 @@ + $template->addBodyListItemModified($selectedEvent->SUMMARY, $l10n->t('Updated Title:'), + $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + } - } -- $meetingWhen = $this->generateWhenString($l10n, $vevent); ++ } + $meetingWhen = $this->generateWhenString($l10n, $selectedEvent); if ($meetingWhen) { - $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), @@ -110,7 +162,9 @@ - if ($vevent->LOCATION) { - $template->addBodyListItem($vevent->LOCATION, $l10n->t('Location:'), - $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); ++ + if ($selectedEvent->LOCATION) { ++ + if(trim($selectedEvent->LOCATION)==trim($parentevent->LOCATION)){ + $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); @@ -128,7 +182,7 @@ $template->addBodyListItem(sprintf('%s', htmlspecialchars($url), htmlspecialchars($url)), -@@ -565,12 +592,18 @@ +@@ -565,12 +629,28 @@ $url,'',self::IMIP_INDENT); } @@ -148,13 +202,54 @@ + $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); + } + ++ } ++ if (isset($selectedEvent->ATTENDEE)) { ++ $finalguests=''; ++ foreach ($selectedEvent->ATTENDEE as $attendee) { ++ $emailid= substr(($attendee->getValue()),7); ++ $finalguests.=$emailid.' -'.$attendee['PARTSTAT'].', '; ++ ++ } ++ $template->addBodyListItem($finalguests, $l10n->t('Guests:'), ++ $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); } } -@@ -723,4 +756,4 @@ +@@ -659,7 +739,7 @@ + Message $iTipMessage, $lastOccurrence) { + $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); + +- $template->addBodyButtonGroupTentative( ++ $template->addBodyButtonGroup( + $l10n->t('Accept'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ + 'token' => $token, +@@ -667,11 +747,18 @@ + $l10n->t('Decline'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ + 'token' => $token, +- ]), +- $l10n->t('Maybe'), +- $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ++ ]) + ); + ++ $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ ++ 'token' => $token, ++ ]); ++ $html = vsprintf('%s', [ ++ $moreOptionsURL, $l10n->t('More options …') ++ ]); ++ $text = $l10n->t('More options at %s', [$moreOptionsURL]); ++ ++ $template->addBodyText($html, $text); + } + + /** +@@ -716,4 +803,4 @@ return $token; } -} +} -\ No newline at end of file +\ No newline at end of file \ No newline at end of file -- GitLab From 6cf25d21a1fca3e46d32758183c5f7a7db89dc7f Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 27 Jul 2022 13:54:02 +0530 Subject: [PATCH 18/42] added new messages and guest --- patches/015-email-mail-template.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index d96507b0..7185a93c 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -30,8 +30,10 @@ - $template->addBodyText($html, $text); } + /** + --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-27 13:21:50.294113800 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-27 12:56:55.734113800 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-27 13:52:13.154113800 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { @@ -252,4 +254,4 @@ } -} +} -\ No newline at end of file \ No newline at end of file +\ No newline at end of file -- GitLab From 7e88077dac1f33aff8b60e814566902c45fe45a5 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 28 Jul 2022 11:47:30 +0530 Subject: [PATCH 19/42] added guest --- patches/015-email-mail-template.patch | 35 +++++---------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 7185a93c..5b2b5df1 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -33,7 +33,7 @@ /** --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-27 13:21:50.294113800 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-27 13:52:13.154113800 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-28 11:43:03.254435200 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { @@ -217,38 +217,15 @@ } } -@@ -659,7 +739,7 @@ - Message $iTipMessage, $lastOccurrence) { - $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); - -- $template->addBodyButtonGroupTentative( -+ $template->addBodyButtonGroup( - $l10n->t('Accept'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ - 'token' => $token, -@@ -667,11 +747,18 @@ - $l10n->t('Decline'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ - 'token' => $token, -- ]), -- $l10n->t('Maybe'), -- $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) -+ ]) +@@ -671,7 +751,6 @@ + $l10n->t('Maybe'), + $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ); - -+ $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ -+ 'token' => $token, -+ ]); -+ $html = vsprintf('%s', [ -+ $moreOptionsURL, $l10n->t('More options …') -+ ]); -+ $text = $l10n->t('More options at %s', [$moreOptionsURL]); -+ -+ $template->addBodyText($html, $text); +- } /** -@@ -716,4 +803,4 @@ +@@ -716,4 +795,4 @@ return $token; } -- GitLab From f12972e32f938176b658cee07995718cd4dabfcc Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Mon, 8 Aug 2022 18:05:12 +0530 Subject: [PATCH 20/42] email template mod --- patches/015-email-mail-template.patch | 28 +++++++++------------------ 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 5b2b5df1..bbc0a5f3 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -32,8 +32,8 @@ /** ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-27 13:21:50.294113800 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-28 11:43:03.254435200 +0530 +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-08-08 17:59:57.632858800 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-08-08 17:21:58.792858800 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { @@ -128,8 +128,7 @@ + $lastmodified=$dtstampTime; + $selectedEvent = $currentevent; + } - } -- $meetingWhen = $this->generateWhenString($l10n, $vevent); ++ } + + + if ($selectedEvent->SUMMARY) { @@ -141,7 +140,8 @@ + $template->addBodyListItemModified($selectedEvent->SUMMARY, $l10n->t('Updated Title:'), + $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + } -+ } + } +- $meetingWhen = $this->generateWhenString($l10n, $vevent); + $meetingWhen = $this->generateWhenString($l10n, $selectedEvent); if ($meetingWhen) { - $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), @@ -184,7 +184,7 @@ $template->addBodyListItem(sprintf('%s', htmlspecialchars($url), htmlspecialchars($url)), -@@ -565,12 +629,28 @@ +@@ -565,12 +629,18 @@ $url,'',self::IMIP_INDENT); } @@ -204,20 +204,10 @@ + $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); + } + -+ } -+ if (isset($selectedEvent->ATTENDEE)) { -+ $finalguests=''; -+ foreach ($selectedEvent->ATTENDEE as $attendee) { -+ $emailid= substr(($attendee->getValue()),7); -+ $finalguests.=$emailid.' -'.$attendee['PARTSTAT'].', '; -+ -+ } -+ $template->addBodyListItem($finalguests, $l10n->t('Guests:'), -+ $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); } } -@@ -671,7 +751,6 @@ +@@ -671,7 +741,6 @@ $l10n->t('Maybe'), $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ); @@ -225,10 +215,10 @@ } /** -@@ -716,4 +795,4 @@ +@@ -716,4 +785,4 @@ return $token; } -} +} -\ No newline at end of file +\ No newline at end of file \ No newline at end of file -- GitLab From 1437ac573c1abe508cab5c4d1e6aa684850add2c Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Tue, 9 Aug 2022 11:12:03 +0530 Subject: [PATCH 21/42] version bump --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ca76a59f..16f86a00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,9,1/22,2,9,4/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,9,1/22,2,9,3/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images -- GitLab From 9032ee14ec95060cf020b71df4f18800acbd7101 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 18 Aug 2022 19:49:14 +0530 Subject: [PATCH 22/42] translation fix --- patches/015-email-mail-template.patch | 41 +++++++++++++++++++-------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index bbc0a5f3..71c708d8 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -32,8 +32,8 @@ /** ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-08-08 17:59:57.632858800 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-08-08 17:21:58.792858800 +0530 +--- apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-27 13:21:50.294113800 +0530 ++++ apps/dav/lib/CalDAV/Schedule/IMipPlugin-New.php 2022-08-16 16:29:16.531866700 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { @@ -86,7 +86,23 @@ * @param IL10N $l10n * @param VEvent $vevent */ -@@ -535,28 +542,85 @@ +@@ -525,38 +532,99 @@ + private function addSubjectAndHeading(IEMailTemplate $template, IL10N $l10n, + $method, $summary) { + if ($method === self::METHOD_CANCEL) { +- $template->setSubject('Canceled: ' . $summary); ++ //TRANSLATORS Subject for email, when an invitation is cancelled. Ex: "Cancelled: {{Event Name}}" ++ $template->setSubject($l10n->t('Cancelled: %1$s', [$summary])); + $template->addHeading($l10n->t('Invitation canceled')); + } elseif ($method === self::METHOD_REPLY) { +- $template->setSubject('Re: ' . $summary); ++ // TRANSLATORS Subject for email, when an invitation is updated. Ex: "Re: {{Event Name}}" ++ $template->setSubject($l10n->t('Re: %1$s', [$summary])); + $template->addHeading($l10n->t('Invitation updated')); + } else { +- $template->setSubject('Invitation: ' . $summary); ++ // TRANSLATORS Subject for email, when an invitation is sent. Ex: "Invitation: {{Event Name}}" ++ $template->setSubject($l10n->t('Invitation: %1$s', [$summary])); $template->addHeading($l10n->t('Invitation')); } } @@ -100,13 +116,16 @@ + private function addSubjectAndHeadingUpdated(IEMailTemplate $template, IL10N $l10n, + $method, $summary) { + if ($method === self::METHOD_CANCEL) { -+ $template->setSubject('Canceled: ' . $summary); ++ //TRANSLATORS Subject for email, when an invitation is cancelled. Ex: "Cancelled: {{Event Name}}" ++ $template->setSubject($l10n->t('Cancelled: %1$s', [$summary])); + $template->addHeading($l10n->t('Invitation canceled')); + } elseif ($method === self::METHOD_REPLY) { -+ $template->setSubject('Re: ' . $summary); ++ // TRANSLATORS Subject for email, when an invitation is updated. Ex: "Re: {{Event Name}}" ++ $template->setSubject($l10n->t('Re: %1$s', [$summary])); + $template->addHeading($l10n->t('Invitation updated')); + } else { -+ $template->setSubject('Invitation: ' . $summary); ++ // TRANSLATORS Subject for email, when an invitation is sent. Ex: "Invitation: {{Event Name}}" ++ $template->setSubject($l10n->t('Invitation: %1$s', [$summary])); + $template->addHeading($l10n->t('Invitation Update')); + } + } @@ -164,9 +183,7 @@ - if ($vevent->LOCATION) { - $template->addBodyListItem($vevent->LOCATION, $l10n->t('Location:'), - $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); -+ + if ($selectedEvent->LOCATION) { -+ + if(trim($selectedEvent->LOCATION)==trim($parentevent->LOCATION)){ + $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); @@ -184,7 +201,7 @@ $template->addBodyListItem(sprintf('%s', htmlspecialchars($url), htmlspecialchars($url)), -@@ -565,12 +629,18 @@ +@@ -565,12 +633,18 @@ $url,'',self::IMIP_INDENT); } @@ -207,7 +224,7 @@ } } -@@ -671,7 +741,6 @@ +@@ -671,7 +745,6 @@ $l10n->t('Maybe'), $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ); @@ -215,10 +232,10 @@ } /** -@@ -716,4 +785,4 @@ +@@ -716,4 +789,4 @@ return $token; } -} +} -\ No newline at end of file \ No newline at end of file +\ No newline at end of file -- GitLab From 735e1a4c393f9f6c410472304b274a37fb8e37c2 Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 1 Sep 2022 10:55:54 +0000 Subject: [PATCH 23/42] 22.2.10 --- Dockerfile | 31 ++++++++++++------- patches/005-autocomplete-user-leak-core.patch | 10 +++--- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 16f86a00..602c43a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,23 @@ -FROM nextcloud:22.2.9-fpm AS nextcloud +FROM nextcloud:22.2.10-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="22.1.3" -ARG THEME_HELPER_VERSION="1.3.2" -ARG NEWS_VERSION="18.1.0" +ARG THEME_VERSION="22.1.4" +ARG THEME_HELPER_VERSION="1.4.1" +ARG NEWS_VERSION="18.1.1" ARG QUOTA_WARN_VERSION="1.14.0" -ARG NOTES_VERSION="4.3.1" -ARG CONTACTS_JOB_ID="329486" -ARG CALENDAR_JOB_ID="344794" +ARG NOTES_VERSION="4.5.0" +ARG CONTACTS_JOB_ID="372144" +ARG CALENDAR_JOB_ID="372097" ARG USER_BACKEND_RAW_SQL_VERSION="1.3.0" -ARG EMAIL_RECOVERY_JOB_ID="313915" +ARG EMAIL_RECOVERY_JOB_ID="314819" ARG RAINLOOP_VERSION="7.2.5" ARG RAINLOOP_COMMIT_SHA="523518ba" ARG EA_TAG="2.1.0" ARG ECLOUD_LAUNCHER_JOB_ID="345049" -ARG GOOGLE_INTEGRATION_VERSION="1.0.6" +ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,9,1/22,2,9,3/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,10,2/22,2,10,5/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images @@ -62,8 +62,8 @@ RUN curl -fsSL -o user_backend_sql_raw.tar.gz \ RUN curl -fsSL -o email-recovery.zip \ "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/email-recovery/-/jobs/${EMAIL_RECOVERY_JOB_ID}/artifacts/download" && \ unzip email-recovery.zip && \ - cd dist && tar -xf email-recovery.tar.gz -C ${BASE_DIR}/custom_apps/ && \ - rm email-recovery.tar.gz; + mv dist/email-recovery ${BASE_DIR}/custom_apps/ && \ + rm email-recovery.zip; RUN curl -fsSL -o rainloop.tar.gz \ "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/rainloop-nextcloud/-/archive/${RAINLOOP_VERSION}-${RAINLOOP_COMMIT_SHA}/rainloop-nextcloud-${RAINLOOP_VERSION}-${RAINLOOP_COMMIT_SHA}.tar.gz" && \ @@ -129,6 +129,13 @@ RUN curl -fsSL -o eCloud-theme.tar.gz \ # Replace "Get your own free account" NC link with /e/ Account link in public pages RUN sed -i 's/https:\/\/nextcloud.com\/signup\//https:\/\/e\.foundation\/\/e-email-invite\//' ${BASE_DIR}/core/templates/layout.public.php +# Set default class of hidden to settings-hint +RUN sed -i 's/settings-hint/settings-hint hidden/' ${BASE_DIR}/apps/settings/templates/settings/personal/security/twofactor.php + +# Seds to fix displayname save regression +RUN sed -i "s/'email' ||/'email'/" ${BASE_DIR}/apps/settings/js/federationsettingsview.js +RUN sed -i "s/field === 'displayname'//" ${BASE_DIR}/apps/settings/js/federationsettingsview.js + ENTRYPOINT ["/custom_entrypoint.sh"] CMD ["php-fpm"] diff --git a/patches/005-autocomplete-user-leak-core.patch b/patches/005-autocomplete-user-leak-core.patch index 26cbf334..68d0f74e 100644 --- a/patches/005-autocomplete-user-leak-core.patch +++ b/patches/005-autocomplete-user-leak-core.patch @@ -14,13 +14,15 @@ this filtering works in conjunction with the autocomplete feature disabled in ne diff --git lib/private/Collaboration/Collaborators/UserPlugin.php lib/private/Collaboration/Collaborators/UserPlugin-new.php --- lib/private/Collaboration/Collaborators/UserPlugin.php 2021-01-25 15:56:05.000000000 +0100 +++ lib/private/Collaboration/Collaborators/UserPlugin-new.php 2021-02-16 14:56:26.778152834 +0100 -@@ -114,7 +114,7 @@ - $uid = (string) $uid; +@@ -186,8 +186,8 @@ if ( + $this->shareeEnumerationFullMatch && $lowerSearch !== '' && (strtolower($uid) === $lowerSearch || - strtolower($userDisplayName) === $lowerSearch || -+// strtolower($userDisplayName) === $lowerSearch || - strtolower($userEmail) === $lowerSearch) +- ($this->shareeEnumerationFullMatchIgnoreSecondDisplayName && trim(strtolower(preg_replace('/ \(.*\)$/', '', $userDisplayName))) === $lowerSearch) || ++ // strtolower($userDisplayName) === $lowerSearch || ++ // ($this->shareeEnumerationFullMatchIgnoreSecondDisplayName && trim(strtolower(preg_replace('/ \(.*\)$/', '', $userDisplayName))) === $lowerSearch) || + ($this->shareeEnumerationFullMatchEmail && strtolower($userEmail) === $lowerSearch)) ) { if (strtolower($uid) === $lowerSearch) { diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Collaboration/Collaborators/MailPlugin-new.php -- GitLab From 3c3f200e436e4b82184afa46efe48c1c4c46b024 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 22 Jul 2022 13:57:56 +0530 Subject: [PATCH 24/42] Add selfhost CI/CD and selfhost Dockerfile steps --- .gitlab-ci.yml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 6 +++++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3be72010..85464544 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,11 +14,32 @@ default: tags: - generic_privileged +<<<<<<< HEAD .build-docker: +======= +build-branch: + stage: build + variables: + TARGET: ecloud + SUBPATH: '' + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: $CI_COMMIT_TAG != null + when: never + - if: $CI_COMMIT_REF_SLUG =~ /^selfhost/ + variables: + TARGET: "selfhost" + SUBPATH: "/selfhost" + - if: $CI_COMMIT_REF_SLUG != null + when: on_success + allow_failure: true +>>>>>>> f25afbd (Add selfhost CI/CD and selfhost Dockerfile steps) script: - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" +<<<<<<< HEAD build-branch: stage: build @@ -56,3 +77,37 @@ build-tag-selfhost: only: - tags extends: .build-docker +======= + +build-tag: + stage: build + variables: + TARGET: ecloud + SUBPATH: '' + allow_failure: true + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: $CI_COMMIT_TAG == null + when: never + - if: $CI_COMMIT_REF_SLUG =~ /^selfhost/ + variables: + TARGET: "selfhost" + SUBPATH: "/selfhost" + - if: $CI_COMMIT_TAG != null + when: on_success + script: + - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" + - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + +docker-tag: + stage: .post + rules: + - when: manual + script: + - echo "SOURCE $SOURCE, TARGET $TARGET" + - docker pull $CI_REGISTRY_IMAGE:$SOURCE + - docker tag $CI_REGISTRY_IMAGE:$SOURCE $CI_REGISTRY_IMAGE:$TARGET + - docker push $CI_REGISTRY_IMAGE:$TARGET +>>>>>>> f25afbd (Add selfhost CI/CD and selfhost Dockerfile steps) diff --git a/Dockerfile b/Dockerfile index 602c43a2..cfa3db71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -152,7 +152,6 @@ RUN patch -u ${BASE_DIR}/apps/settings/lib/Settings/Personal/ServerDevNotice.php 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 patch -u ${BASE_DIR}/lib/private/Authentication/Token/PublicKeyTokenProvider.php -i ${TMP_PATCH_DIR}/013-revert-token-password-update.patch @@ -175,6 +174,11 @@ 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 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 +<<<<<<< HEAD +======= +RUN patch -u ${BASE_DIR}/lib/private/Updater.php -i ${TMP_PATCH_DIR}/010-disable-app-store-upgrade.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 +>>>>>>> f25afbd (Add selfhost CI/CD and selfhost Dockerfile steps) RUN rm -rf ${TMP_PATCH_DIR} -- GitLab From 30aba1c94a73d711dc9b6e473c22c24916efa56b Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 27 Jul 2022 15:28:17 +0530 Subject: [PATCH 25/42] Re-add app store upgrade patch --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index cfa3db71..7f79ab40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -152,6 +152,7 @@ RUN patch -u ${BASE_DIR}/apps/settings/lib/Settings/Personal/ServerDevNotice.php 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 patch -u ${BASE_DIR}/lib/private/Authentication/Token/PublicKeyTokenProvider.php -i ${TMP_PATCH_DIR}/013-revert-token-password-update.patch @@ -175,10 +176,13 @@ RUN patch -u ${BASE_DIR}/core/Controller/ContactsMenuController.php -i ${TMP_PAT 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 <<<<<<< HEAD +<<<<<<< HEAD ======= RUN patch -u ${BASE_DIR}/lib/private/Updater.php -i ${TMP_PATCH_DIR}/010-disable-app-store-upgrade.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 >>>>>>> f25afbd (Add selfhost CI/CD and selfhost Dockerfile steps) +======= +>>>>>>> 10dd67a (Re-add app store upgrade patch) RUN rm -rf ${TMP_PATCH_DIR} -- GitLab From 7d6d12c8974b08c3a34d7ed23828567ff154680e Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 28 Oct 2022 01:45:57 +0530 Subject: [PATCH 26/42] Remove login screen patch --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7f79ab40..bf4eedac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -158,7 +158,7 @@ RUN cd ${BASE_DIR} && patch -u ${BASE_DIR}/apps/dashboard/lib/Controller/Dashboa RUN patch -u ${BASE_DIR}/lib/private/Authentication/Token/PublicKeyTokenProvider.php -i ${TMP_PATCH_DIR}/013-revert-token-password-update.patch RUN patch -u ${BASE_DIR}/lib/private/legacy/OC_Helper.php -i ${TMP_PATCH_DIR}/014-add-mail-usage.patch RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/015-email-mail-template.patch -RUN patch -u ${BASE_DIR}/core/templates/layout.guest.php -i ${TMP_PATCH_DIR}/016-login-screen.patch +# RUN patch -u ${BASE_DIR}/core/templates/layout.guest.php -i ${TMP_PATCH_DIR}/016-login-screen.patch RUN patch -u ${BASE_DIR}/core/Command/User/Setting.php -i ${TMP_PATCH_DIR}/018-occ-user-setting.patch RUN rm -rf ${TMP_PATCH_DIR} -- GitLab From 787532905c6d30afaa7fc3b2b8016e561b818222 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 28 Oct 2022 01:48:16 +0530 Subject: [PATCH 27/42] Bump version --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index bf4eedac..97a06b7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM nextcloud:22.2.10-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="22.1.4" +ARG THEME_VERSION="selfhost-22.1.5" ARG THEME_HELPER_VERSION="1.4.1" ARG NEWS_VERSION="18.1.1" ARG QUOTA_WARN_VERSION="1.14.0" @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,10,2/22,2,10,5/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,10,2/22,2,10,6/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images -- GitLab From 55955f345205a048a56d5a88aa37075f77e2c738 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 28 Oct 2022 01:51:24 +0530 Subject: [PATCH 28/42] Correct gitlab ci --- .gitlab-ci.yml | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85464544..75dd630b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,9 +14,6 @@ default: tags: - generic_privileged -<<<<<<< HEAD -.build-docker: -======= build-branch: stage: build variables: @@ -34,50 +31,10 @@ build-branch: - if: $CI_COMMIT_REF_SLUG != null when: on_success allow_failure: true ->>>>>>> f25afbd (Add selfhost CI/CD and selfhost Dockerfile steps) script: - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" -<<<<<<< HEAD - -build-branch: - stage: build - variables: - TARGET: ecloud - SUBPATH: '' - only: - - branches - extends: .build-docker - -build-branch-selfhost: - stage: build - variables: - TARGET: selfhost - SUBPATH: '/selfhost' - only: - - branches - when: manual - extends: .build-docker - -build-tag: - stage: build - variables: - TARGET: ecloud - SUBPATH: '' - only: - - tags - extends: .build-docker - -build-tag-selfhost: - stage: build - variables: - TARGET: selfhost - SUBPATH: '/selfhost' - only: - - tags - extends: .build-docker -======= build-tag: stage: build @@ -110,4 +67,3 @@ docker-tag: - docker pull $CI_REGISTRY_IMAGE:$SOURCE - docker tag $CI_REGISTRY_IMAGE:$SOURCE $CI_REGISTRY_IMAGE:$TARGET - docker push $CI_REGISTRY_IMAGE:$TARGET ->>>>>>> f25afbd (Add selfhost CI/CD and selfhost Dockerfile steps) -- GitLab From dd4cf7b9691e48e16d204017466d56f4658fdeac Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 28 Oct 2022 01:53:19 +0530 Subject: [PATCH 29/42] Correct dockerfile --- Dockerfile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 97a06b7c..6655c2a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -175,14 +175,7 @@ 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 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 -<<<<<<< HEAD -<<<<<<< HEAD -======= -RUN patch -u ${BASE_DIR}/lib/private/Updater.php -i ${TMP_PATCH_DIR}/010-disable-app-store-upgrade.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 ->>>>>>> f25afbd (Add selfhost CI/CD and selfhost Dockerfile steps) -======= ->>>>>>> 10dd67a (Re-add app store upgrade patch) RUN rm -rf ${TMP_PATCH_DIR} -- GitLab From 2c6bfefed5489b89c63bda26cd54c53d50c1cbec Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 28 Oct 2022 01:54:35 +0530 Subject: [PATCH 30/42] Recorrect gitlab ci --- .gitlab-ci.yml | 71 +++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 41 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 75dd630b..3be72010 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,56 +14,45 @@ default: tags: - generic_privileged +.build-docker: + script: + - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" + - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + build-branch: stage: build variables: TARGET: ecloud SUBPATH: '' - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - when: never - - if: $CI_COMMIT_TAG != null - when: never - - if: $CI_COMMIT_REF_SLUG =~ /^selfhost/ - variables: - TARGET: "selfhost" - SUBPATH: "/selfhost" - - if: $CI_COMMIT_REF_SLUG != null - when: on_success - allow_failure: true - script: - - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" - - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . - - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + only: + - branches + extends: .build-docker + +build-branch-selfhost: + stage: build + variables: + TARGET: selfhost + SUBPATH: '/selfhost' + only: + - branches + when: manual + extends: .build-docker build-tag: stage: build variables: TARGET: ecloud SUBPATH: '' - allow_failure: true - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - when: never - - if: $CI_COMMIT_TAG == null - when: never - - if: $CI_COMMIT_REF_SLUG =~ /^selfhost/ - variables: - TARGET: "selfhost" - SUBPATH: "/selfhost" - - if: $CI_COMMIT_TAG != null - when: on_success - script: - - echo "TARGET $TARGET, BRANCH $CI_COMMIT_BRANCH, COMMIT_REF_SLUG $CI_COMMIT_REF_SLUG, COMMIT_TAG $CI_COMMIT_TAG" - - docker build --target $TARGET --pull -t "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" . - - docker push "$CI_REGISTRY_IMAGE$SUBPATH:$CI_COMMIT_REF_SLUG" + only: + - tags + extends: .build-docker -docker-tag: - stage: .post - rules: - - when: manual - script: - - echo "SOURCE $SOURCE, TARGET $TARGET" - - docker pull $CI_REGISTRY_IMAGE:$SOURCE - - docker tag $CI_REGISTRY_IMAGE:$SOURCE $CI_REGISTRY_IMAGE:$TARGET - - docker push $CI_REGISTRY_IMAGE:$TARGET +build-tag-selfhost: + stage: build + variables: + TARGET: selfhost + SUBPATH: '/selfhost' + only: + - tags + extends: .build-docker -- GitLab From a937adac251a99b645502ffb5713d5d5b9069cc5 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 28 Oct 2022 01:57:25 +0530 Subject: [PATCH 31/42] Remove dash patch --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6655c2a1..fe7e4a38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -115,8 +115,6 @@ RUN sed -i 's/Nextcloud administrator/administrator/' ${BASE_DIR}/custom_apps/in # Remove changeAvatar in changeUserHook of ldap_write_support as it throws errors RUN sed -i 's/$this->changeAvatar/\/\/ $this->changeAvatar/' ${BASE_DIR}/custom_apps/ldap_write_support/lib/LDAPUserManager.php -# 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 # Custom theme RUN curl -fsSL -o eCloud-theme.tar.gz \ @@ -154,7 +152,6 @@ RUN patch -u ${BASE_DIR}/core/Controller/SvgController.php -i ${TMP_PATCH_DIR}/0 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 patch -u ${BASE_DIR}/lib/private/legacy/OC_Helper.php -i ${TMP_PATCH_DIR}/014-add-mail-usage.patch RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/015-email-mail-template.patch @@ -182,3 +179,5 @@ RUN rm -rf ${TMP_PATCH_DIR} 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-main.js RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/{name:\[a,"displayname"\]},//' js/calendar-main.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 -- GitLab From 0b0ebd3ca3d09cc1749e8b88358601781a1f9107 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 28 Oct 2022 15:44:16 +0530 Subject: [PATCH 32/42] Theme version change --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fe7e4a38..25083786 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM nextcloud:22.2.10-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="selfhost-22.1.5" +ARG THEME_VERSION="22.0.0" ARG THEME_HELPER_VERSION="1.4.1" ARG NEWS_VERSION="18.1.1" ARG QUOTA_WARN_VERSION="1.14.0" -- GitLab From 000089b11dcda39c639c737c1bc7df9c36a3c365 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 28 Oct 2022 15:45:06 +0530 Subject: [PATCH 33/42] Bump version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 25083786..a2c49796 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,10,2/22,2,10,6/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,10,2/22,2,10,7/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images -- GitLab From 4164b48bdb861b15ed885e5d15ab7891e5ef315a Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 28 Oct 2022 18:29:36 +0530 Subject: [PATCH 34/42] Use selfhost-22.0.0 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a2c49796..90c646f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM nextcloud:22.2.10-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="22.0.0" +ARG THEME_VERSION="selfhost-22.0.0" ARG THEME_HELPER_VERSION="1.4.1" ARG NEWS_VERSION="18.1.1" ARG QUOTA_WARN_VERSION="1.14.0" @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,10,2/22,2,10,7/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,10,2/22,2,10,8/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images -- GitLab From ce60b68ce65245862d9e402450ef48d33cfa7a36 Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 10 Nov 2022 15:19:39 +0530 Subject: [PATCH 35/42] Move patch down --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 90c646f0..fdf57909 100644 --- a/Dockerfile +++ b/Dockerfile @@ -155,7 +155,6 @@ RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/011-privacy-settings.patch RUN patch -u ${BASE_DIR}/lib/private/Authentication/Token/PublicKeyTokenProvider.php -i ${TMP_PATCH_DIR}/013-revert-token-password-update.patch RUN patch -u ${BASE_DIR}/lib/private/legacy/OC_Helper.php -i ${TMP_PATCH_DIR}/014-add-mail-usage.patch RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/015-email-mail-template.patch -# RUN patch -u ${BASE_DIR}/core/templates/layout.guest.php -i ${TMP_PATCH_DIR}/016-login-screen.patch RUN patch -u ${BASE_DIR}/core/Command/User/Setting.php -i ${TMP_PATCH_DIR}/018-occ-user-setting.patch RUN rm -rf ${TMP_PATCH_DIR} @@ -173,6 +172,7 @@ RUN patch -u ${BASE_DIR}/core/Controller/ContactsMenuController.php -i ${TMP_PAT 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 -u ${BASE_DIR}/apps/dashboard/lib/Controller/DashboardController.php -i ${TMP_PATCH_DIR}/012-remove-user-status-widget.patch +RUN patch -u ${BASE_DIR}/core/templates/layout.guest.php -i ${TMP_PATCH_DIR}/016-login-screen.patch RUN rm -rf ${TMP_PATCH_DIR} -- GitLab From 0b86d137bcc89768a30cbb7b3f62d60bce4f8dd0 Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 16 Nov 2022 23:17:07 +0530 Subject: [PATCH 36/42] Bump version number --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fdf57909..44343d73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,10,2/22,2,10,8/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,10,2/22,2,10,9/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images -- GitLab From 067ff869cc291e5c147f20d8a65d4c7a2002cd79 Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 17 Nov 2022 00:26:26 +0530 Subject: [PATCH 37/42] Update theme version --- Dockerfile | 4 ++-- custom_entrypoint.sh | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 44343d73..4d0abe34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM nextcloud:22.2.10-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="selfhost-22.0.0" +ARG THEME_VERSION="selfhost-22.1.5" ARG THEME_HELPER_VERSION="1.4.1" ARG NEWS_VERSION="18.1.1" ARG QUOTA_WARN_VERSION="1.14.0" @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,10,2/22,2,10,9/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,10,2/22,2,10,10/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images diff --git a/custom_entrypoint.sh b/custom_entrypoint.sh index 87606ea4..49498429 100644 --- a/custom_entrypoint.sh +++ b/custom_entrypoint.sh @@ -38,4 +38,10 @@ else fi +if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:enable murena_launcher" +else + sh -c "php $DST_DIR/occ app:enable murena_launcher" +fi + /entrypoint.sh "$@" -- GitLab From fa235fe171aab139ca6c89d8be1401f3f34d3b26 Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 17 Nov 2022 00:35:45 +0530 Subject: [PATCH 38/42] Add ecloud-dashboard --- Dockerfile | 7 +++++++ custom_entrypoint.sh | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4d0abe34..cb11a9ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ ARG EA_TAG="2.1.0" ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" +ARG ECLOUD_DASHBOARD_JOB_ID="433049" RUN sed -i 's/22,2,10,2/22,2,10,10/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / @@ -65,6 +66,12 @@ RUN curl -fsSL -o email-recovery.zip \ mv dist/email-recovery ${BASE_DIR}/custom_apps/ && \ rm email-recovery.zip; +RUN curl -fsSL -o ecloud-dashboard.zip \ + "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/ecloud-dashboard/-/jobs/${ECLOUD_DASHBOARD_JOB_ID}/artifacts/download" && \ + unzip ecloud-dashboard.zip && \ + mv dist/ecloud-dashboard ${BASE_DIR}/custom_apps/ && \ + rm ecloud-dashboard.zip; + RUN curl -fsSL -o rainloop.tar.gz \ "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/rainloop-nextcloud/-/archive/${RAINLOOP_VERSION}-${RAINLOOP_COMMIT_SHA}/rainloop-nextcloud-${RAINLOOP_VERSION}-${RAINLOOP_COMMIT_SHA}.tar.gz" && \ tar -xf rainloop.tar.gz -C ${BASE_DIR}/custom_apps/ && \ diff --git a/custom_entrypoint.sh b/custom_entrypoint.sh index 49498429..374dcaca 100644 --- a/custom_entrypoint.sh +++ b/custom_entrypoint.sh @@ -40,8 +40,12 @@ fi if [ "$(id -u)" = 0 ]; then su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:enable murena_launcher" + su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:enable ecloud-dashboard" + su -p www-data -s /bin/sh -c "php $DST_DIR/occ config:system:set defaultapp --value 'ecloud-dashboard,files'" else sh -c "php $DST_DIR/occ app:enable murena_launcher" + sh -c "php $DST_DIR/occ app:enable ecloud-dashboard" + sh -c "php $DST_DIR/occ config:system:set defaultapp --value 'ecloud-dashboard,files'" fi /entrypoint.sh "$@" -- GitLab From ae6c6ad2e8254c3a37d5329838d3177d684534ff Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 17 Nov 2022 00:41:33 +0530 Subject: [PATCH 39/42] remove ecloud-dashboard --- Dockerfile | 7 ------- custom_entrypoint.sh | 2 -- 2 files changed, 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb11a9ff..4d0abe34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,6 @@ ARG EA_TAG="2.1.0" ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -ARG ECLOUD_DASHBOARD_JOB_ID="433049" RUN sed -i 's/22,2,10,2/22,2,10,10/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / @@ -66,12 +65,6 @@ RUN curl -fsSL -o email-recovery.zip \ mv dist/email-recovery ${BASE_DIR}/custom_apps/ && \ rm email-recovery.zip; -RUN curl -fsSL -o ecloud-dashboard.zip \ - "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/ecloud-dashboard/-/jobs/${ECLOUD_DASHBOARD_JOB_ID}/artifacts/download" && \ - unzip ecloud-dashboard.zip && \ - mv dist/ecloud-dashboard ${BASE_DIR}/custom_apps/ && \ - rm ecloud-dashboard.zip; - RUN curl -fsSL -o rainloop.tar.gz \ "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/rainloop-nextcloud/-/archive/${RAINLOOP_VERSION}-${RAINLOOP_COMMIT_SHA}/rainloop-nextcloud-${RAINLOOP_VERSION}-${RAINLOOP_COMMIT_SHA}.tar.gz" && \ tar -xf rainloop.tar.gz -C ${BASE_DIR}/custom_apps/ && \ diff --git a/custom_entrypoint.sh b/custom_entrypoint.sh index 374dcaca..0c085508 100644 --- a/custom_entrypoint.sh +++ b/custom_entrypoint.sh @@ -41,11 +41,9 @@ fi if [ "$(id -u)" = 0 ]; then su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:enable murena_launcher" su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:enable ecloud-dashboard" - su -p www-data -s /bin/sh -c "php $DST_DIR/occ config:system:set defaultapp --value 'ecloud-dashboard,files'" else sh -c "php $DST_DIR/occ app:enable murena_launcher" sh -c "php $DST_DIR/occ app:enable ecloud-dashboard" - sh -c "php $DST_DIR/occ config:system:set defaultapp --value 'ecloud-dashboard,files'" fi /entrypoint.sh "$@" -- GitLab From 3085e50bddec6b47fbc0dc55b187ef436862fd8f Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 17 Nov 2022 17:57:35 +0530 Subject: [PATCH 40/42] Use theme 22.0.0 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4d0abe34..245387a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM nextcloud:22.2.10-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="selfhost-22.1.5" +ARG THEME_VERSION="selfhost-22.0.0" ARG THEME_HELPER_VERSION="1.4.1" ARG NEWS_VERSION="18.1.1" ARG QUOTA_WARN_VERSION="1.14.0" -- GitLab From a05bb725e56ce8009109937f5640f5489513274a Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 11 Jan 2023 13:02:05 +0530 Subject: [PATCH 41/42] Bump version, move lws down --- Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 245387a3..12ba61fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,9 +15,8 @@ ARG RAINLOOP_COMMIT_SHA="523518ba" ARG EA_TAG="2.1.0" ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.8" -ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,10,2/22,2,10,10/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,10,2/22,2,10,11/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images @@ -96,10 +95,6 @@ RUN curl -fsSL -o ecloud-accounts.tar.gz \ mv "${BASE_DIR}/custom_apps/ecloud-accounts-${EA_TAG}" "${BASE_DIR}/custom_apps/ecloud-accounts" && \ rm ecloud-accounts.tar.gz; -RUN curl -fsSL -o ldap_write_support.tar.gz \ - "https://github.com/nextcloud-releases/ldap_write_support/releases/download/v${LDAP_WRITE_SUPPORT_VERSION}/ldap_write_support.tar.gz" && \ - tar -xf ldap_write_support.tar.gz -C ${BASE_DIR}/custom_apps && \ - rm ldap_write_support.tar.gz # Remove unzip when unzipping is done RUN apt-get -y remove unzip @@ -164,6 +159,7 @@ RUN rm -rf ${TMP_PATCH_DIR} From selfhost as ecloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" +ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" # Patches COPY patches/ ${TMP_PATCH_DIR}/ @@ -181,3 +177,8 @@ RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/"GROUP","INDIVIDUAL"/"INDIV RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/{name:\[a,"displayname"\]},//' js/calendar-main.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 + +RUN curl -fsSL -o ldap_write_support.tar.gz \ + "https://github.com/nextcloud-releases/ldap_write_support/releases/download/v${LDAP_WRITE_SUPPORT_VERSION}/ldap_write_support.tar.gz" && \ + tar -xf ldap_write_support.tar.gz -C ${BASE_DIR}/custom_apps && \ + rm ldap_write_support.tar.gz \ No newline at end of file -- GitLab From f298fa78a79058143925355c36c9c5221aa4d0ba Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 11 Jan 2023 13:59:50 +0530 Subject: [PATCH 42/42] move lws command down --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 12ba61fe..9c35473a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -107,8 +107,6 @@ RUN sed -i 's/$this->header, \[$this->themingDefaults->getColorPrimary()/$this-> RUN sed -i 's/ in Nextcloud/ /' ${BASE_DIR}/custom_apps/integration_google/js/integration_google-personalSettings.js RUN sed -i 's/Nextcloud administrator/administrator/' ${BASE_DIR}/custom_apps/integration_google/js/integration_google-personalSettings.js -# Remove changeAvatar in changeUserHook of ldap_write_support as it throws errors -RUN sed -i 's/$this->changeAvatar/\/\/ $this->changeAvatar/' ${BASE_DIR}/custom_apps/ldap_write_support/lib/LDAPUserManager.php # Custom theme @@ -181,4 +179,7 @@ RUN sed -i 's/recommendations,spreed,mail,calendar/calendar,tasks,notes/' ${BASE RUN curl -fsSL -o ldap_write_support.tar.gz \ "https://github.com/nextcloud-releases/ldap_write_support/releases/download/v${LDAP_WRITE_SUPPORT_VERSION}/ldap_write_support.tar.gz" && \ tar -xf ldap_write_support.tar.gz -C ${BASE_DIR}/custom_apps && \ - rm ldap_write_support.tar.gz \ No newline at end of file + rm ldap_write_support.tar.gz + +# Remove changeAvatar in changeUserHook of ldap_write_support as it throws errors +RUN sed -i 's/$this->changeAvatar/\/\/ $this->changeAvatar/' ${BASE_DIR}/custom_apps/ldap_write_support/lib/LDAPUserManager.php -- GitLab