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

Commit 8089cde6 authored by Arnau Vàzquez's avatar Arnau Vàzquez
Browse files

Bundle news app and eelo theme with the container

parent a6e13bd9
Loading
Loading
Loading
Loading
+31 −5
Original line number Diff line number Diff line
FROM nextcloud:19.0.8-fpm
ARG BASE_DIR="/usr/src/nextcloud"
ARG THEME_VERSION="19.0.8.2"
ARG NEWS_VERSION="14.2.2"

RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images
COPY patches/ /tmp/build_patches/
RUN sed -i 's/19,0,8,1/19,0,8,2/g' /usr/src/nextcloud/version.php
#RUN patch -u /usr/src/nextcloud/core/signature.json -i /tmp/build_patches/001-sha512-signature.patch
RUN patch -u /usr/src/nextcloud/core/Controller/LoginController.php -i /tmp/build_patches/002-login-without-domain.patch
RUN patch -u /usr/src/nextcloud/core/templates/layout.user.php -i /tmp/build_patches/003-contact-search-removal.patch
RUN patch -u /usr/src/nextcloud/core/Controller/ContactsMenuController.php -i /tmp/build_patches/004-contact-search-controller-removal.patch
 No newline at end of file
COPY custom_entrypoint.sh /
RUN chmod +x /custom_entrypoint.sh
RUN sed -i 's/19,0,8,1/19,0,8,3/' ${BASE_DIR}/version.php

# Patches
#RUN patch -u ${BASE_DIR}/core/signature.json -i /tmp/build_patches/001-sha512-signature.patch
RUN patch -u ${BASE_DIR}/core/Controller/LoginController.php -i /tmp/build_patches/002-login-without-domain.patch
RUN patch -u ${BASE_DIR}/core/templates/layout.user.php -i /tmp/build_patches/003-contact-search-removal.patch
RUN patch -u ${BASE_DIR}/core/Controller/ContactsMenuController.php -i /tmp/build_patches/004-contact-search-controller-removal.patch
RUN rm -rf /tmp/build_patches/

# 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;

# 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"]
 No newline at end of file

custom_entrypoint.sh

0 → 100644
+10 −0
Original line number Diff line number Diff line
#!/bin/sh

echo "Custom eCloud entrypoint"
rsync_options="-rlDog --chown www-data:www-data --delete"

rsync $rsync_options --include "/news/" --exclude '/*' /usr/src/nextcloud/custom_apps/ /var/www/html/custom_apps/
rsync $rsync_options --include "/eelo/" --exclude '/*' /usr/src/nextcloud/themes/ /var/www/html/themes/

/entrypoint.sh "$@"
echo "bye bye NC"
 No newline at end of file