fix(files): review round 1, the server — the tray's window, the GC's locks, a file's origin, the upgrade path
- The queue keeps a done job by when it became done (ready_at), not by its last write: renaming, keeping or moving an old file, or the GC's expiry warning, no longer brings it back as just finished. - GC expiry and eviction re-read each file under the asset→job locks the user routes take, and commit one file at a time: a delete, a re-download or a keep made while the GC runs is honoured, never a second release that frees a file another user still holds. - A file records the origin it was placed under (download_jobs.source_key, migration 0105): an edit whose parent expired still goes back to its folder, not to Uploads. - A folder a file is being put in is held (FOR SHARE) until it lands; a delete of it waits and takes that file home too, instead of failing on the foreign key. - The hash route reads at most two files at once (429 past that) and holds no connection meanwhile. - 0104's backfill dates old files by their request date only: no notice prod wrote names its job. - The old DOWNLOAD_ROOT still finds the files; a files root that is not a mounted volume stops the worker and is logged by the API; the volume-copy recipe looks the project-prefixed names up. - Stale comments about the /downloads mount and the Downloads page.
This commit is contained in:
+26
-10
@@ -254,17 +254,33 @@ Then `pull` + `up -d` stays on that version until you change the line. Released
|
||||
changed in them are listed in the app itself, under **Release Notes** in the account menu, and in
|
||||
[`CHANGELOG.md`](../CHANGELOG.md).
|
||||
|
||||
**The media mount was renamed** (the Files library): `DOWNLOAD_HOST_PATH` is now `FILES_HOST_PATH`,
|
||||
mounted at `/files`, and the default volume is `siftlode_files` instead of `siftlode_downloads`. If you
|
||||
set a host directory, rename the variable in `.env`. If you used the default volume, copy it over once
|
||||
before you start the new version (Docker cannot rename a volume), then remove the old one when the
|
||||
library looks right:
|
||||
**The media mount was renamed** (the Files library): it is mounted at `/files` (`FILES_ROOT`), set
|
||||
from `FILES_HOST_PATH`, and the default volume is `siftlode_files`. Until you move, nothing breaks: a
|
||||
compose file from before still mounts `/downloads` and sets `DOWNLOAD_ROOT`, and the app still reads
|
||||
that name. To move to the new layout, download the new
|
||||
[`docker-compose.selfhost.yml`](../docker-compose.selfhost.yml) over your old one, then:
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose.selfhost.yml down
|
||||
docker volume create siftlode_files
|
||||
docker run --rm -v siftlode_downloads:/from -v siftlode_files:/to alpine cp -a /from/. /to/
|
||||
```
|
||||
- **If you set a host directory**, rename `DOWNLOAD_HOST_PATH` to `FILES_HOST_PATH` in `.env`.
|
||||
- **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:
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose.selfhost.yml down
|
||||
docker volume ls --format '{{.Name}}' | grep 'siftlode_downloads$' # e.g. mysiftlode_siftlode_downloads
|
||||
OLD=mysiftlode_siftlode_downloads # the name it printed
|
||||
NEW="${OLD%siftlode_downloads}siftlode_files"
|
||||
docker volume create "$NEW"
|
||||
docker run --rm -v "$OLD":/from -v "$NEW":/to alpine cp -a /from/. /to/
|
||||
docker compose -f docker-compose.selfhost.yml up -d
|
||||
```
|
||||
|
||||
Open the Files library and check your files play; only then remove the old volume
|
||||
(`docker volume rm "$OLD"`).
|
||||
|
||||
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.
|
||||
|
||||
**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,
|
||||
|
||||
Reference in New Issue
Block a user