I wish I were a bird...
So, this is it, I made a blog.
Why? Well, I had the idea for it after writing out another multi paragraph ramble (in this case about mechanical keyboards, as a complete novice I was laying out my options, I have now purchased a Ajazz A820-Pro) I came to think laying out multiple paragraphs over multiple messages just nukes a channel, and also becomes burried quickly (that is if the Discord isn’t deader then insert failed AAA live service game).
It is also that when trouble shooting I browse dozzends of sites, go on wild adventures to finally arrive at a cobbled together conclusion (like k3s-on-alpine, that might need a post for retrospecive, although I do also really need to update Longhorn and the cluster... I fear this), and I sort of want want to share some, or provide info for others on the hunt...
oh, who am I kidding, nobody is going to find this blog... but that is fine, I have said what I said, and if then one person comes along this is useful for, then this is fine. Same as streaming to 1 person.
Well, I briefly looked at awesome-selfhosted (a great resource for finding hostable software), but I wasn’t impressed, I wanted something simple, where I can just dump my markdown files in, and it presents them.
So I wrote pinneedle, what you are looking at, and banged it together in like 2 days.
It is written in Rust, uses Tokio with Axum for the serving part and Maud for HTML generation.
Additionally it uses the markdown crate for converting the Markdown to html, except that it is quite limited, so I will likely in the future swap to using only it’s tokenizer and then building the html manually, but for now it will do.
The landing page does suffer from this as you see right now the file names rather then the Post names (or even a short subtitle), no post dates (even though we do collect them, using git log, for sorting purposes), and formating is limited.
Although in general, I do not have so much expiernce with css, only done a bit with it for DataRace, and I have to slowly figure out some settings that make it look sensible.
Oh yeah, and I did mention git, yeah, this works by cloning a git repo containing the blog, then periodically pulling it to update it automatically. This means when deployed through docker I have to only pass in the env Variable to set the repo and set up the ports. So this software is technically super scaleable, as there is no state in the individual deployments, so they can be dublicated and killed at will. Obviously in reality this doesn’t really scale well past you and your cat, as it generates html on each request, for which it reads from the filesystem. So while we can get lucky and the os puts our containers filesystem into RAM (and caches the relatively small text files), it is still not ideal. Heck the home page iterates through all files in the posts folder, someone could very much DOS the site with this relatively easily.
But it does not really matter, maybe in the future some caching, but right now, good enough is good enough (and likely will be still for me in the future, so the likelyhood of the "temporary" solution being permanent, again, is high).
Oh yeah, when it came to deploying it was pretty straight forward, biggest issue I had is that I wanted to ssh into my docker server for some maintance.
But I couldn’t I hadn’t yet added my ssh key for my Thinkpad, but I was able to access the machine through Proxmox, so I reenabled PasswordAuthentication it still didn’t work.
Updated and restarted the machine (despite that it is the host of my VPN connection home... that I need to work on it in the first place, but luckily everything worked out), and it still didn’t. About 5 StackOverflow Threads and related Articles (because Permission denied (Publickey)
is ungodly generic, and gives you all these garbage content farm tutorial sites), after manually tpying my ssh key in and pipping it into authorized_keys
, deleting .ssh
on the server, generating ssh keys on the server, having turned PubkeyAuthentication
off and even then being unable to sign in with the knowingly the correct password (not even from the machine itself over localhost), I found one post mentioning that KbdInteractiveAuthentication
had to be turned on, and for some reason (maybe when I disabled PasswordAuth on that server) it was disabled, and that finally fixed it.
So I flushed my keys onto the server, switched password Auth off correctly, and now was able to connect, and create the Caddyfile.
Caddy suprisingly did not put up a fight, and was very simple to deploy. Although last time I had tried to use it within my kubernetes cluster to sign my outbound traffik, and that doesn’t work, you have to do that on a cluster level, but how traefik is configered on k3s is a whole other can of worms for another day...
I think this makes for a good enough blog post, I touch up the css a bit and then finally commit it, and hope nothing else explodes...