AWS S3
To use Amazon S3 as your storage service, you need to configure the storage in theconfig/storage.yml
file.
aws-sdk-s3
gem to your Gemfile.
bundle install
.
Now you need to switch the storage service in your config/environments/production.rb
file.
config/storage.yml
file on your hosting provider.
To test them locally you can put them in the .env
file.
CORS Configuration
Spree Admin Dashboard uses direct uploads to handle file uploads. For this to work properly, you need to configure CORS on your S3 bucket.- Go to your S3 bucket in AWS Console
- Click on “Permissions” tab
- Scroll down to “Cross-origin resource sharing (CORS)”
- Click “Edit” and paste the following configuration:
myspreestore.com
should be replaced with your domain name which you access your Spree Admin Dashboard.Cloudflare R2
Cloudflare R2 is an S3-compatible, zero egress-fee, object storage with a built-in CDN. We strongly recommend using it as your storage service. To use Cloudflare R2 as your storage service, you need to configure the storage in theconfig/storage.yml
file.
aws-sdk-s3
gem to your Gemfile.
aws-sdk-s3 version 1.178.0 introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.To mitigate, users can use 1.177.0 or add the following to their s3 client instantiation:
bundle install
.
Now you need to switch the storage service in your config/environments/production.rb
file.
config/storage.yml
file on your hosting provider.
To test them locally you can put them in the .env
file.
CORS Configuration
Spree Admin Dashboard uses direct uploads to handle file uploads. For this to work properly, you need to configure CORS on your R2 bucket.- Go to your R2 bucket in Cloudflare Console
- Click on “Settings” tab
- Scroll down to “CORS policy”
- Click “Edit CORS policy” and paste the following configuration:
myspreestore.com
should be replaced with your domain name which you access your Spree Admin Dashboard.