Commit Graph
24417 Commits
Author SHA1 Message Date
Viktor Scharf bb2db1de60 test(search): cover trailing NOT operator in invalid KQL patterns (#3982)
* test(search): cover trailing NOT operator in invalid KQL patterns

* skip downloadFile:321 for reva
2026-11-16 08:43:59 +01:00
Viktor Scharf 9c33410bbe test(guest-link): guest session does not override other credentials (#3877)
Requests that carry a guest session cookie together with other
credentials (bearer token, basic auth, public link, signed URL) must be
authenticated with those credentials, or rejected with 401 if they
are invalid, and never fall back to the guest.
2026-11-16 08:28:45 +01:00
Pascal Bleser 9856b448ff fix(ci): skip the font regeneration that restarts OnlyOffice (#3996)
The entrypoint of the OnlyOffice image regenerates the fonts after the
document server first started, and restarts it about 30 s later. The
wait step only sees the first instance, and the collaboration service
fetches the WOPI discovery once at startup: when that fetch hits the
restart, it gets a 502, registers without mimetypes, and every
OnlyOffice app-open fails until its next registration 30 s later.

The image comes with the fonts already generated, so skip the
regeneration with GENERATE_FONTS=false.

Fixes #3994

Assisted-by: Claude Code:claude-opus-5-5
2026-11-15 15:53:04 +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
Michael Barz 309f9d643b Merge pull request #3941 from pbleser-oc/feat/graph-drive-v1beta1-aliases
feat(graph): add the v1beta1 endpoints for a single drive
2026-11-13 19:44:10 +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
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
Jörn Friedrich Dreyer 18fc08c697 build: bump reva to main 036856689
workpackages was merged into reva main with
https://github.com/opencloud-eu/reva/pull/957, so we no longer need to
pin the workpackages branch. The code is the same as 7ff1d6fb1, only
the version changes.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-13 15:50:33 +01:00
Jörn Friedrich Dreyer 454c05afc9 build: bump reva to workpackages 7ff1d6fb1
Brings in https://github.com/opencloud-eu/reva/pull/1001, which merges
reva main into workpackages: the typed storage results, the fix for
synchronous uploads stuck in processing (moved to the upload
coordinator), the main-queue replica fix and the posix id cache fail
fast.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-13 15:21:45 +01:00
Sara Ahmadi 768cd264d7 feat(graph): reject drive ids that belong to existing users
Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 13:22:24 +01:00
Andre Duffeck f314b17fce Merge pull request #3925 from opencloud-eu/chore/drop-enable-vips
drop the enable_vips build flag
2026-11-13 12:38:28 +01:00
micbar c996d22dc4 chore: add new target branch to backport config 2026-11-13 09:56:19 +01:00
Jörn Friedrich Dreyer 498979b76e Merge pull request #3976 from dragonchaser/backport-wp2-744
feat(frontend): add server managed spaces capability
2026-11-13 09:24:12 +01:00
opencloudeu c61b1cec87 [tx] updated from transifex 2026-11-12 23:17:06 +00:00
Pascal Bleser 2bb40b631b fix(graph): reject empty tags and report only removed tags on unassign
Three follow-ups to the idempotent tag unassignment:

- A request whose tags are all empty, e.g. [""] or [","], is rejected
  with 400 again. The tags are now split and cleaned up the same way as
  the stored ones before checking that there are any.
- The TagsRemoved event lists only the tags that were actually removed,
  and is empty when the resource had none of them. It is still sent in
  that case, so that search reads the resource again. Search, the only
  consumer, uses only the reference of the event.
- A locked resource is answered with 423, like assigning tags does,
  instead of 500.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-12 23:28:45 +01:00
Pascal Bleser acb16b538a fix(graph): return the identities of the identity backend on /me
Without $expand=memberOf, GET /me built the user from the CS3 user of
the request context. That user doesn't know the identities the user
signed in with, so identities[].issuerAssignedId contained the internal
user ID instead of the subject assigned by the identity provider, which
the identity backend stores when the user is provisioned. Only requests
with $expand=memberOf read the user from the identity backend and
returned the correct value.

GET /me now always reads the user from the identity backend. The group
memberships are still only looked up when $expand=memberOf asks for
them, so a plain /me costs one more user lookup in the identity
backend.

This changes the response of a plain GET /me in two cases:
- users for whom the identity backend has no stored identity, e.g.
  users created through the API rather than signed in through an
  identity provider, get no identities at all, instead of one that
  wrongly carried the internal user ID
- when the identity backend doesn't know the user, /me answers with its
  error (e.g. 404 instead of 200 with a model built from the request
  context)

A failing identity backend is now logged at error level, a user it
doesn't know at debug level.

PERFORMANCE: every plain GET /me now runs one search in the identity
backend (LDAP), where it used to need none.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-12 18:04:58 +01:00
Jörn Friedrich Dreyer 0d969c3179 thumbnails: drop the enable_vips build flag
The thumbnails service now always resizes in pure Go. Deployments that
want more formats, webp output or an attention crop run a real imagor
and point WEBDAV_THUMBNAILS_GENERATOR_URL at it. The built-in service
stays as a minimal fallback that keeps working when imagor or libvips
have to be taken out, for example during a security issue.

Without cgo dependencies the docker images link statically again and no
longer need the vips packages. The vips parity run in CI goes away, the
regular test run already covers the pure Go build.

The preview fixtures of the acceptance tests were rendered by libvips,
so they are regenerated with the pure Go build. Text previews now lose
their left edge: the 640x480 text canvas is filled into a square box
and the pure Go build crops the centre, where libvips' attention crop
kept the left side with the text.

part of https://github.com/opencloud-eu/opencloud/issues/3912

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-12 15:41:35 +01:00
Sara Ahmadi 3999ed0de8 Merge pull request #3881 from asaah262/feat/895-improve-graph-logging-and-tracing
feat(graph): improve logging and tracing for drive item permissions
2026-11-12 15:36:53 +01:00
Christian Richter ada4f0a5e6 test(frontend): cover the server managed spaces capability
Assert that the spaces.server_managed capability follows the OC_CLAIM_MANAGED_SPACES_ENABLED setting for both values.
2026-11-12 14:58:48 +01:00
Martin Mattel 9cb072872a docs(frontend): document the server managed spaces setting
Refine the description of the OC_CLAIM_MANAGED_SPACES_ENABLED setting and add a section to the frontend README that explains what it does.
2026-11-12 14:43:45 +01:00
Julian Koberg 7ee5a8a6af feat(frontend): add server managed spaces capability
Publish the spaces.server_managed capability, driven by the OC_CLAIM_MANAGED_SPACES_ENABLED setting, so that clients can block adding and removing users to and from spaces.
2026-11-12 14:41:16 +01:00
Sara Ahmadi f12a02b007 feat(graph): log error text and correlate gateway selection failures
Log the error text with every permission failure, at debug and error
level, and the texts of both errors when a fallback returns a different
error than the first attempt.

Log gateway selection failures in the share helpers at error level with
the request id and, where available, the permission id, so they can be
matched with the entry of the calling operation.

Use constants for the log keys, the recipient types and the tracer name,
log the space type of unsupported spaces and the user id of the shared
by me listing, and log an unknown permission type when deleting.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-12 11:58:30 +01:00
Jörn Friedrich Dreyer 0da2e8954a build: bump reva to workpackages fa3c9e289
Picks up the space manager checks from
https://github.com/opencloud-eu/reva/pull/990 and
https://github.com/opencloud-eu/reva/pull/993.

go-chi and go-jose move up because reva requires the newer versions.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-12 11:13:35 +01:00
Jörn Friedrich Dreyer f9918ea698 build: bump reva to workpackages c5a650fe2
Picks up https://github.com/opencloud-eu/reva/pull/978: a failed blob
commit now logs the space and node id, and the last attempt logs that
we give up. This runs the rest of the `owncloud/reva#733` port through
the opencloud CI.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-12 11:11:30 +01:00
Jörn Friedrich Dreyer 143a35e63d test: expect 403 when the federated share does not permit the upload
The remote instance still sees the share with the role it was created
with, so the upload coordinator refuses the upload there instead of the
owner's instance failing it with 500.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-12 11:11:30 +01:00
Jörn Friedrich Dreyer 3281a35ae6 storage-users: pass the mount id to the posix driver
The upload coordinator reads the mount id from the driver config to drop
postprocessing results that belong to another storage. The dataprovider
does not add it to the driver config the way the storageprovider does,
so without it the coordinator accepts every result for posix.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-12 11:11:30 +01:00
Alexander Salimonov 0281ccb811 fix: pass mount id to the decomposeds3 storage driver
Postprocessing results are dropped when their storage id does not match
the driver's mount id. Only the decomposed driver was given a mount_id,
so under decomposeds3 there was nothing to compare against.

Also pass it in DecomposedNoEvents and DecomposedS3NoEvents.
2026-11-12 11:11:30 +01:00
Roman Perekhod d71110f01d feat: pass the mount id to the decomposed driver and the resource id on PostprocessingFinished
The storage drops postprocessing events that belong to another storage,
which needs its mount id and the resource id on the event.
2026-11-12 11:11:30 +01:00
Jörn Friedrich Dreyer 74b6eddf8d storage-users: name the queue group the uploads command must stay out of
The driver no longer consumes postprocessing events: the upload
coordinator does, in the "dcfs" group, and the driver only consumes
DeleteRevision in "dcfs-revisions". The command still disables async
uploads so it does not join that group.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-12 11:11:30 +01:00