Royc30ne

Royc30ne

机器学习 | 联邦学习 | VPS | 摄影 | 日常

Advanced use of Chevereto V4: Mounting external object storage to expand storage space.

The article was first published on Advanced Usage of Chevereto V4: Mounting External Object Storage for Extended Storage Space, please indicate the source if reposted.

In this blog post, we will introduce how to mount external storage object storage in Chevereto V4. Chevereto is an open-source image hosting and sharing system that supports various storage options, including local storage and external object storage services. Since our image hosting platform often runs on VPS, when the capacity is not enough, we can expand the storage space of our image hosting platform through S3 object storage.

Prerequisites#

Before getting started, make sure you have completed the following steps:

  1. Installed and configured Chevereto V4. (You can refer to my previous article on how to install and configure it: # Teach You How to Use Docker to Install Chevereto V4 and Build Your Own Image Hosting Platform)
  2. Have an account for an external object storage service, such as Amazon S3, Google Cloud Storage, or DigitalOcean Spaces. Here, we will take Backblaze as an example, which is cheaper compared to big companies like Google.

image

Step 1: Register and Obtain Key#

First, you need to obtain the access information for your S3 object storage service. This usually includes:

  • API Endpoint URL of the storage service
  • Access Key
  • Secret Key

Taking Backblaze as an example, first go to the Backblaze official website to register your account. After registration, you will have 10GB of free storage capacity. Then click on My Account to enter the backend management interface and create a new storage bucket.

image

When creating the storage bucket, enter a name you like in Bucket Unique Name, and make sure to check the second option Public. Otherwise, Chevereto will not be able to access the files in the object storage.

image

The next step is to create a new Application Key to obtain the operations and access permissions for the newly created bucket.

image

When creating the Application Key, make sure to obtain both write and read permissions for Chevereto to operate on and access the images. Since we are mounting external storage through S3 storage, it is best to check Allow List All Bucket Names as well.

20230511234840.webp

After creating it, you will be returned to the original webpage. A pop-up box will appear, and remember to take note of the keyID and applicationKey for the next step. If you leave this webpage, you will not be able to return and can only create a new Application Key.

image

Step 2: Configure Chevereto#

Open the Chevereto admin panel and navigate to Settings -> External Storage. In the External Storage section, click Add to add a new external storage.

image

In the dialog box that appears, you need to fill in the following information:

  • Storage Name: Customize a name you like.
  • API: Here we use S3 object storage, so select S3 compatible.
  • Region: The storage region of the object storage.
  • Bucket: The name of the storage bucket you want to use.
  • Access Key: The Access Key of your storage service.
  • Secret Key: The Secret Key of your storage service.
  • Endpoint: The Endpoint of the storage service.
  • URL: The URL of the storage.

I will tell you where to obtain these things. First, the keyID and applicationKey we obtained earlier correspond to the Access Key and Secret Key. Bucket is the name you gave to the bucket. The Endpoint can be seen in the Backblaze backend as shown in the following image. The region is the second segment of the domain name, which is us-east-005 here.

image

The URL is {https://} + Bucket ID + {EndPoint}, which is https://Demo-Bucket.s3.us-east-005.backblazeb2.com/ here.

image

After filling in this part, the creation is successful. Return and check the Active column to start storing images in the object storage.

Step 3: Test Configuration#

After completing the configuration, you should see the storage you just added in the Settings -> External Storage section of Chevereto. You can upload a new image and enter the album. If the image is displayed correctly, it means you have successfully mounted the external storage object storage to Chevereto V4!

🎉Congratulations!

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