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

Tổng quan ItemsAdderUploadPlus

IAUP giải quyết một vấn đề vận hành: sau khi ItemsAdder tạo resource pack, server cần host file zip ở nơi player có thể tải ổn định. IAUP upload zip lên object storage tương thích S3 và cập nhật ItemsAdder trỏ tới URL mới.

Khi upload thủ công hoặc khi có event ItemsAdder pack-compressed, IAUP:

  1. đọc plugins/ItemsAdderUploadPlus/config.yml
  2. tìm pack file đã cấu hình
  3. upload lên storage tương thích S3
  4. tạo download URL
  5. tùy chọn cập nhật plugins/ItemsAdder/config.yml
  6. tùy chọn dispatch /iareload

Pack file mặc định:

plugins/ItemsAdder/output/generated.zip

Key ItemsAdder target mặc định:

resource-pack.hosting.external-host.url

Dùng IAUP khi:

  • server dùng ItemsAdder
  • local self-host không đủ
  • muốn delivery resource pack qua CDN
  • muốn upload vào private bucket với presigned download URL
  • tạo pack thường xuyên và muốn giảm bước thủ công

IAUP không tạo ItemsAdder pack. ItemsAdder vẫn sở hữu /iazip và pack compression. IAUP bắt đầu sau khi zip tồn tại.

IAUP cũng không tự cấu hình cloud account. Bạn phải tạo bucket, credential, public domain hoặc CDN, và policy.

IAUP dùng AWS S3 Java SDK. Vì vậy nó có thể hoạt động với AWS S3 và nhiều service tương thích S3:

  • AWS S3
  • Cloudflare R2
  • MinIO
  • RustFS
  • endpoint tương thích S3 khác

Khác biệt provider được xử lý bằng:

  • s3.endpoint
  • s3.region
  • s3.path_style
  • s3.acl
  • s3.public_url_base

Dùng khi object có thể tải qua public bucket, public endpoint, CDN, hoặc custom domain.

s3:
use_presigned_url: false
public_url_base: "https://cdn.example.com"

Dùng khi bucket private và client phải tải qua URL ký tạm thời.

s3:
use_presigned_url: true
presigned_expiry_seconds: 3600

Presigned URL có thể giảm public exposure, nhưng expiry ngắn có thể làm player tải pack thất bại sau khi URL hết hạn.