From 3a50d8265717e49601e00a591189ebc21060f850 Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 28 Mar 2024 15:21:36 +0000 Subject: [PATCH] Move systemd unit templates to cmdeploy They are part of deployment rather than service itself. Different deployments may have different users, filesystem layout etc. --- cmdeploy/src/cmdeploy/__init__.py | 4 +++- .../src/cmdeploy/service}/chatmail-metadata.service.f | 0 .../src/cmdeploy/service}/doveauth.service.f | 0 .../src/cmdeploy/service}/echobot.service.f | 0 .../src/cmdeploy/service}/filtermail.service.f | 2 +- 5 files changed, 4 insertions(+), 2 deletions(-) rename {chatmaild/src/chatmaild => cmdeploy/src/cmdeploy/service}/chatmail-metadata.service.f (100%) rename {chatmaild/src/chatmaild => cmdeploy/src/cmdeploy/service}/doveauth.service.f (100%) rename {chatmaild/src/chatmaild => cmdeploy/src/cmdeploy/service}/echobot.service.f (100%) rename {chatmaild/src/chatmaild => cmdeploy/src/cmdeploy/service}/filtermail.service.f (71%) diff --git a/cmdeploy/src/cmdeploy/__init__.py b/cmdeploy/src/cmdeploy/__init__.py index 2c14909..cb32825 100644 --- a/cmdeploy/src/cmdeploy/__init__.py +++ b/cmdeploy/src/cmdeploy/__init__.py @@ -110,7 +110,9 @@ def _install_remote_venv_with_chatmaild(config) -> None: remote_venv_dir=remote_venv_dir, mail_domain=config.mail_domain, ) - source_path = importlib.resources.files("chatmaild").joinpath(f"{fn}.service.f") + source_path = importlib.resources.files(__package__).joinpath( + "service", f"{fn}.service.f" + ) content = source_path.read_text().format(**params).encode() files.put( diff --git a/chatmaild/src/chatmaild/chatmail-metadata.service.f b/cmdeploy/src/cmdeploy/service/chatmail-metadata.service.f similarity index 100% rename from chatmaild/src/chatmaild/chatmail-metadata.service.f rename to cmdeploy/src/cmdeploy/service/chatmail-metadata.service.f diff --git a/chatmaild/src/chatmaild/doveauth.service.f b/cmdeploy/src/cmdeploy/service/doveauth.service.f similarity index 100% rename from chatmaild/src/chatmaild/doveauth.service.f rename to cmdeploy/src/cmdeploy/service/doveauth.service.f diff --git a/chatmaild/src/chatmaild/echobot.service.f b/cmdeploy/src/cmdeploy/service/echobot.service.f similarity index 100% rename from chatmaild/src/chatmaild/echobot.service.f rename to cmdeploy/src/cmdeploy/service/echobot.service.f diff --git a/chatmaild/src/chatmaild/filtermail.service.f b/cmdeploy/src/cmdeploy/service/filtermail.service.f similarity index 71% rename from chatmaild/src/chatmaild/filtermail.service.f rename to cmdeploy/src/cmdeploy/service/filtermail.service.f index 4bc35d2..5974839 100644 --- a/chatmaild/src/chatmaild/filtermail.service.f +++ b/cmdeploy/src/cmdeploy/service/filtermail.service.f @@ -1,5 +1,5 @@ [Unit] -Description=Chatmail Postfix BeforeQeue filter +Description=Chatmail Postfix before queue filter [Service] ExecStart={execpath} {config_path}