Commit Graph
152 Commits
Author SHA1 Message Date
Dominik Schmidt 4e85772b47 fix(webdav): stop the resolution ladder at 2048
The largest rung is the largest box a generator is asked for, and fill and stretch enlarge a small source to fill it, so the rungs above 2048 let a tiny image cost whatever 8K costs. Web asks for 1200 at most.
2026-10-20 16:56:28 +02:00
Dominik Schmidt 41b7160f3a fix(webdav): the source type belongs in the cache key
The same bytes uploaded under two types are not the same thumbnail: the type picks the extractor, and with Tika in front what it finds depends on it.
2026-10-20 16:03:06 +02:00
Dominik Schmidt 4f79fdf9bb fix(webdav): hash the checksum that becomes the cache key
The checksum is not this service's to trust, an OCM share takes it from a remote PROPFIND, and it ends up as a path on disk and as an S3 object key.
2026-10-20 16:02:39 +02:00
Dominik Schmidt ab29d4848f fix(webdav): keep the deprecated cache root pointing at its files directory
THUMBNAILS_FILESYSTEMSTORAGE_ROOT named the directory the old service kept files/ in, so reading it as the cache directory moved the cache one level up and left the existing thumbnails behind.
2026-10-20 16:01:52 +02:00
Dominik Schmidt 56d96d2df8 fix(webdav): say it when the thumbnail cache fails to answer
Only a miss is silent now; every other error from the cache is logged instead of disappearing behind a regenerated thumbnail.
2026-10-20 14:59:08 +02:00
Dominik Schmidt 260d6f0bbd fix(webdav): a missing s3 bucket is not a cache miss
Matching any 404 let a typo in the bucket name read as a miss on every lookup; only NoSuchKey, and a 404 that carries no code at all, are misses now.
2026-10-20 14:58:46 +02:00
Dominik Schmidt fa73366ff0 fix(webdav): read the generator's status before the writer's error
A 429 or 413 is answered without reading the body, which breaks the write; the broken pipe used to mask the status. A 413 now reads as too large, not as a server fault.
2026-10-20 14:58:09 +02:00
Dominik Schmidt 89e2f42d7c refactor(webdav): ask ForType for options, not for an any map 2026-10-19 15:16:06 +02:00
Dominik Schmidt ee4465f500 fix(webdav): stop refusing a type mapping on a guess about the generator 2026-10-19 14:57:36 +02:00
Dominik Schmidt 48f9990a41 fix(webdav): ask the generator for the smart crop
A cropping resize now carries imagor's smart segment, which is how the libvips
build and a real imagor keep the region that carries the image, the way main
cropped before the generator moved out. A build without libvips answers the
same request with a centre crop, and the parity suite records that.
2026-10-19 14:57:36 +02:00
Dominik Schmidt c980083938 docs: say less in the comments, and name what matchOperation returns 2026-10-19 14:57:36 +02:00
Dominik Schmidt 999ad6fb7c fix: answer the review from @orgaralf
Both builds and imagor now crop the same region, a gif is bounded by its
declared frames, the posted body by THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE and an
image extracted from a container by the configured input size. The s3 cache
reads a miss where minio reports it.

The push endpoint's HTTP behaviour is asserted in the parity suite now, where
imagor answers the same request, so 41 duplicated service specs are gone and
the 32 that remain are what a non-default config or a helper decides.
2026-10-19 14:57:36 +02:00
Dominik Schmidt 4da8971ca7 docs: say what the code does, in the places that still described something else
The aspect-ignored header blamed a processor for a decision the free axis can make too. fit-in does not letterbox, it answers smaller than the box. The s3 cache checks bucket, region and credentials, not the endpoint. A mapping onto a type the generator cannot write is refused at startup instead of quietly becoming a JPEG. And a processor name nobody knows resolves like none, which three comments and a readme line still denied.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 1da9fa8013 fix: answer the third review round
With previews off a thumbnail path answered 405, because the REPORT patterns match the same paths and the GET routes were left out; the routes stay now and the shared parse step answers 404, which is what the setting promises. The deprecated cache directory is read again: its default no longer sits in the config struct, where it made the fallback unreachable. A processor nobody knows is treated like none, in the parser too. A comma-joined resolutions entry in yaml keeps working. Plus the comments and the readme line that described something else than the code does.
2026-10-19 14:57:35 +02:00
Dominik Schmidt c5c5ec2e2c refactor(webdav): own the list of types a preview is announced for
The thumbnails service kept a single map of supported mime types that nothing in that service used any more, only webdav read it, and the comment still claimed reva reads it there. It is webdav's announcement, so DefaultSourceTypes lives next to SourceTypes now, the leftover package is gone, and no webdav file imports the thumbnails service any longer.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 67856fdf6d fix: the small things the review left over
A processor that needs the whole box is not a cropping one, so targetsExactBox says what it decides. An output format without an encoder answers 406 like every other thing this build cannot write. The configured defaults are no longer seeded twice, the constructors merge them anyway, like they do for the source types. And webp needs no build tag: both builds read it, the pure Go one answers the JPEG the mapping asks for, which the parity suite pins.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 3572410fc4 fix: answer the review, and read imagor's path the way imagor does
The push endpoint takes an empty filters segment, ignores an image key behind the box and computes a side given as 0 from the other one, all measured against both imagors and pinned in the parity suite. Plus the review leftovers: no em dashes, the request test on ginkgo, comments that contradicted the code, one stat for Head and generate, one thumbnail handler, the gif fit-in rounding of vips, and the new env names last so they win.
2026-10-19 14:57:35 +02:00
Dominik Schmidt f4792a0b02 fix(webdav): keep the acceptance contract for previews
An explicit x=0 or y=0 is an error again, only an omitted axis is unconstrained, and the text preview fixtures carry the resolution the generator writes now.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 6c9dc28599 refactor: one gif resize, a request struct, half the routes
The gif loop is shared by both builds, the executor takes a request
struct, the route table halves, the aspect flag is a pointer instead of
two bools, and the cache's budget is named after what it is.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 99c7666ad2 fix(webdav): make the legacy a flag mean something again
An unconstrained axis is fitted instead of refused, a decides when the
client sent it, and an empty resolution ladder is refused at startup
instead of letting the client pick the cache key.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 918c2baa7d fix(webdav): refuse what it cannot serve and pass the generator through
A cache backend nobody can serve fails at startup instead of dropping
entries silently, the memory backend is bounded, a busy generator's 429
reaches the client with its Retry-After, and a 400 from the generator is
read as this service's own bug instead of a missing preview.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 70002306a8 docs: describe the push endpoint and the preview settings as they are
The fixtures are named after what they are, and the leftovers of the
deleted grpc service are gone.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 9879927f4f refactor(webdav): a converter returns the image bytes and their type
A converter that found nothing returns nil, so the workflow decides what to
do with it instead of reading an error.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 32f4ee02e8 feat(webdav): let a deployment add the types a preview is made of
webdav, graph and ocdav read the same list, so a configured type is
announced and attempted by all three. A type the generator cannot answer
is refused at startup, and ocdav takes the types from its own
configuration instead of importing an OpenCloud package, which the
vendored reva carries until opencloud-eu/reva#885 lands.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 07d6829bd6 fix(webdav): hand an embedded image to the generator as it was found
Nothing is decoded in webdav any more, which also ends the libvips build
split in the preview path.
2026-10-19 14:57:35 +02:00
Dominik Schmidt de467d7dd8 feat(webdav): write a thumbnail in the type the source maps to
A source type maps onto the type its thumbnail is returned in, and that
type is asked for by the name the generator knows it under. The answer
carries that type whether it was just generated or came from the cache,
which is also what the cache key says.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 0f734ac32c fix(webdav): type the upload part and answer the small things
The multipart part carries the source's own type, because imagor's upload
loader accepts image/* only. A public link that needs a password is a 404 again, a preview carries
nosniff and a content length, and the input size limit is read with reva's
bytesize again.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 4c0768cb83 fix(webdav): name the thumbnail config fields after what they configure
The yaml keys stay as they are, so a config file written against them keeps
working, and OC_DISABLE_PREVIEWS is back without disabling search.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 95fcc4c623 fix(webdav): snap each thumbnail axis onto a ladder of edge lengths
Each axis is rounded up on its own, so a square request can no longer land
in a landscape box, and the cache is keyed on the snapped box.
2026-10-19 14:57:35 +02:00
Jörn Friedrich Dreyer 81d0a86c35 refactor(webdav): drive the thumbnail workflow via the push-based generator
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-10-19 14:57:35 +02:00
André Duffeck 5b9ec396c4 Dynamically adapt the URL prefix depending on the request 2026-05-27 10:04:01 +02:00
André Duffeck 6bb2324233 Only try to limit search to spaces if there's a space id to limit to 2026-05-26 13:42:57 +02:00
Sai Asish Y 8b48501082 fix(webdav): register chi REPORT method in init to avoid race with concurrent route setup 2026-05-13 12:19:17 +02:00
André Duffeck 7ad037d96b Add the favorite flag to REPORT results 2026-03-23 15:35:23 +01:00
Christian Richter 36b90c8619 consolidate log config in webdav
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
2026-01-08 13:46:30 +01:00
Christian Richter 0372869b8b refactor remaining code from urfave/cli
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
2025-12-15 16:40:27 +01:00
Christian Richter 7be33b0607 refactor interims DefaultAppCobra to DefaultApp
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
2025-12-15 16:40:26 +01:00
Christian Richter ee5ff08209 migrate webdav from urfave/cli to spf13/cobra
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
2025-12-15 16:40:26 +01:00
Jörn Friedrich Dreyer 10913ca00a Merge pull request #1918 from opencloud-eu/otlp-tracing
update otlp tracing
2025-11-27 12:57:26 +01:00
Jörn Friedrich Dreyer a3ef7f6d79 update otlp tracing
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-11-27 12:28:15 +01:00
Jörn Friedrich Dreyer 62bcd91019 kill unused env vars
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-11-21 11:58:39 +01:00
Roman Perekhod c597dfb917 set default timeouts and clean up 2025-09-12 12:18:47 +02:00
Roman Perekhod 9a3fc08dd4 to separate controll ower the http and grpc driven services 2025-09-12 12:18:47 +02:00
Juan Pablo Villafáñez 9e1b80a1be feat: use runners to startup the services 2025-09-12 12:18:47 +02:00
Christian RichterandAndré Duffeck 55f1d9e4d2 Add has-preview to search
Co-authored-by: André Duffeck <a.duffeck@opencloud.eu>
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
2025-07-23 10:30:44 +02:00
Florian Schade 41f630d698 enhancement(webdav): add privatelink field to the webdav search response 2025-06-02 18:23:54 +02:00
Ralf Haferkamp 96684df32d Adjust to new tablewriter release 2025-05-19 19:26:38 +02:00
Ralf Haferkamp 8e1f68f315 Reset 'introductionVersion" struct tag to 1.0.0 2025-02-24 11:40:33 +01:00
André Duffeck e8d35e1280 Use the opencloud reva from now on 2025-01-21 11:16:38 +01:00
Jörn Friedrich Dreyer 2085de372d webdav
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-17 10:20:06 +01:00