From e8d2a6875dea7b409496d314a2c51816f4415f43 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 12 Sep 2024 20:20:07 +1000 Subject: [PATCH] fix: Update notifications to make it clearer --- server.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index a03b452..5b3fc79 100644 --- a/server.py +++ b/server.py @@ -460,10 +460,14 @@ def send_down_notification(node): if not node["cert_853"]["valid"]: description += "- Certificate on port 853 is invalid\n" - # Also add the expiry date of the certificates - description += "\nCertificate expiry dates:\n" - description += f"- Certificate on port 443 expires {node['cert']['expires']}\n" - description += f"- Certificate on port 853 expires {node['cert_853']['expires']}\n" + if node["plain_dns"] and node["doh"] and node["dot"]: + if node["cert"]["valid"] and node["cert_853"]["valid"]: + description = f"The certificate on {node['name']} ({node['ip']}) is expiring soon\n" + title = f"{node['name']} certificate is expiring soon" + # Also add the expiry date of the certificates + description += "\nCertificate expiry dates:\n" + description += f"- Certificate on port 443 expires {node['cert']['expires']}\n" + description += f"- Certificate on port 853 expires {node['cert_853']['expires']}\n" send_notification(title, description, node["name"])