fix(media): refuse local disk when a NAS share is configured
CI / build (push) Has been cancelled

A bind-mounted host directory made the app report storage as ready while
media landed on the container host's local filesystem, so the NFS export was
never actually used. mediaStorage() now reads the mount table: a share written
as host:/export is only accepted when the media root is on a network
filesystem, otherwise uploads, edits and filing are blocked with the real
device and the fix. Settings and the Media page show the detected filesystem
and host-mount steps, README section 9 documents the OS-level mount (including
Docker-in-LXC) with docker-compose.nfs.yml as the alternative, and the E2E
suites use path-style shares for local test directories.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
2026-11-21 00:45:36 +00:00
parent 2fc71883d7
commit 982f9048e1
14 changed files with 439 additions and 33 deletions
+31
View File
@@ -0,0 +1,31 @@
# Compose override: let Docker mount the NFS export for media storage.
#
# The base stack expects the export to be mounted on the Docker host and
# bind-mounted in via MEDIA_ARCHIVE_DIR. With this override the Docker daemon
# mounts the export itself, so nothing has to be in /etc/fstab on the host and a
# missing host mount can no longer leave media on the host's local disk.
#
# NFS_ADDR=nas.local NFS_EXPORT=/volume1/church-media \
# docker compose -f docker-compose.yml -f docker-compose.nfs.yml up -d
#
# NFS_ADDR is the server, NFS_EXPORT is the exported path (no server prefix).
# NFS_VERSION defaults to 4; set 3 on older exports. The mounted path inside the
# container stays /archive, so Settings → Media storage keeps /archive.
#
# Verify inside the container (expect an `nfs`/`nfs4` line):
# docker compose exec app grep ' /archive ' /proc/self/mounts
services:
app:
volumes:
- outbox-data:/tmp/outbox
- uploads-data:/tmp/uploads
- archive-nfs:/archive
volumes:
archive-nfs:
driver: local
driver_opts:
type: nfs
o: "addr=${NFS_ADDR:?set NFS_ADDR to the NFS server},rw,nfsvers=${NFS_VERSION:-4}"
device: ":${NFS_EXPORT:?set NFS_EXPORT to the exported path}"