Bỏ qua để đến nội dung
ViGrise Platform

S3 Source

Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.

The S3 source allows PreviewProxy to fetch images directly from an Amazon S3 bucket or any S3-compatible object storage (such as Cloudflare R2, RustFS, or Backblaze B2).

The S3 source is disabled by default. Set PP_S3_ENABLED=true along with the required credentials to activate it.

VariableDescription
PP_S3_ENABLEDSet to true to enable the S3 source.
PP_S3_BUCKETName of the S3 bucket to fetch images from.
PP_S3_ACCESS_KEY_IDAWS access key ID (or equivalent for S3-compatible storage).
PP_S3_SECRET_ACCESS_KEYAWS secret access key (or equivalent for S3-compatible storage).
VariableDefaultDescription
PP_S3_REGIONus-east-1AWS region where the bucket is hosted.
PP_S3_ENDPOINT(unset)Custom endpoint URL for S3-compatible storage providers.
PP_S3_ENABLED=true
PP_S3_BUCKET=my-assets
PP_S3_REGION=us-east-1
PP_S3_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
PP_S3_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
# For Cloudflare R2, RustFS, or S3-compatible storage:
# PP_S3_ENDPOINT=https://<account_id>.r2.cloudflarestorage.com

To request an image from S3, use the s3: scheme in the image URL portion of the path. Note that the scheme uses a single slash after the colon (not two):

/800x600,webp/s3:/images/product/photo.jpg

The path after s3:/ is the object key within the configured bucket.

RequestObject Key Fetched
/w=400/s3:/banner.jpgbanner.jpg
/800x600,webp/s3:/images/product/photo.jpgimages/product/photo.jpg
/format=avif/s3:/2024/uploads/avatar.png2024/uploads/avatar.png

To use PreviewProxy with Cloudflare R2, set PP_S3_ENDPOINT to the S3 API address:

PP_S3_ENABLED=true
PP_S3_BUCKET=my-assets
PP_S3_REGION=auto
PP_S3_ACCESS_KEY_ID=<access_key>
PP_S3_SECRET_ACCESS_KEY=<secret_key>
PP_S3_ENDPOINT=https://<account_id>.r2.cloudflarestorage.com

To use PreviewProxy with RustFS, set PP_S3_ENDPOINT to your RustFS server address:

PP_S3_ENABLED=true
PP_S3_BUCKET=my-assets
PP_S3_REGION=us-east-1
PP_S3_ACCESS_KEY_ID=<access_key>
PP_S3_SECRET_ACCESS_KEY=<secret_key>
PP_S3_ENDPOINT=http://<rustfs-host>:<port>