← Back to all posts
Environment Setup2 min read

Repost: Handling Gitee Image Hosting External-Link Issues

After discovering that Gitee had restricted external links and the blog’s images could no longer load, the image repository was cloned, uploaded to Qiniu Cloud, and the Markdown image URLs were replaced.

#image hosting#Gitee
Read in Chinese→

Preparing Qiniu Image Hosting

I got up in the middle of the night and discovered that Gitee image hosting had restricted external links, leaving the blog inaccessible. I was completely dumbfounded.

[哭泣

Crying

All the images on the blog had become impossible to load.

[心如死灰.jpg

Heartbroken.jpg

After trying several image-hosting platforms, I found that Qiniu Cloud does not modify filenames when files are uploaded (SM.MS does), so I decided to clone the repository, upload it to Qiniu Cloud, and then update the image URLs.

Cloning the Repository

Simply locate the image-hosting repository, package it, and download it.

[克隆仓库

Clone Repository

Preparing Qiniu Image Hosting

I’ll skip the Qiniu Cloud registration process. We’ll use Qiniu Cloud’s Object Storage service.

[对象存储

Object Storage

Create a new bucket under Bucket Management and set it to public.

[新建空间

Create Bucket

Once it has been created, refresh the page, open the bucket, switch to File Management, click Upload Files, and select all the images in the cloned repository.

[上传文件

Upload Files

[上传

Upload

After clicking Start Upload, you can open the Task Center on the right to view the upload progress.

[上传进度

Upload Progress

Once the upload is complete, refresh the page and click File Details to view the file URL.

[文件信息

File Information

Replacing File URLs

Next comes the tense and exciting process of replacing the Markdown links.

You can write code to read the files and perform the replacements. I used an IDE here for a simple text replacement. Just replace the original Gitee prefix with Qiniu’s CDN URL.

[地址替换

Replace URLs

After completing the replacements, deploy and push the changes in one go. Everything is back to normal now, and I can finally rest easy.

[恢复正常

[Back to Normal](

Author: maple
Article URL: http://www.ice-maple.com/2022/03/26/Gitee Pic Host Crash/
Copyright Notice: Unless otherwise stated, all articles on this blog are licensed under the BY-NC-SA license. Please credit the source when reposting!