From 71a9e5db55ccc407a6e19831dd5722a621f139bf Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Tue, 22 Sep 2020 10:43:06 +0100
Subject: [PATCH] Add support for WebDAV probes

See issue ai3/prod#185.
---
 roles/service-prober/templates/probes.py.j2 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/roles/service-prober/templates/probes.py.j2 b/roles/service-prober/templates/probes.py.j2
index a9cb1a4a..e1405f63 100644
--- a/roles/service-prober/templates/probes.py.j2
+++ b/roles/service-prober/templates/probes.py.j2
@@ -47,6 +47,20 @@ pannello_template = Probe(
 PROBES.extend(parameterize(
     pannello_template, 'credentials', test_credentials))
 
+# WebDAV.
+# Can't use "parameterize" because credentials are bound to the URL.
+{% for c in service_prober_webdav_credentials | default([]) %}
+PROBES.append(Probe(
+        probe_webdav,
+        'webdav_{{ c.username }}',
+        {
+            'url': 'https://www.{{ domain_public[0] }}/dav/{{ c.username }}/',
+            'credentials': Credentials(
+                username='{{ c.username }}',
+                password={{ c.password | to_json }}),
+        }))
+{% endfor %}
+
 # IMAP logins.
 imap_template = Probe(
     probe_imap,
@@ -60,6 +74,7 @@ PROBES.extend(
             imap_template, 'credentials', test_credentials),
         'addr', frontends))
 
+# SMTP (inbound / outbound).
 smtp_template = Probe(
     probe_mail_local_delivery,
     'mail_local_delivery',
-- 
GitLab