Skip to content

S3 ချန်နယ် ထည့်သွင်းခြင်း

အသင့်တော်ဆုံး အခြေအနေ

အောက်ပါအခြေအနေများတွင် S3 ချန်နယ်ကို အသုံးပြုပါ။

  • Cloudflare R2၊ Backblaze B2၊ MinIO၊ AWS S3 သို့မဟုတ် အခြား S3-compatible object storage service တစ်ခုခုနှင့် ချိတ်ဆက်လိုပါက။
  • Endpoint၊ Access Key နှင့် Secret Key ပါဝင်သော standard S3 configuration model ကို အသုံးပြုလိုပါက။
  • Native Cloudflare R2 binding channel ကို မသုံးလိုပါက သို့မဟုတ် သင်၏ storage provider သည် Cloudflare R2 မဟုတ်ပါက။

မစတင်မီ လိုအပ်သည့်အရာများ

လိုအပ်ချက်ရည်ရွယ်ချက်
S3 Endpointobject storage service ၏ S3 API endpoint။
Bucket nameဖိုင်များ သိမ်းဆည်းမည့် bucket။
RegionStorage region။ Cloudflare R2 အတွက် ပုံမှန်အားဖြင့် auto ဖြစ်သည်။
Access Key IDS3 access key ID။
Secret Access KeyS3 secret access key။
CDN domainဖိုင်ဝင်ရောက်မှုအတွက် ရွေးချယ်နိုင်သော custom domain။

S3 API မှတစ်ဆင့် Cloudflare R2 ကို အသုံးပြုသည့် ဥပမာ။

text
Endpoint: https://your-account-id.r2.cloudflarestorage.com
Bucket: your-r2-bucket-name
Region: auto
Access Key ID: copied from the Cloudflare R2 API token
Secret Access Key: copied from the Cloudflare R2 API token

ထည့်သွင်းမည့်နေရာ

  1. စနစ် ဆက်တင်များ ကိုဖွင့်ပါ။
  2. အပ်လုဒ် ဆက်တင်များ သို့သွားပါ။
  3. ညာဘက်အပေါ်ထောင့်ရှိ ချန်နယ် ထည့်ရန် ကိုနှိပ်ပါ။
  4. S3 ကိုရွေးပါ။

အကွက် ရည်ညွှန်းချက်

အကွက်လုပ်ဆောင်ချက်လိုအပ်မှု
ချန်နယ်အမည်ဤ S3 ချန်နယ်အတွက် မှတ်မိလွယ်သောအမည်၊ ဥပမာ s3test သို့မဟုတ် R2-S3ဟုတ်သည်
Enable channelဤချန်နယ်သည် အပ်လုဒ်ရွေးချယ်မှုတွင် ပါဝင်မပါဝင်ကို ထိန်းချုပ်သည်။အကြံပြုသည်
Endpointhttps:// ပါဝင်သော S3 service endpoint အပြည့်အစုံ။ဟုတ်သည်
Custom CDN domainရွေးချယ်နိုင်သည်။ သတ်မှတ်ထားပါက generated file link များသည် ဤ domain ကို ဦးစားပေးအသုံးပြုမည်။မဟုတ်ပါ
Bucket names3test သို့မဟုတ် img-r2 ကဲ့သို့ bucket name။ဟုတ်သည်
Bucket regionRegion။ Cloudflare R2 အတွက် ပုံမှန်အားဖြင့် auto ဖြစ်သည်။ဟုတ်သည်
Access Key IDS3 access key ID။ဟုတ်သည်
Secret Access KeyS3 secret access key။ဟုတ်သည်
Path-style accessCompatibility switch။ မူရင်း အားဖြင့် ပိတ်ထားသည်။ MinIO၊ OpenList သို့မဟုတ် self-hosted S3 service အချို့တွင် လိုအပ်နိုင်သည်။မဟုတ်ပါ
Quota limitဤ S3 ချန်နယ်သည် capacity အပေါ်မူတည်သော အပ်လုဒ်ရွေးချယ်မှုတွင် ပါဝင်မပါဝင်ကို ထိန်းချုပ်သည်။မဟုတ်ပါ
Capacity limitquota limit ဖွင့်ပြီးနောက် လိုအပ်သည်။ ဥပမာ 10 GBquota limit ဖွင့်ထားပါက လိုအပ်သည်
Thresholdအသုံးပြုမှုသည် ဤရာခိုင်နှုန်းသို့ ရောက်လျှင် ရေးခြင်းကို ရပ်တန့်စေသည်။ ဥပမာ 90%quota limit ဖွင့်ထားပါက လိုအပ်သည်
မှတ်ချက်ကိုယ်ပိုင် maintenance အတွက် မှတ်ချက်များ။မဟုတ်ပါ

Cloudflare R2 S3 API Key များ ဖန်တီးခြင်း

  1. Cloudflare Dashboard ကိုဖွင့်ပါ။
  2. R2 Object Storage သို့သွားပါ။
  3. Manage R2 API Tokens သို့မဟုတ် API token management entry ကိုရှာပါ။

R2 API token entry

  1. Target bucket ကို access လုပ်နိုင်သော R2 API token တစ်ခု ဖန်တီးပါ။

Account API token ဖန်တီးခြင်း

  1. Generated Access Key ID နှင့် Secret Access Key ကို ကူးယူပါ။

Token တန်ဖိုးများ ကူးယူခြင်း

  1. R2 bucket စာမျက်နှာသို့ ပြန်သွားပြီး bucket name ကို အတည်ပြုပါ။
  2. အကောင့်အတွက် S3 API endpoint ကို မှတ်သားပါ။ ပုံမှန်အားဖြင့် အောက်ပါပုံစံမျိုးဖြစ်သည်။
text
https://your-account-id.r2.cloudflarestorage.com

ပြင်ဆင်မှု အဆင့်များ

  1. အပ်လုဒ် ဆက်တင်များ ကိုဖွင့်ပါ။
  2. ချန်နယ် ထည့်ရန် ကိုနှိပ်ပါ။
  3. S3 ကိုရွေးပါ။
  4. ဥပမာ s3test ကဲ့သို့ သင်မှတ်မိနိုင်သော ချန်နယ်အမည် ကိုထည့်ပါ။
  5. Endpoint တွင် S3 API endpoint ကိုထည့်ပါ။
  6. Custom CDN သုံးပါက Custom CDN domain တွင် ထည့်ပါ။ မသုံးပါက အလွတ်ထားပါ။
  7. Bucket name ကိုထည့်ပါ။
  8. Region ကိုထည့်ပါ။ Cloudflare R2 ဥပမာအတွက် auto ကိုအသုံးပြုပါ။
  9. Access Key ID နှင့် Secret Access Key ကိုထည့်ပါ။
  10. Provider က အတိအကျလိုအပ်ကြောင်း မဖော်ပြထားလျှင် path-style access ကို ပိတ်ထားပါ။
  11. Capacity control လိုအပ်ပါက quota limit ကိုဖွင့်ပြီး capacity limit နှင့် threshold ကိုထည့်ပါ။
  12. Save ကိုနှိပ်ပါ။

S3 configuration ထည့်ခြင်း

အတည်ပြုနည်း

စစ်ဆေးချက်အတည်ပြုနည်း
ချန်နယ်ကတ် ပေါ်လာသည်သိမ်းပြီးနောက် အပ်လုဒ် ဆက်တင်များ စာမျက်နှာတွင် S3 ချန်နယ်ကတ် ပေါ်လာသင့်သည်။
Channel ကို enable လုပ်ထားသည်Card ၏ ညာဘက်အပေါ်ထောင့်ရှိ switch သည် ဖွင့်ထားသည့်အခြေအနေတွင် ရှိသင့်သည်။
အဓိက အကွက်များ သိမ်းထားသည်Detail view တွင် Endpoint၊ Bucket၊ Region၊ path-style access နှင့် ဆက်စပ် အကွက်များ ပြသသင့်သည်။
Upload အလုပ်လုပ်သည်စမ်းသပ်ပုံတစ်ပုံကို အပ်လုဒ်လုပ်ပြီး object သည် target bucket တွင် ပေါ်လာကြောင်း အတည်ပြုပါ။
Link ဖွင့်နိုင်သည်Upload ပြီးနောက် ပြန်လာသော image link ကို ပုံမှန်ဖွင့်နိုင်သင့်သည်။
Capacity display အလုပ်လုပ်သည်quota limit ဖွင့်ထားပါက card တွင် used capacity နှင့် configured limit ကို ပြသသင့်သည်။

S3 capacity statistics ကို provider bucket ကို real time query လုပ်ခြင်းဖြင့် မတွက်ချက်ပါ။ ImgHost ၏ local file records မှ တွက်ချက်သည်။ S3 configuration ကို သိမ်းပြီးနောက် စနစ်သည် လက်ရှိ D1 records မှ quota ledger ကို ပြန်လည်တွက်ချက်သည်။

Quota query အောင်မြင်ခြင်း

FAQ

path-style access ကို enable လုပ်သင့်ပါသလား။

ပုံမှန်အားဖြင့် မလိုအပ်ပါ။

သင်၏ S3-compatible provider သည် virtual-hosted-style URL များကို မပံ့ပိုးပါက သို့မဟုတ် provider documentation က path-style access လိုအပ်ကြောင်း အတိအကျဖော်ပြထားပါကသာ enable လုပ်ပါ။ MinIO၊ self-hosted S3 နှင့် OpenList-compatible endpoint အချို့တွင် လိုအပ်နိုင်သည်။

CDN domain ကို ဘာအတွက်သုံးသနည်း။

Bucket ရှေ့တွင် CDN သို့မဟုတ် custom access domain တစ်ခု ထားရှိပါက ၎င်းကို ဤနေရာတွင် ထည့်ပါ။

ပြင်ဆင်ပြီးနောက် generated file link များသည် ဤ domain ကို ဦးစားပေးအသုံးပြုမည်။ CDN မသုံးပါက အလွတ်ထားပါ။

အပ်လုဒ် ဘာကြောင့် မအောင်မြင်သနည်း။

အောက်ပါအချက်များကို ဦးစွာစစ်ဆေးပါ။

  1. Endpoint တွင် https:// ပါဝင်သော URL အပြည့်အစုံ ပါရှိသည်။
  2. Bucket name မှန်ကန်သည်။
  3. Region သည် provider လိုအပ်ချက်နှင့် ကိုက်ညီသည်။
  4. Access Key ID နှင့် Secret Access Key ကို အပြည့်အစုံ ကူးယူထားသည်။
  5. Key တွင် target bucket အတွက် write permission ရှိသည်။
  6. Provider သည် path-style access မလိုအပ်ပါ၊ သို့မဟုတ် လိုအပ်ပါက path-style access ကို enable လုပ်ထားသည်။

အမြန် စစ်ဆေးစာရင်း

text
Prepare S3 Endpoint, Bucket, Region, Access Key, and Secret Key
-> Open Upload Settings
-> Add Channel
-> Select S3
-> Enter Endpoint / Bucket / Region / Access Key / Secret Key
-> Enter a CDN domain if needed
-> Leave path-style access off by default
-> Enable quota limit if needed
-> Save
-> Upload a test image and check the result

Released as user documentation for ImgHost.