banner
Geek

Geek

🧠在家居士 | 🥦素食者 | 🏃🏻马拉松爱好者 | 📡AI降临派 | 过🪜技术资深学者 | 🤖科技狂 | 📤更新狂🆅 https://www.igeekbb.com/
twitter
github

Build a free image hosting service using PicGo + uPic + Github

787shots_so

Introduction#

Since coming to xLog, I have developed the habit of writing blogs. Although xLog currently has no restrictions on uploading images and is free, I have always developed the habit of backing up the services I use, so I am not afraid of them shutting down. After comparing Amazon S3 & Cloudflare R2, if you are interested, you can take a look at R2 vs S3. I feel that Cloudflare R2 has a higher cost performance and you can also get 10 GB for free, but I am always afraid of being betrayed. I don't consider the issue of mainland IP access, so I simply switched to the free Github. Who can be more stable than Github? In short, "better safe than sorry".

Github Image Library#

Create a Repository#

Register a Github account and create a repository. Remember the name of the repository.

Create a Token#

1/Click on "Settings" under "Profile".

CleanShot2023-05-20at10.35.21@2x

2/Select "<>Developer settings" at the bottom left.

image

3/Select "Tokens (classic)" and click on "Generate new token (classic)".

CleanShot 2023-05-21 at 10.42.58@2x

4/Fill in the optional note and make sure to check "repo".

CleanShot 2023-05-20 at 10.44.07@2x

5/Copy the token.

CleanShot 2023-05-20 at 10.45.25@2x

That's it, the Github image library is set up


PicGo#

Download PicGo#

Configure PicGo#

Open PicGo settings, select Github, and edit the configuration file on the right.

CleanShot2023-05-20at13.27.03@2x

Enter the repository name (in the format of username/repo) you noted in the first step and paste the token you copied. Then click "OK".

CleanShot2023-05-20at13.27.35@2x


uPic#

Download uPic#

ProjectLink
uPic  Githubhttps://github.com/gee1k/uPic
Homebrewbrew install bigwig-club/brew/upic --cask
Github Downloadhttps://github.com/gee1k/uPic/releases

Configure uPic#

In the settings, select the image hosting service and choose "Github" at the bottom left.

  • Username: Github username. For example, my Github homepage is https://github.com/gee1k, so my username is gee1k.
  • Repository: The name of the repository where the uploaded files will be stored. For example, my repository address is https://github.com/gee1k/oss, so the repository name is oss.
  • Branch: The branch name, default is master. If it is a different branch, you must create the branch before uploading.
  • Token: Github personal access token.
  • Domain: The domain name is not necessary to set. It will use the default Github access address. If your repository has enabled the pages feature and configured a custom domain, you can use your custom domain here.
    ---quoted from https://blog.svend.cc/upic/tutorials/github/

Save the settings.

CleanShot2023-05-20at13.44.50@2x

jsDelivr Acceleration#

If you need jsdelivr CDN acceleration, please check the box👇

The link will become

https://cdn.jsdelivr.net/gh/geekbb/oss_img@×***

CleanShot2023-05-20at13.44.30@2x


Typora#

The configuration of Typora is simpler. Once you have configured PicGo, select PicGo.app in the Typora settings.

CleanShot2023-05-20at13.55.06@2x

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