Add support for remote MySQL server #355
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull requests adds initial support for remote MySQL server instead of localhost only, in various places for eFa.
localhost still remains the default, but all config files as well as scripts are updated to support alternative database hosts from /etc/eFa/* config files.
I've been running a pair of eFa VMs (load balanced) which both are using a remote galera cluster instead of localhost db for a long time and every time I updated eFa, my configurations where overridden. It's not that many files that need to change and it's easy to add support since it already has different DB passwords for each database.
I've updated the following:
/var/www/html/sgwi/includes/config.inc.php
/var/www/html/mailscanner/conf.php
/usr/share/MailScanner/perl/custom/CustomAction.pm
/usr/share/MailScanner/perl/custom/MailWatchConf.pm
/etc/cron.daily/trim-txrep
/etc/cron.daily/eFa-Tokens.cron
/usr/sbin/eFa-Daily-DMARC
/usr/sbin/eFa-Backup-cron
/var/eFa/lib/eFa-Configure/func_setipsettings
/var/eFa/lib/eFa-Configure/func_resetadmin
/var/eFa/lib/eFa-Configure/func_peruser
/var/www/html/mailscanner/eFa-learn.php
/var/www/html/mailscanner/eFa-release.php
/etc/mail/spamassassin/mailscanner.cf
/etc/sqlgrey/sqlgrey.conf
/usr/sbin/eFa-Monitor-cron (remove mariadb monitoring)
/etc/cron.daily/mailwatch (comment mailwatch_db_clean on backup host)
/usr/sbin/eFa-Backup-cron only reads MYSQLHOST from /etc/eFa/MySQL-Config, so that means that so far only one remote DB is supported (for backup) and not different DB servers.
Restore has no support (so far) for remote database servers. We need to think about this procedure.
I haven't used it at all so I'm not familiar. I use external tools to backup eFa hosts and remote DBs.
Anyway this is my initial commit, if you're interested I could work more on this.