Commit graph

543 commits

Author SHA1 Message Date
provokateurin
f5e3e97ea6
fix(files): Always return a valid mimetype
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-10-06 16:00:04 +02:00
Marcel Müller
5f70d36fb9 fix: Stop infinite loop in ExpireTrash
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
2025-09-25 15:36:54 +00:00
Joas Schilling
722d4b452f fix(trashbin): Translate Nextcloud exception to Sabre exception
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-09-19 12:51:49 +00:00
Kate
0e73460198
Merge pull request #54999 from nextcloud/backport/54950/stable31 2025-09-15 10:04:23 +02:00
provokateurin
5f3e1f2e63 fix(files_trashbin): Fix size propagation when moving file to trash
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-14 21:30:38 +02:00
Louis Chemineau
60455d724b feat(files_trashbin): Refactor expire background job to support parallel run
- Follow-up of #51600

The original PR introduced the possibility to continue an `ExpireTrash` job by saving the offset. This was to prevent having to start over the whole user list when the job crashed or was killed.

But on big instances, one process is not enough to go through all the users in a timely manner. Supporting parallel run allows covering more ground faster.

This PR introduced this possibility. We are now storing the offset right away to allow another parallel job to pick up the task at that point. We are arbitrarily cutting the user list in chunk of 10 to not drastically overflow the 30 minutes time limit.

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-09-11 16:10:25 +02:00
provokateurin
48fe23e772
Revert "fix(files_trashbin): Fix size propagation when moving file to trash"
This reverts commit b0a27e4dc4.

Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-10 09:00:41 +02:00
provokateurin
b0a27e4dc4
fix(files_trashbin): Fix size propagation when moving file to trash
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-10 07:27:23 +02:00
Côme Chilliet
7e401c80f1 fix(trashbin): Fix errors in the log on MOVE operations
dirname will return '.' for files at the root, which will cause an
 Exception that gets logged.
Instead use \Sabre\Uri\split like other sabre plugins, to get an empty
 string for root directory.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-08-28 12:23:05 +00:00
Ferdinand Thiessen
6fa0692323
fix(files_trashbin): has-preview must return true or false
Currently it returned the boolean value, but PHP will turn it into an
integer...

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-08-07 12:24:59 +02:00
Kent Delante
f8cce08595 fix(files_trashbin): Expire trashbin items when space is needed
Signed-off-by: Kent Delante <kent.delante@proton.me>
2025-07-16 08:00:28 +08:00
Kent Delante
5c38eef584 fix(files_trashbin): check if there is enough space before restoring
Signed-off-by: Kent Delante <kent.delante@proton.me>

[skip ci]
2025-05-27 08:16:35 +00:00
Louis Chemineau
def8bf3102
chore(files_trashbin): Add user details in log from Trashbin
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-04-07 15:39:42 +02:00
Louis Chemineau
bea43d14c8 fix: Catch exceptions when expiring trashbin
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-04-03 09:16:58 +00:00
Louis Chemineau
d6c16e95b0 chore: Use iterator in ExpireTrash command
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-04-03 09:16:58 +00:00
Louis Chemineau
27079eedeb feat: Limit trash expire job to 30 minutes
And pick up where it left off, leveraging getSeenUsers.

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-03-31 11:01:02 +00:00
Louis Chemineau
3250d71284 feat: Support X-NC-Skip-Trashbin header
This is useful for clients that want to directly and permanently delete a file.

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-01-24 17:58:14 +00:00
provokateurin
31c21c7797
feat(files_trashbin): Allow preventing trash to be deleted permanently
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-01-13 15:19:19 +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
Christopher Ng
119e7d1bd7 feat(trashbin): Add backend dav property
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2024-12-03 16:09:13 -08: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
f25a71806b
fix(apps): Fix wrong or missing casts
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-23 17:08:29 +02: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
dependabot[bot]
bb598c8451
chore(deps): Bump nextcloud/coding-standard in /vendor-bin/cs-fixer
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v1.3.1...v1.3.2)

---
updated-dependencies:
- dependency-name: nextcloud/coding-standard
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-19 07:57:35 +02:00
Git'Fellow
a1681b0756 chore(db): Apply query prepared statements
Fix: psalm

fix: bad file

fix: bug

chore: add batch

chore: add batch

chore: add batch

fix: psalm
2024-10-17 20:30:47 +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
provokateurin
6d8ffb381f
refactor(files_trashbin): Add Storage parameter strong types
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-07 15:00:07 +02:00
provokateurin
0356e9e82f
fix(files_trashbin): Fix all IStorage return types
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-26 17:29:22 +02:00
Côme Chilliet
b80bc81579
chore: Use SPDX headers and property promotion in new files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-23 18:13:29 +02:00
Carl Schwan
77821f8f3e
feat(trashbin): Port files trashbin events to IEventDispatcher/IEventListener
oc_hooks is deprecated and will at some point be removed

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-23 18:13:21 +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
Robin Appelman
42ea824fd7 fix: improve moving object store items to trashbin
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-19 21:01:44 +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
Côme Chilliet
03b969fb95
chore: Improve typing and phpdoc comments
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-16 20:29:48 +02:00
Côme Chilliet
492e6997d8
chore: Fix psalm issues, put back private versions of getter in private Storage interface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-16 18:11:38 +02:00
Anna Larch
8af7ecb257 chore: adjust code to adhere to coding standard
Signed-off-by: Anna Larch <anna@nextcloud.com>
2024-09-05 21:23:38 +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æ
d35c4eb911
Merge branch 'master' into jr-readdir-false-false
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
2024-08-16 10:53:50 +02:00
Kate
8c08ac0def
Merge pull request #46812 from nextcloud/refactor/files_trashbin/security-attributes 2024-08-14 09:46:28 +02:00
Stephan Orbaugh
5c54a3caa7
Merge pull request #46974 from nextcloud/fix/noid/add-metadata-to-migrationsteps
feat(migrations): add metadata to existing migrations
2024-08-06 13:27:04 +02:00
Ferdinand Thiessen
b5cd64e584
fix(files_trashbin): Original name of the deleted files should be set as display name for DAV
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-08-05 14:02:57 +02:00
Maxence Lange
5e1196095c feat(migrations): add metadata to existing migrations
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-08-02 18:26:12 -01:00
Joas Schilling
bfd96b070b
fix(trashbin): Improve documentation of since/until timestamps of restore trashbin
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-30 20:33:56 +02:00
provokateurin
220c6a2bd9
refactor(files_trashbin): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-07-27 21:33:47 +02:00
Robin Appelman
c82d382a20 feat: add base class for extending the query builder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-07-12 17:01:39 +02:00
Ferdinand Thiessen
dea5559d35
fix(files_trashbin): Make files view registering an init script
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-06-23 16:53:10 +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
Christopher Ng
583517eb38 feat(trashbin): Add deleted by properties
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2024-04-23 16:20:41 -07:00
Christopher Ng
caed644c03 chore(trashbin): Add method to get deleted by from trash item
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2024-04-23 16:20:41 -07:00
Christopher Ng
b41834fb8d chore(trashbin): Store deleted by user
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2024-04-23 15:15:02 -07:00