From 5d410c1a39701eab8c3461557b6c1ce69f791bd1 Mon Sep 17 00:00:00 2001 From: andryyy Date: Wed, 14 Dec 2016 09:25:54 +0100 Subject: [PATCH] Change SOGo Dockerfile --- 007-build-sogo.sh | 10 +++------- data/Dockerfiles/sogo/Dockerfile | 7 +++++++ data/conf/sogo/sogo.conf | 24 ++---------------------- mailcow.conf | 15 --------------- 4 files changed, 12 insertions(+), 44 deletions(-) diff --git a/007-build-sogo.sh b/007-build-sogo.sh index c24cd965..94da4024 100755 --- a/007-build-sogo.sh +++ b/007-build-sogo.sh @@ -10,17 +10,13 @@ if [[ ! -z $(docker ps -af "name=${NAME}" -q) ]]; then docker rm $(docker ps -af "name=${NAME}" -q) fi -sed -i "s#OCSEMailAlarmsFolderURL.*#OCSEMailAlarmsFolderURL = \"mysql://${DBUSER}:${DBPASS}@mysql:3306/${DBNAME}/sogo_alarms_folder\";#" data/conf/sogo/sogo.conf -sed -i "s#OCSFolderInfoURL.*#OCSFolderInfoURL = \"mysql://${DBUSER}:${DBPASS}@mysql:3306/${DBNAME}/sogo_folder_info\";#" data/conf/sogo/sogo.conf -sed -i "s#OCSSessionsFolderURL.*#OCSSessionsFolderURL = \"mysql://${DBUSER}:${DBPASS}@mysql:3306/${DBNAME}/sogo_sessions_folder\";#" data/conf/sogo/sogo.conf -sed -i "s#SOGoProfileURL.*#SOGoProfileURL = \"mysql://${DBUSER}:${DBPASS}@mysql:3306/${DBNAME}/sogo_user_profile\";#" data/conf/sogo/sogo.conf -sed -i "s#viewURL.*#viewURL = \"mysql://${DBUSER}:${DBPASS}@mysql:3306/${DBNAME}/sogo_view\";#" data/conf/sogo/sogo.conf -sed -i "s#WOWorkersCount.*#WOWorkersCount = \"${SOGOCHILDS}\";#" data/conf/sogo/sogo.conf - docker run \ -v ${PWD}/data/conf/sogo/:/etc/sogo/ \ --name ${NAME} \ --network=${DOCKER_NETWORK} \ --network-alias sogo \ -h sogo \ + -e DBNAME=${DBNAME} \ + -e DBUSER=${DBUSER} \ + -e DBPASS=${DBPASS} \ -d -t andryyy/mailcow-dockerized:sogo diff --git a/data/Dockerfiles/sogo/Dockerfile b/data/Dockerfiles/sogo/Dockerfile index 239d9973..8389ce28 100644 --- a/data/Dockerfiles/sogo/Dockerfile +++ b/data/Dockerfiles/sogo/Dockerfile @@ -10,6 +10,13 @@ RUN apt-get update \ && apt-get update \ && apt-get -y --force-yes install sogo sogo-activesync +RUN defaults write sogod SOGoUserSources '({type = sql;id = directory;viewURL = mysql://${DBUSER}:${DBPASS}@${DBHOST}:3306/${DBNAME}/sogo_view;canAuthenticate = YES;isAddressBook = YES;displayName = \"GAL\";MailFieldNames = (aliases, ad_aliases, senderacl);userPasswordAlgorithm = ssha256;})' +RUN defaults write sogod SOGoProfileURL 'mysql://${DBUSER}:${DBPASS}@${DBHOST}:3306/${DBNAME}/sogo_user_profile' +RUN defaults write sogod OCSFolderInfoURL 'mysql://${DBUSER}:${DBPASS}@${DBHOST}:3306/${DBNAME}/sogo_folder_info' +RUN defaults write sogod OCSEMailAlarmsFolderURL 'mysql://${DBUSER}:${DBPASS}@${DBHOST}:3306/${DBNAME}/sogo_alarms_folder' +RUN defaults write sogod OCSSessionsFolderURL 'mysql://${DBUSER}:${DBPASS}@${DBHOST}:3306/${DBNAME}/sogo_sessions_folder' + + USER sogo CMD ["/usr/sbin/sogod"] diff --git a/data/conf/sogo/sogo.conf b/data/conf/sogo/sogo.conf index fae8b7b3..b5a3f77c 100644 --- a/data/conf/sogo/sogo.conf +++ b/data/conf/sogo/sogo.conf @@ -1,26 +1,5 @@ { - // START - // WILL BE UPDATED AUTOMATICALLY WHEN RUNNING build_sogo.sh SRIPT - OCSEMailAlarmsFolderURL = "mysql://mailcow:mysafepasswd@mysql:3306/mailcow/sogo_alarms_folder"; - OCSFolderInfoURL = "mysql://mailcow:mysafepasswd@mysql:3306/mailcow/sogo_folder_info"; - OCSSessionsFolderURL = "mysql://mailcow:mysafepasswd@mysql:3306/mailcow/sogo_sessions_folder"; - SOGoProfileURL = "mysql://mailcow:mysafepasswd@mysql:3306/mailcow/sogo_user_profile"; - WOWorkersCount = "20"; - SOGoMemcachedHost = "memcached:11211"; - SOGoUserSources = - ( - { - type = sql; - id = directory; - viewURL = "mysql://mailcow:mysafepasswd@mysql:3306/mailcow/sogo_view"; - canAuthenticate = YES; - isAddressBook = YES; - MailFieldNames = (aliases, ad_aliases, senderacl); - displayName = "Domain"; - userPasswordAlgorithm = SSHA256; - } - ); - // END + // Database configuration is written to GNUStep defaults when starting container. SOGoCalendarDefaultRoles = ( PublicViewer, @@ -28,6 +7,7 @@ PrivateDAndTViewer ); + WOWorkersCount = "20"; SOGoACLsSendEMailNotifications = YES; SOGoAppointmentSendEMailNotifications = YES; SOGoDraftsFolderName = "Drafts"; diff --git a/mailcow.conf b/mailcow.conf index 6c309d2b..10992726 100644 --- a/mailcow.conf +++ b/mailcow.conf @@ -11,18 +11,6 @@ DBUSER=mailcow DBPASS=mysafepasswd DBROOT=myothersafepasswd -# MariaDB -DBVERS=latest - -# SOGo configuration -SOGOCHILDS=20 - -# Webserver configuration -# Default port binding for Nginx is 443 -# -PHPVERS="5.6-fpm" -NGINXVERS="stable" - # You should leave that alone # Can also be 11.22.33.44:25 or 0.0.0.0:465 etc. for specific binding SMTP_PORT=25 @@ -34,9 +22,6 @@ POP_PORT=110 POPS_PORT=995 SIEVE_PORT=4190 -# Redis -REDISVERS="latest" - # Networking # You need to rebuild all containers after changing values. # Remove old networks manually.