Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Dockerfile 10.8 KiB
Newer Older
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
FROM nextcloud:23.0.9-fpm AS nextcloud
ARG BASE_DIR="/usr/src/nextcloud"
ARG TMP_PATCH_DIR="/tmp/build_patches"
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
ARG THEME_VERSION="22.1.5"
ARG THEME_HELPER_VERSION="1.4.4"
Akhil's avatar
Akhil committed
ARG NEWS_VERSION="18.1.1"
Akhil's avatar
Akhil committed
ARG QUOTA_WARN_VERSION="1.14.0"
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
ARG NOTES_VERSION="4.5.1"
ARG CONTACTS_JOB_ID="400045"
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
ARG CALENDAR_JOB_ID="414851"
ARG USER_BACKEND_RAW_SQL_VERSION="1.3.0"
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
ARG EMAIL_RECOVERY_JOB_ID="389385"
Akhil's avatar
Akhil committed
ARG RAINLOOP_VERSION="7.2.5"
ARG RAINLOOP_COMMIT_SHA="523518ba"
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
ARG EA_TAG="2.1.1"
ARG ECLOUD_LAUNCHER_JOB_ID="389373"
Akhil's avatar
Akhil committed
ARG GOOGLE_INTEGRATION_VERSION="1.0.8"
ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0"
Akhil's avatar
Akhil committed
ARG OIDC_LOGIN_VERSION="2.3.3"
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
RUN sed -i 's/23,0,9,1/23,0,9,19/' ${BASE_DIR}/version.php
Akhil's avatar
Akhil committed
COPY custom_entrypoint.sh /
RUN chmod +x /custom_entrypoint.sh
RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images
Arnau Vàzquez's avatar
Arnau Vàzquez committed
# Install unzip for unzipping artifacts
Arnau Vàzquez's avatar
Arnau Vàzquez committed
RUN apt-get update && apt-get install unzip

# Custom apps
RUN curl -fsSL -o news.tar.gz \
    "https://github.com/nextcloud/news/releases/download/${NEWS_VERSION}/news.tar.gz" && \
    tar -xf news.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    rm news.tar.gz;

RUN curl -fsSL -o quota_warning.tar.gz \
Akhil's avatar
Akhil committed
    "https://github.com/nextcloud-releases/quota_warning/releases/download/v${QUOTA_WARN_VERSION}/quota_warning-v${QUOTA_WARN_VERSION}.tar.gz" && \
    tar -xf quota_warning.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    rm quota_warning.tar.gz;

Arnau Vàzquez's avatar
Arnau Vàzquez committed
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;
# custom Calendar 3.2.4
RUN curl -fsSL -o calendar.zip \
Arnau Vàzquez's avatar
Arnau Vàzquez committed
    "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;

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;

Arnau Vàzquez's avatar
Arnau Vàzquez committed
RUN curl -fsSL -o email-recovery.zip \
Arnau Vàzquez's avatar
Arnau Vàzquez committed
    "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/email-recovery/-/jobs/${EMAIL_RECOVERY_JOB_ID}/artifacts/download" && \
Arnau Vàzquez's avatar
Arnau Vàzquez committed
    unzip email-recovery.zip && \
Akhil's avatar
Akhil committed
    mv dist/email-recovery ${BASE_DIR}/custom_apps/ && \
    rm email-recovery.zip;
Arnau Vàzquez's avatar
Arnau Vàzquez committed
RUN curl -fsSL -o rainloop.tar.gz \
Arnau Vàzquez's avatar
Arnau Vàzquez committed
    "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" && \
Arnau Vàzquez's avatar
Arnau Vàzquez committed
    tar -xf rainloop.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    mv "${BASE_DIR}/custom_apps/rainloop-nextcloud-${RAINLOOP_VERSION}-${RAINLOOP_COMMIT_SHA}" "${BASE_DIR}/custom_apps/rainloop" && \
    rm rainloop.tar.gz;

