Notes from getting the learning journal actually online.
The memory crunch
The 512MB droplet fell over under vim-go's tooling. gopls alone wanted
more RAM than the box had. Two fixes:
- Stripped the heavy vim plugins (YCM, gutentags, ALE, jedi) down to syntax highlighting only.
- Added a 1GB swap file — turns an OOM crash into a brief slowdown.
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile
The blog generator
Go + goldmark, generating static HTML from Markdown. Two binaries: gen
builds the site, serve serves public/.
The bug that ate an hour
serve kept 404ing. The cause: http.Handle("/home/user/go/blog/", fs) —
the directory path had been pasted into the URL route. Should have been
http.Handle("/", fs). The file server was fine; it was just mounted at a
URL nobody was requesting.
Lesson
A 404 with the file clearly present means the router, not the filesystem. Check the route before the permissions.
Still to do
- HTTPS via Caddy (currently plain HTTP — not great now that it's public)
- systemd unit so it survives reboots
- Actually remove OpenVPN (still running)
- Add a stats page to show page hits
- Maybe do something about keeping bots away