Blog
Deployment!
Mechanism
Ok, so I took about 3 minutes to think about how I wanted to deploy this garbage, and I settled on a DigitalOcean droplet behind one of their load balancers. I think this is a classic case of letting convenience dictate design, because it made the domain stuff really simple. My web server is just a go binary, pretty dumb, and it runs on linux as a little systemd service that will pop back up if it fails (or when the server restarts). That's pretty simple, because it's one little file and some terminal commands:
[Unit]
Description=Kyle's Personal Website
After=network.target
[Service]
WorkingDirectory=/var/www/personalwebsite
ExecStart=/var/www/personalwebsite/bin/personalwebsite
Restart=on-failure
User=nobody
Group=nogroup
As explained by this very cool guy I stole from, it just waits until the network is up to start. Runs as the `nobody` user and restarts automatically if it ever fails. You've got to run the right systemd commands to get launching on startup. He explains it better over there.
Now that I'm crediting him, I realize I haven't credited the guy I stole the styling from. You might notice some resemblence between our pages. I'm very sorry for that and I plan to differentiate myself a little bit more eventually. But until then... thanks!
I bought a domain for this dumb thing, and Digital Ocean's little load balancer is really nice because it'll just do the ssl stuff for you, and you tell it where to route those requests. So all I really need to think about is making my little site work, which is not exactly complicated. I will say, it's not really "cheap" considering I could have used a computer I already own, and a domain I already own and gotten a pretty similar result. That said, it's not tremendously expensive either, and if this thing gets hacked, what do I care? It's a bunch of information that I was already making public you know? Better than putting it on a computer in my house. One downside is that my blog is now hosted in New York of all places, so I get one of the worst experiences clicking around here lol. Also, it's occurring to me now that I can just do my blogging nonsense, and make that look like real programming work in my github chart, which is a huge plus in my book. I'll be all green all the time baby.
What's Next?
Well, I think I've got something I can use for a while, but I'll probably need to make that blog list page, paged. Right now I'm just going to load all the blogs in reverse order to their little timestamps, but I think I want to add some query parameters so that I can respond only with a page of like, idk, 5-10 or so at a time. I also think I should (eventually) be tagging these somehow. Not because anyone else is going to read them, but because I might want to track down like the difference between my book review entries and my "philosophical" rants. Oh, and I still really dislike how HTMX behaves regarding the navigation. I know it's my lack of skill, but at current the only navigation that works is clicking the links I have made, and it swaps the HTML all the time. For these static blog posts, I probably just need to make them honestly their own page so that the back button will work. I just also dislike the whole page reloading when I click around on websites. Not so sure about this HTMX thing right now.