Newer
Older
ARG BASE_DIR="/usr/src/nextcloud"
ARG TMP_PATCH_DIR="/tmp/build_patches"
ARG THEME_HELPER_JOB_ID="635069"
ARG NOTES_VERSION="4.8.0"
ARG CONTACTS_JOB_ID="620997"
ARG CALENDAR_JOB_ID="628427"
RUN sed -i 's/25,0,8,2/25,0,8,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
RUN curl -fsSL -o notes.tar.gz \
"https://github.com/nextcloud/notes/releases/download/v${NOTES_VERSION}/notes.tar.gz" && \
tar -xf notes.tar.gz -C ${BASE_DIR}/custom_apps/ && \
rm notes.tar.gz;
# custom Contact
RUN curl -fsSL -o contacts.zip \
"https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/contacts/-/jobs/${CONTACTS_JOB_ID}/artifacts/download" && \
unzip contacts.zip && \
mv dist/contacts ${BASE_DIR}/custom_apps/ && \
rm contacts.zip;
"https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/calendar/-/jobs/${CALENDAR_JOB_ID}/artifacts/download" && \
unzip calendar.zip && \
mv dist/calendar ${BASE_DIR}/custom_apps/ && \
rm calendar.zip;
"https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/email-recovery/-/jobs/${EMAIL_RECOVERY_JOB_ID}/artifacts/download" && \
mv dist/email-recovery ${BASE_DIR}/custom_apps/ && \
rm email-recovery.zip;
Florent VINCENT
committed
RUN curl -fsSL -o ecloud-theme-helper.zip \
"https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/ecloud-theme-helper/-/jobs/${THEME_HELPER_JOB_ID}/artifacts/download" && \
unzip ecloud-theme-helper.zip && \
mv dist/ecloud-theme-helper ${BASE_DIR}/custom_apps/ && \
rm ecloud-theme-helper.zip;
"https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/launcher/-/jobs/${LAUNCHER_JOB_ID}/artifacts/download" && \
unzip murena_launcher.zip && \
mv dist/murena_launcher ${BASE_DIR}/custom_apps/ && \
rm murena_launcher.zip;
RUN curl -fsSL -o integration_google.tar.gz \
"https://github.com/nextcloud/integration_google/releases/download/v${GOOGLE_INTEGRATION_VERSION}/integration_google-${GOOGLE_INTEGRATION_VERSION}.tar.gz" && \
tar -xf integration_google.tar.gz -C ${BASE_DIR}/custom_apps/ && \
chown -R www-data:www-data ${BASE_DIR}/custom_apps/integration_google && \
rm integration_google.tar.gz;
RUN curl -fsSL -o ecloud-accounts.zip \
"https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/ecloud-accounts/-/jobs/${EA_JOB_ID}/artifacts/download" && \
unzip ecloud-accounts.zip && \
mv dist/ecloud-accounts ${BASE_DIR}/custom_apps/ && \
rm ecloud-accounts.zip;
RUN curl -fsSL -o ecloud-dashboard.zip \
"https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/murena-dashboard/-/jobs/${DASHBOARD_JOB_ID}/artifacts/download" && \
RUN curl -fsSL -o snappymail.tar.gz \
"https://snappymail.eu/repository/nextcloud/snappymail-${SNAPPY_VERSION}-nextcloud.tar.gz" && \
tar -xf snappymail.tar.gz -C ${BASE_DIR}/custom_apps/ && \
rm snappymail.tar.gz;
RUN curl -fsSL -o user_migration.zip \
"https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/user_migration/-/jobs/${USER_MIGRATION_JOB_ID}/artifacts/download" && \
unzip user_migration.zip && \
mv dist/user_migration ${BASE_DIR}/custom_apps/ && \
rm user_migration.zip;
# Fix snappymail icon
RUN sed -i 's/logo-white-64x64.png/app.svg/' ${BASE_DIR}/custom_apps/snappymail/appinfo/info.xml
# Snappy theme
RUN curl -fsSL -o Murena-snappymail-theme.tar.gz \
"https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/snappymail-theme/-/archive/${SNAPPY_THEME_VERSION}/snappymail-theme-${SNAPPY_THEME_VERSION}.tar.gz" && \
tar -xf Murena-snappymail-theme.tar.gz -C /tmp/ && \
mv /tmp/snappymail-theme-${SNAPPY_THEME_VERSION}/ ${BASE_DIR}/themes/Murena/snappymail && \
chown -R www-data:www-data ${BASE_DIR}/themes/Murena/ && \
rm -rf Murena-snappymail-theme.tar.gz
RUN curl -fsSL -o memories.tar.gz \
"https://github.com/pulsejet/memories/releases/download/v${MEMORIES_VERSION}/memories.tar.gz" && \
tar -xf memories.tar.gz -C ${BASE_DIR}/custom_apps/ && \
rm memories.tar.gz;
# Remove unzip when unzipping is done
RUN apt-get -y remove unzip
# force eCloud theme not to be disabled even when there is an upgrade process launched
RUN sed -i "s/\$systemConfig->setValue('theme', '');/\$systemConfig->setValue('theme', 'eCloud');/g" ${BASE_DIR}/lib/base.php
# Disable editor feature of media viewer
RUN sed -i 's/!this.isMobile/!this.isMobile\&\&false/' ${BASE_DIR}/apps/viewer/js/viewer-main.js
ENTRYPOINT ["/custom_entrypoint.sh"]
CMD ["php-fpm"]
From nextcloud as selfhost
ARG BASE_DIR="/usr/src/nextcloud"
ARG TMP_PATCH_DIR="/tmp/build_patches"
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/002-login-without-domain.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 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 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 -u ${BASE_DIR}/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php -i ${TMP_PATCH_DIR}/015-email-mail-template.patch
RUN patch -u ${BASE_DIR}/core/Command/User/Setting.php -i ${TMP_PATCH_DIR}/018-occ-user-setting.patch
RUN patch -u ${BASE_DIR}/apps/files/js/files.js -i ${TMP_PATCH_DIR}/021-repeated-storage-dialog-fix.patch
RUN cd ${BASE_DIR} && patch -u ${BASE_DIR}/3rdparty/sabre/vobject/lib/ITip/Broker.php -i ${TMP_PATCH_DIR}/022-significantchange.patch
RUN patch -u ${BASE_DIR}/apps/dav/lib/CalDAV/Reminder/ReminderService.php -i ${TMP_PATCH_DIR}/024-reminder-service-handle-exception.patch
RUN patch -u ${BASE_DIR}/apps/theming/lib/Themes/CommonThemeTrait.php -i ${TMP_PATCH_DIR}/026-primary-color-fix.patch
# 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/
# User Backend
RUN curl -fsSL -o user_backend_sql_raw.tar.gz \
"https://github.com/PanCakeConnaisseur/user_backend_sql_raw/releases/download/v${USER_BACKEND_RAW_SQL_VERSION}/user_backend_sql_raw.tar.gz" && \
tar -xf user_backend_sql_raw.tar.gz -C ${BASE_DIR}/custom_apps/ && \
rm user_backend_sql_raw.tar.gz;
# Selfhost theme
RUN curl -fsSL -o user_backend_sql_raw.tar.gz \
"https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/selfhost-theme-helper/-/archive/${SELFHOST_THEME_VERSION}/selfhost-theme-helper-${SELFHOST_THEME_VERSION}.tar.gz" && \
tar -xf selfhost-theme-helper.tar.gz -C ${BASE_DIR}/custom_apps/ && \
rm selfhost-theme-helper.tar.gz;
# 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
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
#replace error class in schedule response error file to fix error color
RUN sed -i 's/update/error/g' ${BASE_DIR}/apps/dav/templates/schedule-response-error.php
# Fix the navbar entries
RUN sed -i 's/this.appLimit=e/this.appLimit=this.appList.length/' ${BASE_DIR}/dist/core-main.js
# Fix total quota value for users in settings and files
RUN sed -i "s/'total'/'quota'/" ${BASE_DIR}/apps/files/lib/Controller/ViewController.php
RUN sed -i "s/'total'/'quota'/" ${BASE_DIR}/apps/settings/lib/Settings/Personal/PersonalInfo.php
RUN sed -i "s/\['total'\]/\['quota'\]/" ${BASE_DIR}/apps/provisioning_api/lib/Controller/AUserData.php
From selfhost as ecloud
ARG BASE_DIR="/usr/src/nextcloud"
ARG TMP_PATCH_DIR="/tmp/build_patches"
# 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 patch -u ${BASE_DIR}/core/templates/layout.guest.php -i ${TMP_PATCH_DIR}/016-login-screen.patch
RUN patch -u ${BASE_DIR}/lib/private/Notification/Manager.php -i ${TMP_PATCH_DIR}/020-fairuse-notification-fix.patch
RUN cd ${BASE_DIR} && patch -u ${BASE_DIR}/apps/user_ldap/lib/User_LDAP.php -i ${TMP_PATCH_DIR}/023-ldap-check-pwd-optimization.patch
RUN patch -u ${BASE_DIR}/lib/private/User/Manager.php -i ${TMP_PATCH_DIR}/025-optimize-get-by-email.patch
RUN patch -u ${BASE_DIR}/apps/dav/lib/Connector/Sabre/Principal.php -i ${TMP_PATCH_DIR}/027-displayname-user-leak-dav.patch
RUN patch -u ${BASE_DIR}/apps/dav/lib/HookManager.php -i ${TMP_PATCH_DIR}/028-default-task-calendar.patch
RUN rm -rf ${TMP_PATCH_DIR}
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-v${LDAP_WRITE_SUPPORT_VERSION}.tar.gz" && \
tar -xf ldap_write_support.tar.gz -C ${BASE_DIR}/custom_apps && \
rm ldap_write_support.tar.gz
RUN curl -fsSL -o oidc_login.tar.gz \
"https://github.com/pulsejet/nextcloud-oidc-login/releases/download/v${OIDC_LOGIN_VERSION}/oidc_login.tar.gz" && \
tar -xf oidc_login.tar.gz -C ${BASE_DIR}/custom_apps && \
rm oidc_login.tar.gz
# Remove user avatar generation for system addressbook card
RUN sed -i 's/$this->getAvatarImage($user)/null/' ${BASE_DIR}/apps/dav/lib/CardDAV/Converter.php
# 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\/<?php p(\$_\[\x27language\x27\]); ?>\/e-email-invite\//' ${BASE_DIR}/core/templates/layout.public.php
# RUN cd ${BASE_DIR}/dist && sed -i 's/resetPassword:!1/resetPassword:!1||Z.showResetPassword==="1"/' core-login.js
# hide oidc login button
RUN sed -i 's/$context->registerAlternativeLogin(OIDCLoginOption::class);/\/\/$context->registerAlternativeLogin(OIDCLoginOption::class);/' ${BASE_DIR}/custom_apps/oidc_login/lib/AppInfo/Application.php
# add attr about how many notifications to notif icon
RUN sed -i 's/attrs:{id:"notifications",/attrs:{id:"notifications","data-has-notifications":0!==e.notifications.length,/' ${BASE_DIR}/apps/notifications/js/notifications-main.js
# Add data-object-type to notification
RUN sed -i 's/"data-id":e.notificationId,/"data-id":e.notificationId,"data-object-type":e.objectType,/' ${BASE_DIR}/apps/notifications/js/notifications-main.js
#Hide Archive/Unarchive feature in memories app
RUN sed -i 's/{name:(0,be.Iu)("memories","Archive"),icon:la,callback:this.archiveSelection.bind(this),if:()=>!this.routeIsArchive()&&!this.routeIsAlbum()},{name:(0,be.Iu)("memories","Unarchive"),icon:ua,callback:this.archiveSelection.bind(this),if:()=>this.routeIsArchive()},//g' ${BASE_DIR}/custom_apps/memories/js/memories-main.js
RUN sed -i 's/{name:"archive",icon:la,title:(0,be.Iu)("memories","Archive")},//g' ${BASE_DIR}/custom_apps/memories/js/memories-main.js
# 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:\[o,"displayname"\]},//' js/calendar-main.js
RUN cd ${BASE_DIR}/custom_apps/notes && sed -i 's/<step>OCA\\Notes\\Migration\\EditorHint<\/step>//g' appinfo/info.xml
RUN cd ${BASE_DIR}/apps/theming && sed -i 's/<step>OCA\\Theming\\Migration\\MigrateUserConfig<\/step>//g' appinfo/info.xml
# 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
# 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
# Remove 'fix broken values of calendar objects' repair step
RUN sed -i '/<step>OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue<\/step>/d' ${BASE_DIR}/apps/dav/appinfo/info.xml
RUN rm -rf ${BASE_DIR}/themes/eCloud && \
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/