smarcet/silverstripe-cloudassets-swift

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Swift CloudFiles bucket driver for markguinn/silverstripe-cloudassets

1.0.0 2019-01-11 17:27 UTC

This package is not auto-updated.

Last update: 2021-06-12 12:13:15 UTC


README

Swift CloudFiles Driver

CloudAssets module allows you to host all or part of the assets folder on a cloud storage container (CDN). You can find more details about how it works here: https://github.com/markguinn/silverstripe-cloudassets

This driver gives you the bucket type SwiftBucket for connecting to CloudFiles.

This module can happily co-exist with other bucket driver modules (which don't exist at the time of this writing).

Requirements

  • Silverstripe 3.1+
  • Cloud Assets module
  • php-opencloud/openstack

Best way to install by far is composer require smarcet/silverstripe-cloudassets-swift.

Example

Assuming you have a CloudFiles container called site-uploads:

mysite/_config/cloudassets.yml:

---
name: assetsconfig
---
CloudAssets:
  map:
    'assets':
      Type: SwiftBucket
      BaseURL: 'http://yourcdnbaseurl.com/'
      Container: site-uploads
      Region: Region Name
      Username: yourlogin
      UserDomainId: user domain id (default)
      ApiKey: yourkey
      ProjectName: your project name
      AuthURL: keystone base url 
      ProjectDomainId: project domain id (default)
      LocalCopy: false     

OR using application credentials

---
name: assetsconfig
---
CloudAssets:
  map:
    'assets':
      Type: SwiftBucket
      BaseURL: 'http://yourcdnbaseurl.com/'
      Container: site-uploads
      Region: Region Name
      ApplicationCredentialId: application credential id
      ApplicationCredentialSecret: application credential secret
      ProjectName: your project name
      AuthURL: keystone base url 
      LocalCopy: false