Akhil's avatar
Akhil committed
RUN curl -fsSL -o ecloud-theme-helper.tar.gz \
Arnau Vàzquez's avatar
Arnau Vàzquez committed
    "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/ecloud-theme-helper/-/archive/${THEME_HELPER_VERSION}/ecloud-theme-helper-${THEME_HELPER_VERSION}.tar.gz" && \
Akhil's avatar
Akhil committed
    tar -xf ecloud-theme-helper.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    mv "${BASE_DIR}/custom_apps/ecloud-theme-helper-${THEME_HELPER_VERSION}" "${BASE_DIR}/custom_apps/ecloud-theme-helper" && \
    rm ecloud-theme-helper.tar.gz;

Arnau Vàzquez's avatar
Arnau Vàzquez committed
RUN curl -fsSL -o murena_launcher.zip \
Arnau Vàzquez's avatar
Arnau Vàzquez committed
    "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/launcher/-/jobs/${ECLOUD_LAUNCHER_JOB_ID}/artifacts/download" && \
Arnau Vàzquez's avatar
Arnau Vàzquez committed
    unzip murena_launcher.zip && \
    mv dist/murena_launcher ${BASE_DIR}/custom_apps/ && \
    rm murena_launcher.zip;
Akhil's avatar
Akhil committed

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.tar.gz \
    "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/ecloud-accounts/-/archive/${EA_TAG}/ecloud-accounts-${EA_TAG}.tar.gz" && \
    tar -xf ecloud-accounts.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    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
Arnau Vàzquez's avatar
Arnau Vàzquez committed

Akhil's avatar
Akhil committed
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

Arnau Vàzquez's avatar
Arnau Vàzquez committed
# Remove unzip when unzipping is done
RUN apt-get -y remove unzip

Akhil's avatar
Akhil committed
# 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
Arnau Vàzquez's avatar
Arnau Vàzquez committed
# Patches
Akhil's avatar
Akhil committed
COPY patches/ ${TMP_PATCH_DIR}/
Akhil's avatar
Akhil committed
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
Akhil's avatar
Akhil committed
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/009-help-links.patch
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
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
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
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
Akhil's avatar
Akhil committed
RUN patch -u ${BASE_DIR}/lib/private/legacy/OC_Helper.php -i ${TMP_PATCH_DIR}/014-add-mail-usage.patch
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
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/templates/layout.guest.php -i ${TMP_PATCH_DIR}/016-login-screen.patch
Akhil's avatar
Akhil committed
RUN patch -u ${BASE_DIR}/core/Command/User/Setting.php -i ${TMP_PATCH_DIR}/018-occ-user-setting.patch
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
RUN patch -u ${BASE_DIR}/apps/settings/lib/Sections/Personal/Groupware.php -i ${TMP_PATCH_DIR}/019-groupware.patch
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
RUN patch -u ${BASE_DIR}/lib/private/Notification/Manager.php -i ${TMP_PATCH_DIR}/020-fairuse-notification-fix.patch
RUN patch -u ${BASE_DIR}/apps/files/js/files.js -i ${TMP_PATCH_DIR}/021-repeated-storage-dialog-fix.patch
RUN rm -rf ${TMP_PATCH_DIR}
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
# show reset pwd page with a query param
AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
RUN cd ${BASE_DIR}/core/js/dist && sed -i 's/resetPassword:!1/resetPassword:!1||Z.showResetPassword==="1"/' login.js

Akhil's avatar
Akhil committed
# 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

AVINASH GUSAIN's avatar
AVINASH GUSAIN committed
# sed version of ldap_write_support
RUN cd ${BASE_DIR}/custom_apps/ldap_write_support && sed -i 's/max-version="22"/max-version="23"/' appinfo/info.xml
# 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
Akhil's avatar
Akhil committed
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
Akhil's avatar
Akhil committed
# 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

#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

# Custom theme
RUN curl -fsSL -o eCloud-theme.tar.gz \
Arnau Vàzquez's avatar
Arnau Vàzquez committed
    "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
Arnau Vàzquez's avatar
Arnau Vàzquez committed
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
Akhil's avatar
Akhil committed
# 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"]