+ Set COULOBRE_SERVICE_HEALTH in /etc/coulobre/panel.env and enable coulobre-health.timer to collect service observations.
+
{% endfor %}
{% endblock %}
diff --git a/src/coulobre/service_health.py b/src/coulobre/service_health.py
index fc934f4..c5d1976 100644
--- a/src/coulobre/service_health.py
+++ b/src/coulobre/service_health.py
@@ -29,6 +29,8 @@ SERVICES = {
"bind9": ("BIND9", "named.service"),
"postfix": ("Postfix", "postfix.service"),
"dovecot": ("Dovecot", "dovecot.service"),
+ "rspamd": ("Rspamd", "rspamd.service"),
+ "redis": ("Redis", "redis-server.service"),
"spamd": ("SpamAssassin", "spamd.service"),
"spamass-milter": ("SpamAssassin milter", "spamass-milter.service"),
"firewall": ("Coulobre firewall", "coulobre-firewall.service"),
@@ -38,6 +40,8 @@ REMOTE_SERVICES = (
"bind9",
"postfix",
"dovecot",
+ "rspamd",
+ "redis",
"spamd",
"spamass-milter",
"firewall",
diff --git a/tests/test_panel_installer.py b/tests/test_panel_installer.py
index 2501a1f..8be1843 100644
--- a/tests/test_panel_installer.py
+++ b/tests/test_panel_installer.py
@@ -1,3 +1,4 @@
+import json
import stat
import tempfile
import unittest
@@ -12,6 +13,7 @@ from deploy.panel_installer.config import (
read_password,
read_plan,
)
+from deploy.panel_installer.engine import Installer
from deploy.panel_installer.web import Wizard, WizardHandler, form_plan
PROXY = {
@@ -24,6 +26,53 @@ ADMIN = {"username": "operator", "email": "ops@example.net"}
class InstallerParametersTests(unittest.TestCase):
+ def test_default_health_targets_follow_locally_installed_roles(self):
+ cases = (
+ ({}, None, []),
+ (
+ {
+ "dns": {"mode": "local"},
+ "mail": {
+ "mode": "local",
+ "host": "panel.example.net",
+ "tls": "acme",
+ },
+ },
+ "8.5",
+ ["php-fpm", "bind9", "postfix", "dovecot", "rspamd", "redis"],
+ ),
+ )
+ for roles, php, extras in cases:
+ with (
+ self.subTest(roles=roles),
+ patch(
+ "deploy.panel_installer.engine.platform_settings",
+ return_value=(php, True),
+ ),
+ ):
+ plan = parse_plan({"panel": PROXY, "admin": ADMIN, **roles})
+ installer = Installer(plan, "test-only", Mock())
+ installer.state = dict.fromkeys(
+ ("secret_key", "database_password", "broker_password"),
+ "test-only",
+ )
+ env = dict(
+ line.split("=", 1)
+ for line in installer.environment().splitlines()
+ )
+ base = [
+ "panel",
+ "worker",
+ "scheduler",
+ "apache",
+ "mariadb",
+ "rabbitmq",
+ ]
+ self.assertEqual(
+ json.loads(env["COULOBRE_SERVICE_HEALTH"]),
+ {"panel": {"local": base + extras}},
+ )
+
def test_interactive_export_reuses_the_same_plan(self):
plan = parse_plan(
{