Commit Graph
5443 Commits
Author SHA1 Message Date
Sara Ahmadi e7ddde8ce0 Merge pull request #4114 from asaah262/test/861-auth-app-token-label
test(auth-app): cover custom labels of app tokens and document the label parameter
2026-11-25 09:16:15 +01:00
Sara Ahmadi f4ab61990d Merge pull request #4116 from asaah262/fix/865-hsts-include-subdomains
fix(proxy): add includeSubDomains to the Strict-Transport-Security header
2026-11-25 09:11:48 +01:00
opencloudeu 99899755c6 [tx] updated from transifex 2026-11-24 23:17:30 +00:00
Florian Schade 93a514c6da Merge pull request #4113 from fschade/fix-search-extraction-state
feat(search): keep tika out of tag updates and retry incomplete extractions
2026-11-24 18:27:49 +01:00
Florian Schade cf5a087de2 fix(search): index files by name while tika is unreachable 2026-11-24 17:51:11 +01:00
Florian Schade 7577dbfd5d fix(search): cap and space the retries of unparsable files 2026-11-24 17:37:54 +01:00
Sara Ahmadi b9a39ea2d5 fix(proxy): add includeSubDomains to the Strict-Transport-Security header
Assisted-by: Claude Code:claude-opus-5-5
2026-11-24 16:55:55 +01:00
Florian Schade 8dc18b7f1d refactor(search): drop UpsertItem and reuse the stat in UpdateMetadata 2026-11-24 16:44:45 +01:00
Florian Schade 23f890cd62 fix(search): index failed extractions by name and retry them 2026-11-24 16:23:29 +01:00
Florian Schade 6cfc198663 fix(search): keep existing index entries out of the upgrade reindex 2026-11-24 16:20:57 +01:00
Sara Ahmadi 05933a6932 test(auth-app): cover custom labels of app tokens and document the label parameter
Assisted-by: Claude Code:claude-opus-5-5
2026-11-24 15:18:06 +01:00
Florian Schade 4e3d952c13 fix(search): keep tika out of tag updates and retry incomplete extractions 2026-11-24 14:12:19 +01:00
Sara Ahmadi 9095f76f52 feat(audit): log the space name when a space is deleted
Assisted-by: Claude Code:claude-opus-5-5
2026-11-24 13:14:50 +01:00
Pascal Bleser 0b73e9ecf8 Merge pull request #3778 from pbleser-oc/feat/1419-clean-up-file-versions
feat: clean up old revisions according to a cleanup strategy
2026-11-24 12:15:43 +01:00
Florian Schade 27b89c8e1a Merge pull request #3652 from opencloud-eu/feat/search-report-facets
feat(webdav): add facets to REPORT hits
2026-11-24 11:53:04 +01:00
Sara Ahmadi 4e0b8f483b Merge pull request #4092 from asaah262/test/856-basic-challenge-app-auth
test(proxy): cover the authentication challenges for basic auth and app tokens
2026-11-24 11:46:12 +01:00
Sara Ahmadi 245bc7aa66 Merge pull request #4101 from asaah262/fix/858-selector-cookie-flags
fix(proxy): set Secure, HttpOnly and SameSite=Strict on the policy selector cookie
2026-11-24 11:45:23 +01:00
Sara Ahmadi 1aa9a5a80d test(proxy): build the test metrics from the default config
Assisted-by: Claude Code:claude-opus-5-5
2026-11-24 11:31:53 +01:00
Pascal Bleser 5e8a88a05f feat: 1419: clean up revisions by the time they were created
Follows opencloud-eu/reva#895, which makes the revision cleanup go by
the time a revision was created, recorded by the server, instead of the
modification time of its content, which clients choose with X-OC-Mtime.
"auto" keeps the oldest revision of each slot (#3735).

- The storage-users README explains the new age of a revision.
- The acceptance scenario outline that checked the age as the time the
  content was written is replaced by two scenarios: versions whose
  content is dated 60 and 50 days ago are kept by "30d", and a version
  with content dated 10 years ahead doesn't push out the newest one
  under "1".

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Pascal Bleser a9b16e6745 fix: 1419: describe what a file metadata cache local to each process does
The revisions cleanup command, its help and the README said that, with
a cache local to each process, the server would keep listing the
revisions the command deleted until their cache entries expire or it
restarts. It doesn't: the server lists the revisions of a file from
disk. What it doesn't learn about is that they were deleted, so a list
of versions that is already open, e.g. in the Versions panel, keeps
showing them, and downloading or restoring one of them fails.

The command still refuses to run with such a cache, unless
--allow-local-cache is given: a shared cache is the right setup for a
command that changes the storage next to the server.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Pascal Bleser 498e5030e7 feat: 1419: let a dry run of the revisions cleanup keep a cache of its own
A dry run reads the metadata of every file it looks at. With a file
metadata cache shared with the server, e.g. 'nats-js-kv', it filled
that cache with entries for all of them, for a run that changes
nothing.

A dry run now always keeps its file metadata cache in its own memory,
whatever is configured. It doesn't need the shared cache: it deletes
nothing the server would have to see, and a cache of its own starts
empty, so it reads the metadata from disk. A real run still uses the
configured cache, which must be shared.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Pascal Bleser cae8a78da9 docs: 1419: a restore keeps the revision of the replaced content
The revision cleanup doesn't apply the strategy to the revision a
restore created of the content it replaced, not even an age limit,
as long as the file has the restored content. Say so next to the
strategies, as it is an exception admins wouldn't expect.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Pascal Bleser 1b0a81f39d feat: 1419: refuse to clean up revisions with a file metadata cache local to each process
The revisions cleanup command runs in a process of its own. With a file
metadata cache that each process keeps in its own memory ('memory', the
default, or 'ocmem'), the server doesn't learn about the revisions the
command deletes: a list of versions that is already open, e.g. in the
Versions panel, keeps showing them, and downloading or restoring one of
them fails. A new list is right, as the server lists them from disk.

The command now refuses to run with such a cache. The error says how to
share the cache (STORAGE_USERS_FILEMETADATA_CACHE_STORE=nats-js-kv, not
OC_CACHE_STORE, which sets the cache store of all services) and that
--allow-local-cache runs it anyway. A dry run deletes nothing and runs
with any cache.

The acceptance tests pass --allow-local-cache: their server runs with the
default cache, and they check the versions through the API, which lists
them from disk.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Pascal Bleser 26a7b4f903 feat: 1419: add a command to clean up old revisions on demand
'opencloud storage-users revisions cleanup' deletes old revisions,
according to a cleanup strategy, of:

- the files of spaces (--space, repeatable),
- or of a file or folder within a space (--space with --path),
- or of all spaces (--all),
- or of a file or folder given by its path on disk (--fs-path, posix
  only).

The id of a file or folder is rejected as the id of a space, as the
command would otherwise clean up its whole space. So is an id without a
space id, e.g. 'storage$'.

The storage-users service only cleans up the revisions of a file when it
gets a new one. The command also covers the files that are not changed
anymore, and applies a different strategy once.

The strategy and the settings of the background workers default to the
configured ones (STORAGE_USERS_REVISIONS_CLEANUP_*), and can be
overridden with --strategy, --async, --workers and --queue-size. Only
--queue-full defaults to 'block' without a timeout, whatever is
configured: the command finds files faster than the workers clean them
up, so dropping the files that find the queue full, or giving up after
the timeout meant for uploads, would skip most of them.
--queue-full-timeout sets one for the run.

The command uses the storage driver directly, in its own process, like
'uploads sessions': posix neither scans nor watches the file system, and
no driver joins the postprocessing consumer group of the service.

For posix, the driver needs NATS for its event stream. The command waits
for it 10 seconds at most, instead of the 15 minutes the stream retries
for, and ctrl-c also stops that wait: with the single binary, NATS only
runs within the server (opencloud-eu/opencloud#3805). The driver gets
the logger of the command: posix passes it on to the NATS connections
of its id cache, whose handlers would panic on a lost connection
without one. Ctrl-C also stops waiting for the driver, e.g. for the id
cache, which retries for up to 15 minutes as well.

Unless it is a dry run, which changes nothing on disk, the command
warns when the storage belongs to another user than the one it runs as,
e.g. root: the lock files it creates belong to that user, and the
server may not be able to lock these files anymore.

Output: a line for every file whose revisions were deleted, that failed
or that was skipped, with its path within its space, and a summary;
--verbose adds every file and every revision with the decision and its
reason; --json prints the same as JSON objects, one per line, with a
final summary object. --dry-run deletes nothing.

--timeout stops the cleanup gracefully, as does ctrl-c, and a second
ctrl-c ends the command right away, which can leave the blob of a
deleted revision behind; the help says so. Whether the timeout or ctrl-c
stopped the cleanup is told by the contexts of the command, not by the
error: the storage can return context errors of its own. --shuffle walks
the spaces and folders in a random order, so that repeated runs that
are stopped by the timeout, e.g. from a cron job, eventually reach all
files. The help explains that a file waiting for a lock can't be
interrupted, and that a dry run changes nothing on disk, but decides on
a snapshot, as it doesn't keep the files locked while it decides.

The common flags have short forms: -a (--all), -p (--fs-path),
-s (--strategy), -n (--dry-run), -v (--verbose), -j (--json) and
-t (--timeout).

Exit codes:

- 0 when done,
- 1 if the cleanup or any file failed, or if it was interrupted,
- 2 if the timeout stopped the cleanup before all files were cleaned
  up.

The storage-users README documents the command, along with the cleanup
strategies and how they relate to the configured cleanup.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Pascal Bleser 7676730860 feat: 1419: configure the revision cleanup of the storage-users drivers
Wire reva's revision cleanup options into the 'decomposed', 'decomposeds3'
and 'posix' drivers, in the storage provider and in the data provider.

The options are a single 'revisions_cleanup' section of the storage-users
configuration, next to 'filemetadata_cache' and 'id_cache', as only one
driver is used at a time. Its environment variables:

- STORAGE_USERS_REVISIONS_CLEANUP_STRATEGY: which old revisions to
  delete whenever a file gets a new revision, e.g. 'auto', '30d' or
  '7d, auto, 90d'
- STORAGE_USERS_REVISIONS_CLEANUP_ASYNC: run the cleanup in background
  workers
- STORAGE_USERS_REVISIONS_CLEANUP_ASYNC_WORKERS: number of background
  workers
- STORAGE_USERS_REVISIONS_CLEANUP_ASYNC_QUEUE_SIZE: number of files that
  can wait
- STORAGE_USERS_REVISIONS_CLEANUP_ASYNC_QUEUE_FULL: 'drop' or 'block'
- STORAGE_USERS_REVISIONS_CLEANUP_ASYNC_QUEUE_FULL_TIMEOUT: how long
  'block' waits for room at most, 0 for as long as it takes

The strategy defaults to 'disabled', which keeps all revisions as before.
The other defaults are reva's: background workers, with the number of
workers and the queue size determined automatically, dropping the
cleanup of a file when the queue is full (it is cleaned up with its
next revision), and a timeout of 5s for 'block'.

Other commands that create a driver, 'posixfs scan' and 'uploads
sessions', clean up revisions without background workers: they could
exit before the workers are done, and stop the cleanup of a file
midway.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Sara Ahmadi dc749a39bb Merge pull request #4097 from asaah262/fix/857-auth-app-user-not-found
fix: return 404 when creating an app token for an unknown user
2026-11-23 19:03:29 +01:00
Sara Ahmadi 82d6b0d1b1 fix(proxy): set Secure, HttpOnly and SameSite=Strict on the policy selector cookie
Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 18:54:46 +01:00
Dominik Schmidt c3d9b93238 test(webdav): cover every photo field and a hit without facets 2026-11-23 18:03:37 +01:00
Dominik Schmidt 927df2bdce feat(webdav): carry the facets in the search REPORT hits
The search service returns audio, location, image, photo, video, motion photo and live photo with every hit, the REPORT response only carried photo and location, as flat oc:photo-* props. All facets are now rendered in the xml shape PROPFIND uses, so a client reads both the same way. This replaces the flat props.
2026-11-23 17:44:23 +01:00
Florian Schade 9afb99f54a Merge pull request #4096 from fschade/feat-search-photo-props-numeric-ranges
feat(search): return photo metadata and allow ranges on numeric fields
2026-11-23 17:33:06 +01:00
Florian Schade ba5da33c42 Merge pull request #4094 from fschade/fix-search-reindex-walk
fix(search): descend into unchanged folders and skip failed uploads
2026-11-23 17:32:42 +01:00
Sara Ahmadi 41112716fe fix: return 404 when creating an app token for an unknown user
Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 16:11:30 +01:00
Florian Schade 5fe4935e7f feat(search): return photo metadata and allow ranges on numeric fields 2026-11-23 15:47:15 +01:00
Jörn Friedrich Dreyer 9f1fbc4480 fix(ocs): never hand out signing keys to link visitors
A public link token carries the link owner as user. If a link visitor
ever reaches GetSigningKey they get the owner's signing key and can sign
urls for everything the owner can read, until the key expires. Today the
proxy public paths and the reva link scope keep visitors away from the
endpoint, this adds the check in the handler itself.

We now refuse guests and users with a public-share-role in the opaque,
before reading or creating the key.

ported from https://github.com/owncloud/ocis/pull/12332
related: https://github.com/opencloud-eu/omega/issues/879

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-23 15:33:15 +01:00
Florian Schade 4c25436e4e fix(search): descend into unchanged folders and skip failed uploads 2026-11-23 15:33:09 +01:00
Sara Ahmadi 814a2a763f test(proxy): cover the authentication challenges for basic auth and app tokens
Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 14:53:40 +01:00
Alex Ababii d43947a209 Merge pull request #3876 from maki5/feat/personal_space_permissions
feat(permissions): new permissions for personal spaces
2026-11-23 13:05:40 +01:00
opencloudeu 627c375c03 [tx] updated from transifex 2026-11-20 23:17:33 +00:00
Alex Ababii ddea1f00c3 feat(permissions): upd permissions description 2026-11-20 17:24:04 +01:00
Alex Ababii bd23beb0f1 feat(permissions): new permissions for personal spaces 2026-11-20 17:24:04 +01:00
Jörn Friedrich Dreyer 2dc0668893 Merge pull request #4073 from dragonchaser/backport-wp3-778
fix(graph): keep the given expiration time of public links
2026-11-20 09:30:42 +01:00
Alex Ababii 1bf81a7ff1 fix(graph): upd guest share type for driveitems 2026-11-19 16:57:24 +01:00
Alex Ababii b93909a5c7 fix(graph): upd driveItem details to return guest type 2026-11-19 16:57:24 +01:00
Alex Ababii 10e231e13a fix(graph): tmp handle the share type guest on drive items info 2026-11-19 16:57:24 +01:00
Roman Perekhod 436fb35dbb Fix the expiration date response for links 2026-11-19 15:48:14 +01:00
opencloudeu c97aff7230 [tx] updated from transifex 2026-11-18 23:17:11 +00:00
Pascal Bleser e6c2215bab Merge pull request #3891 from pbleser-oc/fix/3889-get-tags-sorted-limit
fix(graph): list the tags in use sorted and cut at a fixed limit
2026-11-18 19:36:03 +01:00
Jörn Friedrich Dreyer c0a334f173 Merge pull request #4032 from opencloud-eu/feat/disable-new-shares
feat(sharing): allow disabling the creation of new shares
2026-11-18 13:33:38 +01:00
Pascal Bleser 7ed534d191 fix(graph): sort the listed tags in byte order
Byte order is the order in which search engines sort keyword values,
e.g. an OpenSearch terms aggregation ordered by key. With the same
order, the search can return just the first tags of every space, and
merging those lists still gives exactly the first tags overall. A
case-insensitive order would need an aggregation on a lowercased copy
of the field, with a mapping change, a reindex and the loss of the
original casing.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-18 11:28:47 +01:00
Pascal Bleser f45248336a fix(graph): list the tags in use sorted and cut at a fixed limit
GetTags collected the tags of all search results into a tags.Tags
object, which is meant for the tags of a single resource: it stops
accepting tags at 100 and puts new tags in front. So when more than 100
distinct tags were in use, the response held an arbitrary 100 of them,
and the order changed with the order of the search results.

Collect the distinct tags, sort them case-insensitively (ties in byte
order), and cut the list at the documented constant maxListedTags (100).
An empty list is still rendered as "value": [].

Fixes #3889

Assisted-by: Claude Code:claude-opus-5-5
2026-11-18 11:01:55 +01:00