Commit graph

389 commits

Author SHA1 Message Date
Louis Chemineau
cec0b310a5 Move module versions management logic out of main logic
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-09-07 15:47:59 +02:00
Julius Härtl
bbb7172220
fix: Also cleanup version metadata if expiring
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-08-14 19:31:41 +02:00
jld3103
3dff41786d files_versions: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-07-13 10:20:09 +02:00
Louis Chemineau
eb71ee950d Enable all files versions features when groupfolders is enabled
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-07-05 15:52:13 +02:00
Christoph Wurst
95145ee0c9
feat(ocp): More specific type for ICapabilities::getCapabilities
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-07-03 10:03:45 +02:00
Louis Chemineau
05acd916b5 Base versions' has-preview on mimetype
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-06-29 12:08:59 +02:00
Louis Chemineau
36c3846475 Provide hasPreview in files_versions DAV API
This allow to no request non existing previews
I also set some properties to the img element to reduce preview loading to what the browser think is necessary

Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-06-28 16:46:48 +02:00
Louis Chemineau
7fec07196d Do not create a new version if previousNode has the same mtime
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-06-22 17:49:49 +02:00
Julius Härtl
b94145f6bd
fix: Add logging statement for cases when updating the version fails
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-06-21 10:35:12 +02:00
Louis Chemineau
ecdcc72e4d Handle previousNode size === 0 on version creation
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-06-21 09:56:20 +02:00
Julius Härtl
e76c96be5c
fix: Avoid failing to update the current version entry if there is none
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-06-13 22:10:13 +02:00
Benjamin Somers
75e04614c1 Enable version features again with S3 versioning
Signed-off-by: Benjamin Somers <bsomers@resel.fr>
2023-06-13 15:06:36 +02:00
Louis Chemineau
c3475f4dbb Fix initialisation of versions in the DB
Broken after https://github.com/nextcloud/server/pull/36690

Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-05-25 23:43:40 +02:00
Git'Fellow
d6eb48c436
Check if version has entity before trying to access it
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-05-12 16:00:16 +02:00
Git'Fellow
7cd5cbe6e9
Check if version entity is not null before delete
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-05-08 14:24:58 +02:00
Max
337fc110ec
fix: catch ManuallyLockedException and use app context
The files_lock app may throw ManuallyLockedExceptions
when attempting to revert a file that is currently opened.
This would prevent the user from rolling back a opened file.

Text and Richdocuments handle changes of the file while editing.
Allow reverting files even when they are locked by these apps
and let the apps handle the conflict.

Signed-off-by: Max <max@nextcloud.com>
2023-05-03 09:52:36 +02:00
Côme Chilliet
60b7d2117e
Merge pull request #37428 from nextcloud/enh/ignore-non-numeric-versions
Ignore and log non integer versions
2023-04-20 13:33:58 +02:00
Louis Chemineau
cca46f18eb Really disable versions features when S3 versioning is enabled
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-04-17 11:16:20 +02:00
Julius Härtl
2e1a560867
Merge pull request #36690 from nextcloud/bugfix/noid/rollback-hook 2023-04-14 17:09:17 +02:00
Côme Chilliet
a6b1d990a4
Check for non-numeric versions, not non-integer
All versions are string

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 17:50:45 +02:00
Côme Chilliet
8cc8765089
Ignore and log non integer versions
This avoids being stuck when there is one buggy file version with a
 non-integer version. It allows the expiration process to not crash and
 continue with the other ones.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 17:44:14 +02:00
Côme Chilliet
ea05544213
Fix return type of methods returning false on error
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-03 10:52:34 +02:00
Julius Härtl
f00f4244d4
fix: Check return type on rollback
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-03-13 10:59:33 +01:00
Robin Appelman
62e6a32899
don't re-get fileinfo for versioned file if it's not shared
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-03-13 10:52:37 +01:00
Julius Härtl
c22d51c1ad
tests(files_versions): Tear down fs to clear mount cache before testing
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-03-13 10:52:37 +01:00
Julius Härtl
cf46bd6915
fix: Make sure that rollback hook is triggered on all version backends
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-03-13 10:52:35 +01:00
Louis Chemineau
21cd3b0e0d Handle empty DB while expiring versions
Version on the FS can have no equivalent in the DB if they were created before the version naming feature. This makes sure that we catch the resulting exception and proceed as usual.

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

Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-02-08 13:56:49 +00:00
Côme Chilliet
1765908c03
Document that size may be a float in new class VersionEntity
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:34 +01:00
Louis Chemineau
88abb2d97c Fix versions restoring with S3
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
3da63f4148 Use node's owner if no user is connected
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
84e5b9c5f7 Prevent storing versions with the same mtime
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
6dcfb29cfc Fix renaming files_versions
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
c88328e68e Handle empty files in version creation logic
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
d8b479752d Fix hookconnector tests
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
53d736207c Adapt files_versions tests to modernized hooks
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
2ce4ac4aa4 User rootFolder instead of userFolder in FileEventsListener
Requesting userFolder fails during NC installation phase.

Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
8f23cc8259 Rename Hooks.php to FileEventsListener.php
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
ad469969bf Prevent expiration of named versions
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
1adc9d2aab Delete file versions entries in DB when node is deleted
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
6a2f8bc599 Allow to delete a version through DAV
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
629de6c8c9 Support getting and patching version-label
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +00:00
Louis Chemineau
e82bfba114 Create files_versions table
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:22 +00:00
Louis Chemineau
1ade482797 Modernise hook listener of files_versions
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:22 +00:00
Côme Chilliet
53cb5b8d07
Handle badly named version files more gracefully and log information
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-11 10:10:49 +02:00
Robin Appelman
9587a4a548
use filesystem user instead of file owner for creating version
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-09-09 16:22:40 +02:00
Robin Appelman
7be5788995
always use the default fs owner when storing versions
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-09-06 16:59:48 +02:00
Carl Schwan
48d9c4d2b0
Port existing server code to new interface
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-08 17:03:19 +02:00
Thomas Citharel
190a71ecf9
Expose additional emails in {DAV:}alternate-URI-set
This allows iMip invitations to be send with an alternative email as
"Reply-To" field.

Closes #27201

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-05-17 15:11:36 +02:00
Robin Appelman
d5953e5c33
cache internalpath in versions cleanup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:34 +02:00
Daniel Kesselberg
3293428ac0
Add configuration flag to disable the background job for files_versions
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2021-10-11 12:32:46 +02:00