Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for remote MySQL server #355

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

bilias
Copy link
Contributor

@bilias bilias commented Jul 14, 2023

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:

  • all config files in /etc/eFa/ are updated to include a new variable (same way as it's done for password) to host. localhost is the default in order to not break existing installations
  • The following scripts:
    /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
  • Files that need manual change (a script should be created for those):
    /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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant