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

Skip to content
Dockerfile 5.08 KiB
Newer Older
ARG BASE_DIR="/usr/src/nextcloud"
Arnau Vàzquez's avatar
Arnau Vàzquez committed
ARG TMP_PATCH_DIR="/tmp/build_patches"
ARG THEME_VERSION="20.0.11"
ARG QUOTA_WARN_VERSION="1.9.1"
ARG CALENDAR_VERSION="2.3.1"
ARG USER_BACKEND_RAW_SQL_VERSION="1.1.0"
Arnau Vàzquez's avatar
Arnau Vàzquez committed
ARG EMAIL_RECOVERY_JOB_ID="162557"
ARG RAINLOOP_VERSION="7.1.2"
Akhil's avatar
Akhil committed
ARG RAINLOOP_COMMIT_SHA="aa5c57a7"
Arnau Vàzquez's avatar
Arnau Vàzquez committed
ARG USC_VERSION="1.0.0"
ARG EDA_TAG="nc-20"
Arnau Vàzquez's avatar
Arnau Vàzquez committed
RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images
Arnau Vàzquez's avatar
Arnau Vàzquez committed
COPY patches/ ${TMP_PATCH_DIR}/
COPY custom_entrypoint.sh /
RUN chmod +x /custom_entrypoint.sh
RUN sed -i 's/20,0,11,1/20,0,11,5/' ${BASE_DIR}/version.php
Arnau Vàzquez's avatar
Arnau Vàzquez committed

# Install unzip for unzipping artifacts
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 \
    "https://github.com/nextcloud/quota_warning/releases/download/v${QUOTA_WARN_VERSION}/quota_warning-${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;

RUN curl -fsSL -o contacts.tar.gz \
    "https://github.com/nextcloud-releases/contacts/releases/download/v${CONTACTS_VERSION}/contacts.tar.gz" && \
    tar -xf contacts.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    rm contacts.tar.gz;

RUN curl -fsSL -o calendar.tar.gz \
    "https://github.com/nextcloud-releases/calendar/releases/download/v${CALENDAR_VERSION}/calendar.tar.gz" && \
    tar -xf calendar.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    rm calendar.tar.gz;

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 \
    "https://gitlab.e.foundation/e/infra/selfhost/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/ && \
Arnau Vàzquez's avatar
Arnau Vàzquez committed
RUN curl -fsSL -o rainloop.tar.gz \
    "https://gitlab.e.foundation/e/infra/selfhost/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/ && \
    mv "${BASE_DIR}/custom_apps/rainloop-nextcloud-${RAINLOOP_VERSION}-${RAINLOOP_COMMIT_SHA}" "${BASE_DIR}/custom_apps/rainloop" && \
    rm rainloop.tar.gz;

RUN curl -fsSL -o ecloud_drop_account.tar.gz \
    "https://gitlab.e.foundation/e/infra/selfhost/nextcloud-apps/ecloud-drop-account/-/archive/${EDA_TAG}/ecloud-drop-account-${EDA_TAG}.tar.gz" && \
    tar -xf ecloud_drop_account.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    mv "${BASE_DIR}/custom_apps/ecloud-drop-account-${EDA_TAG}" "${BASE_DIR}/custom_apps/ecloud_drop_account" && \
    rm ecloud_drop_account.tar.gz;

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

Arnau Vàzquez's avatar
Arnau Vàzquez committed
# Patches
RUN patch -u ${BASE_DIR}/core/Controller/LoginController.php -i ${TMP_PATCH_DIR}/002-login-without-domain.patch
RUN patch -u ${BASE_DIR}/core/templates/layout.user.php -i ${TMP_PATCH_DIR}/003-contact-search-removal.patch
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
Arnau Vàzquez's avatar
Arnau Vàzquez committed
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.js
Arnau Vàzquez's avatar
Arnau Vàzquez committed
RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/anyof/allof/g' js/calendar.js
# Custom theme
RUN curl -fsSL -o eelo-theme.tar.gz \
    "https://gitlab.e.foundation/e/infra/nextcloud-theme/-/archive/${THEME_VERSION}/nextcloud-theme-${THEME_VERSION}.tar.gz" && \
    tar -xf eelo-theme.tar.gz -C /tmp/ && \
    mv /tmp/nextcloud-theme-${THEME_VERSION}/eelo ${BASE_DIR}/themes/ && \
    chown -R www-data:www-data ${BASE_DIR}/themes/eelo/ && \
    rm -rf eelo-theme.tar.gz /tmp/nextcloud-theme-* ${BASE_DIR}/themes/example/

ENTRYPOINT ["/custom_entrypoint.sh"]
CMD ["php-fpm"]