Harden security, polish admin UI and document Windows WebDAV

- helmet, express-rate-limit (login/setup/customer-auth/me-password)
- Constant-time login (bcrypt always runs against a dummy hash on miss)
- Cookie secure flag follows req.protocol; trust proxy is env-gated to
  prevent X-Forwarded-For spoofing on direct exposure
- Drop SVG from accepted logo types (same-origin XSS) and resolve the
  served logo path against LOGO_DIR as defense in depth
- Self-service /me/password endpoint plus header button; bumps minimum
  password length to 8 across backend, prompts and edit modal
- Multer 1.x → 2.x for current security backports
- Customer edit modal replaces stacked prompts; user role is now an
  inline dropdown with a confirm-and-revert flow
- Windows .reg helper plus README section for Basic-Auth-over-HTTP and
  the http:// vs \\HOST@PORT\DavWWWRoot\ mapping syntax

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stefan Hacker
2026-04-16 12:53:13 +02:00
parent 3f86fca578
commit 182ef04cc5
7 changed files with 263 additions and 43 deletions
+38 -5
View File
@@ -66,8 +66,41 @@ Der WebDAV-Container (Debian Apache) beobachtet das Verzeichnis via `inotifywait
## WebDAV-Zugriff
- macOS Finder: `Gehe zu → Mit Server verbinden → http://HOST:1900/`
- Windows: Netzlaufwerk hinzufügen → `http://HOST:1900/`
- Linux / KDE Dolphin: `webdav://<user>@HOST:1900/`
- Write-Rechte umfassen: `PUT`, `DELETE`, `MKCOL`, `MOVE`, `COPY`, `PROPPATCH`, `LOCK`, `UNLOCK`.
- In Dolphin löscht **Shift+Entf** direkt (umgeht den nicht existierenden WebDAV-Papierkorb).
- **macOS Finder**: `Gehe zu → Mit Server verbinden → http://HOST:1900/`
- **Linux / KDE Dolphin**: `webdav://<user>@HOST:1900/`
- **Windows**: siehe Abschnitt unten (einmalige Einrichtung nötig)
Write-Rechte umfassen: `PUT`, `DELETE`, `MKCOL`, `MOVE`, `COPY`, `PROPPATCH`, `LOCK`, `UNLOCK`.
In Dolphin löscht **Shift+Entf** direkt (umgeht den nicht existierenden WebDAV-Papierkorb).
### Windows als Netzlaufwerk verbinden
Windows verweigert standardmäßig WebDAV via Basic Auth über HTTP und limitiert
Dateien auf 50 MB. Beides per Registry erlauben:
1. [windows/enable-webdav-basicauth.reg](windows/enable-webdav-basicauth.reg)
per Rechtsklick → **Zusammenführen** (als Administrator) ausführen.
2. WebClient-Dienst (neu) starten:
```cmd
sc config WebClient start=auto
net stop WebClient
net start WebClient
```
3. Verbinden — **HTTP-URL ist die saubere Variante** (eindeutig WebDAV, keine
SMB-Verwechslung). Beispiel mit `karlheinz`-Credentials, gemountet als `Z:`:
```cmd
net use Z: http://HOST:1900/frank-meier /user:karlheinz DEINPW /persistent:yes
```
Im Explorer **„Netzlaufwerk verbinden"** → Adresse:
`http://HOST:1900/` bzw. `http://HOST:1900/frank-meier/`.
Alternativ mit UNC-Syntax (intern dasselbe, etwas hakeliger):
`\\HOST@1900\DavWWWRoot\frank-meier\` — `@1900` und `\DavWWWRoot\` sind
dabei Pflicht, sonst landest du bei SMB Port 445.
Wenn weiterhin „Ordner nicht gefunden" → meist ist der WebClient-Dienst nicht
gestartet oder das Registry-Merge wurde nicht als Administrator ausgeführt.