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

Commit 908efc95 authored by Arnau Vàzquez's avatar Arnau Vàzquez
Browse files

Merge branch 'new-theme-beta' into 'master'

New theme beta

See merge request !34
parents 9529dced 027d9f16
Loading
Loading
Loading
Loading
Loading
+38 −16
Original line number Diff line number Diff line
FROM nextcloud:20.0.11-fpm
FROM nextcloud:20.0.12-fpm
ARG BASE_DIR="/usr/src/nextcloud"
ARG TMP_PATCH_DIR="/tmp/build_patches"
ARG THEME_VERSION="20.0.11"
ARG NEWS_VERSION="16.0.0"
ARG THEME_VERSION="20.1.0-rc3"
ARG THEME_HELPER_VERSION="1.0.0-rc3"
ARG NEWS_VERSION="16.0.1"
ARG QUOTA_WARN_VERSION="1.9.1"
ARG NOTES_VERSION="4.1.0"
ARG CONTACTS_VERSION="4.0.1"
ARG CALENDAR_VERSION="2.3.1"
ARG NOTES_VERSION="4.1.1"
ARG CONTACTS_VERSION="4.0.2"
ARG CALENDAR_VERSION="2.3.3"
ARG USER_BACKEND_RAW_SQL_VERSION="1.1.0"
ARG EMAIL_RECOVERY_JOB_ID="162557"
ARG EMAIL_RECOVERY_JOB_ID="199763"
ARG RAINLOOP_VERSION="7.1.2"
ARG RAINLOOP_COMMIT_SHA="aa5c57a7"
ARG USC_VERSION="1.0.0"
ARG EDA_TAG="nc-20"
ARG ECLOUD_LAUNCHER_JOB_ID="199516"

RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images
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
RUN sed -i 's/20,0,12,1/20,0,12,9/' ${BASE_DIR}/version.php

# Install unzip for unzipping artifacts
RUN apt-get update && apt-get install unzip 
@@ -72,11 +73,23 @@ RUN curl -fsSL -o ecloud_drop_account.tar.gz \
    mv "${BASE_DIR}/custom_apps/ecloud-drop-account-${EDA_TAG}" "${BASE_DIR}/custom_apps/ecloud_drop_account" && \
    rm ecloud_drop_account.tar.gz;

RUN curl -fsSL -o ecloud-theme-helper.tar.gz \
    "https://gitlab.e.foundation/e/infra/selfhost/nextcloud-apps/ecloud-theme-helper/-/archive/${THEME_HELPER_VERSION}/ecloud-theme-helper-${THEME_HELPER_VERSION}.tar.gz" && \
    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;

RUN curl -fsSL -o ecloud-launcher.zip \
    "https://gitlab.e.foundation/e/infra/selfhost/nextcloud-apps/launcher/-/jobs/${ECLOUD_LAUNCHER_JOB_ID}/artifacts/download" && \
    unzip ecloud-launcher.zip && \
    mv dist/ecloud-launcher ${BASE_DIR}/custom_apps/ && \
    rm ecloud-launcher.zip;

# Remove unzip when unzipping is done
RUN apt-get -y remove unzip

# force eelo theme not to be disabled even when there is an upgrade process launched
RUN sed -i "s/\$systemConfig->setValue('theme', '');/\$systemConfig->setValue('theme', 'eelo');/g" ${BASE_DIR}/lib/base.php
# 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

# Patches
RUN patch -u ${BASE_DIR}/core/Controller/LoginController.php -i ${TMP_PATCH_DIR}/002-login-without-domain.patch
@@ -88,6 +101,9 @@ RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/006-recovery-email-changes.pa
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
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 rm -rf ${TMP_PATCH_DIR}

# autocomplete leak tweak apps frontend with sed, disable group suggestion
@@ -96,13 +112,19 @@ RUN cd ${BASE_DIR}/custom_apps/contacts && sed -i 's/"GROUP","INDIVIDUAL"/"INDIV
RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/"GROUP","INDIVIDUAL"/"INDIVIDUAL"/g' js/calendar.js
RUN cd ${BASE_DIR}/custom_apps/calendar && sed -i 's/anyof/allof/g' js/calendar.js

# 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

# Custom theme
RUN curl -fsSL -o eelo-theme.tar.gz \
RUN curl -fsSL -o eCloud-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/
    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/

