silverstripe / s3cdn
4.2.1
2020-06-23 03:06 UTC
Requires
- aws/aws-sdk-php: ~3.0
- symbiote/silverstripe-cdncontent: ~3.0
Replaces
- silverstripe/s3cdn: 4.2.1
This package is not auto-updated.
Last update: 2022-02-01 12:38:18 UTC
README
配置
在本地配置中,指定以下内容以配置内容读取器/写入器对,并将它们绑定到可用的 CDN 内容存储
---
Name: locals3settings
After:
- '#s3services'
---
Injector:
S3Service:
constructor:
key: {your_api_key}
secret: {your_api_secret}
region: {region}
S3ContentReader:
type: prototype
properties:
s3service: %$S3Service
bucket: {your_bucket_name}
baseUrl: https://{your_bucket_name}.s3.amazonaws.com
S3ContentWriter:
type: prototype
properties:
s3service: %$S3Service
bucket: {your_bucket_name}
baseUrl: https://{your_bucket_name}.s3.amazonaws.com
ContentService:
constructor:
defaultStore: Default
properties:
stores:
Default:
ContentReader: S3ContentReader
ContentWriter: S3ContentWriter
另外,确保您已从 cdncontent 模块绑定 CDNFile 扩展
File: extensions: - CDNFile Folder: extensions: - CDNFolder
要更改上传时应用的默认 ACL,请重新配置 defaultAcl
选项
Injector
S3ContentWriter:
type: prototype
properties:
s3Service: %$S3Service
bucket: bucket
defaultAcl: ""
有关详细信息,请参阅 CDN 内容 模块
迁移
如果您正在考虑迁移到 S3 或从 S3 迁移,请查看包含的构建任务。
故障排除
重采样图像
如果您已进行 SS 升级并/或将 URL 更换为新 URL,可能需要运行以下查询。这确保所有图像都正确重采样。
UPDATE File SET ResamplingsValue = '';
TRUNCATE TABLE `SilverStripeAustralia\ContentServiceAssets\ContentServiceAsset`;
TRUNCATE TABLE `Symbiote\ContentServiceAssets\ContentServiceAsset`;