Images: upload, publish, display and delete

Images: upload, publish, display and delete A sequence diagram generated by Archify. POST images.camptocamp.org/upload Before sending, a Workerreduces the photo to 3072px on its long side(panoramas: 2048 px shortside, 16 MP), JPEG 0.9. Oneupload at a time. Varnish buffers the body → round robin maxconn 2 per instance;client address inX-Forwarded-For. PUT original + SI/MI/BI (JPEG/PNG) Checks the format: HEIC →JPEG, WebP/AVIF/TIFF/GIF →JPEG/PNG, SVG sanitized; ≤100 MP (HEIC 50). Renamed<timestamp>_<random>.<ext>. 200 {filename, width, height, size} PUT SI/MI/BI .avif, after the answer GENERATE_AVIF: quality 55(drawings 80), effort 3. POST /images/list One image document perfile, with its filename andassociations (outing,route...). POST /publish {secret, filename} Through haproxy:8081(internal_images), insidethe request: a non-200answer gives a 500 andnothing is saved. Also whenan update changes thefilename. move original + all thumbnails Incoming → active. An AVIFnot rendered yet is moved20 s later(THUMBNAILS_PUBLISH_DELAY). 200 {success} {images: [document_id...]} GET media.camptocamp.org/c2corg-active/<name>MI.avif <picture>: AVIF for imagesuploaded aftermodernThumbnailsTimestamp,else (or on error) theJPEG/PNG thumbnail. anonymous GET (backend s3) Anonymous reads of thebucket are only acceptedfrom the HAProxies. image, Cache-Control: public, max-age=3600 GET /images/proxy/{id}?size=MI&extension=avif When only the document idis known; follows mergedimages to their target. 302 → media URL POST /delete {secret, filenames[]} After commit, when an imagedocument is deleted ormerged: every filename ofits archives. A failure isonly logged. DELETE each original + thumbnails Versioned bucket: only adelete marker, recoverablefor 30 days. expire unpublished files after 24 h A lifecycle rule of thebucket, created at startupif missing; else an hourlysweep by the service. 1 · Upload: the UI talks to c2c_images directly 2 · Save: the API publishes what it stores 3 · Display: media.camptocamp.org 4 · Delete and expiry Browser · c2c_ui image uploader · Sequence participant Browser c2c_ui image uploader v6_api · image documents · Sequence participant v6_api image documents HAProxy + Varnish · haproxy0 / haproxy1 · Sequence participant HAProxy + Varnish haproxy0 / haproxy1 c2c_images · images0 / images1 · sharp · Sequence participant c2c_images images0 / images1 · sharp c2corg-incoming · SOS bucket, unpublished · Sequence participant c2corg-incoming SOS bucket, unpublished c2corg-active · SOS bucket, published · Sequence participant c2corg-active SOS bucket, published Legend main request return security async trace message