fix(files): review round 2, the server — locks the GC and folders read under, the mount check, the old mount name

- GC: the expiry warning marks each file conditionally on the expiry it saw, one commit each (a file
  deleted meanwhile no longer fails the run; one re-timed keeps its fresh expiry unwarned); eviction
  counts the disk again when a candidate was freed meanwhile, so it never evicts for space already free.
- Folders: a retention change locks the folder and its files, and a finishing file reads the retention
  under a share lock, so neither misses the other; a folder delete locks the files it takes home (a
  file moved out meanwhile stays put, one deleted meanwhile no longer fails the delete).
- Upload: the folder is checked before the probe and held only once the job names it.
- Dedup enqueue locks the cached asset, so a release meanwhile yields a fresh one instead of a 500.
- Mount check reads the kernel's mount table instead of comparing devices (the vfs storage driver gave
  a mounted volume the device of /), and only inside a container; the API also logs a fresh, empty
  volume in the library's place.
- Compose files fall back to DOWNLOAD_HOST_PATH; the upgrade notes cover the from-source pull.
- Folder routes call owned_or_404 directly.
This commit is contained in:
2026-10-13 02:32:49 +02:00
parent 8b2260c9a8
commit 54a6bbf07f
15 changed files with 543 additions and 93 deletions
+8 -2
View File
@@ -260,7 +260,8 @@ compose file from before still mounts `/downloads` and sets `DOWNLOAD_ROOT`, and
that name. To move to the new layout, download the new
[`docker-compose.selfhost.yml`](../docker-compose.selfhost.yml) over your old one, then:
- **If you set a host directory**, rename `DOWNLOAD_HOST_PATH` to `FILES_HOST_PATH` in `.env`.
- **If you set a host directory**, nothing to do: the new compose file still reads
`DOWNLOAD_HOST_PATH` when `FILES_HOST_PATH` is not set. Rename it in `.env` when it suits you.
- **If you used the default volume**, copy it over once before you start the new version (Docker
cannot rename a volume). Compose names a volume after the project, which is your folder's name
unless you set one, so look the old one up rather than guessing it:
@@ -277,10 +278,15 @@ that name. To move to the new layout, download the new
Open the Files library and check your files play; only then remove the old volume
(`docker volume rm "$OLD"`).
- **If you build from source**, a `git pull` brings the new `docker-compose.yml`, whose default
volume is `files` (it was `downloads`): copy it over the same way, with `downloads` and `files` in
place of `siftlode_downloads` and `siftlode_files`, before you start the new version.
If the files library is not mounted where the app looks, the API says so in its log at start
(`The files library is not reachable`), and the download worker refuses to start rather than write
files into a container that throws them away.
files into a container that throws them away. A fresh, empty volume in the library's place (the old
one not copied over) is a real mount, so the worker runs; the API's log says that too, at start
(`The files library is empty but the database names files`). Copy the old volume over, as above.
**The registry keeps only the newest few releases, not every version the changelog lists.** A pin is
"decide when you take the next hop", not "stay here forever": once you are several releases behind,