Commit graph

470 commits

Author SHA1 Message Date
Ferdinand Thiessen
2dcadd2603
fix(files_versions): only close stream if still open, fixing S3
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-18 16:48:56 +02:00
Ferdinand Thiessen
0f69648d0a
fix(files_version): use Storage::writeStream instead of deprecated streamCopy if possible
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-16 17:28:24 +02:00
Ferdinand Thiessen
01db539d0a
chore: move streamCopy implementation from OC_Helper to OCP\Files
The function was already there but called the legacy version.
So moved the implementation and migrated all usages of it.
Sadly the interface was slightly different so adjusted it to be
compatible with both legacy and the OCP one.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-16 13:03:05 +02:00
Côme Chilliet
2cd491f491
Merge pull request #48560 from nextcloud/fix/migrate-encryption-away-from-hooks
feat(encryption): Migrate from hooks to events
2025-05-14 19:25:51 +02:00
provokateurin
78a175fc74
refactor: Apply rector refactorings
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-05-14 15:29:02 +02:00
Côme Chilliet
536ccf144c feat(encryption): Migrate from hooks to events
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-05-13 23:37:52 +02:00
Git'Fellow
1b549d4943 fix(files_versions): Folder should not be hardcoed
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2025-05-09 09:35:17 +02:00
Ferdinand Thiessen
9df998e710
Merge pull request #52369 from nextcloud/fix/files-versions-author
fix(files_versions): wait for version to be created before setting metadata
2025-04-29 11:01:58 +02:00
Ferdinand Thiessen
8ca23f2c7d
fix(files_versions): only handle path updates when there is path
`getPathForNode` can fail with null for various reasons (e.g. no owner),
in this cases we need to just skip the event handling.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-27 23:51:56 +02:00
Ferdinand Thiessen
5e03c6fb58
fix(files_versions): create version if previous does not exist
This issue happens reproducible if:
- Versions is disabled
- Upload a file
- Enable versions
- Upload same file unchanged
- Now the error happens.

Problem is that the mtime is unchanged so no version will be created on the upload, but it tries to update the last version which does not exists.
Instead of "upload same file unchanged" you can also - like in the example stack trace above - use Android with an SD card with invalid mtime -> the mtime will be stripped so its always the same.
Instead of disable versions the same also happens if e.g. the versions creation failed due to other issues.

The solution now is to catch the exception and create if not exists.
A cleaner solution would be to have a method on the versions backend
like `hasVersionEntity(File $file, int $revision): bool` but this would
be a breaking change or at least a feature that apps need to implement.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-23 16:03:20 +02:00
Ferdinand Thiessen
2020760f88
fix(files_versions): wait for version to be created before setting metadata
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-23 13:09:43 +02:00
provokateurin
936166939c
feat(files_versions): Implement preview mime icon fallback
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-03-27 08:56:45 +01:00
provokateurin
89779808e0
fix(files_versions): Cache previews
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-03-27 08:56:45 +01:00
Stephan Orbaugh
ef099806a4
Merge pull request #50990 from AIlkiv/refactor/version-rollback-to-event
refactor: move version rollback hook to event
2025-02-27 15:03:37 +01:00
Louis
9682ef7025
Merge pull request #50903 from nextcloud/artonge/fix/min_age_rentention_files_versions
fix(files_versions): Do not expire versions newer than min age
2025-02-25 16:01:05 +01:00
ailkiv
9b3424f607 refactor: move version rollback hook to event
Signed-off-by: ailkiv <a.ilkiv.ye@gmail.com>
2025-02-25 14:03:21 +00:00
Kostiantyn Miakshyn
9bba153e4f Fix: NotFoundException for anonymous users
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
2025-02-21 18:24:11 +01:00
Louis Chemineau
4561a0a870 fix(files_versions): Do not expire versions newer than min age
The auto expire logic does not take into account the min retention age set by the admin. So versions were eagerly deleted.

