Gritty's Blog

geminiProtocol

CGI is alive and kicking on the #geminiProtocol, for sure.

The formative years of my life were in the 1990s, back when Common Gateway Interface, or CGI, was all the rage. I remember seeing URLs like example.com/cgi-bin/ and seeing how it generated dynamic content, but since I didn't have access to a web server like that back then, I never really got into CGI programming. After I started doing web programming, it was Javascript, Javascript, Javascript, and AJAX to save the day and goodbye old, non-secure, heavy CGI scripts.

So as you can imagine, when I stumbled across Gemini around January of 2022, I was very surprised to see that a lot of the servers being created for people to use had CGI support for creating dynamic content. At first I was baffled, but it really does make a lot of sense for a text-focused protocol such as Gemini:

  • Most capsules are low traffic so spinning up these processes, while resource intensive by today's standards, aren't really too much of an issue for Gemini
  • Gemini is purposely limited, and as such, things like AJAX calls to a Gemini server just aren't supported
  • CGI has been around for a while, and is fairly accessible to professional and hobby coders alike

I think the beauty of CGI scripts is that it lowers the barrier for novice programmers to make an interactive capsule (gemini site) and practice their coding skills. Want to make an old school guestbook using Bash scripts and SQLite? Go for it! Want to make a commenting system using Python? Sure. No problem. It's the simplicity that I like, which is core to the theme of Gemini.

Documentation, however, on how to make a CGI script specifically for Gemini was lacking, so I ended up making my own HOWTOs on doing that. I even convinced Solderpunk to put a link on their official Gemini FAQ that goes over creating your own capsule and introducing you to CGI programming.

Again, if you have a Gemini browser – like LaGrange – you can see my HOWTO here: gemini://gemini.smallweb.space/HOWTO/managing-your-own-capsule.gmi