Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Commit

Permalink
Fix database build failures
Browse files Browse the repository at this point in the history
  • Loading branch information
shawniverson committed May 20, 2017
1 parent 4a004e7 commit c236dc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions build/MYSQL/create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ CREATE TABLE IF NOT EXISTS `maillog` (
`time` time DEFAULT NULL,
`headers` mediumtext COLLATE utf8_unicode_ci,
`quarantined` tinyint(1) DEFAULT '0',
`rblspamreport` mediumtext COLLATE utf8_unicode_ci DEFAULT NULL,
`token` CHAR(64) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`maillog_id`),
KEY `maillog_datetime_idx` (`date`,`time`),
KEY `maillog_id_idx` (`id`(20)),
Expand All @@ -134,8 +136,8 @@ CREATE TABLE IF NOT EXISTS `maillog` (
KEY `from_domain_idx` (`from_domain`(50)),
KEY `to_domain_idx` (`to_domain`(50)),
KEY `maillog_quarantined` (`quarantined`),
KEY `timestamp_idx` (`timestamp`),
FULLTEXT KEY `subject_idx` (`subject`)
KEY `timestamp_idx` (`timestamp`)
/*!50604 , FULLTEXT KEY `subject_idx` (`subject`) */
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------
Expand Down Expand Up @@ -258,6 +260,9 @@ CREATE TABLE IF NOT EXISTS `users` (
`resetid` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`resetexpire` bigint(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`lastreset` bigint(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`login_expiry` bigint(20) COLLATE utf8_unicode_ci DEFAULT '-1',
`last_login` bigint(20) COLLATE utf8_unicode_ci DEFAULT '-1',
`login_timeout` smallint(5) COLLATE utf8_unicode_ci DEFAULT '-1',
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Expand Down
8 changes: 5 additions & 3 deletions build/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -763,10 +763,9 @@ EOF
rm -rf docs

cp conf.php.example conf.php
# Issue #66 grab all passwords from EFA-Config
sed -i "/^define('DB_PASS',/ c\$efa_config = preg_grep('/^MAILWATCHSQLPWD/', file('/etc/EFA-Config'));\nforeach(\$efa_config as \$num => \$line) {\n if (\$line) {\n \$db_pass_tmp = chop(preg_replace('/^MAILWATCHSQLPWD:(.*)/','\$1', \$line));\n }\n}\ndefine('DB_PASS', \$db_pass_tmp);" conf.php
# Issue #66 grab all passwords from EFA-Config
sed -i "/^define('DB_USER',/ c\define('DB_USER', 'mailwatch');" conf.php
#sed -i "/^define('DB_PASS',/ c\define('DB_PASS', '$password');" conf.php
sed -i "/^define('DB_PASS',/ c\define('DB_PASS', '$password');" conf.php
sed -i "/^define('TIME_ZONE',/ c\define('TIME_ZONE', 'Etc/UTC');" conf.php
sed -i "/^define('QUARANTINE_USE_FLAG',/ c\define('QUARANTINE_USE_FLAG', true);" conf.php
sed -i "/^define('QUARANTINE_REPORT_FROM_NAME',/ c\define('QUARANTINE_REPORT_FROM_NAME', 'EFA - Email Filter Appliance');" conf.php
Expand Down Expand Up @@ -846,6 +845,9 @@ EOF

/usr/bin/php /usr/src/EFA/MailWatch-$MAILWATCHBRANCH/upgrade.php --skip-user-confirm /var/www/html/mailscanner/functions.php

# Update conf.php to grab password from EFA-Config after running upgrade.php
sed -i "/^define('DB_PASS',/ c\$efa_config = preg_grep('/^MAILWATCHSQLPWD/', file('/etc/EFA-Config'));\nforeach(\$efa_config as \$num => \$line) {\n if (\$line) {\n \$db_pass_tmp = chop(preg_replace('/^MAILWATCHSQLPWD:(.*)/','\$1', \$line));\n }\n}\ndefine('DB_PASS', \$db_pass_tmp);" /var/www/html/mailscanner/conf.php

# Issue #308 ClamAV Status Page blank
usermod apache -G mtagroup

Expand Down

0 comments on commit c236dc8

Please sign in to comment.