Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9a73833
Restore and delete operations in trashbin will affect versions
jvillafanez Aug 16, 2022
43cc172
Homogenize calls to delete permanently from the trashbin
jvillafanez Aug 16, 2022
cc69e2e
Homogenize restore calls for trashbin
jvillafanez Aug 17, 2022
731c0d6
Adjust tests and code to new method calls
jvillafanez Aug 17, 2022
441216f
Fix case with d66 and similar extensions
jvillafanez Aug 17, 2022
710adae
Update docs
jvillafanez Aug 17, 2022
136cebd
Add changelog entry
jvillafanez Aug 17, 2022
4032d73
Fix wrong path
jvillafanez Aug 17, 2022
8074a30
Files_external mount config will show group displaynames
jvillafanez Oct 10, 2022
06ce947
Add changelog entry
jvillafanez Oct 10, 2022
ce35a4f
(graph api) determine group existing using gruopname
saw-jan Nov 7, 2022
0f860ba
Bump socket.io-parser from 4.0.4 to 4.0.5 in /build
dependabot[bot] Nov 9, 2022
9334460
Merge pull request #40476 from owncloud/test/get-with-groupname
individual-it Nov 10, 2022
df3b1a6
demo branch to test inbucket API
SagarGi Oct 18, 2022
858668c
Merge pull request #40484 from owncloud/dependabot/npm_and_yarn/build…
phil-davis Nov 10, 2022
1eadb3c
[tx] updated from transifex
ownclouders Nov 10, 2022
1dfc04c
Merge pull request #40291 from owncloud/fix_versions_in_trashbin
jvillafanez Nov 10, 2022
32da6b0
Merge pull request #40412 from owncloud/fix_applicable_group_displayname
jvillafanez Nov 10, 2022
5b79ced
Automated changelog update [skip ci]
jvillafanez Nov 10, 2022
f885fc3
Replace mailhog email service with inbucket email service
SagarGi Oct 19, 2022
a021d11
Merge pull request #40442 from owncloud/inbucketTestBranch
phil-davis Nov 10, 2022
47e5eaf
[tx] updated from transifex
ownclouders Nov 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .drone.star
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ATMOZ_SFTP = "atmoz/sftp"
DRONE_CLI_ALPINE = "drone/cli:alpine"
MAILHOG_MAILHOG = "mailhog/mailhog"
INBUCKET_INBUCKET = "inbucket/inbucket"
MINIO_MC_RELEASE_2020_VERSION = "minio/mc:RELEASE.2020-12-10T01-26-17Z"
OC_CI_ALPINE = "owncloudci/alpine:latest"
OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier"
Expand Down Expand Up @@ -1734,7 +1734,7 @@ def acceptance(ctx):
makeParameter = "test-acceptance-cli"

if params["emailNeeded"]:
environment["MAILHOG_HOST"] = "email"
environment["EMAIL_HOST"] = "email"

if params["ldapNeeded"]:
environment["TEST_WITH_LDAP"] = True
Expand Down Expand Up @@ -2134,7 +2134,7 @@ def emailService(emailNeeded):
if emailNeeded:
return [{
"name": "email",
"image": MAILHOG_MAILHOG,
"image": INBUCKET_INBUCKET,
}]

