Add sendmail

This commit is contained in:
VirtuBox
2019-09-01 22:02:00 +02:00
parent d4cb9501cf
commit 0ee116bd6c

View File

@@ -34,6 +34,7 @@ from wo.core.mysql import WOMysql
from wo.core.services import WOService from wo.core.services import WOService
from wo.core.shellexec import CommandExecutionError, WOShellExec from wo.core.shellexec import CommandExecutionError, WOShellExec
from wo.core.variables import WOVariables from wo.core.variables import WOVariables
from wo.core.template import WOTemplate
def wo_stack_hook(app): def wo_stack_hook(app):
@@ -88,6 +89,8 @@ class WOStackController(CementBaseController):
dict(help='Install Fail2ban stack', action='store_true')), dict(help='Install Fail2ban stack', action='store_true')),
(['--clamav'], (['--clamav'],
dict(help='Install ClamAV stack', action='store_true')), dict(help='Install ClamAV stack', action='store_true')),
(['--sendmail'],
dict(help='Install Sendmail stack', action='store_true')),
(['--utils'], (['--utils'],
dict(help='Install Utils stack', action='store_true')), dict(help='Install Utils stack', action='store_true')),
(['--redis'], (['--redis'],
@@ -126,7 +129,7 @@ class WOStackController(CementBaseController):
(not pargs.adminer) and (not pargs.utils) and (not pargs.adminer) and (not pargs.utils) and
(not pargs.redis) and (not pargs.proftpd) and (not pargs.redis) and (not pargs.proftpd) and
(not pargs.extplorer) and (not pargs.clamav) and (not pargs.extplorer) and (not pargs.clamav) and
(not pargs.phpredisadmin) and (not pargs.phpredisadmin) and (not pargs.sendmail) and
(not pargs.php73)): (not pargs.php73)):
pargs.web = True pargs.web = True
pargs.admin = True pargs.admin = True
@@ -145,8 +148,10 @@ class WOStackController(CementBaseController):
pargs.php = True pargs.php = True
pargs.mysql = True pargs.mysql = True
pargs.wpcli = True pargs.wpcli = True
pargs.sendmail = True
if pargs.admin: if pargs.admin:
pargs.web = True
pargs.adminer = True pargs.adminer = True
pargs.phpmyadmin = True pargs.phpmyadmin = True
pargs.composer = True pargs.composer = True
@@ -185,9 +190,12 @@ class WOStackController(CementBaseController):
# Redis # Redis
if pargs.redis: if pargs.redis:
pargs.php = True
WOTemplate.addAptPackage(
self, 'redis-server', WOVariables.wo_redis)
if not WOAptGet.is_installed(self, 'redis-server'): if not WOAptGet.is_installed(self, 'redis-server'):
apt_packages = apt_packages + WOVariables.wo_redis apt_packages = apt_packages + WOVariables.wo_redis
pargs.php = True
else: else:
Log.info(self, "Redis already installed") Log.info(self, "Redis already installed")
@@ -270,6 +278,15 @@ class WOStackController(CementBaseController):
Log.debug(self, "ClamAV already installed") Log.debug(self, "ClamAV already installed")
Log.info(self, "ClamAV already installed") Log.info(self, "ClamAV already installed")
# sendmail
if pargs.sendmail:
Log.debug(self, "Setting apt_packages variable for Sendmail")
if not WOAptGet.is_installed(self, 'sendmail'):
apt_packages = apt_packages + ["sendmail"]
else:
Log.debug(self, "Sendmail already installed")
Log.info(self, "Sendmail already installed")
# proftpd # proftpd
if pargs.proftpd: if pargs.proftpd:
Log.debug(self, "Setting apt_packages variable for ProFTPd") Log.debug(self, "Setting apt_packages variable for ProFTPd")
@@ -505,7 +522,7 @@ class WOStackController(CementBaseController):
(not pargs.adminer) and (not pargs.utils) and (not pargs.adminer) and (not pargs.utils) and
(not pargs.redis) and (not pargs.proftpd) and (not pargs.redis) and (not pargs.proftpd) and
(not pargs.extplorer) and (not pargs.clamav) and (not pargs.extplorer) and (not pargs.clamav) and
(not pargs.phpredisadmin) and (not pargs.phpredisadmin) and (not pargs.sendmail) and
(not pargs.php73)): (not pargs.php73)):
pargs.web = True pargs.web = True
pargs.admin = True pargs.admin = True
@@ -526,6 +543,7 @@ class WOStackController(CementBaseController):
pargs.php = True pargs.php = True
pargs.mysql = True pargs.mysql = True
pargs.wpcli = True pargs.wpcli = True
pargs.sendmail = True
if pargs.admin: if pargs.admin:
pargs.composer = True pargs.composer = True
@@ -592,6 +610,12 @@ class WOStackController(CementBaseController):
if WOAptGet.is_installed(self, 'clamav'): if WOAptGet.is_installed(self, 'clamav'):
apt_packages = apt_packages + WOVariables.wo_clamav apt_packages = apt_packages + WOVariables.wo_clamav
# sendmail
if pargs.sendmail:
Log.debug(self, "Setting apt_packages variable for Sendmail")
if WOAptGet.is_installed(self, 'sendmail'):
apt_packages = apt_packages + ["sendmail"]
# proftpd # proftpd
if pargs.proftpd: if pargs.proftpd:
if WOAptGet.is_installed(self, 'proftpd-basic'): if WOAptGet.is_installed(self, 'proftpd-basic'):
@@ -711,7 +735,7 @@ class WOStackController(CementBaseController):
(not pargs.adminer) and (not pargs.utils) and (not pargs.adminer) and (not pargs.utils) and
(not pargs.redis) and (not pargs.proftpd) and (not pargs.redis) and (not pargs.proftpd) and
(not pargs.extplorer) and (not pargs.clamav) and (not pargs.extplorer) and (not pargs.clamav) and
(not pargs.phpredisadmin) and (not pargs.phpredisadmin) and (not pargs.sendmail) and
(not pargs.php73)): (not pargs.php73)):
pargs.web = True pargs.web = True
pargs.admin = True pargs.admin = True
@@ -732,6 +756,7 @@ class WOStackController(CementBaseController):
pargs.php = True pargs.php = True
pargs.mysql = True pargs.mysql = True
pargs.wpcli = True pargs.wpcli = True
pargs.sendmail = True
if pargs.admin: if pargs.admin:
pargs.utils = True pargs.utils = True
@@ -798,6 +823,12 @@ class WOStackController(CementBaseController):
if WOAptGet.is_installed(self, 'clamav'): if WOAptGet.is_installed(self, 'clamav'):
apt_packages = apt_packages + WOVariables.wo_clamav apt_packages = apt_packages + WOVariables.wo_clamav
# sendmail
if pargs.sendmail:
Log.debug(self, "Setting apt_packages variable for Sendmail")
if WOAptGet.is_installed(self, 'sendmail'):
apt_packages = apt_packages + ["sendmail"]
# proftpd # proftpd
if pargs.proftpd: if pargs.proftpd:
if WOAptGet.is_installed(self, 'proftpd-basic'): if WOAptGet.is_installed(self, 'proftpd-basic'):