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
+17 -9
View File
@@ -70,21 +70,29 @@ OUTBOX_DIR=/tmp/outbox
# storage share below.
UPLOAD_DIR=/tmp/uploads
# Primary storage for original event photos and videos. Mount the NFS export
# (or any local directory) on the Docker host, then point MEDIA_ARCHIVE_DIR at
# that host mount when starting compose:
# MEDIA_ARCHIVE_DIR=/mnt/nfs/glenloch docker compose up -d
# Then set the share name and folder in Settings → Media storage. Photo/video
# uploads and photo editing stay disabled until that check passes; the app never
# writes event media inside the container.
# Primary storage for original event photos and videos. Mount the export at an
# OS level on the Docker host, then point MEDIA_ARCHIVE_DIR at that mount:
# sudo mount -t nfs nas.example.org:/export /mnt/glenloch-media
# MEDIA_ARCHIVE_DIR=/mnt/glenloch-media docker compose up -d
# Mount before starting the app: the bind is read at container start. Then set
# the share name and folder in Settings → Media storage. Photo/video uploads and
# photo editing stay blocked (with the reason) while a NAS-style share is not a
# real network mount; the app never writes event media inside the container.
ARCHIVE_DIR=/archive
ARCHIVE_FOLDER=Glenloch Media
# Human-readable share, e.g. nas.local:/volume1/church-media or /mnt/media.
# Required in app settings (Settings → Media storage); this seeds the default.
NFS_SHARE=
# Host path bind-mounted at /archive. Point this at real storage; the app blocks
# media writes on a Docker-managed named volume.
# Host path bind-mounted at /archive, e.g. /mnt/glenloch-media mounted from the
# share. Point this at real storage; the app blocks media writes on a
# Docker-managed named volume or a NAS-style share that is not a network mount.
MEDIA_ARCHIVE_DIR=
# Alternative to the host mount: docker-compose.nfs.yml makes the Docker daemon
# mount the export as the volume behind /archive. Needs mount permission (fails
# with "operation not permitted" in an unprivileged LXC).
NFS_ADDR=
NFS_EXPORT=
NFS_VERSION=4
# Observability (declared; no Sentry integration is wired yet)
SENTRY_DSN=