I haven’t updated it for a long time. I was too busy some time ago, and it was a bit messy, so, um, I understand everything. The day before I wrote this blog, I sat in a chair for two hours, thinking about the meaning of life.
Without further ado, let’s get started.
1. Cause
Because I haven’t managed the blog for a long time, I don’t know what’s going on with the blog recently. Suddenly one day, a friend sent me a message:
I just found out that the pictures on the blog had been dropped. I searched for the reason and found that the pictures on csdn could not be accessed from external links, which is very (ke) good (wu). I admit that I have always used csdn’s blog system as a picture bed, ahaha, I have no choice but to compromise, so I considered the picture bed.
2. Image bed selection
I have known a lot of picture beds before, so I don’t recommend them here, mainly: free if you can.
At the beginning, I chose Lychee image bed, but Typora didn’t support it, so I replaced it and didn’t use it. If Lychee image bed is built, I will write another article later.
So I chose PicGo (because Typora supports it) and Minio (docker shortcut) to work with my Typora and hexo.
3. Operating environment
Native: Macbook Air (M2) MacOS: 13.2
Local environment: configured hexo and installed PicGo and Typora.
VPS: Baidu cloud server (1 core 2g)
VPS environment: installed docker.
4. Serving
1. Configure docker and start Minio
(1) Pull the latest image from Minio
docker pull minio/minio
(2) The container starts the MinIO instance
docker run -p 9000:9000 -p 9001:9001 --name minio -d --restart=always -e "MINIO_ACCESS_KEY=xxx" -e "MINIO_SECRET_KEY=xxxxxxxx" -v /home/data:/data - v /home/config:/root/.minio minio/minio server --console-address ":9000" --address ":9001" /data
ps: Port 9000 is used by the console, port 9001 is used by API, MINIO_ACCESS_KEY=xxx sets the login user name here, MINIO_SECRET_KEY=xxxxxxxx sets the login password here, /home/data is the host mapping directory volume, /home/config is Host-mapped configuration file directory volume.
The user name must be at least 3 characters, and the password must be at least 8 characters.
(3) Configure MinIO
Now it can be accessed through ip:9000:
Enter the account password, enter the management interface, click Buckets on the left, and create a new Bucket on the right:
Enter the name and click Create Bucket:
Click the newly created Buckets, enter the configuration, and click Anonymous at the bottom:
Then add a rule:
Set a name, then change the permission bit to readwrite:
Then return to the homepage of buckets, click private under access policy:
Change to public, then click set:
Next, configure the access key, click Access Keys on the left menu bar, and create a new key:
Remember these two keys, and click create:
2. Configure PicGo
(1) Install PicGO
I can download directly in Typora:
(2) Install the MinIO plugin
You can search for Minio in the plug-in after science, and then install it, or install it on github:
I have not tried github, you can refer to other tutorials.
(3) Configure PicGo
After installing the MinIO plug-in, you can see the MinIO map bed in the map bed settings, add one, and then configure:
You can upload a picture to verify it.
3. Configure Typora
In Typora settings, click the image, select PicGo.app as the upload service, and then click the verification image upload option, and it can be used if it appears normal:
5. Problems encountered
If you use Hexo + Github to deploy, after the image bed is deployed, you can see that the image is displayed locally, but you cannot see it after github is deployed. The picture of minio is http service, you need to enable Minio’s HTTPS service, you need certificate settings.
I use the certificate generated by the official certgen.exe to generate two files, upload them to a directory on the server, then use docker to specify the certificate directory, then start a MinIO service, change a port, and then upload it through MinIO of the HTTP service Image, MinIO displayed blog on HTTPS service.
6. Blog URL
https://maxenton-pym.top/
If you have any questions, you can leave a message or send a private message.