joe

joe

picgo uses Cloudflare R2 storage.

Currently, R2 provides 10GB/month of free storage space, and there is also a free quota for traffic, which is basically enough for a general personal blog.

R2 Pricing#

Free QuotaPaid - Rates
Storage10 GB / month$0.015 / GB-month
Class A Operations1 million requests / month$4.50 / million requests
Class B Operations10 million requests / month$0.36 / million requests

Create a Storage Bucket#

After activating R2, go to the R2 interface and click the Create Storage Bucket button, as shown in Figure 1.

https://res-joe-blog.midware.dev/2023/04/c9ad6bf4e226f44a3b3778e87476a2bd.png

Figure 1

Fill in the storage bucket information:

https://res-joe-blog.midware.dev/2023/04/755e192c33611eb66f038e97210be604.png

Figure 2

Bucket Name: Choose according to your needs.

Location: You can select "Automatic" (i.e., no dropdown options) or choose the region where your audience is located, such as Asia-Pacific if your audience is in China or the surrounding areas.

Access: If it is not for public access, you can ignore it. If you need to provide public access, you can enable it after creating the storage bucket.

After filling in the information, click the "Create Storage Bucket" button to create a storage bucket. If you don't need to provide public access, you can skip the next section on "Setting up the Storage Bucket."

Set up the Storage Bucket#

https://res-joe-blog.midware.dev/2023/04/60c2c64d702d885dfd9f66c58766fc26.png

Figure 3

In the settings page, we can see that public URL access and domains are not allowed. Now let's enable public access. Click the "Allow Access" button next to R2.dev Subdomain in the settings page. This will enable public access. At this time, a green label saying "Allowed" will be displayed next to R2.dev Subdomain. Cloudflare will assign a subdomain to us, but it is not recommended to use this subdomain to access resources, as explained on the Cloudflare settings page.

https://res-joe-blog.midware.dev/2023/04/be343fc945202d0aeae0f99a41619502.png

Figure 4

If you have your own domain, you can set it in the Custom Domain to replace the default assigned r2.dev subdomain.

If you need to set up cross-origin resource sharing (CORS), you can do so in the CORS Policy section below.

Apply for R2 API Token#

In the top right corner of Figure 1, there is a link for managing R2 API Tokens. Click on this link to enter the page. On the right side, click the Create API Token button. In the creation page, you need to set a few things:

https://res-joe-blog.midware.dev/2023/04/bc5b89c938a92c5c3e227f6867bee50d.png

Figure 5

Token Name: Modify according to your needs.

Permissions: Select "Edit" permission, as PicGo upload requires edit permission.

TTL: The validity period of resources under this storage bucket. Choose according to your needs. I chose "Permanent" for myself.

Client IP Address Filtering: If there are no specific restrictions, you can leave it as default.

Then click the "Create API Token" button. After successful creation, record the Access Key ID and Secret Access Key.

Set up PicGo#

PicGo is a free, open-source, cross-platform tool with a powerful plugin system. It supports most common hosting platforms. You can download the latest version from the official website.

After installation, click on the plugin settings and search for "S3" in the search box. The first one is the plugin, so install it.

https://res-joe-blog.midware.dev/2023/04/60e887ff8b08f512b1cac7ee3fca2498.png

Figure 6

Image Hosting Settings

Select "Amazon S3" and fill in the relevant configurations. After configuring, you can start uploading images.

Access Key ID: Access Key ID
Access Key: Secret Access Key
Bucket: Storage Bucket Name
File Path: Configure according to your needs. For details, refer to the plugin page instructions.
Region: The region selected when creating the storage bucket.
Custom Endpoint: The one below "test" in Figure 3.
Custom Domain: Fill in if you have one.
bucketEndpoint: yes

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.