guardian / grid

The Guardian’s image management system
https://www.theguardian.com/info/developer-blog/2015/aug/12/open-sourcing-grid-image-service
Apache License 2.0
1.44k stars 120 forks source link

support 'projecting' from replica bucket as a way of restoring images incorrectly hard deleted #4125

Closed twrichards closed 1 year ago

twrichards commented 1 year ago

https://trello.com/c/ffAUNID4/1621-lazarus-mechanism-to-restore-deleted-grid-images-from-replica-bucket

Following on from the excellent https://github.com/guardian/grid/pull/4116. Adds a fallback to the 'replica bucket' (see https://github.com/guardian/editorial-tools-platform/pull/696 for more about replica buckets) when the file cannot be found in the main image bucket.

This should help us restore images quickly which have been hard deleted by mistake (perhaps by reaper) - so long as we have the ID of course.

Requires new (optional) bit of image loader config s3.image.replicaBucket.

twrichards commented 1 year ago

This approach doesn't reinstate the image file in the image bucket (nor does it recreate thumbs or optimised image, which will have been deleted during reaping), so closing this PR in favour of https://github.com/guardian/grid/pull/4128 which achieves the intentions of this PR but via image-loader so it can regenerate all it needs but preserving original uploadTime, uploadedBy and original filename.