콘텐츠로 이동

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

  1. Install the package using the following command:

    Terminal window
    npm i @studiocms/s3-storage
  2. 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()
    });
  3. Configure the required environment variables in your .env file:

    .env
    CMS_S3_PROVIDER=AWS
    CMS_S3_REGION=us-east-1
    CMS_S3_ENDPOINT= # Leave empty for AWS
    CMS_S3_ACCESS_KEY_ID=your_access_key
    CMS_S3_SECRET_ACCESS_KEY=your_secret_key
    CMS_S3_BUCKET_NAME=your_bucket_name
    CMS_S3_FORCE_PATH_STYLE=false
    # CMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing files
.env
CMS_S3_PROVIDER=AWS
CMS_S3_REGION=us-east-1
CMS_S3_ENDPOINT= # Leave empty for AWS
CMS_S3_ACCESS_KEY_ID=your_access_key
CMS_S3_SECRET_ACCESS_KEY=your_secret_key
CMS_S3_BUCKET_NAME=your_bucket_name
CMS_S3_FORCE_PATH_STYLE=false
CMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing files
.env
CMS_S3_PROVIDER=Cloudflare R2
CMS_S3_REGION=auto
CMS_S3_ENDPOINT=https://your-account-id.r2.cloudflarestorage.com
CMS_S3_ACCESS_KEY_ID=your_r2_access_key
CMS_S3_SECRET_ACCESS_KEY=your_r2_secret_key
CMS_S3_BUCKET_NAME=your_bucket_name
CMS_S3_FORCE_PATH_STYLE=false
CMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing files
.env
CMS_S3_PROVIDER=DigitalOcean Spaces
CMS_S3_REGION=nyc3
CMS_S3_ENDPOINT=https://nyc3.digitaloceanspaces.com
CMS_S3_ACCESS_KEY_ID=your_spaces_key
CMS_S3_SECRET_ACCESS_KEY=your_spaces_secret
CMS_S3_BUCKET_NAME=your_space_name
CMS_S3_FORCE_PATH_STYLE=false
CMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing files
.env
CMS_S3_PROVIDER=Backblaze B2
CMS_S3_REGION=us-west-004
CMS_S3_ENDPOINT=https://s3.us-west-004.backblazeb2.com
CMS_S3_ACCESS_KEY_ID=your_b2_key_id
CMS_S3_SECRET_ACCESS_KEY=your_b2_application_key
CMS_S3_BUCKET_NAME=your_bucket_name
CMS_S3_FORCE_PATH_STYLE=false
CMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing files
.env
CMS_S3_PROVIDER=MinIO
CMS_S3_REGION=us-east-1
CMS_S3_ENDPOINT=http://localhost:9000
CMS_S3_ACCESS_KEY_ID=minioadmin
CMS_S3_SECRET_ACCESS_KEY=minioadmin
CMS_S3_BUCKET_NAME=your_bucket_name
CMS_S3_FORCE_PATH_STYLE=true # Required for MinIO
CMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing files
.env
CMS_S3_PROVIDER=Wasabi
CMS_S3_REGION=us-east-1
CMS_S3_ENDPOINT=https://s3.us-east-1.wasabisys.com
CMS_S3_ACCESS_KEY_ID=your_wasabi_key
CMS_S3_SECRET_ACCESS_KEY=your_wasabi_secret
CMS_S3_BUCKET_NAME=your_bucket_name
CMS_S3_FORCE_PATH_STYLE=false
CMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing files
.env
CMS_S3_PROVIDER=Linode
CMS_S3_REGION=us-east-1
CMS_S3_ENDPOINT=https://us-east-1.linodeobjects.com
CMS_S3_ACCESS_KEY_ID=your_linode_key
CMS_S3_SECRET_ACCESS_KEY=your_linode_secret
CMS_S3_BUCKET_NAME=your_bucket_name
CMS_S3_FORCE_PATH_STYLE=false
CMS_S3_PUBLIC_ENDPOINT= # Optional: Custom public endpoint for accessing files