TLS certs are being generated within the sage-mailserver container's entrypoint.sh.
Problem
The code block to generate the TLS certs in entrypoint.sh is hitting an error (see logs below)
-> the script exits
-> the container restarts
-> the code block re-executed and re-errors
You can't get exec into the container when it's in the restart loop - every restart kicks your out of the container session.
sage-mailserver | Generating TLS certs...
...
sage-mailserver | /entrypoint.sh: line 12: CRITICAL ERROR: Failed to find TLS cert files.: command not found
sage-mailserver exited with code 0
Another problem is that when the container restarts, it runs the certbot command to generate TLS certs again. Letsencrypt rate-limits the cert request attempts. Unfortunately I ran entrypoint.sh 5x and am prohibited from requesting certs from Letsencrypt for 2 days :(
Solution
Create a cron job that generates the TLS certs and renews them:
Create and remove a container for running the certbot command.
Background
sage-mailserver
container'sentrypoint.sh
.Problem
entrypoint.sh
is hitting an error (see logs below)exit
sexec
into the container when it's in the restart loop - every restart kicks your out of the container session.certbot
command to generate TLS certs again. Letsencrypt rate-limits the cert request attempts. Unfortunately I ranentrypoint.sh
5x and am prohibited from requesting certs from Letsencrypt for 2 days :(Solution
certbot
command.sage-mailserver
containerCompleted in this pull request: https://github.com/katefike/sage/pull/104