Settings Reference

Currently, S3 Image Port settings include three parts:

  1. S3 Bucket Settings
  2. Gallery Settings
  3. Upload Settings

S3 Bucket Settings

Endpoint, bucket name, region, Access Key, and Secret Key are all provided when creating an S3 bucket, so we won't elaborate on them here.

Use Path Style API

For the vast majority of S3 providers, this option should be kept disabled. This is a fallback prepared for some particularly old S3 providers.

For more information about path name and virtual hosted-style, refer to the AWS S3 documentation.

Public URL

Images in the bucket need to be directly accessible through a link.

For example, if an image's path in the bucket is i/2024/05/29/name.jpg, and you can directly access it (without authentication) through the link https://i.yfi.moe/i/2024/05/29/name.jpg, then https://i.yfi.moe/ is the Public URL you need to fill in.

If you directly use the "public bucket" feature of some S3-compatible services, the same principle applies. For example, for Cloudflare R2, it should look like https://pub-<bunch-of-characters>.r2.dev. For Tencent Cloud COS, it should look like https://<BucketName-APPID>.cos.<Region>.myqcloud.com

Include Path

Optional path prefix to filter which objects are listed from your S3 bucket. This is useful when your bucket contains non-image objects or when you want to organize images in specific paths.

When you specify an include path (e.g., i/), only objects starting with that prefix will be fetched from S3. This filtering happens at the API level, reducing data transfer and improving performance.

Examples:

  • Leave empty to list all objects in the bucket
  • i/ - only list objects starting with "i/"
  • images/ - only list objects starting with "images/"
  • 2024/photos/ - only list objects starting with "2024/photos/"

Note: This setting filters objects when they are fetched from S3. Changing this value will automatically refresh the gallery to show only the filtered objects.

Upload Settings

Key Template

The naming template when uploading to S3. Placeholders wrapped in {{}} will be replaced.

The following placeholders are supported:

  • {{year}}: Year. e.g., 2024
  • {{month}}: Month (two digits). e.g., 05
  • {{day}}: Day (two digits). e.g., 29
  • {{timestamp}}: Unix timestamp. e.g., 1732847234567 (milliseconds)
  • {{filename}}: Filename (without extension). e.g., image
  • {{ext}}: File extension. e.g., jpg
  • {{ulid}}: Unique identifier (ULID). e.g., 01BX5ZZKBKACTAV9WEVGEMMVR0
  • {{ulid-dayslice}}: ULID day slice (recommended for use with year, month, day). e.g., 5zzkbk-mmvr
  • {{random}}: Random string (deprecated, use ulid-dayslice instead)

Default template: i/{{year}}/{{month}}/{{day}}/{{ulid-dayslice}}.{{ext}}

Example result: i/2024/05/29/5zzkbk-mmvr.jpg

Image Compression and Conversion

Images will be processed according to the given parameters during upload.

Auto Refresh

Automatically refresh every time the gallery is loaded. If enabled, the gallery cache will sync better with the S3 bucket, but there will be more ListObjects requests, which may slightly increase S3 costs.