Preface#
This article is a record and reflection on life from 2024-03-17
to 2024-03-24
.
This week, I rekindled a lot of enthusiasm for work and study, completed the migration of the blog comment system and data statistics system that had been on my TODO list for a long time, and felt a sense of comfort as if I had organized my desk; I experienced oil painting for the first time over the weekend, creating a new avatar for myself, which was very fulfilling; I resumed my fitness routine; continued learning to drive and registered for the second driving test; and many other interesting things happened.
Oil Painting Experience and New Avatar#
My senior and I have very different personalities and preferences; she has many interests that I have never explored, while I seem to be fascinated by areas that are often unknown to her. Recently, we set some flags to experience each other's hobbies/skills, and I chose typing and programming, with typing already showing significant results; she took me to an oil painting class this week.
I actually have zero foundation in painting and never thought my hobbies had anything to do with art. I was just curious about what kind of attraction could lead her to spend most of an afternoon in a sketching or oil painting studio refining small details, feeling both excited and a bit nervous.
Logically, beginners shouldn't start with complex subjects like portraits, but I wanted a new avatar. The studio teacher was very nice and willing to guide me, so I chose a photo focused on the "head" and began, outlining, mixing colors, applying paint, and adding details based on light and position. Everything was more interesting than I imagined; several simple color combinations could create many layers, and the act of creation felt like magic.
The result of an afternoon's work is shown in the picture; the brushstrokes are clumsy, but it is a piece created by my own hand, which has a unique significance, and I changed my avatar across all platforms.
Blog System Upgrade#
Cusdis -> Remark42#
I previously wrote an article titled 「Lightweight Open Source Free Blog Comment System Solution (Cusdis + Railway)」, discussing how my blog uses the self-hosted Randy open-source Cusdis comment system. I started using it in mid-2021, and it has been running steadily for three full years, except for some initial deployment platform troubles due to Heroku and Railway charging fees.
However, I encountered some issues during use:
- Due to some modifications made by the WeChat built-in browser, the comment component is not visible when opening the blog from WeChat chats/conversations.
- Although email input is supported, it does not allow subscription to comment replies.
- Comments need to be manually reviewed by the administrator, but the comment notification TG Bot often fails, causing missed comments.
Additionally, its core functionality has not seen updates for a long time, making it seem somewhat rudimentary compared to other more mature comment systems. However, I have always adhered to the principle of "good enough," so I never thought about migrating/updating until I participated in some development of the Cusdis V2 version while learning front-end, but that small group became inactive shortly after.
Recently, because my blog had hardly been updated and I hadn't received notifications from the comment TG Bot, I thought no one was commenting until I needed to change the Connection String for the database hosted on Supabase. I discovered that there had been dozens of comments, some expressing concern and encouragement, and others asking technical questions, but by the time I saw them, it was already one or two months later, which was quite embarrassing.
Moreover, when changing the database URI, Vercel deployment kept throwing errors, so I decided to migrate from Cusdis. After researching, I chose Remark42 as the final selection in reorx’s article on 「Changing Blog Comment Systems」.
In terms of configuration options, it is much richer than Cusdis. I have configured several commonly used social account logins (GitHub, Twitter, Telegram, email), allowed anonymous comments, supported email subscription for reply notifications, and set up TG bot notifications. It is deployed on fly.io, using a Go single binary + a single file database, which is a very comfortable solution.
Since I had accumulated a lot of comment data, and because Cusdis uses PostgreSQL while Remark42 uses a single file database (BoltDB), the latter does not support remote connections, so I couldn't directly write SQL statements. I had to first perform a join query to export the required fields into a JSON file, then manually execute the Migrator script (and since the official support is only for WordPress, Disqus, and Commento, I had to implement the conversion logic manually). Fortunately, it was written in Go, which I am familiar with, and after a night of work, I finally completed the pr!!!
After the migration, I found that I had accumulated a total of 438 comments over the years, which surprised me; they all came back!!!
Umami -> GoatCounter#
With the mindset of having already changed the comment system, I decided to update the data statistics system, which had also been a concern.
Umami had actually been working fine without any issues until I changed it, running diligently for a year and a half. However, because I started using it quite early, during a major version update, the database migration script had incompatible field updates. I was a bit puzzled as to why such a large-scale open-source project would encounter such issues, and I saw many other users in the issues section expressing the same concerns, but ultimately no good solution was provided.
However, since I had been running it for over half a year, I was reluctant to part with the previous data, so I kept delaying the update, and I was still on an old version that I forked. Although I didn't have many functional demands for the new version, I felt a bit uncomfortable due to my mild obsessive-compulsive tendencies, but I just kept putting it off.
So, taking advantage of this major blog overhaul, I switched to GoatCounter, which is also a Go single binary + SQLite single file deployed on fly.io, making for a very comfortable configuration.
Interestingly, the author of GoatCounter is quite insistent that such single-file applications in containerization would actually increase maintenance costs, so they do not provide an official image. However, having an image for deployment on VPS or serverless platforms is more convenient, so I created a CI with GitHub Actions that pulls the latest code, builds the image, and uploads it to Docker Hub daily. Those in need can use it, and the corresponding Dockerfile and Docker Compose files can refer to this PR.
docker pull pseudoyu/goatcounter
The frequency of my weekly report output over the past six months has been concerning; aside from a long article about information management systems, I haven't had any satisfactory outputs. Therefore, I decided not to migrate the previous access data (the complexity should be much higher), and I thank every cyber friend who clicked into my blog website, capturing screenshots as a memento.
Recently, I feel that my enthusiasm for tinkering with software/hardware/service configurations has returned, and I have many new blog ideas. The new data will serve as a fresh start 🫡
One of the biggest motivations for the switch was that GoatCounter's interface perfectly matches my aesthetic sense, just like my old blog theme, and I feel I could stare at this interface forever 🤩 I can't resist this Retro Internet design.
Thoughts on Self-Hosting#
I have gone through many ups and downs with VPS and serverless platforms, which may not be insights but are indeed experiences gained from deep engagement.
I used to be a proponent of serverless; I would almost never set up anything myself if it could be deployed on PaaS platforms like Vercel/Railway. I could achieve stability comparable to large platforms with almost no operational costs, and I indeed managed to serverless-ify all my services, enjoying a long period of peace and ease.
However, after experiencing HeroKu and Railway changing their pricing models, as well as n8n running up a monthly bill of over ten dollars on Railway, I gradually discovered some drawbacks. Serverless does reduce the requirements for managing one's own servers, but correspondingly, it also subjects you to the rules of these platforms.
The pricing model is just one part of the reason; compared to renting a well-configured server, the cost is not too high, but it seems to bind my services and data to a centralized platform, creating a sense of insecurity as if I could be at their mercy. Moreover, when I want to migrate to another platform, they often do not provide a convenient solution, and the complexity of operations compared to directly copying Docker Compose files and mounted volumes between servers is significantly higher.
Therefore, I have moved many of my services to servers, running stably for over 430 days.
A few days ago, when discussing service deployment solutions with reorx, he mentioned that he now prioritizes self-hosting solutions using SQLite or other similar file databases, which can reduce maintenance and migration costs and complexity.
Later, I thought about it; in essence, whether on VPS or serverless platforms, they are both self-hosting choices. What is more needed is to consider the dependencies of the deployed services themselves. For instance, many instabilities I experienced with Cusdis and Umami actually stemmed from the services being hosted on PaaS like Vercel and Netlify, while the data was hosted on DaaS like Supabase. A self-hosted service relying on two platforms means that any issues with either side can lead to service unavailability. What VPS does is merely convert such risks into a single point of self-maintenance.
So, I started tinkering again after a long time, deploying both Remark42 and GoatCounter on fly.io, as the single binary + file database keeps performance consumption well within the free plan limits. Meanwhile, I continue to host applications that are relatively dependent and need to provide external services, such as RSSHub, n8n, and image hosting, more centrally on VPS. Services that consume more performance or storage are running on a Home Server and exposed through a local network penetration solution.
Others#
I unified the software installed on my Mac from various sources, with the principle being to reinstall everything that can be installed via brew cask. Previously, I had to search for command-line installations without much feeling, but now that I have a GUI to view, I found that the software sources are indeed much richer than I imagined. This method facilitates management/migration and relatively ensures the security of the software's source 🫡
I switched from RapidAPI to a new API debugging tool Bruno, pre-purchasing its Golden Edition, and the experience has been quite good so far.
Interesting Things and Items#
Inputs#
Although most interesting inputs will automatically sync in the 「Yu's Life」 Telegram channel, I still selected a portion to list here, making it feel more like a newsletter.
Books#
- The Red and the Black, I saw a video explanation that left a deep impression regarding Julien's self-esteem and the arrogance it manifests; currently reading.
- Camus' Notebooks, just started reading.
Favorites#
Articles#
Videos#
Series#
- The Three-Body Problem Season 1, currently watching.