Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nextcloud
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libre.sh
docker
nextcloud
Commits
28065c2e
Verified
Commit
28065c2e
authored
2 years ago
by
Hugo Renard
Browse files
Options
Downloads
Patches
Plain Diff
fix: revert file version
parent
b9f7b17e
No related branches found
No related tags found
1 merge request
!19
Feature s3 patch
Pipeline
#1333
passed with stages
in 4 minutes and 59 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
base/Dockerfile
+2
-1
2 additions, 1 deletion
base/Dockerfile
base/apps/files_versions_s3.patch
+70
-0
70 additions, 0 deletions
base/apps/files_versions_s3.patch
with
72 additions
and
1 deletion
base/Dockerfile
+
2
−
1
View file @
28065c2e
...
@@ -7,7 +7,8 @@ WORKDIR /apps
...
@@ -7,7 +7,8 @@ WORKDIR /apps
ARG
MINOR_VERSION
ARG
MINOR_VERSION
RUN
./install.sh
RUN
./install.sh
RUN
cd
apps/mail
&&
patch
-p1
< ../../mail-enumeration-leak.patch
RUN
cd
apps/mail
&&
patch
-p1
< ../../mail-enumeration-leak.patch
RUN
rm
./install.sh ./install-list ./mail-enumeration-leak.patch
RUN
cd
apps/files_versions_s3
&&
patch
-p1
< ../../files_versions_s3.patch
RUN
rm
./install.sh ./install-list ./mail-enumeration-leak.patch ./files_versions_s3.patch
FROM
nextcloud:${MARKETTING_VERSION}-fpm-alpine
FROM
nextcloud:${MARKETTING_VERSION}-fpm-alpine
ENV
VERSION $PATCH_VERSION
ENV
VERSION $PATCH_VERSION
...
...
This diff is collapsed.
Click to expand it.
base/apps/files_versions_s3.patch
0 → 100644
+
70
−
0
View file @
28065c2e
diff --git a/lib/Versions/AbstractS3VersionBackend.php b/lib/Versions/AbstractS3VersionBackend.php
index a13e882..4b9d142 100644
--- a/lib/Versions/AbstractS3VersionBackend.php
+++ b/lib/Versions/AbstractS3VersionBackend.php
@@ -48,7 +48,7 @@
abstract class AbstractS3VersionBackend implements IVersionBackend {
abstract protected function getUrn(FileInfo $file): string;
- abstract protected function postRollback(FileInfo $file);
+ abstract protected function postRollback(FileInfo $file, IVersion $version);
public function getVersionsForFile(IUser $user, FileInfo $file): array {
$s3 = $this->getS3($file);
@@ -68,7 +68,7 @@
abstract class AbstractS3VersionBackend implements IVersionBackend {
$s3 = $this->getS3($source);
if ($s3) {
$this->versionProvider->rollback($s3, $this->getUrn($source), $version->getRevisionId());
- $this->postRollback($source);
+ $this->postRollback($source, $version);
return true;
}
diff --git a/lib/Versions/ExternalS3VersionsBackend.php b/lib/Versions/ExternalS3VersionsBackend.php
index 1d2ee00..c92e40c 100644
--- a/lib/Versions/ExternalS3VersionsBackend.php
+++ b/lib/Versions/ExternalS3VersionsBackend.php
@@ -26,6 +26,7 @@
namespace OCA\FilesVersionsS3\Versions;
use OC\Files\ObjectStore\S3ConnectionTrait;
use OC\Files\Storage\Wrapper\Jail;
use OCA\Files_External\Lib\Storage\AmazonS3;
+use OCA\Files_Versions\Versions\IVersion;
use OCP\Files\FileInfo;
use OCP\Files\Storage\IStorage;
@@ -59,7 +60,7 @@
class ExternalS3VersionsBackend extends AbstractS3VersionBackend {
return $path;
}
- protected function postRollback(FileInfo $file) {
+ protected function postRollback(FileInfo $file, IVersion $version) {
$file->getStorage()->getUpdater()->update($file->getInternalPath());
}
}
diff --git a/lib/Versions/PrimaryS3VersionsBackend.php b/lib/Versions/PrimaryS3VersionsBackend.php
index 7331676..c4eeabc 100644
--- a/lib/Versions/PrimaryS3VersionsBackend.php
+++ b/lib/Versions/PrimaryS3VersionsBackend.php
@@ -26,6 +26,7 @@
namespace OCA\FilesVersionsS3\Versions;
use OC\Files\ObjectStore\ObjectStoreStorage;
use OC\Files\ObjectStore\S3;
use OC\Files\ObjectStore\S3ConnectionTrait;
+use OCA\Files_Versions\Versions\IVersion;
use OCP\Files\FileInfo;
use OCP\Files\Storage\IStorage;
@@ -62,11 +63,12 @@
class PrimaryS3VersionsBackend extends AbstractS3VersionBackend {
return $storage->getURN($file->getId());
}
- protected function postRollback(FileInfo $file) {
+ protected function postRollback(FileInfo $file, IVersion $version) {
$cache = $file->getStorage()->getCache();
$cache->update($file->getId(), [
'mtime' => time(),
- 'etag' => $file->getStorage()->getETag($file->getInternalPath())
+ 'etag' => $file->getStorage()->getETag($file->getInternalPath()),
+ 'size' => $version->getSize(),
]);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment