Problem/Motivation

In our situation, we have a site being migrated to Drupal, which already has their images and videos in an S3 bucket. The bucket is huge - we've already moved beyond testing with a subset in a different bucket, and are testing with an ostensibly-but-apparently-not-actually-readonly access key with the "real" bucket. In testing data migration in particular, we do many imports and rollbacks, the latter of which will make unlink requests - which, while testing, we do *not* want to be honored. Therefore, for debugging purposes, it's helpful to only pretend we've deleted physical files, while leaving them in place for the next round of migration import testing.

Note: we don't have a strong need for this to actually be committed - we most likely will be past the testing phase by the time this shows up in a release anyway, but for now putting the patch up here and referencing it in composer.json serves our needs.

Proposed resolution

Add a "disable_delete" option to the settings form - when this is turned on, the stream wrapper unlink() simply returns TRUE without doing anything.

Remaining tasks

Review the patch.

User interface changes

Checkbox added to the settings form.

API changes

None.

Data model changes

None.

Comments

mikeryan created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, s3fs-disable-delete.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mikeryan’s picture

Status: Needs work » Needs review
StatusFileSize
new2.25 KB
mikeryan’s picture

Priority: Normal » Minor

Well, we did finally figure out the right incantation to get keys providing puttable-but-not-deletable permissions, so we're no longer using this. Downgrading but leaving here, it might be helpful for quickly temporarily disabling deletion. No worries if the maintainers say "Closed (won't fix)".

geoffreyr’s picture

StatusFileSize
new2.31 KB

Rerolled against latest 8.x-3.x-dev.

cmlara’s picture

Status: Needs review » Closed (won't fix)
Related issues: +#3185760: Allow read only use of S3 bucket

I would rather we keep ACL control at the bucket instead of inside S3FS, closing in favor of the approach proposed in #3185760: Allow read only use of S3 bucket.