Backblaze B2 storage driver #135
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: aheathershaw/blue-twilight#135
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Allow photos to be stored on the Backblaze B2 cloud.
https://www.backblaze.com/b2/docs/
We should support both public and private buckets.
If set to public, generate a public URL for Backblaze.
If set to private, generate a 5-minute auth token using b2_get_download_authorization and use b2_download_file_by_name.
If set to auto-detect (the default), check if the bucket is public or private on the first call to the B2 API, and set the public/private flag accordingly.
B2’s delete method requires a file ID, whereas we only store the filename - the path is generated on-demand.
To avoid an additional call to B2 to delete a file (to get the file ID) we should cache the path to the file and it’s ID within the Blue Twilight DB - the result of the upload operation.
We can then just issue the delete calls with the cached ID when needed. Obviously the cached records needs deleting when the file is deleted.
For private buckets we may be able to generate URLs to get_download_file_by_id so visitors can’t guess at the original image URL.
Also need to test/consider what happens with the modification methods - rotate, flip and replace image - for example.
We should follow the logic outlined here so we can submit Blue Twilight as an integration to Backblaze.
https://www.backblaze.com/b2/docs/integration_checklist.html
This is all working apart from file versions.
When deleting a file, we need to make sure we delete all versions.
There doesn't seem to be a way to retrieve all file versions - perhaps before we upload a changed file, we issue a delete request first.