@studiocms/s3-storage
이 콘텐츠는 아직 번역되지 않았습니다.
StudioCMS S3 Storage Manager plugin, Provides AWS S3 Storage Support for StudioCMS. This plugin allows you to use Amazon S3 or any S3-compatible storage service as the backend for storing files in your StudioCMS application.
-
Install the package using the following command:
Terminal window npm i @studiocms/s3-storageTerminal window pnpm add @studiocms/s3-storageTerminal window yarn add @studiocms/s3-storage -
Add this plugin in your StudioCMS config. (
studiocms.config.mjs)studiocms.config.mjs import { defineStudioCMSConfig } from 'studiocms/config';import s3Storage from '@studiocms/s3-storage';export default defineStudioCMSConfig({storageManager: s3Storage()}); -
Configure the required environment variables in your
.envfile:.env CMS_S3_PROVIDER=AWSCMS_S3_REGION=us-east-1CMS_S3_ENDPOINT= # Leave empty for AWSCMS_S3_ACCESS_KEY_ID=your_access_keyCMS_S3_SECRET_ACCESS_KEY=your_secret_keyCMS_S3_BUCKET_NAME=your_bucket_nameCMS_S3_FORCE_PATH_STYLE=false# CMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing files
Environment Variable Examples
Section titled “Environment Variable Examples”CMS_S3_PROVIDER=AWSCMS_S3_REGION=us-east-1CMS_S3_ENDPOINT= # Leave empty for AWSCMS_S3_ACCESS_KEY_ID=your_access_keyCMS_S3_SECRET_ACCESS_KEY=your_secret_keyCMS_S3_BUCKET_NAME=your_bucket_nameCMS_S3_FORCE_PATH_STYLE=falseCMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing filesCloudflare R2
Section titled “Cloudflare R2”CMS_S3_PROVIDER=Cloudflare R2CMS_S3_REGION=autoCMS_S3_ENDPOINT=https://your-account-id.r2.cloudflarestorage.comCMS_S3_ACCESS_KEY_ID=your_r2_access_keyCMS_S3_SECRET_ACCESS_KEY=your_r2_secret_keyCMS_S3_BUCKET_NAME=your_bucket_nameCMS_S3_FORCE_PATH_STYLE=falseCMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing filesDigitalOcean Spaces
Section titled “DigitalOcean Spaces”CMS_S3_PROVIDER=DigitalOcean SpacesCMS_S3_REGION=nyc3CMS_S3_ENDPOINT=https://nyc3.digitaloceanspaces.comCMS_S3_ACCESS_KEY_ID=your_spaces_keyCMS_S3_SECRET_ACCESS_KEY=your_spaces_secretCMS_S3_BUCKET_NAME=your_space_nameCMS_S3_FORCE_PATH_STYLE=falseCMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing filesBackblaze B2
Section titled “Backblaze B2”CMS_S3_PROVIDER=Backblaze B2CMS_S3_REGION=us-west-004CMS_S3_ENDPOINT=https://s3.us-west-004.backblazeb2.comCMS_S3_ACCESS_KEY_ID=your_b2_key_idCMS_S3_SECRET_ACCESS_KEY=your_b2_application_keyCMS_S3_BUCKET_NAME=your_bucket_nameCMS_S3_FORCE_PATH_STYLE=falseCMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing filesCMS_S3_PROVIDER=MinIOCMS_S3_REGION=us-east-1CMS_S3_ENDPOINT=http://localhost:9000CMS_S3_ACCESS_KEY_ID=minioadminCMS_S3_SECRET_ACCESS_KEY=minioadminCMS_S3_BUCKET_NAME=your_bucket_nameCMS_S3_FORCE_PATH_STYLE=true # Required for MinIOCMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing filesWasabi
Section titled “Wasabi”CMS_S3_PROVIDER=WasabiCMS_S3_REGION=us-east-1CMS_S3_ENDPOINT=https://s3.us-east-1.wasabisys.comCMS_S3_ACCESS_KEY_ID=your_wasabi_keyCMS_S3_SECRET_ACCESS_KEY=your_wasabi_secretCMS_S3_BUCKET_NAME=your_bucket_nameCMS_S3_FORCE_PATH_STYLE=falseCMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing filesLinode Object Storage
Section titled “Linode Object Storage”CMS_S3_PROVIDER=LinodeCMS_S3_REGION=us-east-1CMS_S3_ENDPOINT=https://us-east-1.linodeobjects.comCMS_S3_ACCESS_KEY_ID=your_linode_keyCMS_S3_SECRET_ACCESS_KEY=your_linode_secretCMS_S3_BUCKET_NAME=your_bucket_nameCMS_S3_FORCE_PATH_STYLE=falseCMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing files