Commit Graph
5392 Commits
Author SHA1 Message Date
Andre Duffeck f8a8ecf724 Merge pull request #3966 from opencloud-eu/fix/postprocessing-uploadready-without-upload
fix(postprocessing): ignore UploadReady events without an upload
2026-11-18 10:34:31 +01:00
Andre Duffeck 9200fac9b8 Merge pull request #4030 from opencloud-eu/fix/search-debouncer-double-run
fix(search): run the debounced work once when both timers fire
2026-11-18 10:28:04 +01:00
Pascal Bleser 5b9e691484 Merge pull request #4017 from pbleser-oc/feat/tag-length-validation
feat(graph): limit the length of tags
2026-11-18 09:36:52 +01:00
Andre Duffeck edacb0e01f Merge pull request #4036 from opencloud-eu/feat/graph-expose-favorites
feat(graph): expose the favorite state on drives and sharedWithMe
2026-11-18 08:45:39 +01:00
Pascal Bleser a359ef7e85 feat(graph): limit the length of tags
Tags could be of any length. Assigning tags through the graph API now
rejects the whole request with 400 if one of the tags is longer than the
maximum, listing the tags that are too long. The length is counted in
characters, after the whitespace around each tag is removed. Tags that
already exist are not affected.

The maximum is 100 characters by default, and can be changed with
OC_MAX_TAG_LENGTH, or turned off with 0. The frontend service announces
it to clients as the graph.tags.max_tag_length capability, so that they
can check tags before sending them. Both services read the same
variable, without a service-specific alias, so that the announced limit
is always the one graph enforces.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-18 00:29:40 +01:00
opencloudeu f35dcd5718 [tx] updated from transifex 2026-11-17 23:17:37 +00:00
Sara Ahmadi 1668aa8b71 Merge pull request #4035 from asaah262/fix/4018-permissions-top-query-option
fix(graph): keep the permissions list query options with $top=0
2026-11-17 16:13:12 +01:00
Sara Ahmadi 8174209bb4 Merge pull request #4038 from asaah262/feat/1041-instrument-get-permission
feat(graph): add logging and tracing to the single-permission GET endpoints
2026-11-17 15:56:39 +01:00
Viktor Scharf 3b43e2a425 bump opencloud version to 9.2.0 (#4033)
* bump opencloud version to 9.2.0

* docs: set removal version 9.1.1 for deprecated options (#4029)
2026-11-17 14:39:14 +01:00
Sara Ahmadi 5a818b6f41 feat(graph): add logging and tracing to the single-permission GET endpoints
Assisted-by: Claude Code:claude-opus-5-5
2026-11-17 14:02:05 +01:00
Alexander Ackermann d2b1ab3c45 feat(graph): expose the favorite state on drives and sharedWithMe
Spaces and received shares can be marked as favorites, but the graph
API did not report it, so the web app could not show them.

drive.root and the sharedWithMe driveItems now carry
@libre.graph.me.following. The space root info only holds the requested
quota metadata, so the per-user flag is also read from the favorites
list the storage driver adds to the opaque.

Fixes #2511
2026-11-17 13:36:41 +01:00
Sara Ahmadi ccba4a5e49 fix(graph): keep the permissions list query options with $top=0
Assisted-by: Claude Code:claude-opus-5-5
2026-11-17 13:10:40 +01:00
Alex 0ec0411e75 chore: bump web to v8.3.0 (#4027)
Assisted-by: Claude Code:claude-opus-5-5
2026-11-17 13:09:44 +01:00
André Duffeck 2b77cb9a17 Bump reva to v3.0.1 2026-11-17 12:45:18 +01:00
Dominik Schmidt ca733e731f fix(search): run the debounced work once when both timers fire
Every pending space has a debounce timer and a timeout timer, and both
call the same work function. The function checked for a run in progress
before taking the mutex, so when both timers were due together, both
calls passed the check and the space was indexed twice at the same
time.

Take the mutex first and return when the work item is no longer the
pending one.

This is also what made "fires at the timeout even when continuously
debounced" flaky: its two timers are due about 50ms apart, which is
close enough on a busy CI runner.
2026-11-17 12:06:59 +01:00
Jörn Friedrich Dreyer 2032e85c83 Merge pull request #4011 from pbleser-oc/test/4010-thumbnail-cache-test-race
test(webdav): fix a data race in the thumbnail cache test
2026-11-17 10:03:03 +01:00
Jörn Friedrich Dreyer a8a10db244 docs(gateway): reword the caching paragraphs
With only the provider cache left the "it uses one cache:" sentence
followed by a list with a single entry read odd, so name the provider
cache in the sentence instead.

Also tell admins where the create home cache went. Someone searching
the README for GATEWAY_CREATE_HOME_CACHE_* now finds that the envvars
are gone and that the proxy remembers which users already have a
personal space.

Assisted-by: Claude Code:claude-fable-5-2
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-17 08:36:59 +01:00
Roman Perekhod 0cc21c5039 fix: move the home space create cache to the proxy
The gateway kept a cache of the users whose personal space had already
been created, but the proxy still sent a CreateHome request to the
gateway on every authenticated request, so each of them had to reach
the gateway before that cache could help.

Keep the set of users whose personal space exists in the proxy instead
and skip the gateway call for them. The set lives in memory only: after
a restart the first request of each user simply asks the gateway once
more, so persistence is not needed. A created and an already existing
personal space are both remembered, a failed attempt is not and gets
retried by the next request.

With the cache in the proxy the gateway no longer needs its own, so
remove the create home cache settings (GATEWAY_CREATE_HOME_CACHE_*) and
the create_personal_space_cache_config entry of the generated gateway
configuration, and update the gateway README accordingly.
2026-11-17 08:36:59 +01:00
opencloudeu 9ed89daff7 [tx] updated from transifex 2026-11-16 23:17:18 +00:00
Sara Ahmadi 16ba119131 Merge pull request #4019 from asaah262/test/907-permissions-select-allowed-values
test(graph): cover $select on the permissions list endpoints
2026-11-16 19:11:06 +01:00
Sara Ahmadi 146397ef73 test(graph): cover $select on the permissions list endpoints
Assisted-by: Claude Code:claude-opus-5-5
2026-11-16 18:10:30 +01:00
Sara Ahmadi dc891683eb fix(graph): hide private user attributes from other users
Assisted-by: Claude Code:claude-opus-5-5
2026-11-16 13:03:58 +01:00
Pascal Bleser 41196f511e test(webdav): fix a data race in the thumbnail cache test
The test "should use atomic write via temp file + rename" set
sawTempFile in a watcher goroutine and read it after close(done),
without waiting for the goroutine to stop, so the race detector failed
TestCache.

Make sawTempFile an atomic.Bool and wait for the watcher to return
before reading it.

Fixes #4010

Assisted-by: Claude Code:claude-opus-5-5
2026-11-16 12:38:00 +01:00
Sara Ahmadi 2ff7018524 Merge pull request #3992 from asaah262/refactor/graph-unified-role-labels
refactor(graph): keep the unified role labels in one place
2026-11-16 10:09:55 +01:00
Pascal Bleser 5853b9b598 fix(graph): return the drive id in remoteItem.parentReference.driveId
For received shares, remoteItem.parentReference.driveId held the id of
the root item of the drive (<storage>$<space>!<root>) instead of the id
of the drive (<storage>$<space>), unlike all other drive items. Clients
had to cut off the root part themselves to request /drives/{drive-id}.

Use the drive id for user and OCM shares, and expect it in the
acceptance tests of the shared with me listing.

Fixes #3997

Assisted-by: Claude Code:claude-opus-5-5
2026-11-16 09:33:47 +01:00
opencloudeu 15d181d3f4 [tx] updated from transifex 2026-11-13 23:17:01 +00:00
Pascal Bleser 8fe28aaae1 Merge pull request #3993 from pbleser-oc/fix/graph-space-image-limit-name
fix(graph): name the space image size limit after space images
2026-11-13 22:52:15 +01:00
Jörn Friedrich Dreyer 0cef1028c1 Merge pull request #3950 from pbleser-oc/fix/graph-idempotent-tag-unassign
fix(graph): succeed when unassigning tags a resource doesn't have
2026-11-13 20:37:35 +01:00
Jörn Friedrich Dreyer 8ba2c3c581 Merge pull request #3973 from pbleser-oc/feat/graph-export-personal-data-rate-limit
graph: rate limit the personal data export
2026-11-13 20:17:34 +01:00
Pascal Bleser dd93fd4d43 docs(graph): mention the v1beta1 route for space images
A space image can be assigned with a PATCH of the drive on the v1beta1
route as well, and the size limit applies there the same way. Say so in
the README, and cover the refusal of a too large image on that route in
the tests.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 19:15:45 +01:00
Pascal Bleser 67e210a541 feat(graph): add the v1beta1 endpoints for a single drive
Under /graph/v1beta1, drives could only be listed. Getting, creating,
updating and deleting a single drive was only possible under v1.0,
which returns the permissions of a drive's root with the old role names
instead of the IDs of the unified roles.

Add GET, PATCH and DELETE on /graph/v1beta1/drives/{driveID}, and POST
on /graph/v1beta1/drives. They take the same requests as their v1.0
counterparts. GET, POST and PATCH return the drive in the v1beta1
format, like the v1beta1 list of drives does: with
$expand=root($expand=permissions), the permissions carry the unified
role IDs and grantedToV2. DELETE behaves the same in both versions.

The handlers for getting, creating and updating a drive now take the
API version as a parameter, and the v1.0 and v1beta1 routes call them
with their own version.

The acceptance test helpers for spaces can now use either version of
the Graph API.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 19:14:34 +01:00
Pascal Bleser ad140be6eb fix(graph): name the space image size limit after space images
The variable that sets a lower size limit for space images alone was
named after the service, GRAPH_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE,
which reads like a limit for thumbnails in general. Rename it to
OC_SPACE_IMAGE_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE, and the yaml key
from thumbnails.max_input_image_file_size to
thumbnails.space_image_max_input_image_file_size.

The shared names OC_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE and
THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE are unchanged. Neither renamed
setting has been released yet.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 19:01:53 +01:00
Jörn Friedrich Dreyer 55b5e7db73 Merge pull request #3944 from opencloud-eu/backport-wp2-batch-e
fix(graph): port share permission and link fixes
2026-11-13 18:50:37 +01:00
Jörn Friedrich Dreyer c88d94ea2b Merge pull request #3986 from pbleser-oc/fix/graph-space-image-size
fix(graph): refuse space images too large for a thumbnail
2026-11-13 18:28:35 +01:00
Pascal Bleser 0169f3b0a5 graph: answer the export rate limit in the graph error format
A request to export the personal data beyond the rate limit got the
plain text 429 of httprate, while the other errors of graph, also those
of the same route, are JSON with an error code.

RateLimitPerAuthenticatedUser takes a handler for the response beyond
the limit now, so that a service can answer in its own format; nil
keeps the plain text 429. Graph answers with activityLimitReached. The
Retry-After header is set before the handler is called, so it stays.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 18:25:47 +01:00
Pascal Bleser a7789f8462 graph: rate limit the personal data export
Each personal data export collects all events of the user and writes
them into the user's personal space, so starting exports over and over
puts load on the system. Limit how many exports a user can start to 5
per minute, configurable with GRAPH_EXPORT_PERSONAL_DATA_RATE_LIMIT
(0 disables the limit). Requests beyond it get a 429 with a
Retry-After header.

The limit uses a new middleware, RateLimitPerAuthenticatedUser. It
counts requests by the id of the authenticated user rather than by the
URL, so that variations of the URL, such as a trailing slash, can't get
around it. It comes after the check that users only export their own
data, so that requests for other users don't count against any limit.
The counters are kept in memory by every instance of the graph service.

This adds the dependency github.com/go-chi/httprate v0.16.1 (MIT), from
the authors of the chi router that the service already uses. It is used
instead of a limiter of our own, because counting requests in sliding
time windows correctly under concurrency is easy to get wrong, and the
library is maintained and tested for exactly that. It brings no further
modules: the two it needs are already required. There are no known
vulnerabilities in it, and govulncheck reports none.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 18:25:47 +01:00
Pascal Bleser b257a651ee graph: check the user id of exportPersonalData in a middleware
Check that a user exports only their own personal data in a new
middleware, RequireOwnUserID, so that the check can run before other
middlewares on the route, such as a rate limit. The route passes the
name of its user id parameter to it.

The handler keeps its own check as well, as a safety net: exporting the
data of one user to another must never happen, also when the route is
changed by mistake. When that check catches a request, it logs an error,
since the middleware must be missing.

Both unescape the user id from the path, like the other handlers of the
users endpoint do, and reject an empty one. The middleware answers 401
when there is no authenticated user. Requests for other users still get
a 400, now with a JSON error body instead of a plain text one.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 18:25:17 +01:00
Jörn Friedrich Dreyer 8a56177b82 fix(graph): reject links on the shares space root
Creating a link on the root of the Shares drive was only caught later
by the permission check, and an internal link with the internal role
was not rejected at all. We now answer with a 400 "cannot create link
on shares space root" before even looking at the request body, just
like we do for the personal space root.

The acceptance scenarios now expect the new message for the Shares
drive, and the internal link scenario covers the Shares drive again.

ported from `owncloud/ocis#11543`

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-13 18:18:31 +01:00
Jörn Friedrich Dreyer 5cfb0fca1a fix(graph): list permissions when public shares are inaccessible
When the public share manager cannot access its metadata space, e.g.
after an upgrade, listing public shares fails with an already exists
error and the whole permissions request ended in a 500. The space
members dialog in web then just keeps spinning.

We now log a warning, skip the link permissions and still return the
user and space permissions.

Our reva currently replaces the original error with a generic "error
listing public shares", so this only takes effect together with the
port of `owncloud/reva#264`, which passes the error message through.

ported from `owncloud/ocis#11245`

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-13 18:18:31 +01:00
Jörn Friedrich Dreyer 4bb1feef67 Merge pull request #3964 from opencloud-eu/backport-wp2-753
fix(graph): apply the role allowlist to permission updates
2026-11-13 18:13:41 +01:00
Sara Ahmadi f815a94274 refactor(graph): keep the unified role labels in one place
Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 18:09:13 +01:00
Michael Barz f3810e851b Merge pull request #3990 from opencloud-eu/fix-search-debouncer-flaky-test
test(search): wait for the first debouncer run instead of sleeping
2026-11-13 17:57:06 +01:00
Jörn Friedrich Dreyer bc8cd60fc3 Merge pull request #3956 from opencloud-eu/workpagages
feat: merge the workpagages branch into main
2026-11-13 17:53:39 +01:00
Jörn Friedrich Dreyer a7b21848cf test(search): wait for the first debouncer run instead of sleeping
"doesn't trigger twice simultaneously" slept 100ms and assumed the
first run had started by then. On a busy CI runner the 50ms debounce
timer can fire later. The second Debounce then only resets the pending
timer, both calls collapse into one run and the count never reaches 2:

  [FAILED] Timed out after 2.001s.
  Expected <int>: 1 to equal <int>: 2

The run now blocks on a channel until the test releases it. We wait
for the first run to start, check that the second debounce does not
start another run while it is in progress, then release it and expect
the second run.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-13 17:41:56 +01:00
Jörn Friedrich Dreyer e864b06797 Merge pull request #3913 from Pflum/fix-revaconfig
Fix Reva config to also validate OC_CACHE_* tls settings and fix the disable_persistence key
2026-11-13 17:24:43 +01:00
Jörn Friedrich Dreyer ede21a0ac6 Merge branch 'main' into workpagages
The only conflicts were the reva bump in go.mod, go.sum and vendor.
main moved to reva v2.52.2, workpagages already points to reva main
036856689, which contains v2.52.2, so we keep that and re-vendor.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-13 17:03:53 +01:00
Jörn Friedrich Dreyer a24d49a296 Merge pull request #3839 from opencloud-eu/port-upload-coordinator
feat: switch uploads to the reva upload coordinator
2026-11-13 16:57:58 +01:00
Michael Barz db7ffa7a40 Merge pull request #3899 from asaah262/feat/898-allow-setting-spaceid
feat(graph): allow client-supplied drive IDs when creating spaces
2026-11-13 16:27:29 +01:00
Jörn Friedrich Dreyer 21b48b9d05 Merge pull request #3981 from pbleser-oc/fix/graph-me-issuer-assigned-id
fix(graph): return the identities of the identity backend on /me
2026-11-13 16:11:44 +01:00
Pascal Bleser 51b92da2e5 fix(graph): refuse space images too large for a thumbnail
A space image is only ever shown as a thumbnail. When a file larger
than the thumbnail generator accepts was set as the image of a space,
the PATCH of the drive succeeded, but no thumbnail could be made of the
file, so the space showed no image and nobody got an error.

Before setting the image, graph now looks up the size of the file, and
refuses a file above the limit with 413 Request Entity Too Large,
without changing the space. The limit is the one of the thumbnail
generator: graph reads it under the same names as the webdav and
thumbnails services (OC_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE and the
older THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE, 50MB by default, empty for
unlimited), so one setting keeps the three in agreement.
GRAPH_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE sets a lower limit for space
images alone.

The default of 50MB is now one constant, which the graph, webdav and
thumbnails services all use.

Only the file size is checked: the dimension limits of the generator
would need the whole image to be read. The space readme has no limit,
and an empty image id is passed on unchecked, as before.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 15:55:12 +01:00