项目作者: zaxbux

项目描述 :
Winter CMS plugin for using the Backblaze B2 storage service as a filesystem
高级语言: PHP
项目地址: git://github.com/zaxbux/wn-backblazeb2storagedriver-plugin.git
创建时间: 2019-03-25T03:20:14Z
项目社区:https://github.com/zaxbux/wn-backblazeb2storagedriver-plugin

开源协议:MIT License

下载


Backblaze B2 Storage Driver

This Winter CMS plugin allows you to use the Backblaze B2 cloud storage service as a filesystem on your installation.

Requirements

To use B2 Cloud Storage, you need to have a Backblaze account. You can get an account by signing up at backblaze.com. After enabling B2 for your account, you will have access to your Account ID and Application Key that lets you use the API. (https://www.backblaze.com/b2/docs/)

Plugin Settings

The plugin is configured in the Winter CMS filesystems.php and cms.php files.

filesystems.php

Edit your filesystems.php to add a disk “backblaze” that uses the b2 driver:

  1. return [
  2. ...
  3. 'disks' => [
  4. 'backblaze' => [
  5. 'driver' => 'b2',
  6. 'bucketName' => '<your bucket name>',
  7. 'applicationKeyId' => '<application key id>',
  8. 'applicationKey' => '<application key>'
  9. ],
  10. ],
  11. ...
  12. ];

You can also use your account ID and master application key instead of application keys, however this is not recommended.

cms.php

Edit your cms.php to configure the media manager to use your “backblaze” disk:

  1. return [
  2. ...
  3. 'storage' => [
  4. 'media' => [
  5. 'disk' => 'backblaze',
  6. 'folder' => '',
  7. 'path' => 'https://f000.backblazeb2.com/file/<your bucket name>'
  8. ],
  9. ],
  10. ...
  11. ];

The folder specifies a “prefix” inside the bucket to store files (useful if you have a namePrefix restriction on your application key). The path specifies the public URL of your bucket (no trailing slash), which can be obtained from the Backblaze B2 dashboard. If you have setup a subdomain to point to your bucket, replace the f000.backblazeb2.com with your custom domain.

Known Limitations

  • The Backblaze B2 API does not support moving or renaming objects. You will have to delete the remote copy and upload it again.

Change Log

  • 1.0.1 - First version