Files
homelab-infra/ops/restore-tests/nextcloud-compose.test.yml
T
Micha 5d1ae68705 fix(restore): nextcloud permissions on unraid shfs (no-new-privileges removal)
Zweiter Erstlauf 2026-06-03 scheiterte weiterhin mit 503, obwohl
config.php korrekt gepatcht war.

Ursache: Unraid's FUSE/shfs-Dateisystem auf User-Shares ignoriert
chown -R 33:33 still — Dateien bleiben bei sshd:sshd. Der
Nextcloud-Entrypoint versucht intern chmod/chown auf /var/www/html und
/var/www/html/data, was mit no-new-privileges:true blockiert wird.

Fix:
- no-new-privileges vom restoretest-nextcloud Container entfernt,
  damit der Entrypoint Rechte im Container selbst setzen kann
  (Test-Postgres und Test-Redis behalten no-new-privileges)
- Host-seitiger chown durch chmod a+rwX ersetzt (funktioniert auf shfs)
- Vertretbar im isolierten Smoke-Kontext (127.0.0.1, Wegwerf-Daten,
  kein Traefik)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 10:55:56 +02:00

67 lines
2.8 KiB
YAML

services:
restoretest-nextcloud-postgres:
# Gleiche Major-Version wie apps/nextcloud/docker-compose.yml in Produktion.
image: postgres:18.4@sha256:8ff36f3c66371cba71d20ceedccfc3de9669a68737607888c4ef0af93abe8e39
container_name: restoretest-nextcloud-postgres
restart: "no"
environment:
TZ: Europe/Berlin
POSTGRES_DB: nextcloud
POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: restoretest-nextcloud-db
PGDATA: /var/lib/postgresql/18/docker
volumes:
- /mnt/user/backups/restore-lab/nextcloud/postgres:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U nextcloud -d nextcloud"]
interval: 10s
timeout: 5s
retries: 10
security_opt:
- no-new-privileges:true
restoretest-nextcloud-redis:
image: redis:8.8.0-alpine@sha256:09160599abd229764c0fb44cb6be640294e1d360a54b19985ab4843dcf2d90f1
container_name: restoretest-nextcloud-redis
restart: "no"
command: redis-server --save "" --appendonly no
security_opt:
- no-new-privileges:true
restoretest-nextcloud:
# Gleicher Image-Digest wie apps/nextcloud/docker-compose.yml.
image: nextcloud:33.0.4-apache@sha256:caa40b8beaf0057ac213d8dfc515c36ce64f7a8f0825b6a287e6f7cf2f4a095d
container_name: restoretest-nextcloud
restart: "no"
depends_on:
restoretest-nextcloud-postgres:
condition: service_healthy
restoretest-nextcloud-redis:
condition: service_started
environment:
TZ: Europe/Berlin
POSTGRES_HOST: restoretest-nextcloud-postgres
POSTGRES_DB: nextcloud
POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: restoretest-nextcloud-db
REDIS_HOST: restoretest-nextcloud-redis
NEXTCLOUD_ADMIN_USER: restoretest-admin
NEXTCLOUD_ADMIN_PASSWORD: restoretest-nextcloud-admin-pass
NEXTCLOUD_DATA_DIR: /var/www/html/data
# Bewusst keine Trusted-Domain/Proxy-Konfiguration: Smoke prueft
# nur localhost-HTTP, keine Traefik-Route.
ports:
# nur 127.0.0.1, keine Public-Route, keine Traefik-Labels
- "127.0.0.1:18180:80"
volumes:
# Restore-Lab-Pfade: alles isoliert, keine produktiven Mounts.
- /mnt/user/backups/restore-lab/nextcloud/html:/var/www/html
- /mnt/user/backups/restore-lab/nextcloud/data:/var/www/html/data
# KEIN no-new-privileges fuer den Smoke-Test-Container.
# Der Nextcloud-Entrypoint fuehrt intern chown/chmod auf /var/www/html
# und /var/www/html/data aus. Auf Unraid (FUSE/shfs) ignoriert das
# Host-Dateisystem chown-Aufrufe von aussen, deshalb muss der
# Container-Entrypoint die Rechte selbst setzen koennen. Im isolierten
# Smoke-Kontext (127.0.0.1, kein Traefik, Wegwerf-Daten) ist das
# vertretbar. Test-Postgres und Test-Redis behalten no-new-privileges.