Assets
Overdog is optimized for integration with AWS S3 and Cloudfront, allowing for efficient asset storage and distribution, such as CMS images and documents. During setup, the Amazon S3 plugin is automatically installed, and two default volumes are created for organizational purposes.
For the .env file, you will need to provide specific information for each environment variable, which includes:
S3_BUCKET_DOCS
— The name of the S3 bucket for documents.S3_BUCKET_IMAGES
— The name of the S3 bucket for images.S3_BUCKET_REGION
— The AWS region where your S3 buckets are hosted.S3_BUCKET_SUBFOLDER
— Subfolder within your S3 bucket, if any.S3_DOCS_URL
— The URL endpoint for the documents S3 bucket.S3_DOCS_DIST_ID
— Cloudfront distribution ID for documents.S3_IMAGES_URL
— The URL endpoint for the images S3 bucket.S3_IMAGES_DIST_ID
— Cloudfront distribution ID for images.S3_USER_ID
— Your AWS user ID.S3_USER_SECRET
— Your AWS user secret key.
The default File Systems created are as follows:
Name | Handle |
---|---|
Documents | fileSystemsDocuments |
Images | fileSystemsImages |
In 95% of projects, these pre-configured file systems will meet your needs, offering a structured approach to asset management. Fields can be used to create subfolders within these volumes.
Two pre-configured Volumes are also created :
Name | Handle |
---|---|
Documents | volumeDocuments |
Images | volumeImages |
Asset Fields - Craft CMS
When setting up an asset field in Craft CMS, you have the option to organize your assets into subfolders. You can define the default upload location for each field by specifying a subfolder path during the field setup in the 'Default Upload Location' setting, or directly manage subfolders through the 'Assets' sidebar menu.
Example subfolder paths could be: /news
, /documentation
, etc.
Setting Up a Private Volume
For scenarios where file access needs to be restricted, such as a user portal, you can create a private volumes. To facilitate secure, private assets distribution, we created the CloudFront Signed URLs plugin.
- Create a New Volume: In your Craft CMS control panel, create a volume with the handle
volumePrivate
. This volume will be configured to serve assets privately. - Install the Plugin: To manage access to this private volume, install the CloudFront Signed URLs plugin available on the Craft Plugin Store.
- Configure Access: Follow the plugin’s documentation to set up signed URLs, which will ensure that your assets are securely delivered to authorized users only.
By implementing this plugin, you ensure that your private content is served securely, maintaining the confidentiality of the files.
For complete setup and configuration details, please refer to the official plugin documentation.