diff --git a/app.py b/app.py index 7f00f5a..c3dd293 100644 --- a/app.py +++ b/app.py @@ -306,6 +306,9 @@ def _write_webdav_conf(shares): ] with open(WEBDAV_CONF, 'w') as f: f.writelines(lines) + # Ensure the passwd file exists so Apache doesn't 500 before any user has logged in + if not os.path.exists(WEBDAV_PASSWD): + Path(WEBDAV_PASSWD).touch(mode=0o640) subprocess.run(['a2enconf', 'micronas-webdav'], capture_output=True) subprocess.run(['systemctl', 'reload', 'apache2'], capture_output=True)