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:
@@ -167,17 +167,40 @@ test.describe("growth goals and maintenance", () => {
|
||||
"Photo and video uploads are disabled",
|
||||
);
|
||||
|
||||
// Leave a working destination behind for the specs that upload media.
|
||||
const restored = await page.request.put(`${BASE}/api/dev/storage`, {
|
||||
// A share name that reads like `host:/export` while the path is a local
|
||||
// directory must block writes: media would silently land on local disk.
|
||||
const mismatched = await page.request.put(`${BASE}/api/dev/storage`, {
|
||||
data: {
|
||||
nfsShare: "e2e-nas:/export/church",
|
||||
archivePath: archiveRoot,
|
||||
archiveFolder: "E2E Gate",
|
||||
},
|
||||
});
|
||||
expect(mismatched.ok()).toBe(true);
|
||||
const blockedAgain = await page.request.post(
|
||||
`${BASE}/api/events/${eventId}/folders/${folderId}/photos?name=still-blocked.jpg`,
|
||||
{
|
||||
headers: { "content-type": "image/jpeg" },
|
||||
data: Buffer.from([0xff, 0xd8, 0xff, 0xd9]),
|
||||
},
|
||||
);
|
||||
expect(blockedAgain.status()).toBe(503);
|
||||
expect(((await blockedAgain.json()) as { error: string }).error).toContain(
|
||||
"not a network mount",
|
||||
);
|
||||
|
||||
// Leave a working local-path destination behind for the specs that upload
|
||||
// media; a path-style share is allowed to live on local disk.
|
||||
const restored = await page.request.put(`${BASE}/api/dev/storage`, {
|
||||
data: {
|
||||
nfsShare: archiveRoot,
|
||||
archivePath: archiveRoot,
|
||||
archiveFolder: "E2E Archive",
|
||||
},
|
||||
});
|
||||
expect(restored.ok()).toBe(true);
|
||||
|
||||
// With a usable share the Media page reports the archive's usage.
|
||||
// With a usable local path the Media page reports the storage usage.
|
||||
await page.goto(`${BASE}/media`);
|
||||
await expect(
|
||||
page.getByText("Original media storage", { exact: true }),
|
||||
|
||||
Reference in New Issue
Block a user