GithubHelp home page GithubHelp logo

timkelty / aws-s3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from craftcms/aws-s3

0.0 2.0 0.0 104 KB

Amazon S3 volume type for Craft CMS

License: MIT License

PHP 70.10% JavaScript 12.35% HTML 17.55%

aws-s3's Introduction

Amazon S3 for Craft CMS

This plugin provides an Amazon S3 integration for Craft CMS.

Requirements

This plugin requires Craft CMS 3.0.0-RC4 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Amazon S3”. Then click on the “Install” button in its modal window.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require craftcms/aws-s3

# tell Craft to install the plugin
./craft install/plugin aws-s3

Setup

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

Per-Environment Configuration

Once you’ve created your S3 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 S3
S3_API_KEY=""

# The AWS API key secret
S3_SECRET=""

# The name of the S3 bucket
S3_BUCKET=""

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

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 [
    'myS3VolumeHandle' => [
        'hasUrls' => true,
        'url' => 'https://'.getenv('S3_BUCKET').'.s3.amazonaws.com/',
        'keyId' => getenv('S3_API_KEY'),
        'secret' => getenv('S3_SECRET'),
        'bucket' => getenv('S3_BUCKET'),
        'region' => getenv('S3_REGION'),
    ],
];

aws-s3's People

Contributors

andris-sevcenko avatar angrybrad avatar brandonkelly avatar mikefrancis avatar vonscriptor avatar

Watchers

 avatar  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.