... in C! With _unix-composability_!
Initial writeup: 2024-08-29
I've written a fastcgi application that can make your gemlog more interactive by enabling users visiting your site to add comments.
In C?! What? Why?
Well, I have my reasons. Some of them are:
Explicitly, my canonical choice would have been Rust, but I have decided against it. Mainly because Rust isn't well supported on OpenBSD. And because I wanted to refresh my C-knowledge! Libevent and everything. I didn't want to use something like rust-tokio to just setup some networking. That's just way too much considering what I am trying to achieve with gmlgcd.
And the result hardly depends on anything! gmlgcd only needs libevent (for portable, event-based networking), libconfuse (because I couldn't be bothered to write config-parsing from scratch) and optionally libbsd (if you are, beware: on linux; because there, strlcpy and strlcat are missing). (And meson for building, which depends on python and kinda messes with my argumentation here, but well, meson is really nice! I for sure won't use CMake or Make [_god forbid_] for C projects anymore.)
You are absolutely right with your concern. And I assure you, I am also concerned. But fear not! I can reduce your concerns. (Hopefully.) Consider this:
Also, there is other functionality that is supposed to guard against idiots:
Now, granted, this is some very basic ratelimiting. But after all, this is geminispace, so, are bots really a problem? (Future me will probably look at this line and facepalm...)
Now, on the same train of thought that has departed from "Portable-C" city, and passed by "Dockerized-Dumbness" town, we reach the point that enabling comments for a given gemlog post is nothing more than just creating a file, and making it writeable for gmlgcd. That's it. And if at some point you don't like to receive more comments for a given post, disabling (but preserving existing) comments is just as easy as revoking write-permissions to that file. Now that's what I call _unix-composability_! :b
I'm glad you asked! Up until now, the code is not open-source, mainly because there are still minor things that I'd like to polish. Still, I provide you an outline on "requirements" for your setup:
Then, you might as well add some useful links to myblogpost.gmi:
=> /comments/myblogpost.gmi View comments => /add-comment/myblogpost.gmi Add comment
After a user enters a sane comment following a request to /add-comments/myblogpost.gmi, he will automatically receive a redirect to /comments/myblogpost.gmi to view his great creation.
Actually, if anyone feels like they are in a hurry, I'll probably release the source-code upon their request. The only thing I am still contemplating about is the LICENSE. I just can't decide between AGPL (true copyleft) or ISC (true freedom, similar to gmid).
Can you help me with this decision, and/or are you in a hurry? if yes ...
I have never said it out loudly, but I imagine it as "gemlog-cd" or "gimmlceedee". haha.
Cheers!