Fix https://github.com/nextcloud/server/issues/19791

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-02-19 12:25:09 +01:00
Côme Chilliet
64863c9d46
chore: Apply new rector configuration to apps folder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-13 11:46:42 +01:00
Côme Chilliet
f758f565d4
fix: Replace getInstalledApps calls with getEnabledApps
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-13 10:19:20 +01:00
Louis Chemineau
c87db7a960 fix(files_versions): Update unencrypted_size during rollback
This prevent restored version of encrypted files from having a wrong reported size. This was blocking download.

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-01-28 15:28:34 +01:00
Louis Chemineau
5336c92ca5 chore(files_versions): Remove unused $node variable
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-01-28 15:28:34 +01:00
provokateurin
085d4c9364
refactor(OpenAPI): Adjust scopes to match previous behavior
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-01-06 14:30:40 +01:00
Louis Chemineau
f6c48a45ae
fix: Correctly create NonExistingFolder during copy
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-12-04 15:38:35 +01:00
provokateurin
77114fb327
fix(OpenAPI): Adjust array syntax to avoid ambiguities
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-11-05 09:58:11 +01:00
provokateurin
381077028a
refactor(apps): Use constructor property promotion when possible
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-21 12:37:59 +02:00
Côme Chilliet
1580c8612b
chore(apps): Apply new rector configuration to autouse classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-10-15 10:40:25 +02:00
Côme Chilliet
1a4978c4ea
chore: Apply rector configuration to apps folder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-20 17:51:00 +02:00
provokateurin
9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +02:00
provokateurin
dc13f9cc1e
fix(Files): Handle getOwner() returning false
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-17 10:10:50 +02:00
Daniel Kesselberg
af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02:00
John Molakvoæ
1fa9d3987b
Merge pull request #46887 from nextcloud/fix/versions-catch-insertion-error 2024-08-14 10:32:45 +02:00
Kate
1044b7f0b9
Merge pull request #46813 from nextcloud/refactor/files_versions/security-attributes 2024-08-14 09:46:46 +02:00
Ferdinand Thiessen
4bbcbc5206
feat: Make ISharedStorage public API and reuse where possible
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-08-12 11:42:10 +02:00
Stephan Orbaugh
199ee80795
Merge pull request #46710 from nextcloud/artonge/fix/use_timestamp_instead_of_revision
fix: Use timestamp instead of revision id in files_versions metadata API
2024-08-06 15:00:41 +02:00
Côme Chilliet
30a2e8f9b8
fix(files_versions): Catch constraint error on version insertion
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-07-30 17:09:10 +02:00
provokateurin
2c8f6a009a
refactor(files_versions): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-07-27 21:34:00 +02:00
greta
26d22881e5 fix: add a try and catch for delete versioning
Signed-off-by: greta <gretadoci@gmail.com>
2024-07-25 14:46:06 +02:00
carhe
7eac3fe7da fix(files_versions): avoid unintentional skipping of expiration
Signed-off-by: carhe <carstenherrmann@web.de>
2024-07-25 12:29:04 +02:00
Louis Chemineau
6e76aed867
fix: Use timestamp instead of revision id in files_versions metadata API
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-07-24 09:34:13 +02:00
Andy Scherzinger
afa48a4e0e
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-06-02 20:00:00 +02:00
Louis Chemineau
369274c9ee
feat(files_versions): Add listener and interfaces to allow versions migration across storages
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-03-26 17:40:31 +01:00
Louis
ddb84f9738
Merge pull request #44362 from nextcloud/artonge/feat/check_permissions_of_all_nodes_for_versions
Check permissions of all accessible file for versions
2024-03-22 20:35:11 +01:00
Louis Chemineau
a15c0d6515
Merge pull request #44297 from nextcloud/fix/forbid-tagging-readonly-files
Forbid tagging readonly files

Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-03-21 15:10:30 +01:00
Louis Chemineau
673a851848 refactor(files_versions): Rename MetadataFileEvents to VersionAuthorListener
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-03-21 12:30:01 +01:00
John Molakvoæ
2ff172004a
Merge pull request #43613 from nextcloud/version-owner-fallback 2024-03-16 13:23:06 +01:00
Louis Chemineau
9361a305ba
chore(files_versions): Use new metadata API for versions
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-03-13 15:27:06 +01:00
Eduardo Morales
c5d1fda4ab fix: fixed stylistic errors
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
2024-03-11 15:57:12 -05:00
Eduardo Morales
a8844d408b fix(files_version): deprecated INameableVersion
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
2024-03-11 15:57:12 -05:00
Eduardo Morales
4cf4fdc278 feat: exposed metadata column to frontend
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
2024-03-11 15:57:12 -05:00