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.
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:
-
Pull image
docker pull baotaoserver/bt-nginx:latest
-
Create a container based on an image - basic settings
3. Folder path
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.
5, point turn应用
, etc. waiting container movement.
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.
If you don’t know the default password, just enter sh directly to change the password.
# 输入命令,启动菜单
~bt
# 根据菜单选择 5修改密码
~5
# 填入新密码
~输入新密码...
齐活
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 .
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.
After waiting for a while, everything is finally installed. CheckNGINX
whether the related services are started normally.
If Nginx fails to start, you can check the log.
presentation 80端口
occupied
Try to modify port 80 here (…default.conf & phpfpm.status.conf) to something else that is not occupied.
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.
Just click and click in the pagoda environment
Click **[Disable Function]** and change exec
, shell_exec
, readlink
, Delete the six disabled functions symlink
, putenv
, chown
, that is, cancel the ban
2.2 Create website
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.
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.
Download and put it into the project
Unzip it
-
Upload the installation package to the site directory and unzip it, and point the site's running directory to the program's
public
foldernginx needs to set pseudo-static, the content is as follows
location / { try_files $uri $uri/ /index.php?$query_string; }
-
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 to0755
Typically, the owner and user group of a Web site directory are
www: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.
3. Typora + PicGo + lsky configuration
Effect demonstration:
PicGo drag file upload
Typora drag-and-drop automatic conversion
3.1. Install PicGo plug-in
OpenTyproa
interface and find文件
—> in the menu bar偏好设置
exist
Click PicGo(app) to install
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
3.3 Configure lankong
// 版本选择 V2
Lsky pro version:V2
// 服务器填入
Server:https://img.deepe.ren
// 验证token (要根据自己账号获取)
Auth token:Bearer 1|hCKcAdIFxxxxxxxxxxxxxxxxxxIvSqJZ7q
Configuration completed:
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
Get the token throughtokens接口
, and fill in your account password belowemail
password
You can useapifox
or postman
to request it
Obtained token:3|hCKcAdIF38tEBlxxxxxxxxxxxxxxxxxxxxxxxx6W1IvSqJZ7q
Then according to the document, add a prefix in frontBearer
Return to the previous steplankong
configuration column and fill in the results.
3.4 PicGo test upload
Drag a picture to test it
3.5 Typora configuration
The configuration here is super simple
文件
- 偏好设置
- 图像
- Select PicGo(app)
to copy PicGo.exe
Path
You can click "Verify image upload options" to test.
my installation pathC:\Users\xiaozepeng\AppData\Local\Programs\PicGo
typora drag picture test
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".