Render photos individually, optimize gallery images, and prune old releases

This commit is contained in:
2026-09-19 16:20:07 +03:30
parent e112ed7640
commit 3ec6cdd3ec
210 changed files with 117 additions and 12 deletions
+12 -5
View File
@@ -2,7 +2,7 @@
Photos → Share → **Publish to blog** → optional caption and highlight name → upload.
The authenticated upload service converts photos to JPEG (maximum 2560 px), applies
The authenticated upload service converts photos to progressive JPEG (maximum 1600 px and 300 KiB), applies
orientation, converts embedded color profiles to sRGB, and strips public metadata.
Originals stay in a private volume. A worker commits optimized images and an `_art`
entry to **github.com/mdibaiee/mahdi.blog**, on `master`.
@@ -150,7 +150,8 @@ Create **Publish to blog**:
only `published` means the deployed site's receipt contains this album.
The ZIP route accepts 1–20 images in archive-entry order and keeps them as one
album. The first image in that order is the highlight target. Metadata sidecars
upload. Each photo renders as its own gallery `<li>`, including photos in older
batches. The caption appears on each photo; the first image is the highlight target. Metadata sidecars
under `__MACOSX/` and `.DS_Store` are ignored. Ordinary API clients can also send
repeated `photos` parts; send either `archive` or `photos`, never both.
Select still photos; videos/Live Photo video components aren't supported. Dates
@@ -158,6 +159,10 @@ are upload time in UTC; captions are plain text. A caption is optional.
An optional highlight name (up to 200 characters) adds one link to **Highlights**,
pointing to the first photo in the batch. Leave it blank for an ordinary upload.
Gallery images are progressive JPEGs with a maximum edge of 1600 pixels and a
300 KiB size limit. The uploader tries moderate JPEG quality levels, then reduces
dimensions further when necessary. Private originals are retained unchanged.
The token is visible in the shortcut editor; remove it before sharing the shortcut.
Rotate it by replacing the token file and recreating the upload container with
`podman compose up -d --force-recreate upload`.
@@ -303,9 +308,11 @@ photo anchors so the service does not mistake a successful push for publication.
Back up the private `photo-data` volume (originals and job state) and GitHub's
repository. `photo-work` is disposable. Never expose private data through nginx or
run `compose down -v`. Originals and deployment releases are retained, so monitor
disk usage and periodically remove old releases (never `current` or an in-progress
release). Interrupted uploads may leave files in `photo-data/temporary`; clean that
run `compose down -v`. Originals are retained, so monitor disk usage. After a
successful deployment switches `current`, all older releases are automatically
pruned; newer uploads still in progress are preserved. There are no retained
server-side rollback copies; rebuild an older Git revision if needed.
Interrupted uploads may leave files in `photo-data/temporary`; clean that
folder only while the API is stopped. Public Git images are optimized copies.
## Tests