A new cliCommands feature, cleanupFileVersions.feature, tests the
"storage-users revisions cleanup" command against a running server,
checking the remaining versions through the WebDAV versions API:
- keeping the newest version of every file in all spaces
- a dry run, which deletes nothing
- only a folder within the personal space (--space with --path)
- only a project space (--space)
- the JSON output (--json)
- no strategy while the configured one is disabled: exit code 1
- a timeout: exit code 2, nothing deleted
- a strategy without spaces after its commas ("auto,1"), as the CLI
wrapper splits commands on spaces
- a folder by its path on disk (--fs-path), posix only
- the configured strategy (STORAGE_USERS_REVISIONS_CLEANUP_STRATEGY),
which cleans up a file whenever it gets a new version: without
background workers, and with them, the default
- the configured strategy for uploads with TUS, as the web UI and the
clients upload
- the age of a version, which is the time its content was written:
uploads with an older modification time (X-OC-Mtime) make versions
that "30d" deletes right away, while "1,30d" keeps the newest one
- restoring a version with the strategy "0": the content from before
the restore is kept, so that the restore can be undone
A second feature, collaborativePosix/cleanupFileVersions.feature, tests
the versions that changes on the POSIX filesystem create, with
STORAGE_USERS_POSIX_ENABLE_FS_REVISIONS: the configured strategy cleans
up a file whenever a change on disk creates a version, with and without
background workers, and the command deletes such versions. The
collaborativePosix suite doesn't run in the CI for now
(https://github.com/opencloud-eu/opencloud/issues/2036), so these
scenarios are ready for when it does again; they pass locally. The
suite gets the FilesVersionsContext, whose steps its existing version
scenarios already use.
New steps: in CliContext, running the command for all spaces, a space,
a path within a space, a path on the POSIX filesystem, or with flags
only; checking the exact exit code; and checking the objects of a JSON
output, which "the command output should contain" can't match as it
contains quotes. In FilesVersionsContext, a number of versions that is
checked until it matches, for the cleanup that runs in the background
after postprocessing. In WebDav, the Given form of an upload with
content and a modification time.
Assisted-by: Claude Code:claude-opus-5-5
A federated editor share of a folder now carries the permissions of
the Editor role, so the graph API returns a role for it instead of a
list of permission actions. Changing the role of a federated share now
notifies the remote, so the remote user can write to the file after
the sharer upgraded the share to File Editor. Accepting an expired
invitation returns the actual reason, "token not valid", instead of
always claiming the token expired.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
The ldap-server step copied our LDIF files to a directory the bitnami
image never reads, so the image created its own default tree. Our
entrypoint override then polled until LDAP answered and imported the
files with ldapadd. That races with the image setup: it answers on a
temporary slapd that gets shut down when setup finishes. In
https://ci.opencloud.rocks/repos/3/pipeline/5531/21 10_base.ldif failed
with "Already exists" and 20_users.ldif was cut off by the slapd
shutdown, so there was no admin user and the multiTenancy server never
became ready.
We now point LDAP_CUSTOM_LDIF_DIR at the LDIF files. The image imports
them during setup, before slapd listens, and skips its default tree.
The override only creates the TLS certificate.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
The reva bump pulls in three backports that change what the acceptance
tests see:
- moving now also requires the delete permission, so a sharee with the
Uploader role gets a 403 when moving inside a share
- oc:permissions only contains NV when the user can move, so a file
shared as File Editor now reports SW instead of SNVW
- shares listed in the share jail root report the share jail root as
their parent id, so propfindShares.feature:149 passes now
The Uploader rows move from the "can move" outlines to the "cannot
move" outlines. This shifts one scenario in moveSpaces.feature by three
lines, the expected failures lists are updated accordingly.
related: https://github.com/opencloud-eu/reva/pull/1020
related: https://github.com/opencloud-eu/reva/pull/1023
related: https://github.com/opencloud-eu/reva/pull/1024
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
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
When the transfer of a response broke off after its headers, e.g.
because the server aborted it, sendRequestOnce caught the exception and
passed the incomplete response on as if it were complete. Tests then
failed later, and misleadingly, e.g. with a JsonException on the cut-off
body, or passed when they only checked the status code.
Re-throw Guzzle's ResponseTransferException, so that such a test fails
at the request, with the transfer error (e.g. cURL error 18).
Refs #4008
Assisted-by: Claude Code:claude-opus-5-5
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
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.
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
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
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>
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>
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
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>
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>
Removing a tag that the resource doesn't have failed with 400 and a
message about assigning tags ("no new tags in createtagsrequest or
maximum reached"). The tags of the resource are then already as
requested, so it now succeeds instead, without writing the unchanged
tags back.
The TagsRemoved event is published in that case too, so that the search
index drops tags that it has but the resource doesn't, which could
otherwise only be removed by assigning them first.
A request without any tags is still rejected with 400, now before
looking up the resource.
The log entries of the request now carry the requested resource id and
the tags, and a failure to store the tags logs the status of the
storage. The log message for a failed TagsRemoved event no longer calls
it TagsAdded.
Assisted-by: Claude Code:claude-opus-5-5
The padding kept the scenario line numbers stable but trips the
newline_before_scenario gherlint rule. The three scenarios are the last
ones in the file and nothing refers to their line numbers, so they can
just move up.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Updating a permission or a space root permission did not check the
roles an administrator enabled with GRAPH_AVAILABLE_ROLES. An invite
with a disabled role was rejected, but the same role could be set by
updating an existing share. We now validate updates against the
allowlist, same as invites.
The three "without enabling it" scenarios now expect a 400. Their
removed lines are padded with blank lines so the line numbers of the
scenarios stay the same.
ported from `owncloud/ocis#12540`. The reva half
(`owncloud/reva#653`) is https://github.com/opencloud-eu/reva/pull/993
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Updating a drive with an empty name ("name": "") succeeded and silently
kept the old name, because the name was only validated when it was
non-empty. Validate it whenever the request contains it, so an empty
name is rejected with 400 like on create. A request without a name, or
with "name": null, still leaves the name unchanged.
Space names were trimmed with strings.TrimSpace, which only removes
Unicode whitespace. Invisible formatting characters such as the
zero-width space (U+200B), the word joiner (U+2060) or the byte order
mark (U+FEFF) aren't whitespace, so a name made only of them was
accepted on create and on update, and showed up as an empty name in
every client. Trim these characters from both ends of the name as
well. Inside a name they are still allowed, since some of them are
needed there, e.g. the zero-width joiner in emoji sequences.
Assisted-by: Claude Code:claude-opus-5-5
The drive item name was derived from the resource path. Space roots
have no path ("."), so e.g. the sharedByMe response reported "." as
the name of a shared project space. Use the name provided by the
storage provider and fall back to the base of the path if it is empty.
Adjust the sharedByMe acceptance scenario for link shares of a
project space accordingly: the space root item now carries the name of
the space.
* tests: add acceptance tests for renewing guest links
Cover renewing a guest link with and without a session, the PIN, rate limiting and the expiry of the session and the PIN.
* tests: replay used PIN with its nonce in PIN-once scenario
The service is thumbnails and its released variables say so; the new ones said THUMBNAIL. None of them has shipped yet, so they are renamed rather than aliased. The input file size gains the shared OC_THUMBNAILS_ name, because webdav and the generator have to agree on it.