NAS + Pagoda + typora + PicGo + lsky build automatic image uploading (with results, you can use it directly)

Typora + PicGo + lsky build automatic uploading of pictures

Introduction:

What is the most reassuring thing in the world? Everyone may have their own answer.

But as a persondeveloper, in an era of massive data leaks, I feel that the most important thing is to have the data in my own hands, which gives me the most peace of mind!

Recently writingmarkdown, when uploading pictures to博客, the local pictures cannot be quickly pasted to major platforms such as blogs.

Probably the pictures on each blog are protected and cannot be copied and pasted.

Just think about building it yourself图床.

This tutorial is divided into two parts. If you don’t want to deploy and build the map bed by yourself, you can go directly to the third step! .

1. Set up the operating environment

The image bed environment built this time is NAS + docker + pagoda + Lsky

Because I need relatively stable conditions, my Hei Qunhui environment is not very stable.

My soft router ikuai openwrt is stable for 122 days, while Black Synology only runs stably for 99 days.

image-20230817143256114

In order to ensure that the image bed can be accessed within 7*24 hours, the image bed is placed on NAS this time.

1.1 NAS-docker installation and deployment pagoda

Before continuing reading, it is recommended to first understand how to deploy in NAS宝塔(https://www.bt.cn/new/index.html).

I use the image made by kangkang223 in Jispace (which solves the permission problem).

https://hub.docker.com/r/kangkang223/baota

Official website Pagoda official website (Why use Pagoda, because it is too convenient to install various environments)

https://hub.docker.com/r/btpanel/baota

Okay, let’s get started:

  1. Pull image

    docker pull baotaoserver/bt-nginx:latest
    
  2. Create a container based on an image - basic settings

image-20230817150713227

3. Folder path

image-20230817151340183

The left side is the folder that needs to be created by Jispace NAS, and the right side is the directory after the container is run.

After mapping, you can find the file in the extreme space directory later, which is convenient for modification without having to use sh to modify it every time.

Directory that needs to be set:

  • Backup path:/www/backup

  • Website data directory inside the container:/www/wwwroot

  • MySQL data directory:/www/server/data

  • vhost file path:/www/server/panel/vhost

4. Network configuration, select host here, use the same IP as the host (extreme space), go to the router later to release the 8888 port, then It can be accessed through the external network.

image-20230817150807560

5, point turn应用, etc. waiting container movement.

image-20230817152230439

Note: After the deployment is completed, please log in to the Pagoda panel immediately -> Modify the user name and password in the panel settings and modify the security entrance

1.2 Pagoda login and password change

Generally, you need to go through a dedicated entrance when logging in after the installation is complete:

I added a btpanel here, so through192.168.1.60:8888/btpanel

In fact, it doesn’t matter if you don’t know. Anyway, enter bt into the server and you can modify the entrance and password login information.

image-20230817151833456

If you don’t know the default password, just enter sh directly to change the password.

image-20230817152119500

# 输入命令,启动菜单
~bt
# 根据菜单选择 5修改密码
~5
# 填入新密码
~输入新密码...
齐活

image-20230817151858229

Log in via portal

1.3 Pagoda installation and deployment environment

After coming in, without saying a word, I first installed the LNMP environment, because it will be needed for later deployment of lsky projects, and this time will be important img.

image-20230817152030464

While waiting, you can check whether the file mapping between this directory file and the NAS is established.

Upload a file and see if it is available on the NAS.

image-20230817152540517

After waiting for a while, everything is finally installed. CheckNGINX whether the related services are started normally.

img

If Nginx fails to start, you can check the log.

image-20230817163202775

presentation 80端口occupied

Try to modify port 80 here (…default.conf & phpfpm.status.conf) to something else that is not occupied.

image-20230817163053983

2. Deploy the lsky map bed

Special thanks兰空图床https://www.lsky.pro/ for your strong support!

You can also take a look at the tutorials on the official website, they are very clear and concise, so I will just be verbose.

2.1 Install extension

Check the installation requirements written on the official website one by one.

image-20230817154556738

Just click and click in the pagoda environment

image-20230817154546637

Click **[Disable Function]** and change exec, shell_exec, readlink, Delete the six disabled functions symlink, putenv, chown, that is, cancel the ban

image-20230817154811849

2.2 Create website

image-20230817155428602

Now you can access this empty project through 192.168.8.60:16080, and there should be a welcome interface (index.html).

If you need external network access, you also need to set up port mapping on the firewall.

The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly.

2.3 Upload project

This is the source code address:

https://github.com/lsky-org/lsky-pro/releases

Open downloadlsky-pro-2.1.zip

If youare nota developer,please do notdownload The compressed package named Source Code is the core source code and you need to install the extension yourself.

aa

image-20230818143522512

Download and put it into the project

image-20230818143717935

Unzip it

  1. Upload the installation package to the site directory and unzip it, and point the site's running directory to the program's public folder

    nginx needs to set pseudo-static, the content is as follows

    location / {
          
          
      try_files $uri $uri/ /index.php?$query_string;
    }
    
  2. Change the permissions, user groups and owners of all folders, subfolders, and files in the directory where the program is located to www, and change the permissions to 0755

    Typically, the owner and user group of a Web site directory arewww:www

The project is ready to run.

After configuring the domain name, visit the siteHomepage. The program will automatically jump to the installation page. After the environment detection passes, you can proceed through the guide. Install.

Before starting, I built my own picture bed at https://img.deepe.ren, registered my own account, and then used my own token, so that the pictures are private.

image-20230818144248884

3. Typora + PicGo + lsky configuration

Effect demonstration:

PicGo drag file upload

picgo-menubar

picGo

Typora drag-and-drop automatic conversion

Typora drag-in demo

3.1. Install PicGo plug-in

OpenTyproa interface and find文件—> in the menu bar偏好设置

image-20220504145003204exist

Click PicGo(app) to install

image-20230818150125053

Then click download below and wait for a while...

Special reminder: When installing, remember to savethe installation path for later use

3.2 Install Lankong plug-in on PicGo

image-20230818150314721

3.3 Configure lankong

// 版本选择 V2
Lsky pro version:V2
// 服务器填入 
Server:https://img.deepe.ren
// 验证token (要根据自己账号获取)
Auth token:Bearer 1|hCKcAdIFxxxxxxxxxxxxxxxxxxIvSqJZ7q

Configuration completed:

image-20230818140050397

3.3.1 How to obtain token

You can use mine directly: https://img.deepe.ren

Open in the browserLskyPro management interface (built earlier)https://img.deepe.ren, find and get a>tokens接口, upload上传接口:

https://img.deepe.ren/api/v1

image-20230906230313323

Get the token throughtokens接口, and fill in your account password belowemail password

image-20230906230349927

You can useapifox or postman to request it

image-20230906230526818

Obtained token:3|hCKcAdIF38tEBlxxxxxxxxxxxxxxxxxxxxxxxx6W1IvSqJZ7q

Then according to the document, add a prefix in frontBearer

image-20230906230639388

Return to the previous steplankong configuration column and fill in the results.

3.4 PicGo test upload

Drag a picture to test it

picGo drag and upload pictures

3.5 Typora configuration

The configuration here is super simple

文件 - 偏好设置 - 图像 - Select PicGo(app) to copy PicGo.exePath

You can click "Verify image upload options" to test.

my installation pathC:\Users\xiaozepeng\AppData\Local\Programs\PicGo

image-20230818140541903

typora drag picture test

Typora drag-in demo

The pictures uploaded in this way are in the cloud, and they no longer need to be uploaded manually when they are later published in the "community".

Guess you like

Origin blog.csdn.net/m0_37680500/article/details/132362580