Skip to content

scratch: #114 + compile-before-timed-tests (do not merge) - #128

Closed
jayleaton wants to merge 2 commits into
ci/compile-before-timed-testsfrom
scratch/ctt-114-combined
Closed

jayleaton wants to merge 2 commits into
ci/compile-before-timed-testsfrom
scratch/ctt-114-combined

Conversation

@jayleaton

Copy link
Copy Markdown
Owner

Scratch: #114's commits on top of the fix, to prove the test budget passes. Closed and deleted afterwards.

@jayleaton
jayleaton force-pushed the scratch/ctt-114-combined branch from 448cf29 to 54d6c87 Compare October 23, 2026 10:56
jayleaton and others added 2 commits October 23, 2026 18:07
Adds packages/storage (S3 client over net/http + SigV4, no SDK),
packages/storage/safefetch (user-URL fetch that checks every dialled IP,
redirect hop included, so DNS rebinding fails) and
packages/storage/imaging (pure-Go JPEG/PNG/GIF/WebP/AVIF decode, EXIF
orientation, fit to 2048 px, re-encode to WebP).

Off unless STORAGE_S3_ENDPOINT/BUCKET/ACCESS_KEY_ID/SECRET_ACCESS_KEY are
set (live secrets, all or none, probed at boot). One example behind the
layers: ImageService with ObjectStore/ImageFetcher/ImageCodec ports and
/api/core/v1/images (upload, import by URL, get, delete), mounted only
when storage is on. The SSRF address and URL rules live in services
(PublicAddr, FetchURLAllowed) and are table-tested there.

New dependencies: gen2brain/webp and gen2brain/avif (libwebp transpiled
to Go, libavif under wazero; the only pure-Go WebP encoder and AVIF
decoder) and golang.org/x/image (resizing). Builds need -tags nodynamic
to stay static: make build and the Dockerfile pass it, and the image
build fails without it.

Source: jayleaton/auto-visuals#9 and #26 (generic parts only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…98 MB

x/image/draw's CatmullRom.Scale keeps the whole horizontally scaled image
(target width x source height x 32 bytes): 198 MB for a 12 MP photo, 396 MB
for 48 MP, and the server held about 540 MB after a few uploads. resize
does the same separable Catmull-Rom (same weights, same 16-bit
premultiplied arithmetic, same rounding) one band of output rows at a
time, scaling only the source rows a band reads, support rows included,
so the output is identical byte for byte and bands leave no seams.

Peak RSS on the real server: 12 MP upload 567 -> 179 MB, 48 MP 591 -> 218
MB, two 12 MP at once 528 -> 266 MB; the stored WebP is byte-identical.
golang.org/x/image is no longer needed (image/draw from the standard
library covers the copy).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jayleaton
jayleaton force-pushed the scratch/ctt-114-combined branch from 54d6c87 to 1f96fde Compare October 23, 2026 11:07
@jayleaton jayleaton closed this Oct 23, 2026
@jayleaton
jayleaton deleted the scratch/ctt-114-combined branch October 23, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant