1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-23 02:27:05 +00:00

Added status checks for the configuration files.

This commit is contained in:
Justus Wingert 2023-08-15 14:28:46 +02:00
parent 1cdf1a0d29
commit c1e4e33415

View File

@ -333,6 +333,18 @@ def run_domain_checks(rounded_time, env, output, pool, domains_to_check=None):
# Get the list of domains we serve HTTPS for. # Get the list of domains we serve HTTPS for.
web_domains = set(get_web_domains(env)) web_domains = set(get_web_domains(env))
output.add_heading("nginx configuration files")
# Check nginx configuration.
sites_enabled = shell("check_output", ["ls", "/etc/nginx/sites-enabled"])
output.print_ok("Checking domain configuration files: %s" % sites_enabled)
for domain in web_domains:
prefixed_domain = "miab_%s" % domain
if prefixed_domain in sites_enabled:
output.print_ok("Domain checked. (%s)" % domain)
else:
output.print_error("A domain configuration file is not enabled in nginx (%s)" % domain)
if domains_to_check is None: if domains_to_check is None:
domains_to_check = mail_domains | dns_domains | web_domains domains_to_check = mail_domains | dns_domains | web_domains