From ff3328ea8c9a14cb4282394916a47c151e29d676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Peters?= Date: Mon, 19 Feb 2018 12:56:45 +0100 Subject: [PATCH] [SOGo] Use indigo theme, copy logo and theme.js to image --- data/Dockerfiles/sogo/Dockerfile | 2 + data/Dockerfiles/sogo/bootstrap-sogo.sh | 2 +- data/Dockerfiles/sogo/sogo-full.svg | 48 ++++++++++++++++++++ data/Dockerfiles/sogo/theme.js | 60 +++++++++++++++++++++++++ data/conf/sogo/sogo.conf | 1 + docker-compose.yml | 2 +- 6 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 data/Dockerfiles/sogo/sogo-full.svg create mode 100644 data/Dockerfiles/sogo/theme.js diff --git a/data/Dockerfiles/sogo/Dockerfile b/data/Dockerfiles/sogo/Dockerfile index 1bfca949..b00e2f73 100644 --- a/data/Dockerfiles/sogo/Dockerfile +++ b/data/Dockerfiles/sogo/Dockerfile @@ -42,6 +42,8 @@ RUN mkdir /usr/share/doc/sogo \ COPY ./bootstrap-sogo.sh / COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf COPY supervisord.conf /etc/supervisor/supervisord.conf +COPY theme.js /usr/lib/GNUstep/SOGo/WebServerResources/js/theme.js +COPY sogo-full.svg /usr/lib/GNUstep/SOGo/WebServerResources/img/sogo-full.svg CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf diff --git a/data/Dockerfiles/sogo/bootstrap-sogo.sh b/data/Dockerfiles/sogo/bootstrap-sogo.sh index 07365981..87bf05f7 100755 --- a/data/Dockerfiles/sogo/bootstrap-sogo.sh +++ b/data/Dockerfiles/sogo/bootstrap-sogo.sh @@ -19,7 +19,7 @@ mysql --host mysql -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "DROP VIEW IF EXISTS so mysql --host mysql -u ${DBUSER} -p${DBPASS} ${DBNAME} << EOF CREATE VIEW sogo_view (c_uid, domain, c_name, c_password, c_cn, mail, aliases, ad_aliases, home, kind, multiple_bookings) AS -SELECT mailbox.username, mailbox.domain, mailbox.username, if(json_extract(attributes, '$.force_pw_update') = '0', password, 'invalid'), mailbox.name, mailbox.username, IFNULL(GROUP_CONCAT(ga.aliases SEPARATOR ' '), ''), IFNULL(gda.ad_alias, ''), CONCAT('/var/vmail/', maildir), mailbox.kind, mailbox.multiple_bookings FROM mailbox +SELECT mailbox.username, mailbox.domain, mailbox.username, if(json_extract(attributes, '$.force_pw_update') LIKE '%0%', password, 'invalid'), mailbox.name, mailbox.username, IFNULL(GROUP_CONCAT(ga.aliases SEPARATOR ' '), ''), IFNULL(gda.ad_alias, ''), CONCAT('/var/vmail/', maildir), mailbox.kind, mailbox.multiple_bookings FROM mailbox LEFT OUTER JOIN grouped_mail_aliases ga ON ga.username REGEXP CONCAT('(^|,)', mailbox.username, '($|,)') LEFT OUTER JOIN grouped_domain_alias_address gda ON gda.username = mailbox.username WHERE mailbox.active = '1' diff --git a/data/Dockerfiles/sogo/sogo-full.svg b/data/Dockerfiles/sogo/sogo-full.svg new file mode 100644 index 00000000..5e0d81df --- /dev/null +++ b/data/Dockerfiles/sogo/sogo-full.svg @@ -0,0 +1,48 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/data/Dockerfiles/sogo/theme.js b/data/Dockerfiles/sogo/theme.js new file mode 100644 index 00000000..4efbf824 --- /dev/null +++ b/data/Dockerfiles/sogo/theme.js @@ -0,0 +1,60 @@ +/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ + +(function() { + 'use strict'; + + angular.module('SOGo.Common') + .config(configure) + + /** + * @ngInject + */ + configure.$inject = ['$mdThemingProvider']; + function configure($mdThemingProvider) { + + /** + * Define the Alternative theme + */ + $mdThemingProvider.theme('mailcow') + .primaryPalette('indigo', { + 'default': '700', // top toolbar + 'hue-1': '400', + 'hue-2': '600', // sidebar toolbar + 'hue-3': 'A700' + }) + .accentPalette('indigo', { + 'default': '500', // fab buttons + 'hue-1': '50', // center list toolbar + 'hue-2': '400', + 'hue-3': 'A700' + }) + .backgroundPalette('grey', { + 'default': '50', // center list background + 'hue-1': '100', + 'hue-2': '200', + 'hue-3': '300' + }); + $mdThemingProvider.theme('default') + .primaryPalette('indigo', { + 'default': '700', // top toolbar + 'hue-1': '400', + 'hue-2': '600', // sidebar toolbar + 'hue-3': 'A700' + }) + .accentPalette('indigo', { + 'default': '500', // fab buttons + 'hue-1': '50', // center list toolbar + 'hue-2': '400', + 'hue-3': 'A700' + }) + .backgroundPalette('grey', { + 'default': '50', // center list background + 'hue-1': '100', + 'hue-2': '200', + 'hue-3': '300' + }); + + $mdThemingProvider.setDefaultTheme('mailcow'); + $mdThemingProvider.generateThemesOnDemand(false); + } +})(); diff --git a/data/conf/sogo/sogo.conf b/data/conf/sogo/sogo.conf index 195c3dfd..73cc2864 100644 --- a/data/conf/sogo/sogo.conf +++ b/data/conf/sogo/sogo.conf @@ -14,6 +14,7 @@ SOGoEnableEMailAlarms = NO; SOGoFoldersSendEMailNotifications = YES; SOGoForwardEnabled = YES; + SOGoUIAdditionalJSFiles = (js/theme.js); // Multi-domain setup // Domains are isolated, you can define visibility options here. diff --git a/docker-compose.yml b/docker-compose.yml index c7af8ce8..f849bb4f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -142,7 +142,7 @@ services: - phpfpm sogo-mailcow: - image: mailcow/sogo:1.17 + image: mailcow/sogo:1.18 build: ./data/Dockerfiles/sogo environment: - DBNAME=${DBNAME}