ENTRYPOINT ["/custom_entrypoint.sh"]
CMD ["php-fpm"]
+22 −5
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ SRC_DIR="/usr/src/nextcloud"
DST_DIR="/var/www/html"

installed_version="0.0.0.0"

if [ -f /var/www/html/version.php ]; then
    installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
fi
@@ -23,13 +24,29 @@ if version_greater "$image_version" "$installed_version"; then
    rsync $rsync_options --include "/calendar/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/
    rsync $rsync_options --include "/contacts/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/
    rsync $rsync_options --include "/user_backend_sql_raw/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/
    rsync $rsync_options --include "/rainloop" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/
    rsync $rsync_options --include "/email-recovery" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/
    rsync $rsync_options --include "/ecloud_drop_account" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/
    rsync $rsync_options --include "/rainloop/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/
    rsync $rsync_options --include "/email-recovery/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/
    rsync $rsync_options --include "/ecloud_drop_account/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/
    rsync $rsync_options --include "/ecloud-theme-helper/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/
    rsync $rsync_options --include "/ecloud-launcher/" --exclude '/*' $SRC_DIR/custom_apps/ $DST_DIR/custom_apps/

    rsync $rsync_options --include "/eelo/" --exclude '/*' $SRC_DIR/themes/ $DST_DIR/themes/
    rsync $rsync_options --include "/eCloud/" --exclude '/*' $SRC_DIR/themes/ $DST_DIR/themes/
else
    echo "Skipping rsync step as version not updated!"
fi

if [ "$(id -u)" = 0 ]; then
    su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:disable apporder"
    su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:enable ecloud-launcher"
    su -p www-data -s /bin/sh -c "php $DST_DIR/occ app:enable ecloud-theme-helper"
    su -p www-data -s /bin/sh -c "php $DST_DIR/occ config:system:set integrity.check.disabled --value='true' --type=boolean"
    su -p www-data -s /bin/sh -c "php $DST_DIR/occ config:system:set theme --value='eCloud'"
else
    sh -c "php $DST_DIR/occ app:disable apporder"
    sh -c "php $DST_DIR/occ app:enable ecloud-launcher"
    sh -c "php $DST_DIR/occ app:disable ecloud-theme-helper"
    sh -c "php $DST_DIR/occ config:system:set integrity.check.disabled --value='true' --type=boolean"
    sh -c "php $DST_DIR/occ config:system:set theme --value='eCloud'"    
fi

/entrypoint.sh "$@"
+83 −0
Original line number Diff line number Diff line
From: Akhil <akhil@e.email>
Date: Thu, 10 Aug 2021 17:30:00 +0530
Subject: [PATCH] Changes help links to point to the correct links

This patch adds changes to the "Settings" app's help template, controller and stylesheet to make sure the correct
help links are shown

--- ./apps/settings/lib/Controller/HelpController.php  2021-08-10 16:54:15.844898527 +0530
+++ ./apps/settings/lib/Controller/HelpController-new.php      2021-08-10 16:54:42.541807384 +0530
@@ -89,7 +89,8 @@
 			'url' => $documentationUrl,
 			'urlUserDocs' => $urlUserDocs,
 			'urlAdminDocs' => $urlAdminDocs,
-			'mode' => $mode,
+            'mode' => $mode,
+            'ncVersion' => \OCP\Util::getVersion()[0]
 		]);
 		$policy = new ContentSecurityPolicy();
 		$policy->addAllowedFrameDomain('\'self\'');
--- ./apps/settings/templates/help.php	2021-07-01 15:13:08.000000000 +0530
+++ ./apps/settings/templates/help-new.php	2021-08-10 17:22:42.771569854 +0530
@@ -3,38 +3,21 @@
 ?>
 <div id="app-navigation">
 	<ul>
-		<li>
-			<a class="icon-user <?php if ($_['mode'] === 'user') {
-	p('active');
-} ?>"
-				href="<?php print_unescaped($_['urlUserDocs']); ?>">
-				<?php p($l->t('User documentation')); ?>
-			</a>
-		</li>
-	<?php if ($_['admin']) { ?>
-		<li>
-			<a class="icon-user-admin <?php if ($_['mode'] === 'admin') {
-	p('active');
-} ?>"
-				href="<?php print_unescaped($_['urlAdminDocs']); ?>">
-				<?php p($l->t('Administrator documentation')); ?>
+	<li>
+			<a class="icon-user"
+				href="https://docs.nextcloud.com/server/20/user_manual/en/" target="_blank" rel="noreferrer noopener">
+				<?php p('Nextcloud ' . $_['ncVersion'] . ' ' . $l->t('User documentation')); ?> ↗
 			</a>
 		</li>
