From 69de709b0ff047f5809cb9cc4e171821d000d7a3 Mon Sep 17 00:00:00 2001 From: cliffmccarthy <16453869+cliffmccarthy@users.noreply.github.com> Date: Fri, 24 Oct 2025 15:01:12 -0500 Subject: [PATCH] refactor: Add FcgiwrapDeployer --- cmdeploy/src/cmdeploy/__init__.py | 34 ++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/cmdeploy/src/cmdeploy/__init__.py b/cmdeploy/src/cmdeploy/__init__.py index 9d1e4c29..5a4e5aa2 100644 --- a/cmdeploy/src/cmdeploy/__init__.py +++ b/cmdeploy/src/cmdeploy/__init__.py @@ -1008,6 +1008,23 @@ class ChatmailDeployer(Deployer): ) +class FcgiwrapDeployer(Deployer): + @staticmethod + def install_impl(): + apt.packages( + name="Install fcgiwrap", + packages=["fcgiwrap"], + ) + + def activate_impl(self): + systemd.service( + name="Start and enable fcgiwrap", + service="fcgiwrap.service", + running=True, + enabled=True, + ) + + def deploy_chatmail(config_path: Path, disable_mail: bool) -> None: """Deploy a chat-mail instance. @@ -1046,6 +1063,7 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None: nginx_deployer = NginxDeployer(config=config) rspamd_deployer = RspamdDeployer() + fcgiwrap_deployer = FcgiwrapDeployer() journald_deployer = JournaldDeployer() mtail_deployer = MtailDeployer(mtail_address=config.mtail_address) @@ -1061,6 +1079,7 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None: postfix_deployer, nginx_deployer, rspamd_deployer, + fcgiwrap_deployer, journald_deployer, mtail_deployer, ] @@ -1129,11 +1148,7 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None: dovecot_deployer.install() nginx_deployer.install() journald_deployer.install() - - apt.packages( - name="Install fcgiwrap", - packages=["fcgiwrap"], - ) + fcgiwrap_deployer.install() www_path, src_dir, build_dir = get_paths(config) # if www_folder was set to a non-existing folder, skip upload @@ -1160,6 +1175,7 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None: rspamd_deployer.install() rspamd_deployer.configure() + fcgiwrap_deployer.configure() opendkim_deployer.configure() opendkim_deployer.activate() @@ -1167,13 +1183,7 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None: postfix_deployer.activate() nginx_deployer.activate() rspamd_deployer.activate() - - systemd.service( - name="Start and enable fcgiwrap", - service="fcgiwrap.service", - running=True, - enabled=True, - ) + fcgiwrap_deployer.activate() systemd.service( name="Restart echobot if postfix and dovecot were just started",