He that would do a good job must sharpen his tools. This article teaches you Typora + PicGo + LskyPro to create a comfortable writing environment.
Wang Xiaoer blogs at itwxe.com
Imperceptibly stop better many days, compare work and amateur more busy recently. Work busy fixing and writing bugs; Amateurish blog recently, using a wide domain name, Nginx configuration split, blog site style optimization, blog CDN increase and so on… The following will be written articles, interested partners are welcome to pay attention ah.
In terms of writing, the map bed was migrated from self-built MinIO to self-built Map bed Lsky Pro, which is also the key content of this article. At the same time, I opened my own wechat public account, and I used the open source tool Doocs/MD to build a one-click Markdown into wechat public account article page. Next will be at the same time to wechat public account synchronization article.
The small talk ends, and the text begins.
One, Typora+PicGo+Lsky Pro role
Typora: What you see is what you get Markdown editor, support MacOS, Window, Linux platform, super shortcut keys, greatly improve writing efficiency.
PicGo: a tool for uploading pictures to PicGo, which supports mainstream PicGo and object storage (Ali Cloud OSS, Tencent Cloud COS, etc.). With Typora, you can copy the local screenshot directly to Typora and automatically upload the picture bed, return to the picture bed picture link, avoid saving the local picture, path error and other problems. It also supports MacOS, Windows, and Linux platforms.
Lsky Pro: an open source map bed, used to store the final picture of the place, support third-party cloud storage, local, Ali cloud OSS, Tencent cloud COS, Seven Niuyun, and shot cloud, FTP.
Ii. Construction of Lsky Pro
1. Why Lsky Pro
If you’re new to MarkDown, the pictures in the article can drive you crazy.
Of course, some people will use a variety of third-party beds, and third-party beds have all the advantages, the only disadvantage is that if the third-party bed runs away, then your pictures will be lost. Therefore, in order to ensure the stability of their own data, there is a server under the condition of self-built map bed is a better choice.
As mentioned earlier, I have been using MinIO, an open source object storage tool similar to Ali Cloud OSS and Tencent Cloud COS, for writing articles. MinIO is lightweight enough and does not rely on other third-party components. It is easy to build and easy to use. If you want to know how MinIO works with you, you can leave a message. If there are more people, I will write an article.
Unfortunately, my demand has increased recently. I want a map bed that is more convenient to manage and preview pictures, and also can automatically watermark pictures.
At this time, I asked for universal Google and Du Sister, and locked two easy to use open source map bed, Lsky Pro and Cheverto-free. In fact, at present, if you do not need to store your pictures to the third-party cloud storage, Then Cheverto-free may be a better choice. Unfortunately, the authors of Chevereto-Free have announced that Chevereto-Free is ending maintenance on December 31, 2021 to focus on their paid version, so I chose Lsky Pro to build the bed.
2. Build Lsky Pro map bed with Docker
Lsky Pro source GitHub address: github.com/wisp-x/lsky…
Lsky Pro official documentation address: www.kancloud.cn/wispx/lsky-…
On Redeme, Lsky Pro is a PROGRAM written in PHP. As a Java programmer, I can deploy a Vue project, but I can’t deploy a PHP project. So what? Say a word in my heart Docker, really fragrant!
Then to my surprise, I looked at the official installation document, Lsky Pro currently does not support Docker deployment, I… Do a GitHub search and there’s nothing I can’t solve. Sure enough, I found a little brother or sister provided by the Dockerfile file, this is not good, here labeled little brother or sister Dockerfile address: github.com/Handsomedog… Thank you. Thank you.
Below installation I will use Docker to install Lsky Pro map bed, image has been packaged to my Docker warehouse, friends directly use it.
My Docker file address is in my own GitHub repository: github.com/itwxe/lsky-… If you are familiar with Docker, you can clone the project and compile it yourself. The files used to build the image are 000-default.conf, entrypoint-sh and Dockerfile.
Of course, if you are familiar with PHP, you can also follow the official documentation.
Environmental description:
Operating system: CentOS7.6
Docker version: Docker-CE-18.09.9
Lsky Pro version: 1.6.3
MySQL version: 5.7
Install the prerequisite
If you already have Docker and MySQL installed, you can skip this step. If you don’t have these two environmental buddies, check out the following two articles separately
- Install Docker:www.itwxe.com/posts/ca163…
- Install MySQL:www.itwxe.com/posts/53489…
After installing MySQL, you need to create database lsky, which will be used in subsequent configuration. The command and process screenshot is as follows:
Enter the docker mysql container
docker exec -it mysql /bin/bash
# login MySQL
mysql -uroot -p
# Create database lsky
create database if not exists lsky default character set = 'utf8mb4';
Copy the code
Install Lsky Pro
In the past, I usually use virtual machines to demonstrate. The server used here is my Tencent Cloud Hong Kong server, using the testing machine with full 199-100 coupons to pull wool.
With Docker and MySQL, installing Lsky Pro is extremely simple, with the same command:
Docker run - d - 4080: name = lskypro - p/hk/dockerData itwxe - 80 - v/lskypro: / var/WWW/HTML/itwxe lskypro: 1.6.3Copy the code
Screenshot of startup process:
If you want to use the domain name + HTTPS, you can configure the domain name mapping server in the console. My Nginx configuration is as follows:
server {
listen 443 ssl;
server_name images.itwxe.com;
ssl_certificate /usr/local/nginx/ssl/any/fullchain.cer;
ssl_certificate_key /usr/local/nginx/ssl/any/itwxe.com.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 30m; Ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:! aNULL:! MD5:! EXPORT56:! EXP; ssl_prefer_server_ciphers on; proxy_connect_timeout 500; proxy_send_timeout 500; proxy_read_timeout 500; client_max_body_size 10m; Location / {proxy_pass http://127.0.0.1:4080; proxy_set_header Host$host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header REMOTE-HOST $remote_addr; }}Copy the code
Tester here I wouldn’t have mapping of domain name, of course, my address is http://43.132.156.226:4080, you can see the following interface, and of course when you see this article may have access to this address, machine test is usually the snapshot will be rolled back.
Once you see this screen click Next, enter your MySQL address, username and password, and click Config Database.
Enter your administrator information after configuration.
A screenshot after the installation is successful.
After you configure the administrator account login can be managed, the full interface of Chinese operation, I believe that little cute people see the interface more little bit know to use, such as close registration, do not allow visitors to upload and so on can be configured on the interface. One thing that needs to be noted is that the API interface needs to be opened. PicGo needs to use the interface to upload pictures to the graph bed later. The configuration is as shown in the figure:
After setting, the interface menu will appear on the refresh interface interface, as shown in the figure below:
Of course, the Token here is an example Token. Do not expose the Token generated by yourself to others. Of course, mine is an experimental machine, so it doesn’t matter. Visit the link http://43.132.156.226:4080/api/token? Email [email protected]&password=123456, where the web address, port, email and password are replaced with their own information, and the Token as shown in the following figure is returned.
Of course, if you need global watermarking like me, you can read the Lsky Pro official document or leave a comment here, otherwise this article will be too long, some things too long is not good, ha ha ha.
If you need to migrate data later, you need to migrate the graph bed data and MySQL Lsky database data at the same time, otherwise the data will be incomplete!
Use and configuration of PicGo
PicGo GitHub: github.com/Molunerfinn…
Download the corresponding version of your system to install it, after installation, open the software, click plug-in installation, search lSkyPro plug-in installation, of course, I have already installed.
After the installation is successful, click The image bed setting, set Lsky Pro as the default image bed, and enter the Url and Token to confirm.
Iv. Use of Typora
Typora website: www.typora.io/
The same official website to download their own system corresponding version of the installation, after installation, open the software, preferences -> image.
Click the “Verify image upload” option to verify that the image can be uploaded normally.
After the verification is successful, as long as the screenshot, directly CTRL + V paste to Typora inside can automatically upload to the self-built map bed and return to the picture link, such as I am writing the sample results of the article:
Finally, check our picture bed to see if the picture is uploaded.
As you can see, the three pictures just uploaded have been normally uploaded to the self-built Lsky Pro chart bed.
With that, you can create a comfortable writing environment without having to worry about pictures in MarkDown, but if you’re on MacOS, the uPic tool is a good alternative to PicGo.
Now that you’ve read this, like, comment, follow, or collect it!