return []
Expand All @@ -2145,7 +2145,7 @@ def waitForEmailService(emailNeeded):
"name": "wait-for-email",
"image": OC_CI_WAIT_FOR,
"commands": [
"wait-for -it email:8025 -t 600",
"wait-for -it email:9000 -t 600",
],
}]

Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ <h2 id="unreleased" class="version"> Changelog for ownCloud Core [unreleased] (U
</p>
<h3 id="unreleased-summary">Summary</h3>
<ul class="summary">
<li class="type-bugfix changelog-item">Bugfix - Properly remove file versions from the trashbin: <a href="https://github.com/owncloud/core/issues/40286">#40286</a></li>
<li class="type-bugfix changelog-item">Bugfix - "available for" in the mount point configuration will show displaynames: <a href="https://github.com/owncloud/core/pull/40412">#40412</a></li>
<li class="type-bugfix changelog-item">Bugfix - Skip public links when updating permissions of share's children: <a href="https://github.com/owncloud/core/pull/40420">#40420</a></li>
<li class="type-change changelog-item">Change - Allow specifying available space for objectstorages: <a href="https://github.com/owncloud/core/pull/40192">#40192</a></li>
<li class="type-change changelog-item">Change - Drop PHP 7.3 support across the platform: <a href="https://github.com/owncloud/core/pull/40394">#40394</a></li>
Expand All @@ -17,6 +19,29 @@ <h3 id="unreleased-summary">Summary</h3>
</ul>
<h3 id="unreleased-details">Details</h3>
<ul class="details">
<li class="type-bugfix changelog-item">
<p>Bugfix - Properly remove file versions from the trashbin: <a href="https://github.com/owncloud/core/issues/40286">#40286</a></p>
<p>Previously, restoring or removing a file from inside a folder that was deleted (so the folder
and the contents are in the trashbin) didn't remove the versions of the file. Those versions
were left in both the DB and the FS, taking space and degrading the performance.This is now being handled properly, so no additional resource is consumed due to the versions
being left stranded.
</p>
<p>https://github.com/owncloud/core/issues/40286<br>
</p>
</li>
<li class="type-bugfix changelog-item">
<p>Bugfix - "available for" in the mount point configuration will show displaynames: <a href="https://github.com/owncloud/core/pull/40412">#40412</a></p>
<p>The "available for" select of the mount configuration of external storages were using the
group id. This wasn't a problem because for local groups the group id matches the group
displayname, and for ldap groups the group id was the "cn" attribute. Due to recent changes, the
ldap group will now use the objectuid attribute (or a similar attribute) as group id by default.
This was causing the "available for" select to show that objectuid, so identifying the right
group was problematic.Now, the "available for" select will show the group displayname, which for ldap is the "cn"
attribute by default.Note that this happens on new installations. There is an automatic migration in place, so for
upgrades, the "cn" attribute will be set as groupname in order to keep the old behavior
</p>
<p>https://github.com/owncloud/core/pull/40412<br></p>
</li>
<li class="type-bugfix changelog-item">
<p>Bugfix - Skip public links when updating permissions of share's children: <a href="https://github.com/owncloud/core/pull/40420">#40420</a></p>
<p>Currently, updates to permissions of a share are wrongly propagated to public links children.
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ownCloud admins and users.
Summary
-------

* Bugfix - Properly remove file versions from the trashbin: [#40286](https://github.com/owncloud/core/issues/40286)
* Bugfix - "available for" in the mount point configuration will show displaynames: [#40412](https://github.com/owncloud/core/pull/40412)
* Bugfix - Skip public links when updating permissions of share's children: [#40420](https://github.com/owncloud/core/pull/40420)
* Change - Allow specifying available space for objectstorages: [#40192](https://github.com/owncloud/core/pull/40192)
* Change - Drop PHP 7.3 support across the platform: [#40394](https://github.com/owncloud/core/pull/40394)
Expand All @@ -20,6 +22,34 @@ Summary
Details
-------

* Bugfix - Properly remove file versions from the trashbin: [#40286](https://github.com/owncloud/core/issues/40286)

Previously, restoring or removing a file from inside a folder that was deleted (so the folder
and the contents are in the trashbin) didn't remove the versions of the file. Those versions
were left in both the DB and the FS, taking space and degrading the performance.

This is now being handled properly, so no additional resource is consumed due to the versions
being left stranded.

https://github.com/owncloud/core/issues/40286

* Bugfix - "available for" in the mount point configuration will show displaynames: [#40412](https://github.com/owncloud/core/pull/40412)

The "available for" select of the mount configuration of external storages were using the
group id. This wasn't a problem because for local groups the group id matches the group
displayname, and for ldap groups the group id was the "cn" attribute. Due to recent changes, the
ldap group will now use the objectuid attribute (or a similar attribute) as group id by default.
This was causing the "available for" select to show that objectuid, so identifying the right
group was problematic.

Now, the "available for" select will show the group displayname, which for ldap is the "cn"
attribute by default.

Note that this happens on new installations. There is an automatic migration in place, so for
upgrades, the "cn" attribute will be set as groupname in order to keep the old behavior

https://github.com/owncloud/core/pull/40412

* Bugfix - Skip public links when updating permissions of share's children: [#40420](https://github.com/owncloud/core/pull/40420)

Currently, updates to permissions of a share are wrongly propagated to public links children.
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/TrashBin/TrashBinManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ public function restore(string $user, AbstractTrashBinNode $trashItem, $targetLo
$path = \implode('/', $path);
return Trashbin::restore(
$path,
$trashItem->getOriginalFileName(),
$trashItem->getDeleteTimestamp(),
$targetLocation
);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/files_external/ajax/applicable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

$groups = [];
foreach (\OC::$server->getGroupManager()->search($pattern, $limit, $offset) as $group) {
$groups[$group->getGID()] = $group->getGID();
$groups[$group->getGID()] = $group->getDisplayName();
}

$users = [];
Expand Down
19 changes: 7 additions & 12 deletions apps/files_trashbin/ajax/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,20 @@

$i = 0;
foreach ($list as $file) {
if ($folder === '/') {
$file = \ltrim($file, '/');
$delimiter = \strrpos($file, '.d');
$filename = \substr($file, 0, $delimiter);
$timestamp = \substr($file, $delimiter+2);
} else {
$filename = $folder . '/' . $file;
$timestamp = null;
}
$file = \ltrim($file, '/');
$filename = $folder . $file; // folder already contains a trailing "/"

OCA\Files_Trashbin\Trashbin::delete($filename, \OCP\User::getUser(), $timestamp);
if (OCA\Files_Trashbin\Trashbin::file_exists($filename, $timestamp)) {
// both "delete" and "file_exists" will require the whole path inside the trashbin
// including the deletion timestamp in the filename, such as "/file.txt.d12345"
// or "/folder.d12345/file.txt"
OCA\Files_Trashbin\Trashbin::delete($filename, \OCP\User::getUser());
if (OCA\Files_Trashbin\Trashbin::file_exists($filename)) {
$error[] = $filename;
\OCP\Util::writeLog('files_trashbin', 'can\'t delete ' . $filename . ' permanently.', \OCP\Util::ERROR);
}
// only list deleted files if not deleting everything
elseif (!$deleteAll) {
$success[$i]['filename'] = $file;
$success[$i]['timestamp'] = $timestamp;
$i++;
}
}
Expand Down
19 changes: 6 additions & 13 deletions apps/files_trashbin/ajax/undelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,17 @@

$i = 0;
foreach ($list as $file) {
$path = $dir . '/' . $file;
if ($dir === '/') {
$file = \ltrim($file, '/');
$delimiter = \strrpos($file, '.d');
$filename = \substr($file, 0, $delimiter);
$timestamp = \substr($file, $delimiter+2);
} else {
$path_parts = \pathinfo($file);
$filename = $path_parts['basename'];
$timestamp = null;
}
$file = \ltrim($file, '/');
$filename = $dir . $file; // dir already contains a trailing "/"

if (!OCA\Files_Trashbin\Trashbin::restore($path, $filename, $timestamp)) {
// "restore" will require the whole path inside the trashbin including
// the deletion timestamp in the filename, such as "/file.txt.d12345"
// or "/folder.d12345/file.txt"
if (!OCA\Files_Trashbin\Trashbin::restore($filename)) {
$error[] = $filename;
\OCP\Util::writeLog('files_trashbin', 'can\'t restore ' . $filename, \OCP\Util::DEBUG);
} else {
$success[$i]['filename'] = $file;
$success[$i]['timestamp'] = $timestamp;
$i++;
}
}
Expand Down
10 changes: 7 additions & 3 deletions apps/files_trashbin/lib/TrashExpiryManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public function expireTrashByRetention(string $uid) {
$userTrashbinContent = Helper::getTrashFiles('/', $uid, 'mtime', false);
foreach ($userTrashbinContent as $key => $trashbinEntry) {
if ($this->expiration->isExpired($trashbinEntry->getMtime())) {
Trashbin::delete($trashbinEntry->getName(), $uid, $trashbinEntry->getMtime());
// Direct content of the trashbin's root folder will have the ".d[timestamp]" suffix
// The deletion timestamp is in the mtime of the trashbin entry
Trashbin::delete("{$trashbinEntry->getName()}.d{$trashbinEntry->getMtime()}", $uid);
$this->logger->info(
"Remove {$trashbinEntry->getName()} from {$uid} trashbin because it exceeds max retention obligation term.",
['app' => 'files_trashbin']
Expand Down Expand Up @@ -104,7 +106,9 @@ public function expireTrash(string $uid) {
for ($i = 0; $i < \count($remainingUserTrashbinContent); $i++) {
$trashbinEntry = $remainingUserTrashbinContent[$i];
if ($this->expiration->isExpired($trashbinEntry->getMtime())) {
$availableSpace += Trashbin::delete($trashbinEntry->getName(), $uid, $trashbinEntry->getMtime());
// Direct content of the trashbin's root folder will have the ".d[timestamp]" suffix
// The deletion timestamp is in the mtime of the trashbin entry
$availableSpace += Trashbin::delete("{$trashbinEntry->getName()}.d{$trashbinEntry->getMtime()}", $uid);
$this->logger->info(
"Remove {$trashbinEntry->getName()} from {$uid} trashbin because it exceeds max retention obligation term.",
['app' => 'files_trashbin']
Expand All @@ -121,7 +125,7 @@ public function expireTrash(string $uid) {
if ($availableSpace < 0) {
foreach ($remainingUserTrashbinContent as $trashbinEntry) {
if ($availableSpace < 0 && $this->expiration->isExpired($trashbinEntry->getMtime(), true)) {
$deletedSize = Trashbin::delete($trashbinEntry->getName(), $uid, $trashbinEntry->getMtime());
$deletedSize = Trashbin::delete("{$trashbinEntry->getName()}.d{$trashbinEntry->getMtime()}", $uid);
$this->logger->info(
"Remove {$trashbinEntry->getMtime()} ({$deletedSize}) to meet the limit of trash bin size ({$this->quota->getPurgeLimit()}% of available quota",
['app' => 'files_trashbin']
Expand Down
Loading