Coder Social home page Coder Social logo

dospaces's Introduction

DigitalOcean Spaces Volume

This plugin provides an DigitalOcean Spaces integration for Craft CMS.

The plugin is based on the first-party AWS S3 Volume for Craft, and behaves in much the same way since Spaces is S3 compatible.

Requirements

This plugin requires Craft CMS 3.0.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require vaersaagod/dospaces
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for "DigitalOcean Spaces Volume".

Usage

To create a new asset volume for your Spaces bucket, go to Settings → Assets, create a new volume, and set the Volume Type setting to “DigitalOcean Spaces”.

Per-Environment Configuration

Once you’ve created your Spaces volume in the Control Panel, you can override its settings with different values for each environment.

First, add the following environment variables to your .env and .env.example files:

# The AWS API key with read/write access to Spaces
SPACES_API_KEY=""

# The AWS API key secret
SPACES_SECRET=""

# The region the S3 bucket is in
SPACES_ENDPOINT=""

# The region the S3 bucket is in
SPACES_REGION=""

# The name of the S3 bucket
SPACES_BUCKET=""

Then fill in the values in your .env file (leaving the values in .env.example blank).

Finally, create a config/volumes.php file containing references to these variables:

<?php

return [
    'mySpacesVolumeHandle' => [
        'hasUrls' => true,
        'url' => 'https://my-spaces-bucket.ams3.digitaloceanspaces.com/',
        'keyId' => getenv('SPACES_API_KEY'),
        'secret' => getenv('SPACES_SECRET'),
        'endpoint' => getenv('SPACES_ENDPOINT'),
        'region' => getenv('SPACES_REGION'),
        'bucket' => getenv('SPACES_BUCKET'),
    ],
];

Price, license and support

The plugin is released under the MIT license, meaning you can do what ever you want with it as long as you don't blame us. It's free, which means there is absolutely no support included, but you might get it anyway. Just post an issue here on github if you have one, and we'll see what we can do.

dospaces's People

Contributors

aelvan avatar leecampbellr avatar tam avatar saboteur777 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.