spacecatninja/imager-x-aws-storage-driver 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

spacecatninja/imager-x-aws-storage-driver

最新稳定版本:1.0.0

Composer 安装命令:

composer require spacecatninja/imager-x-aws-storage-driver

包简介

External storage driver for Imager X that integrates with AWS (S3)

README 文档

README

External storage driver for Imager X that uploads transformed images to Amazon S3. Supports CloudFront cache invalidation and credential-less authentication for ECS/EC2 environments.

Requirements

  • Craft CMS 5.0.0 or later
  • Imager X 6.0.0 or later (Pro edition)

Installation

composer require spacecatninja/imager-x-aws-storage-driver
php craft plugin/install imager-x-aws-storage-driver

Configuration

Add an aws key to storageConfig in your config/imager-x.php:

'storages' => ['aws'],

'storageConfig' => [
    'aws' => [
        'accessKey' => '',
        'secretAccessKey' => '',
        'region' => 'eu-west-1',
        'bucket' => 'my-bucket',
        'folder' => 'transforms',
        'storageType' => 'standard',
        'requestHeaders' => [],
        'disableACL' => false,
        'public' => true,
        'cloudfrontInvalidateEnabled' => false,
        'cloudfrontDistributionId' => '',
    ],
],

Point imagerUrl at your bucket (or CloudFront distribution):

'imagerUrl' => 'https://my-bucket.s3.eu-west-1.amazonaws.com/transforms/',

Always flush your Imager transforms cache when adding or removing external storages, as existing cached transforms will not be re-uploaded.

Configuration options

Option Default Description
accessKey '' AWS access key ID. Supports environment variables (e.g. $AWS_ACCESS_KEY).
secretAccessKey '' AWS secret access key. Supports environment variables.
region '' AWS region (e.g. eu-west-1).
bucket '' S3 bucket name. Supports environment variables.
folder '' Folder prefix within the bucket.
storageType 'standard' S3 storage class. Accepts standard, rrs (Reduced Redundancy), or glacier.
requestHeaders [] Additional headers merged into the S3 putObject request (e.g. Content-Encoding).
disableACL false Set to true to skip setting an ACL on upload (required for buckets with ACLs disabled).
public true When ACL is enabled, sets objects to public-read. Set to false for private.
cloudfrontInvalidateEnabled false Send a CloudFront invalidation request after each upload.
cloudfrontDistributionId '' CloudFront distribution ID to invalidate.
useCredentialLessAuth false Skip access key credentials and rely on IAM roles instead (web identity, ECS, or EC2 instance profile).

Credential-less authentication

When running on AWS infrastructure (ECS, EC2, or with web identity federation), you can omit accessKey and secretAccessKey and let the SDK resolve credentials from the environment automatically:

'aws' => [
    'useCredentialLessAuth' => true,
    'region' => 'eu-west-1',
    'bucket' => 'my-bucket',
    'folder' => 'transforms',
],

The driver checks for AWS_WEB_IDENTITY_TOKEN_FILE/AWS_ROLE_ARN (web identity), AWS_CONTAINER_CREDENTIALS_RELATIVE_URI (ECS), and falls back to the EC2 instance metadata service.

Price, license and support

The plugin is released under the MIT license. It requires Imager X Pro, which is a commercial plugin available in the Craft plugin store.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固