refactor: replace bundled Caddy with external Nginx and Certbot

This commit is contained in:
Meghdad committed 2026-08-13 02:25:42 +03:30
1 parent 6e97feb9a2
commit 6aca6d5a80
3 files changed
+191

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
set -eu
: "${RENEWED_LINEAGE:?Certbot must provide RENEWED_LINEAGE}"
bundle_dir="${MEOVV_BUNDLE_DIR:-/opt/meovv-mail}"
tls_dir="$bundle_dir/secrets/tls"
if [ ! -f "$bundle_dir/compose.yaml" ]; then
echo "MEOVV bundle not found at $bundle_dir" >&2
exit 1
fi
install -d -m 700 "$tls_dir"
install -m 644 "$RENEWED_LINEAGE/fullchain.pem" "$tls_dir/fullchain.pem"
install -m 600 "$RENEWED_LINEAGE/privkey.pem" "$tls_dir/privkey.pem"
# Once the Certificate object points at /etc/stalwart/tls, restarting Stalwart
# makes renewed files active for SMTP submission and IMAP TLS as well as HTTPS.
if [ -n "$(cd "$bundle_dir" && docker compose ps -q stalwart 2>/dev/null || true)" ]; then
cd "$bundle_dir"
docker compose restart stalwart
fi