Use UTF8, MySQL 5.7 is the only docker image to use innodb default row format, but is broken and segfaults on many machines

master
andryyy 2016-12-18 15:50:13 +01:00
parent 1fcdbc01af
commit 861fc190ca
4 changed files with 23 additions and 26 deletions

1
.gitignore vendored 100644
View File

@ -0,0 +1 @@
rebuild-images.sh

View File

@ -137,7 +137,7 @@ Backup database:
source mailcow.conf source mailcow.conf
# Create # Create
DATE=$(date +"%Y%m%d_%H%M%S") DATE=$(date +"%Y%m%d_%H%M%S")
docker-compose exec mysql-mailcow mysqldump --default-character-set=utf8mb4 -u${DBUSER} -p${DBPASS} ${DBNAME} > backup_${DBNAME}_${DATE}.sql docker-compose exec mysql-mailcow mysqldump --default-character-set=utf8 -u${DBUSER} -p${DBPASS} ${DBNAME} > backup_${DBNAME}_${DATE}.sql
``` ```
### Backup maildir (simple tar): ### Backup maildir (simple tar):

View File

@ -1,6 +1,4 @@
{ {
// Database configuration is written to GNUStep defaults when starting container.
SOGoCalendarDefaultRoles = ( SOGoCalendarDefaultRoles = (
PublicViewer, PublicViewer,
ConfidentialDAndTViewer, ConfidentialDAndTViewer,
@ -11,9 +9,8 @@
SOGoACLsSendEMailNotifications = YES; SOGoACLsSendEMailNotifications = YES;
SOGoAppointmentSendEMailNotifications = YES; SOGoAppointmentSendEMailNotifications = YES;
SOGoDraftsFolderName = "Drafts"; SOGoDraftsFolderName = "Drafts";
SOGoJunkFolderName= "Junk"; SOGoJunkFolderName= "Junk";
SOGoMailDomain = "sogo.local"; SOGoMailDomain = "sogo.local";
// Waiting for bug fix from SOGo
SOGoEnableEMailAlarms = NO; SOGoEnableEMailAlarms = NO;
SOGoFoldersSendEMailNotifications = YES; SOGoFoldersSendEMailNotifications = YES;
SOGoForwardEnabled = YES; SOGoForwardEnabled = YES;
@ -39,7 +36,6 @@
SOGoMaximumSyncWindowSize = 0; SOGoMaximumSyncWindowSize = 0;
SOGoMaximumSyncResponseSize = 1024; SOGoMaximumSyncResponseSize = 1024;
MySQL4Encoding = "utf8mb4";
WOWatchDogRequestTimeout = 10; WOWatchDogRequestTimeout = 10;
WOListenQueueSize = 300; WOListenQueueSize = 300;

View File

@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS `admin` (
`modified` datetime NOT NULL DEFAULT '2016-01-01 00:00:00', `modified` datetime NOT NULL DEFAULT '2016-01-01 00:00:00',
`active` tinyint(1) NOT NULL DEFAULT '1', `active` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`username`) PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `alias` ( CREATE TABLE IF NOT EXISTS `alias` (
`address` varchar(255) NOT NULL, `address` varchar(255) NOT NULL,
@ -17,19 +17,19 @@ CREATE TABLE IF NOT EXISTS `alias` (
`active` tinyint(1) NOT NULL DEFAULT '1', `active` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`address`), PRIMARY KEY (`address`),
KEY `domain` (`domain`) KEY `domain` (`domain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `sender_acl` ( CREATE TABLE IF NOT EXISTS `sender_acl` (
`logged_in_as` varchar(255) NOT NULL, `logged_in_as` varchar(255) NOT NULL,
`send_as` varchar(255) NOT NULL `send_as` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `spamalias` ( CREATE TABLE IF NOT EXISTS `spamalias` (
`address` varchar(255) NOT NULL, `address` varchar(255) NOT NULL,
`goto` text NOT NULL, `goto` text NOT NULL,
`validity` int(11) NOT NULL, `validity` int(11) NOT NULL,
PRIMARY KEY (`address`) PRIMARY KEY (`address`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `alias_domain` ( CREATE TABLE IF NOT EXISTS `alias_domain` (
`alias_domain` varchar(255) NOT NULL, `alias_domain` varchar(255) NOT NULL,
@ -40,7 +40,7 @@ CREATE TABLE IF NOT EXISTS `alias_domain` (
PRIMARY KEY (`alias_domain`), PRIMARY KEY (`alias_domain`),
KEY `active` (`active`), KEY `active` (`active`),
KEY `target_domain` (`target_domain`) KEY `target_domain` (`target_domain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `domain` ( CREATE TABLE IF NOT EXISTS `domain` (
`domain` varchar(255) NOT NULL, `domain` varchar(255) NOT NULL,
@ -56,7 +56,7 @@ CREATE TABLE IF NOT EXISTS `domain` (
`modified` datetime NOT NULL DEFAULT '2016-01-01 00:00:00', `modified` datetime NOT NULL DEFAULT '2016-01-01 00:00:00',
`active` tinyint(1) NOT NULL DEFAULT '1', `active` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`domain`) PRIMARY KEY (`domain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `domain_admins` ( CREATE TABLE IF NOT EXISTS `domain_admins` (
`username` varchar(255) NOT NULL, `username` varchar(255) NOT NULL,
@ -64,7 +64,7 @@ CREATE TABLE IF NOT EXISTS `domain_admins` (
`created` datetime NOT NULL DEFAULT '2016-01-01 00:00:00', `created` datetime NOT NULL DEFAULT '2016-01-01 00:00:00',
`active` tinyint(1) NOT NULL DEFAULT '1', `active` tinyint(1) NOT NULL DEFAULT '1',
KEY `username` (`username`) KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `mailbox` ( CREATE TABLE IF NOT EXISTS `mailbox` (
`username` varchar(255) NOT NULL, `username` varchar(255) NOT NULL,
@ -81,14 +81,14 @@ CREATE TABLE IF NOT EXISTS `mailbox` (
`active` tinyint(1) NOT NULL DEFAULT '1', `active` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`username`), PRIMARY KEY (`username`),
KEY `domain` (`domain`) KEY `domain` (`domain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `quota2` ( CREATE TABLE IF NOT EXISTS `quota2` (
`username` varchar(100) NOT NULL, `username` varchar(100) NOT NULL,
`bytes` bigint(20) NOT NULL DEFAULT '0', `bytes` bigint(20) NOT NULL DEFAULT '0',
`messages` int(11) NOT NULL DEFAULT '0', `messages` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`username`) PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `filterconf` ( CREATE TABLE IF NOT EXISTS `filterconf` (
`object` varchar(100) NOT NULL DEFAULT '', `object` varchar(100) NOT NULL DEFAULT '',
@ -97,7 +97,7 @@ CREATE TABLE IF NOT EXISTS `filterconf` (
`prefid` int(11) NOT NULL AUTO_INCREMENT, `prefid` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`prefid`), PRIMARY KEY (`prefid`),
KEY `object` (`object`) KEY `object` (`object`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP VIEW IF EXISTS grouped_mail_aliases; DROP VIEW IF EXISTS grouped_mail_aliases;
DROP VIEW IF EXISTS grouped_sender_acl; DROP VIEW IF EXISTS grouped_sender_acl;
@ -135,7 +135,7 @@ CREATE TABLE IF NOT EXISTS sogo_acl (
c_role varchar(80) NOT NULL, c_role varchar(80) NOT NULL,
KEY sogo_acl_c_folder_id_idx (c_folder_id), KEY sogo_acl_c_folder_id_idx (c_folder_id),
KEY sogo_acl_c_uid_idx (c_uid) KEY sogo_acl_c_uid_idx (c_uid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS sogo_alarms_folder ( CREATE TABLE IF NOT EXISTS sogo_alarms_folder (
c_path varchar(255) NOT NULL, c_path varchar(255) NOT NULL,
@ -144,7 +144,7 @@ CREATE TABLE IF NOT EXISTS sogo_alarms_folder (
c_recurrence_id int(11) DEFAULT NULL, c_recurrence_id int(11) DEFAULT NULL,
c_alarm_number int(11) NOT NULL, c_alarm_number int(11) NOT NULL,
c_alarm_date int(11) NOT NULL c_alarm_date int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS sogo_cache_folder ( CREATE TABLE IF NOT EXISTS sogo_cache_folder (
c_uid varchar(255) NOT NULL, c_uid varchar(255) NOT NULL,
@ -157,7 +157,7 @@ CREATE TABLE IF NOT EXISTS sogo_cache_folder (
c_deleted tinyint(4) NOT NULL DEFAULT '0', c_deleted tinyint(4) NOT NULL DEFAULT '0',
c_content longtext, c_content longtext,
PRIMARY KEY (c_uid,c_path) PRIMARY KEY (c_uid,c_path)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS sogo_folder_info ( CREATE TABLE IF NOT EXISTS sogo_folder_info (
c_folder_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, c_folder_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
@ -173,7 +173,7 @@ CREATE TABLE IF NOT EXISTS sogo_folder_info (
c_folder_type varchar(255) NOT NULL, c_folder_type varchar(255) NOT NULL,
PRIMARY KEY (c_path), PRIMARY KEY (c_path),
UNIQUE KEY c_folder_id (c_folder_id) UNIQUE KEY c_folder_id (c_folder_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS sogo_quick_appointment ( CREATE TABLE IF NOT EXISTS sogo_quick_appointment (
c_folder_id int(11) NOT NULL, c_folder_id int(11) NOT NULL,
@ -201,7 +201,7 @@ CREATE TABLE IF NOT EXISTS sogo_quick_appointment (
c_nextalarm int(11) DEFAULT NULL, c_nextalarm int(11) DEFAULT NULL,
c_description text, c_description text,
PRIMARY KEY (c_folder_id,c_name) PRIMARY KEY (c_folder_id,c_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS sogo_quick_contact ( CREATE TABLE IF NOT EXISTS sogo_quick_contact (
c_folder_id int(11) NOT NULL, c_folder_id int(11) NOT NULL,
@ -218,7 +218,7 @@ CREATE TABLE IF NOT EXISTS sogo_quick_contact (
c_categories varchar(255) DEFAULT NULL, c_categories varchar(255) DEFAULT NULL,
c_component varchar(10) NOT NULL, c_component varchar(10) NOT NULL,
PRIMARY KEY (c_folder_id,c_name) PRIMARY KEY (c_folder_id,c_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS sogo_sessions_folder ( CREATE TABLE IF NOT EXISTS sogo_sessions_folder (
c_id varchar(255) NOT NULL, c_id varchar(255) NOT NULL,
@ -226,7 +226,7 @@ CREATE TABLE IF NOT EXISTS sogo_sessions_folder (
c_creationdate int(11) NOT NULL, c_creationdate int(11) NOT NULL,
c_lastseen int(11) NOT NULL, c_lastseen int(11) NOT NULL,
PRIMARY KEY (c_id) PRIMARY KEY (c_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS sogo_store ( CREATE TABLE IF NOT EXISTS sogo_store (
c_folder_id int(11) NOT NULL, c_folder_id int(11) NOT NULL,
@ -237,14 +237,14 @@ CREATE TABLE IF NOT EXISTS sogo_store (
c_version int(11) NOT NULL, c_version int(11) NOT NULL,
c_deleted int(11) DEFAULT NULL, c_deleted int(11) DEFAULT NULL,
PRIMARY KEY (c_folder_id,c_name) PRIMARY KEY (c_folder_id,c_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS sogo_user_profile ( CREATE TABLE IF NOT EXISTS sogo_user_profile (
c_uid varchar(255) NOT NULL, c_uid varchar(255) NOT NULL,
c_defaults text, c_defaults text,
c_settings text, c_settings text,
PRIMARY KEY (c_uid) PRIMARY KEY (c_uid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO admin (username, password, superadmin, created, modified, active) VALUES ('admin', '{SSHA256}K8eVJ6YsZbQCfuJvSUbaQRLr0HPLz5rC9IAp0PAFl0tmNDBkMDc0NDAyOTAxN2Rk', 1, NOW(), NOW(), 1); INSERT INTO admin (username, password, superadmin, created, modified, active) VALUES ('admin', '{SSHA256}K8eVJ6YsZbQCfuJvSUbaQRLr0HPLz5rC9IAp0PAFl0tmNDBkMDc0NDAyOTAxN2Rk', 1, NOW(), NOW(), 1);
INSERT INTO domain_admins (username, domain, created, active) VALUES ('admin', 'ALL', NOW(), 1); INSERT INTO domain_admins (username, domain, created, active) VALUES ('admin', 'ALL', NOW(), 1);