expose server version via PROPFIND on root collection and display in the UI for authenticated users

This commit is contained in:
Max Berger
2026-04-29 23:13:36 +02:00
parent 98d9257b84
commit cdf9e62e0b
7 changed files with 68 additions and 4 deletions

View File

@@ -168,6 +168,8 @@ def xml_propfind_response(
props = []
# Should list all properties that can be retrieved by the code below
props.append(xmlutils.make_clark("D:principal-collection-set"))
if user:
props.append(xmlutils.make_clark("RADICALE:version"))
props.append(xmlutils.make_clark("D:current-user-principal"))
props.append(xmlutils.make_clark("D:current-user-privilege-set"))
props.append(xmlutils.make_clark("D:supported-report-set"))
@@ -467,6 +469,11 @@ def xml_propfind_response(
element.append(child_element)
else:
is404 = True
elif tag == xmlutils.make_clark("RADICALE:version"):
if user:
element.text = utils.package_version("radicale")
else:
is404 = True
else:
human_tag = xmlutils.make_human_tag(tag)
tag_text = collection.get_meta(human_tag)