Personal Website and Spring Boot 🍃☕
This week, I got my web-counter project up and running. It now counts page views on my personal website https://hinst.github.io/. For the counter to work, users must have JavaScript enabled in their browser. Visits from bots that only download the HTML page are not counted. The data is stored in an SQLite database. I also implemented a spam protection mechanism like this:
- the server multiplies two prime numbers
- client-side JavaScript must find which two numbers they were
This way, it’s impossible to infinitely spam the API. Solving the puzzle sent by the server requires some effort. The protection can be flexibly configured: if you slightly increase the number of factors, decoding the puzzle on the client side will take a significant amount of time. How necessary such protection is for my small project is, of course, a question 🤔💭 At least I gained some extra experience with Spring Boot while writing this feature. https://github.com/hinst/web-counter
Kubernetes and Orange Pi 🐋🍊
I fixed two issues here.
First, I had the RAM log enabled on my Orange Pi. This feature is enabled by default, and because of it, I was losing logs in Kubernetes. I had to turn it off. Logs will no longer disappear, but the load on the memory card will increase.
Also, I found out that my Persistent Volume Claims were misconfigured. It turns out that each pair of PV & PVC must be linked via a matching storageClassName. I hadn’t noticed this before because I had fewer PVs, and they were assigned to the correct PVCs by “happy accident” 🤔🚿 A slightly confusing feature, in my opinion.