The thumbnails service is now a stateless image resizer; remove everything
the old gRPC-based pipeline needed:
- proto definitions and generated code (service + messages)
- gRPC server, handler and decorators
- JWT transfer token code and the /data HTTP download endpoint
- filesystem storage layer and source fetchers (webdav + CS3 imgsource)
- duplicated encoding/generator/processor/resolution utilities
- the preprocessor packages moved to webdav in the previous commit
- dead config fields (Thumbnail struct, GRPC config, unused go-micro client),
no-op metrics/instrumentation wrappers, errors package, stale testdata and
the Makefile protobuf target
Also remove the now-meaningless thumbnails transfer secret generation from
opencloud init and point the graph service at the new webdav thumbnail
package. The README is rewritten to document the imagor-like push endpoint.
webdav now owns the complete thumbnail pipeline: stat -> validate -> cache
check -> download -> preprocess -> generate -> cache -> respond. The
thumbnails service is used only as a stateless imagor-compatible image
resizer via its /unsafe push endpoint.
- New ThumbnailWorkflow drives the pipeline; space-scoped refs are anchored
at the space ResourceId and downloads authenticate with the user's
x-access-token.
- Preprocessing (audio/geogebra/text/gif) moves from the thumbnails service
into webdav (services/webdav/pkg/preprocessor).
- Thumbnail caching moves to webdav (memory/file/s3 backends, file cache off
by default); resolutions are snapped orientation-aware in webdav.
- Generator URL defaults to the local thumbnails service; new WEBDAV_* config
for generator, cache and resolutions.
- Acceptance tests updated for the new sizing/processor behavior.
Add a stateless POST endpoint that accepts an original image as a multipart
upload and returns the resized thumbnail, mimicking imagor's /unsafe/ API:
POST /unsafe(/fit-in|/stretch)/{width}x{height}(/filters:{filters})
The three forms are fill (center-crop to the exact box, may upscale), fit-in
(preserve aspect ratio, fit within the box, never upscale) and stretch (resize
to the exact box without preserving aspect). Supported output formats are jpg,
png and gif. Image processing is split by build tag: stdlib imaging by default,
libvips when built with -tags enable_vips. The endpoint is stateless: no auth,
no storage, no source fetching. This commit only adds the /unsafe routes; the
legacy /data endpoint is left in place and removed in a later commit.
Instead of statically defining the version of Go in mise.toml as well as
in its native files (go.mod), use a small shell script to parse go.mod
and determine the version dynamically from there.
That version is then available as an env variable in the mise.toml file
and can be referenced for go, in order to avoid having to keep those
versions in sync, especially since dependabot will update go in the
go.mod file, but not in mise.toml.