Problems and Solutions of Recent Network Projects

Original link: https://lhcy.org/archives/181.html

After a bit of spare time recently, I’ve dealt with some of the issues that have arisen with web projects in recent months. The appearance of these problems brings some inconvenience to the use and maintenance, and has to be dealt with.

Image and code repository migration

Since Github is intermittently “mixed” where we live, it can no longer be used normally, so I transferred pictures and code repositories from GitHub to Bitbucket.

Picture warehouse

I have three sites with image storage, namely this blog, Gitbook, and Hexo blog (I will talk about the problems of the latter two projects later). Last year, all pictures were migrated to GitHub, and the picture bed of this blog was connected to Netlify (and Vercel was also connected as a backup), and the pictures of the latter two projects used jsdelivr CDN.

In May 2022, the jsdelivr CDN was “quarantined”. At the end of June 2022, I will migrate all three image repositories to Bitbucket, all images will be connected to Netlify and Vercel, and they will be bound to the second-level domain names of the corresponding network projects. Replacing a bunch of md files is difficult to modify one by one. Yu Yi Jiangnan recommended Visual Studio Code developed by Microsoft to me. It has a Chinese interface, and can perform batch search and replacement operations on multiple files and save them automatically.

Due to the high-strength lossy compression of the images, the total space occupied by the three galleries is only tens of Mb, and the traffic used is both Netlify and Vercel traffic, so it does not constitute abuse.

code repository

In the public repositories, except for the Diary theme, which is still on Gitlab (not GitHub), the rest of the code repositories are migrated to Bitbucket. After the change, the download links of the three Typecho themes I released are (successfully arranged in order of release time):

In the private repositories, except those that are no longer used, which are still on GitHub, the rest are transferred to Bitbucket.

Gitbook changed from online compilation to local compilation

The main Gitbook program is no longer updated, and the development team has shifted its focus to the gitbook.com online documentation project. When the new version of nodejs compiles the Gitbook program, an error occurs:

 TypeError: cb.apply is not a function

Previously, Vercel and Netlify did not report errors when compiling Gitbook online. After September 2021, I did not update the content of the Gitbook. Until recently, the online compilation was automatically triggered when the above-mentioned operations were performed. Only then did I find the problem of compiling the Gitbook error after upgrading the nodejs version on the two platforms.

There are many discussions about this on the Internet, and the solutions provided are basically the same. Refer to this article (Internet Archive Backup: Click here to view ), and the node module used by gitbook-cli needs to be modified. The online compilation platform cannot be modified, so Gitbook can only choose the local compilation method.

The Gitbook main program has long been “isolated” in the place where we live, which is manifested as: during the installation process, the execution of gitbook install was unsuccessful. A certain software is only for browsers and clients, and cannot take effect on “terminals”. I need to use another method: with a rooted Android phone + a software that transmits a wireless repeater, the software can transmit a wireless repeater with a certain signal with root privileges, and can transmit at the same time when connected to Wi-Fi wireless relay. Then, gitbook is successfully installed, and it is no longer necessary to use a certain software to compile and publish.

For this local compilation, I installed a plug-in for Gitbook, the secondary directory is folded by default, and one click returns to the top, which makes it more beautiful and convenient to browse.

So the question is, I have used the gitbook.com online documentation before, why don’t I use it now? According to previous experience, there are two reasons: First, the link from the login page to the background is “isolated” in the place where we live, which means that after entering the account password or logging in with a third-party account, we cannot jump to Background; second, the CDN of gitbook.com is intermittently “mixed” in the place where we live, which means that after updating the document, we cannot see the new content in the place where we live, and I can’t tell how long it will take to browse normally. .

Click here to see my Gitbook project . Starting in 2019, I resolved the domain name liudark.com donated by bloggers to Gitbook, and named the project “Liu An”. I forgot to renew it before it expired in 2022. The currently used domain name is also registered and resolved to “Liu An” in 2019, which is a free domain name for eu.org. Since the free domain name service is very stable, we are not ready to resolve paid domain names to this project for the time being.

Hexo blog maintenance suspended

My Hexo blog is for people around me to see, the purpose is to pretend to be X.

Upload the main program file on GitHub, Gitlab, and Bitbucket, connect Vercel and Netlify to compile online, and Gitlab itself can also compile online. When updating, just upload the md file online. The static blog based on Hexo is continuously compatible with the new version of nodejs, and the online compilation has always been normal, so there is no need to worry.

Take Hexo as an example (some files are redundant and are not deleted as a backup):

Compile Hexo online

The Hexo-based static blog, powered by Vercel and Netlify, has greatly simplified the maintenance process. But static blogs have several flaws:

  • Relatively cumbersome to update
  • No smooth transition to dynamic blogs (like WordPress , Typecho )
  • Disqus is “quarantined” where we live on the comment system, which is an “inconvenience” unique to us

If you want to use other commenting platforms, many themes need to manually modify the code, which is very technical. The Cactus theme I used has been modified and failed. Using other comment platforms (such as Waline ) also relies on the international version storage services of domestic companies . The data format is privatized and is destined to be unable to migrate smoothly.

Recently, I set up a new blog to record my work. The content of this blog can be disclosed to the people around me. If necessary, the role of pretending to be X can also be played. Therefore, I decided to suspend the maintenance of Hexo blog, and the .xyz domain name used will not be renewed after expiration. At that time, I will resolve a second-level domain name of the domain name used for the new blog, so that Hexo blog will continue to exist on the Internet.

Self-created mailbox fails

Last year, I used VPS to build my own mailbox with docker+mailu, but virus detection was not turned on. Not long ago, I found that the mailbox has not received any emails, and I logged into the VPS and found that the hard disk was full. After investigation, the problem is not with mailu, but with docker. Docker generates massive logs, which are stored in /var/lib/docker/overlay2, with a total of 28G.

In the discussion about this on the Internet, some docker programs have similar problems. The processing method they described in the article is not specific, and it is completely incomprehensible to a layman. I have tried these methods and failed. So I reused the free mail service (supporting imap) provided by the professional office suite service provider zoho international (international), without binding a domain name.

At present, I am not going to fix this problem, because it is far beyond my ability.

Why no longer use domestic similar platforms

Since the rebuilding of this blog, I have used about a dozen similar platforms in China, and now I have given up all of them. The reasons are various and difficult to explain in a few words. Afterwards, I was deeply moved by this sentence:

To prevent disasters in the first place rather than hurt later. Knowing and acting cautiously, a gentleman does not stand under a dangerous wall, so how can he take it lightly. – “Mencius”

Also, let me state one thing: IP address display and/or IP location display will never be added to the comment section of any blog, website, etc. I build.

The above are the problems encountered in the network project in recent months and how to deal with them. There are a lot of things that shouldn’t have happened or shouldn’t have been complicated, but where we live, there are things, let me say…

The literary world is full of electrified barbed wire, and the art garden is covered with mines; the pen barrel is like the firing pin in a bomb . ——Feng Jicai “Thanks for Life”

This article is reprinted from: https://lhcy.org/archives/181.html
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment