WebDAV: move DAV On to <Location> block, fixes 405 with Alias

<Directory> handles filesystem options; <Location> handles DAV method
routing and auth. DAV On in a <Directory> block doesn't reliably enable
WebDAV methods on Alias-mapped paths in Apache 2.4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
marcandClaude Sonnet 4.6 committed 2026-06-20 19:02:58 +02:00
1 parent e4b23d7e2f
commit 1de49d51fb
1 file changed
+6 -3
+6 -3
View File
@@ -337,14 +337,17 @@ def _write_webdav_conf(shares):
f'# BEGIN {_WEBDAV_MARK} {s["name"]}\n',
f'Alias /dav/{s["name"]} {s["path"]}\n',
f'<Directory {s["path"]}>\n',
' Options Indexes\n',
' AllowOverride None\n',
' Require all granted\n',
'</Directory>\n',
f'<Location /dav/{s["name"]}>\n',
' DAV On\n',
' AuthType Basic\n',
' AuthName "MicroNAS WebDAV"\n',
f' AuthUserFile {WEBDAV_PASSWD}\n',
f' {require}\n',
' Options Indexes\n',
' AllowOverride None\n',
'</Directory>\n',
'</Location>\n',
f'# END {_WEBDAV_MARK} {s["name"]}\n\n',
]
with open(WEBDAV_CONF, 'w') as f: