Cloudflare R2 和 shareX 联动 图床

从零开始搭建你的免费图床系统 (Cloudflare R2 + WebP Cloud + PicGo) · Pseudoyu
博友用这个搭建图床。感觉不错。
picgo能达成的我想 sharex一定可以达成。
多个备用的免费图床也是不错的。
说干就干。
sharex的教程不多。
只有官方的参考。不过挺详细的了。
如果不明白设置的其实参考picgo的也可以的
例如这个文章。Cloudflare R2设置部分十分详细。
segmentfault.com/a/1190000044911455

chrome_sujevhmL27.png
Cloudflare R2 guide - ShareX shareX官方配置文章
‘’## How to configure Cloudflare R2 and use it in ShareX

Make an account for Cloudflare.

Ensure that your domain is added onto Cloudflare and verified with NS (Name Server) records on your domain registrar. Your domain has to be hosted through Cloudflare otherwise this won't work at all, and you will be unable to use R2 / Cloudflare CDN to host your images.

While R2 is not free, it does have a generous free tier. The full pricing is available to see here.

To create a bucket:

  1. Open R2.
  2. Select Create bucket.
  3. Type in your bucket name of choice, and click Create Bucket.
  4. Select Settings.
  5. Scroll to Domain Access and select Connect Domain.
  6. Type in your domain and select Continue.
  7. Select Connect domain.

This will connect your domain to the R2 bucket, and will allow any objects inside of that bucket to be accessible by the selected domain.

To create an API token:

  1. Open R2.
  2. Select Manage R2 API Tokens on the right top side of the dashboard.
  3. Select Create API token.
  4. Select the pencil icon or R2 Token text to edit your API token name.
  5. Under Permissions, select Read or Edit for your token.
  6. Select Create API Token.
  7. Save a copy of your Access Key ID and Secret access key for the next step.

To configure uploading with ShareX:

  1. In Destinations, select Destination Settings.
  2. Scroll down to Amazon S3 and select it.
  3. Using the Access Key ID & Secret access key fill in the two top boxes.
  4. Select "Endpoint:" and type <ACCOUNT_ID>.r2.cloudflarestorage.com. (you can find your account ID on the right hand side of your Dashboard)
  5. Set Region: to auto.
  6. Fill Bucket name: with the Bucket Name you picked on Cloudflare.
  7. Change Upload path: to your preference.
  8. Update Use custom domain: to the domain that you selected in the first step.
  9. Untick "Set public-read ACL on file".
  10. Ignore the rest of the settings.
  11. In Destinations, select Image uploader: and change it to File Uploader -> Amazon S3.
  12. Take a screenshot, and ensure that it uploads correctly.

Now you are ready to use Cloudflare R2 in ShareX!
‘’
ShareX_bG4M5PcYoi.png

4 条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注