Harden against bot floods and add post-provisioning service check

- Traefik rate-limits all routes (60 req/min standard, 300 for Nextcloud)
  and writes access logs to /var/log/traefik/access.log
- Fail2ban watches Traefik access logs and bans IPs after 10 x 403/404
  within 60 s for 24 h
- Nextcloud html directory created as www-data (UID 33) so Apache can
  process .htaccess and serve requests correctly
- scripts/check-services.sh verifies all seven endpoints return the
  expected HTTP status after provisioning
This commit is contained in:
ml
2026-06-28 08:02:45 +02:00
parent e197ba7370
commit b15754ba2f
17 changed files with 168 additions and 4 deletions
@@ -68,7 +68,7 @@ services:
- "traefik.http.routers.nextcloud.entrypoints=websecure"
- "traefik.http.routers.nextcloud.tls.certresolver=letsencrypt"
- "traefik.http.services.nextcloud.loadbalancer.server.port=80"
- "traefik.http.routers.nextcloud.middlewares=nextcloud-wellknown,nextcloud-headers"
- "traefik.http.routers.nextcloud.middlewares=nextcloud-wellknown,nextcloud-headers,rate-limit-lax@docker"
# Redirect .well-known CalDAV/CardDAV to the proper Nextcloud endpoint
- "traefik.http.middlewares.nextcloud-wellknown.redirectregex.regex=^https://([^/]*)/.well-known/(card|cal)dav"
- "traefik.http.middlewares.nextcloud-wellknown.redirectregex.replacement=https://$$1/remote.php/dav/"