-	<?php } ?>
-
 		<li>
-			<a href="https://docs.nextcloud.com" class="icon-category-office" target="_blank" rel="noreferrer noopener">
-				<?php p($l->t('Documentation')); ?> ↗
+			<a href="https://support.e.foundation/how-tos#ecloud-eemail--account" class="icon-category-office" target="_blank" rel="noreferrer noopener">
+				<?php p('/e/' . ' ' . $l->t('Documentation')); ?> ↗
 			</a>
 		</li>
 		<li>
-			<a href="https://help.nextcloud.com" class="icon-comment" target="_blank" rel="noreferrer noopener">
+			<a href="https://community.e.foundation" class="icon-comment" target="_blank" rel="noreferrer noopener">
 				<?php p($l->t('Forum')); ?> ↗
 			</a>
 		</li>
 </div>
 
-<div id="app-content" class="help-includes">
-	<iframe src="<?php print_unescaped($_['url']); ?>" class="help-iframe">
-	</iframe>
-</div>

--- ./apps/settings/css/help.css    2021-08-20 14:16:57.951439620 +0530
+++ ./apps/settings/css/help-new.css        2021-08-20 17:02:43.549016337 +0530
@@ -10,3 +10,12 @@
        border: 0;
        overflow: auto;
 }
+
+#content #app-navigation {
+       transform: none;   
+       width: max-content;
+}
+
+#app-navigation:not(.vue) > ul > li > a {
+       padding: 0 12px 0 44px;
+}
+21 −0
Original line number Diff line number Diff line
From: Akhil <akhil@e.email>
Date: Thu, 12 Aug 2021 19:45:00 +0530
Subject: [PATCH] Disables app store checking during "occ upgrade"

This patch disables checking the app store for app updates during "occ upgrade"

--- ./lib/private/Updater.php	2021-08-11 19:46:04.607195791 +0530
+++ ./lib/private/Updater-new.php	2021-08-11 19:46:15.173946740 +0530
@@ -261,9 +261,9 @@
 		\OC::$server->getAppFetcher()->setVersion($currentVersion);
 
 		// upgrade appstore apps
-		$this->upgradeAppStoreApps(\OC::$server->getAppManager()->getInstalledApps());
-		$autoDisabledApps = \OC::$server->getAppManager()->getAutoDisabledApps();
-		$this->upgradeAppStoreApps($autoDisabledApps, true);
+		//$this->upgradeAppStoreApps(\OC::$server->getAppManager()->getInstalledApps());
+		//$autoDisabledApps = \OC::$server->getAppManager()->getAutoDisabledApps();
+		//$this->upgradeAppStoreApps($autoDisabledApps, true);
 
 		// install new shipped apps on upgrade
 		$errors = Installer::installShippedApps(true);
+37 −0
Original line number Diff line number Diff line
--- ./apps/privacy/lib/Settings/MissionSettings.php	2021-09-07 17:38:08.650902445 +0530
+++ ./apps/privacy/lib/Settings/MissionSettings-new.php	2021-09-07 17:40:30.078256502 +0530
@@ -41,8 +41,8 @@
 	/**
 	 * @return string
 	 */
-	public function getSection():string {
-		return 'privacy';
+	public function getSection() {
+		return null;
 	}
 
 	/**
--- ./apps/privacy/lib/Settings/UserDataManifestoSettings.php	2021-09-07 17:38:06.284224253 +0530
+++ ./apps/privacy/lib/Settings/UserDataManifestoSettings-new.php	2021-09-07 17:40:42.288315736 +0530
@@ -41,8 +41,8 @@
 	/**
 	 * @return string
 	 */
-	public function getSection():string {
-		return 'privacy';
+	public function getSection() {
+		return null;
 	}
 
 	/**
--- ./apps/privacy/templates/who-has-access.php	2021-09-07 17:40:05.704804878 +0530
+++ ./apps/privacy/templates/who-has-access-new.php	2021-09-07 17:40:02.714790363 +0530
@@ -1,3 +1,8 @@
+<?php
+script('privacy', 'privacy');
+style('privacy', 'privacy');
+?>
+
 <div id="themes" class="section">
 	<h3><?php p($l->t('Who has access to your data?')) ?></h3>
 	<h4><?php p($l->t('Administrators')); ?></h4>