From 6f960159a8e2059e016424068fb7c5e534e42931 Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 26 Apr 2022 11:27:00 +0530 Subject: [PATCH 01/20] Updates to apps --- Dockerfile | 124 ++++------------------------------------------------- 1 file changed, 9 insertions(+), 115 deletions(-) diff --git a/Dockerfile b/Dockerfile index ea60fd1a..e7a12b19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,20 +3,21 @@ ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" ARG THEME_VERSION="21.1.1" ARG THEME_HELPER_VERSION="1.0.2" -ARG NEWS_VERSION="17.0.1" -ARG QUOTA_WARN_VERSION="1.13.0" +ARG NEWS_VERSION="18.0.1" +ARG QUOTA_WARN_VERSION="1.14.0" ARG NOTES_VERSION="4.3.1" -ARG CONTACTS_VERSION="4.0.8" -ARG CALENDAR_VERSION="3.1.0" +ARG CONTACTS_VERSION="4.1.0" +ARG CALENDAR_VERSION="3.2.2" ARG USER_BACKEND_RAW_SQL_VERSION="1.1.1" ARG EMAIL_RECOVERY_JOB_ID="199763" -ARG RAINLOOP_VERSION="7.1.2" -ARG RAINLOOP_COMMIT_SHA="e9da581c" -ARG EA_TAG="1.0.0" +ARG RAINLOOP_VERSION="7.2.5" +ARG RAINLOOP_COMMIT_SHA="fc3992e4" +ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="222001" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" RUN sed -i 's/22,2,6,2/22,2,6,4/' ${BASE_DIR}/version.php +RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images # Install unzip for unzipping artifacts RUN apt-get update && apt-get install unzip @@ -142,112 +143,5 @@ 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 -# Use php 8 image -FROM php:8.0.12-fpm-bullseye -RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images - -# Copy all the required files from the nextcloud stage -COPY --from=nextcloud /usr/src/nextcloud /usr/src/nextcloud -COPY --from=nextcloud /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/ -COPY --from=nextcloud /*.sh / -COPY --from=nextcloud /upgrade.exclude / -COPY --from=nextcloud /var/spool/cron/crontabs /var/spool/cron/crontabs -COPY --from=nextcloud /entrypoint.sh / - -# Copy entrypoints and add correct permissions -COPY custom_entrypoint.sh / -RUN chmod +x /custom_entrypoint.sh -RUN chmod +x /entrypoint.sh - -# Install required dependencies of nextcloud -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - libldap-common \ - ; \ - rm -rf /var/lib/apt/lists/*; - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html -ENV PHP_MEMORY_LIMIT 512M -ENV PHP_UPLOAD_LIMIT 512M -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libevent-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - libzip-dev \ - libwebp-dev \ - libgmp-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install -j "$(nproc)" \ - bcmath \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - gmp \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.21; \ - pecl install memcached-3.1.5; \ - pecl install redis-5.3.4; \ - pecl install imagick-3.5.1; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - rm -r /tmp/pear; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; - -# Install imagemagick -RUN apt-get -y install imagemagick;\ - rm -rf /var/lib/apt/lists/*; - -VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 22.2.6 - ENTRYPOINT ["/custom_entrypoint.sh"] -CMD ["php-fpm"] +CMD ["php-fpm"] \ No newline at end of file -- GitLab From 10fc4d16721ce8418ef62cb4763a5bb277bde45e Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 26 Apr 2022 11:52:40 +0530 Subject: [PATCH 02/20] Temporarily set theme and helper to branches --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e7a12b19..3d1bea66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM nextcloud:22.2.6-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="21.1.1" -ARG THEME_HELPER_VERSION="1.0.2" +ARG THEME_VERSION="nc22" +ARG THEME_HELPER_VERSION="nc22" ARG NEWS_VERSION="18.0.1" ARG QUOTA_WARN_VERSION="1.14.0" ARG NOTES_VERSION="4.3.1" -- GitLab From b2c0c7dca6a4cbc211b90fd8193a5b6d4e0eda77 Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 26 Apr 2022 12:38:59 +0530 Subject: [PATCH 03/20] update email recovery job id --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3d1bea66..bbb466b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,14 +9,14 @@ ARG NOTES_VERSION="4.3.1" ARG CONTACTS_VERSION="4.1.0" ARG CALENDAR_VERSION="3.2.2" ARG USER_BACKEND_RAW_SQL_VERSION="1.1.1" -ARG EMAIL_RECOVERY_JOB_ID="199763" +ARG EMAIL_RECOVERY_JOB_ID="293262" ARG RAINLOOP_VERSION="7.2.5" ARG RAINLOOP_COMMIT_SHA="fc3992e4" ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="222001" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,6,2/22,2,6,4/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,6,2/22,2,6,5/' ${BASE_DIR}/version.php RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images # Install unzip for unzipping artifacts RUN apt-get update && apt-get install unzip -- GitLab From 448a693c10edc694cbe02686ecb5eb115b56dcd6 Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 26 Apr 2022 12:43:51 +0530 Subject: [PATCH 04/20] Copy custom entrypoint --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index bbb466b8..f5816eb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,8 @@ ARG ECLOUD_LAUNCHER_JOB_ID="222001" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" RUN sed -i 's/22,2,6,2/22,2,6,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 # Install unzip for unzipping artifacts RUN apt-get update && apt-get install unzip -- GitLab From 95869305b314129e46e4e66a139e541c91938302 Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 26 Apr 2022 12:46:35 +0530 Subject: [PATCH 05/20] Removed integration google sed --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f5816eb8..dffa0b52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -129,8 +129,6 @@ RUN sed -i 's/recommendations,spreed,mail,calendar/calendar,tasks,notes/' ${BASE # Remove colored background from email template logo RUN sed -i 's/$this->header, \[$this->themingDefaults->getColorPrimary()/$this->header, \["none"/' ${BASE_DIR}/lib/private/Mail/EMailTemplate.php -# fix min version of google data migration app -RUN sed -i "s/min-version=\"22\"/min-version=\"21\"/" ${BASE_DIR}/custom_apps/integration_google/appinfo/info.xml 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 -- GitLab From 76959f4bd796616539f3817d62dcec8fefc93280 Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 26 Apr 2022 12:47:05 +0530 Subject: [PATCH 06/20] Version bump --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dffa0b52..942c7cec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="222001" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,6,2/22,2,6,5/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,6,2/22,2,6,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 22da576153ae997b1407ce31f3d42f5d43060b0a Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 26 Apr 2022 13:15:09 +0530 Subject: [PATCH 07/20] Updated launcher job id --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 942c7cec..3aa68633 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,10 +13,10 @@ ARG EMAIL_RECOVERY_JOB_ID="293262" ARG RAINLOOP_VERSION="7.2.5" ARG RAINLOOP_COMMIT_SHA="fc3992e4" ARG EA_TAG="1.2.0" -ARG ECLOUD_LAUNCHER_JOB_ID="222001" +ARG ECLOUD_LAUNCHER_JOB_ID="293286" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,6,2/22,2,6,6/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,6,2/22,2,6,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 661c233b5762af3ba5fc03f82c380ad6cb627437 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 29 Apr 2022 14:48:03 +0530 Subject: [PATCH 08/20] bump version number --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3aa68633..df3af919 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="293286" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,6,2/22,2,6,7/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,6,2/22,2,6,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 e4405a51c73fcc4c63d4153d90786dbe9bedaf7b Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 29 Apr 2022 14:56:19 +0530 Subject: [PATCH 09/20] Updated rainloop version --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index df3af919..9b366177 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,12 +11,12 @@ ARG CALENDAR_VERSION="3.2.2" ARG USER_BACKEND_RAW_SQL_VERSION="1.1.1" ARG EMAIL_RECOVERY_JOB_ID="293262" ARG RAINLOOP_VERSION="7.2.5" -ARG RAINLOOP_COMMIT_SHA="fc3992e4" +ARG RAINLOOP_COMMIT_SHA="e56e17a2" ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="293286" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,6,2/22,2,6,8/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,6,2/22,2,6,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 4dbde96497f404ada249808dfc63b4e80ebb8392 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 29 Apr 2022 16:20:02 +0530 Subject: [PATCH 10/20] Update launcher versioN --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9b366177..d8dceab2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM nextcloud:22.2.6-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -ARG THEME_VERSION="nc22" +ARG THEME_VERSION="22.0.0" ARG THEME_HELPER_VERSION="nc22" ARG NEWS_VERSION="18.0.1" ARG QUOTA_WARN_VERSION="1.14.0" @@ -9,14 +9,14 @@ ARG NOTES_VERSION="4.3.1" ARG CONTACTS_VERSION="4.1.0" ARG CALENDAR_VERSION="3.2.2" ARG USER_BACKEND_RAW_SQL_VERSION="1.1.1" -ARG EMAIL_RECOVERY_JOB_ID="293262" +ARG EMAIL_RECOVERY_JOB_ID="294828" ARG RAINLOOP_VERSION="7.2.5" ARG RAINLOOP_COMMIT_SHA="e56e17a2" ARG EA_TAG="1.2.0" -ARG ECLOUD_LAUNCHER_JOB_ID="293286" +ARG ECLOUD_LAUNCHER_JOB_ID="294845" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,6,2/22,2,6,9/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,6,2/22,2,6,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 -- GitLab From bd64dca13d201cbf872e03f669c970b22493c22b Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 29 Apr 2022 17:44:33 +0530 Subject: [PATCH 11/20] Update helper version --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d8dceab2..d4c1894c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM nextcloud:22.2.6-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" ARG THEME_VERSION="22.0.0" -ARG THEME_HELPER_VERSION="nc22" +ARG THEME_HELPER_VERSION="1.1.0" ARG NEWS_VERSION="18.0.1" ARG QUOTA_WARN_VERSION="1.14.0" ARG NOTES_VERSION="4.3.1" @@ -16,7 +16,7 @@ ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="294845" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,6,2/22,2,6,10/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,6,2/22,2,6,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 -- GitLab From 4d7d1b4acc3fdd6174d538b6e2bcc392abd93f76 Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 29 Apr 2022 17:54:58 +0530 Subject: [PATCH 12/20] add correct rainloop --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d4c1894c..1e8ca498 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ ARG CALENDAR_VERSION="3.2.2" ARG USER_BACKEND_RAW_SQL_VERSION="1.1.1" ARG EMAIL_RECOVERY_JOB_ID="294828" ARG RAINLOOP_VERSION="7.2.5" -ARG RAINLOOP_COMMIT_SHA="e56e17a2" +ARG RAINLOOP_COMMIT_SHA="ddece71a" ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="294845" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -- GitLab From 8c06ab7bcf6a68c9d6c607e5e2e8c6ba60b9c06c Mon Sep 17 00:00:00 2001 From: Akhil Date: Mon, 2 May 2022 12:27:31 +0530 Subject: [PATCH 13/20] 22.2.7 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e8ca498..90b20c63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nextcloud:22.2.6-fpm AS nextcloud +FROM nextcloud:22.2.7-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" ARG THEME_VERSION="22.0.0" @@ -16,7 +16,7 @@ ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="294845" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,6,2/22,2,6,11/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,6,2/22,2,6,12/' ${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 5963aeeaf2a6c5d4196a216805b4acea63146619 Mon Sep 17 00:00:00 2001 From: Akhil Date: Mon, 2 May 2022 12:43:56 +0530 Subject: [PATCH 14/20] edit sed --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 90b20c63..60009acb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="294845" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,6,2/22,2,6,12/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,7,1/22,2,7,1/' ${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 e076f7eca7a5b0ae169c5bbabd7fce83fd2f8b42 Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 11 May 2022 11:40:31 +0530 Subject: [PATCH 15/20] Fix login patch --- Dockerfile | 4 ++- patches/002-login-without-domain.patch | 50 +++++++++++++++++++++----- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 60009acb..03fb27c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ FROM nextcloud:22.2.7-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" +COPY patches/ ${TMP_PATCH_DIR}/ +RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/002-login-without-domain.patch ARG THEME_VERSION="22.0.0" ARG THEME_HELPER_VERSION="1.1.0" ARG NEWS_VERSION="18.0.1" @@ -16,7 +18,7 @@ ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="294845" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,7,1/22,2,7,1/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,7,1/22,2,7,2/' ${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/patches/002-login-without-domain.patch b/patches/002-login-without-domain.patch index 6e670628..19bce0c3 100644 --- a/patches/002-login-without-domain.patch +++ b/patches/002-login-without-domain.patch @@ -6,22 +6,54 @@ This patch auto append the domain handled by nc, configured in env var. only the admin user (also configured in env var) will not have his login appended with a @domain suffix -diff --git files/LoginController.php files/LoginController-new.php ---- files/LoginController.php 2021-02-04 11:20:48.000000000 +0100 -+++ files/LoginController-new.php 2021-02-04 11:24:27.000000000 +0100 -@@ -299,6 +299,15 @@ +diff --git ./core/Controller/LoginController.php ./core/Controller/LoginController-new.php +--- ./core/Controller/LoginController.php 2022-05-11 11:09:58.346364031 +0530 ++++ ./core/Controller/LoginController-new.php 2022-05-11 11:21:08.460617172 +0530 +@@ -302,7 +302,22 @@ + if (!$this->request->passesCSRFCheck()) { return $this->generateRedirect($redirect_url); } - + $user = trim($user); + $user = mb_strtolower($user, 'UTF-8'); -+ $domain = $this->config->getSystemValue("mail_domain"); -+ $domain_suffix = "@$domain"; ++ $domain = $this->config->getSystemValue('mail_domain', ''); ++ $domain_suffix = !empty($domain) ? '@' . $domain : ''; ++ $alt_domain = $this->config->getSystemValue('alt_mail_domain', ''); ++ $alt_domain_suffix = !empty($alt_domain) ? '@' . $alt_domain : ''; + $admin_username = $_ENV["NEXTCLOUD_ADMIN_USER"]; -+ if (stristr($user, $domain_suffix) === FALSE && strcmp($user, $admin_username) != 0) { -+ $user = $user . $domain_suffix; ++ $is_admin = strcmp($user, $admin_username) === 0; + ++ if(!$is_admin) { ++ $user = str_replace($alt_domain_suffix, $domain_suffix, $user); + } + ++ if (!$is_admin && stristr($user, $domain_suffix) === FALSE) { ++ $user = $user . $domain_suffix; ++ } $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-11 11:27:43.978963021 +0530 +@@ -73,6 +73,22 @@ + + $this->logger->debug('Converting login name to UID'); + $uid = $loginName; ++ $uid = trim($uid); ++ $uid = mb_strtolower($uid, 'UTF-8'); ++ $domain = \OC::$server->getConfig()->getSystemValue('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; ++ ++ if(!$is_admin) { ++ $uid = str_replace($alt_domain_suffix, $domain_suffix, $uid); ++ } ++ ++ if (!$is_admin && stristr($uid, $domain_suffix) === FALSE) { ++ $uid = $uid . $domain_suffix; ++ } + Util::emitHook( + '\OCA\Files_Sharing\API\Server2Server', + 'preLoginNameUsedAsUserName', -- GitLab From 7aaa569353f8a5b55be0bf3959586ed55615d82e Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 11 May 2022 11:43:31 +0530 Subject: [PATCH 16/20] Fix login patch --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 03fb27c8..d6e24706 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ FROM nextcloud:22.2.7-fpm AS nextcloud ARG BASE_DIR="/usr/src/nextcloud" ARG TMP_PATCH_DIR="/tmp/build_patches" -COPY patches/ ${TMP_PATCH_DIR}/ -RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/002-login-without-domain.patch ARG THEME_VERSION="22.0.0" ARG THEME_HELPER_VERSION="1.1.0" ARG NEWS_VERSION="18.0.1" @@ -101,7 +99,7 @@ RUN sed -i "s/\$systemConfig->setValue('theme', '');/\$systemConfig->setValue('t # Patches COPY patches/ ${TMP_PATCH_DIR}/ -RUN patch -u ${BASE_DIR}/core/Controller/LoginController.php -i ${TMP_PATCH_DIR}/002-login-without-domain.patch +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 -- GitLab From 84eee91d8100f04611756e56b80f33f8e7bf38b1 Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 11 May 2022 11:53:14 +0530 Subject: [PATCH 17/20] Fix help link --- patches/009-help-links.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/009-help-links.patch b/patches/009-help-links.patch index d5ec7a66..dcd69325 100644 --- a/patches/009-help-links.patch +++ b/patches/009-help-links.patch @@ -28,7 +28,7 @@ help links are shown -} ?>" - href=""> + ++ href="https://docs.nextcloud.com/server/22/user_manual/en" target="_blank" rel="noreferrer noopener"> - t('User documentation')); ?> + t('User documentation')); ?> -- GitLab From 33d55a4229f8eeb18a230ea6b46d8e309494e4d1 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 11 May 2022 13:25:30 +0530 Subject: [PATCH 18/20] added icon in user documentation --- patches/009-help-links.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/009-help-links.patch b/patches/009-help-links.patch index d5ec7a66..7fe7c8d3 100644 --- a/patches/009-help-links.patch +++ b/patches/009-help-links.patch @@ -31,7 +31,7 @@ help links are shown + href="https://docs.nextcloud.com/server/21/user_manual/en" target="_blank" rel="noreferrer noopener"> - t('User documentation')); ?> -+ t('User documentation')); ?> ++ t('User documentation')); ?> ↗ -- GitLab From 716896f5f21e44a620dff9e3e4ffbcea2ce5107b Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 11 May 2022 17:13:30 +0530 Subject: [PATCH 19/20] NC version dynamic --- patches/009-help-links.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/009-help-links.patch b/patches/009-help-links.patch index bb82890f..43bd732b 100644 --- a/patches/009-help-links.patch +++ b/patches/009-help-links.patch @@ -28,7 +28,7 @@ help links are shown -} ?>" - href=""> + ++ href="https://docs.nextcloud.com/server//user_manual/en" target="_blank" rel="noreferrer noopener"> - t('User documentation')); ?> + t('User documentation')); ?> ↗ -- GitLab From 57f54c7b83cd10782da448478036062eb173483b Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 11 May 2022 17:51:56 +0530 Subject: [PATCH 20/20] Fix recovery email patch --- Dockerfile | 2 +- patches/006-recovery-email-changes.patch | 54 ++++++++++++------------ 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/Dockerfile b/Dockerfile index d6e24706..7e4abe84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ ARG EA_TAG="1.2.0" ARG ECLOUD_LAUNCHER_JOB_ID="294845" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" -RUN sed -i 's/22,2,7,1/22,2,7,2/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,7,1/22,2,7,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 diff --git a/patches/006-recovery-email-changes.patch b/patches/006-recovery-email-changes.patch index 95431e24..34367ab9 100644 --- a/patches/006-recovery-email-changes.patch +++ b/patches/006-recovery-email-changes.patch @@ -7,47 +7,45 @@ This patch adds the necessary changes to core NC controller and template for "em diff --git ./core/Controller/LostController.php ./core/Controller/LostController.new.php --- ./core/Controller/LostController.php 2022-03-23 12:00:12.000000000 +0100 +++ ./core/Controller/LostController.new.php 2022-03-23 12:06:45.000000000 +0100 -@@ -173,9 +173,19 @@ - * @throws \Exception +@@ -174,8 +174,20 @@ */ protected function checkPasswordResetToken(string $token, string $userId): void { -+ $domain = $this->config->getSystemValue("mail_domain"); -+ $domainSuffix = "@$domain"; -+ -+ if(stristr($userId, $domainSuffix) === FALSE ) { -+ $userId = $userId . $domainSuffix; -+ } -+ -+ $recoveryEmail = $this->config->getUserValue($userId, 'email-recovery', 'recovery-email'); -+ $mailAddress = is_null($recoveryEmail) ? '' : $recoveryEmail; -+ try { ++ $domain = $this->config->getSystemValue('mail_domain', ''); ++ $domainSuffix = !empty($domain) ? '@' . $domain : ''; ++ $altDomain = $this->config->getSystemValue('alt_mail_domain', ''); ++ $altDomainSuffix = !empty($altDomain) ? '@' . $altDomain : ''; ++ ++ $userId = str_replace($altDomainSuffix, $domainSuffix, $userId); ++ if(stristr($userId, $domainSuffix) === FALSE ) { ++ $userId = $userId . $domainSuffix; ++ } $user = $this->userManager->get($userId); - $this->verificationToken->check($token, $user, 'lostpassword', $user ? $user->getEMailAddress() : '', true); ++ $recoveryEmail = $this->config->getUserValue($userId, 'email-recovery', 'recovery-email'); ++ $mailAddress = is_null($recoveryEmail) ? '' : $recoveryEmail; ++ + $this->verificationToken->check($token, $user, 'lostpassword', $mailAddress, true); } catch (InvalidTokenException $e) { $error = $e->getCode() === InvalidTokenException::TOKEN_EXPIRED ? $this->l10n->t('Could not reset password because the token is expired') -@@ -214,6 +224,13 @@ - return new JSONResponse($this->error($this->l10n->t('Password reset is disabled'))); - } - -+ $domain = $this->config->getSystemValue("mail_domain"); -+ $domainSuffix = "@$domain"; -+ -+ if(stristr($input, $domainSuffix) === FALSE ) { -+ $input = $input . $domainSuffix; -+ } -+ - \OCP\Util::emitHook( - '\OCA\Files_Sharing\API\Server2Server', - 'preLoginNameUsedAsUserName', -@@ -288,7 +305,7 @@ +@@ -287,8 +299,18 @@ + * @throws \OCP\PreConditionNotMetException */ protected function sendEmail($input) { ++ $domain = $this->config->getSystemValue('mail_domain', ''); ++ $domainSuffix = !empty($domain) ? '@' . $domain : ''; ++ $altDomain = $this->config->getSystemValue('alt_mail_domain', ''); ++ $altDomainSuffix = !empty($altDomain) ? '@' . $altDomain : ''; ++ ++ $input = str_replace($altDomainSuffix, $domainSuffix, $input); ++ if(stristr($input, $domainSuffix) === FALSE ) { ++ $input = $input . $domainSuffix; ++ } ++ $user = $this->findUserByIdOrMail($input); - $email = $user->getEMailAddress(); + $email = $this->config->getUserValue($user->getUID(), 'email-recovery', 'recovery-email'); - + if (empty($email)) { throw new ResetPasswordException('Could not send reset e-mail since there is no email for username ' . $input); -- GitLab