Reload Dovecot and Postfix when TLS certificate updates (#271)

This commit is contained in:
link2xt 2024-04-15 14:08:32 +00:00 committed by GitHub
parent 1752803199
commit 39f5f64998
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 12 deletions

View File

@ -2,6 +2,9 @@
## untagged ## untagged
- Reload Dovecot and Postfix when TLS certificate updates
([#271](https://github.com/deltachat/chatmail/pull/271))
- Use forked version of dovecot without hardcoded delays - Use forked version of dovecot without hardcoded delays
([#270](https://github.com/deltachat/chatmail/pull/270)) ([#270](https://github.com/deltachat/chatmail/pull/270))

View File

@ -530,7 +530,6 @@ def deploy_chatmail(config_path: Path) -> None:
# Deploy acmetool to have TLS certificates. # Deploy acmetool to have TLS certificates.
deploy_acmetool( deploy_acmetool(
nginx_hook=True,
domains=[mail_domain, f"mta-sts.{mail_domain}", f"www.{mail_domain}"], domains=[mail_domain, f"mta-sts.{mail_domain}", f"www.{mail_domain}"],
) )

View File

@ -5,7 +5,7 @@ from pyinfra import host
from pyinfra.facts.systemd import SystemdStatus from pyinfra.facts.systemd import SystemdStatus
def deploy_acmetool(nginx_hook=False, email="", domains=[]): def deploy_acmetool(email="", domains=[]):
"""Deploy acmetool.""" """Deploy acmetool."""
apt.packages( apt.packages(
name="Install acmetool", name="Install acmetool",
@ -20,11 +20,8 @@ def deploy_acmetool(nginx_hook=False, email="", domains=[]):
mode="644", mode="644",
) )
if nginx_hook:
files.put( files.put(
src=importlib.resources.files(__package__) src=importlib.resources.files(__package__).joinpath("acmetool.hook").open("rb"),
.joinpath("acmetool.hook")
.open("rb"),
dest="/usr/lib/acme/hooks/nginx", dest="/usr/lib/acme/hooks/nginx",
user="root", user="root",
group="root", group="root",

View File

@ -3,3 +3,5 @@ set -e
EVENT_NAME="$1" EVENT_NAME="$1"
[ "$EVENT_NAME" = "live-updated" ] || exit 42 [ "$EVENT_NAME" = "live-updated" ] || exit 42
systemctl restart nginx.service systemctl restart nginx.service
systemctl reload dovecot.service
systemctl reload postfix.service