Backblaze B2 storage driver #135

Closed
opened 2019-09-03 19:01:52 +01:00 by aheathershaw · 5 comments
Owner

Allow photos to be stored on the Backblaze B2 cloud.

https://www.backblaze.com/b2/docs/

Allow photos to be stored on the Backblaze B2 cloud. https://www.backblaze.com/b2/docs/
aheathershaw self-assigned this 2019-09-03 19:01:52 +01:00
aheathershaw added the
feature
label 2019-09-03 19:01:52 +01:00
aheathershaw added the
wip
label 2019-09-09 13:07:47 +01:00
Author
Owner

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.

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](https://www.backblaze.com/b2/docs/b2_get_download_authorization.html) and use [b2_download_file_by_name](https://www.backblaze.com/b2/docs/b2_download_file_by_name.html). 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.
aheathershaw added this to the Version 2.2.0-beta.2 milestone 2019-09-09 18:30:27 +01:00
Author
Owner

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.

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.
Author
Owner

Also need to test/consider what happens with the modification methods - rotate, flip and replace image - for example.

Also need to test/consider what happens with the modification methods - rotate, flip and replace image - for example.
Author
Owner

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

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
Author
Owner

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.

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.
aheathershaw removed the
wip
label 2019-10-19 21:04:31 +01:00
Sign in to join this conversation.
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: aheathershaw/blue-twilight#135
No description provided.