A summary-like update for a couple of things spread out over the last days
Installed geoblock via the MaxMind GeoLite database. Honestly, it's so sad that I fear for my safety so much that I feel the need to do this
The hardest part was displaying the error page (viewable as /error/451) because nginx is strange. !! Technical tutorial incoming!! If I have a setup like this:
server {
...
if ($geoblock) {
return 451;
}
error_page 451 /error/451.html;
...
}
It won't work because nginx will do an internal request and catch the same error, never getting to error_page. I came up with this solution:
server {
...
error_page 451 /error/451.html;
location /error/ {
}
location / {
if ($geoblock) {
return 451;
}
...
}
}
This way nginx (or anyone, really. There isn't much anything in error pages) will be able to request errors without catching the geoblock. But if you're someone who has made a reasonably big nginx config will know what's wrong with this. You never EVER put if inside location. In my case it didn't try try_files (and it broke all the link URIs), but it could just as well segfault. This was the hardest to figure out, because it's not stated anywhere in the current documentation. Even worse, it's stated as allowed. Now, maybe it's because i'm running an older version of nginx, because the website's running on a raspberry pi 4 and the repositories have an "archive." subdomain, but still, it didn' make this easier. Glad it works now. My current solution is to do something like this:
server {
...
if($uri ~ ^/error/) {
set $geoblock no;
}
if ($geoblock) {
return 451;
}
error_page 451 /error/451.html;
...
}
This matches the /error/ directive in the URI. If it succeeds, you bypass the block !! Tutorial finished !!
The new layout is good enough, i'll update all the pages to use it
Plans for the future:
- Rewrite site's CSS (coming soon)
- Better mobile support (coming soon)
- Lessen page bloat (coming soon)
- Logistics rewrite for the update log, pali mi, pali pi jan ante and blog sections
- The interests section
- Request indexing for Marginalia Search
- A gemini capsule
- Come up with a favicon