Gritty's Blog

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

On the #gemini protocol there is one really prominent content aggregator (think RSS feed) that's been active over the several years of the life of Gemini: Antenna.

Antenna basically works this way: a person writes a gemlog (a blog on Gemini), and then updates an index page that's a list of links to the logs with the dates and titles. A user then submits the that index page to Antenna and it ingests it into a database and displays everyone's entries in chronological order. So instead of having an aggregator poll a list of sites periodically, a user will submit their list. In doing so, it puts the onus on the user to aggregate their content, and ensures that Antenna isn't polling dead gemlogs for months on end.

Well, for a few days I noticed (as well as the community), that Antenna was down. There was a post about it on the new BBS (bulletin board system), and it was mentioned that someone could theoretically create another Antenna. I don't know why I wanted to do this for the community, but I suddenly had to do it.

Now, I have two small kids at home so personal time is the most premium of commodities, and that free time is usually spent relaxing because I'm too tired to do anything else, but sometimes I get this idea in my head and I have to do it. So, I set out making my own version of Antenna after someone pointed me to the code repo.

Much to my chagrin, the instructions were way out of date from the actual code, but luckily it was written in Python and it gave me an opportunity to brush back up on my Python skills. After much digging around and seeing how it works, I finally got my version of Antenna up and running...and if I remember correctly it was about two evenings of trying to get things working.

I posted up on the BBS that I got it working and for folks to try it out. The creator of Gemini, Solderpunk, replied and asked if I would try and theme it so eventually I came up with Deep Space Network Antenna, named after the NASA program. I also changed the allowable posts to be non-technical. The problem with the last part was that most people only had 1 index page for all their gemlogs and in order to not submit technical gemlogs alongside non-technical ones, you'd have to have two. I went to BBS to get opinions on this and there were of course some on both sides, but in general, I decided to leave it up to the capsule owner (gemlog writer) to do this separation.

For a while it was pretty dead on DSN Antenna, but now some folks have started posting to it, and Skyjake (the creator of the best Gemini browser, LaGrange, and gemini's first BBS) added it to Cosmos, his super aggregator, which is an aggregator of aggregators, designed to catch replies between gemlog posts. So it seems fairly official now, and I'm happy about that.

If you have a Gemini browser, you can check it out here: gemini://gemini.smallweb.space/antenna

I've been spending a lot of time on the #gemini protocol this past year, and I'm writing this post on my normal blog so that the search engine crawlers index this page for those that may be interested in it. While I know there are other introductory pages – which I'll link here as well – I feel like this is my contribution on getting the message out. If you happen to be on my gopher:// mirror of this site, just simply drop in https:// instead on a normal browser.

What is the Gemini Protocol?

Gemini FAQ on Circumlunar

Why use Gemini?

A lot of folks are disenfranchised with how the web is today. This is a mix of new and old internet users alike. As you can imagine, the old-heads that saw the internet blossom and loved the promise of a great new world, are now disenfranchised and looking to escape back to what the internet used to be: controlled by individuals, not by corporations greedily collecting your data so they can make money off of you. There's also a surprising group of younger internet citizens that grew up with a cellphone in their hand and internet all around them. They, too, it seems, see the insidious side of the internet and wish to connect with people, not endless status updates.

The second group, which also intersects with the first, are the people who like the cleanliness of text-only presentation. These are the folks that love command line and using text files. They probably use a todo.txt as well.

In a world of flashy websites, content can easily be lacking and overlooked. In the world of Gopher and Gemini, however, content is king because if you have no content there's really nothing to post.

Another group are the ones that love to blog, but they, too, felt lost at sea in the glut of the internet. Since gemini and gopher are much smaller, the interactions are admittedly less, but they are more meaningful because they are real people who stopped by to read your 5000 word #gemlog (gemini's version of a blog), and it struck a chord with them. If they take the time to fire up their email program to write you a response, you can guarantee it means a bit more than the comment section on most internet blogs.

Another reason people join is the clear lack of algorithms feeding you content. Almost everything in Gemini is pull versus push. What this means is that you have to find content instead of it being firehosed to your screen. And why would you want this? It slows you down, and it makes you the curator of your own reading lists. Part of the fun of the old internet, they say, was that you had to DIG to find content, and that the digging was part of best things of the internet then, because when you found a gem or goldmine, it meant that much more to you. That's not to say there aren't any push capabilities; there are at least 4 search engines that I know about, and several content aggregators (think #RSS feeds), and a social microblog site called Station. While these are technically centralizing parts of Gemini (and there have been many discussions about this on Gemini, both pro and con), I think they provide a modicum of convenience while sidestepping most of the bad parts of the highly centralized web.

Generally though, Gemini is just not what most people are looking for, and that's okay. It's draw, for me, is the fact that it's a small (but far from exclusive) community of people, and not big corporations and algorithms.

What can I do on Gemini?

Gemlogs (Gemini Blogs)

A lot of people on Gemini write long-form #gemlogs, which are just Gemini versions of Blogs. Gemini, however, is NOT just a blogosphere on a lesser-known internet protocol, but it does make up a lot of the content on there. When I was first joining Gemini I wasn't much of a writer, but after a while I felt encouraged to write down a few thoughts here and there. People use their gemlogs for a whole host of things that they would use a blog. such as: * Journaling thoughts, talking about your day, etc. * Note taking – this is pretty popular for those people that need a technical reference for themselves and others while the figure out a system or coding, etc.

You can subscribe to gemlogs if they are in the proper gemlog format or if the owner put the logs into an Atom feed

gemlog format for subscribing

Tinylog (microblog)

Gemini also has a version of microblogging called #tinylogs. These are shorter-form posts that don't warrant a full-fledged post. Think Twitter or Mastodon, but stripped waaayyy down to the basics. If you have your own site (or capsule as they are called in Gemini), you can start your own in a single text file, or there's a site called Station that is the closest thing Gemini has to a social network. Station is a microblog-style site that lets you post tinylogs and to like, comment, and subscribe to other people's tinylogs. Gemini is so small that the front page feed only gets a few updates a day and is easily digestable.

If you make your own tinylog on your website, there's a way you can subscribe to other tinylogs and view them as a timeline (otherwise you have to constantly check the tinylogs of others that you like). The two programs are called #gtl and #lace.

Tinylog format / RFC Tinlylog tools

Games

SpellBinding My favorite all-time game on Gemini is #Spellbinding. It's a word game where you are given seven letters in a circle with one letter in the middle, and you must make as many words as possible using the center letter. words must be 4+ letters.

you'll need a Gemini browser to access the link below: gemini://tilde.cafe/~spellbinding/

Wordo A wordle clone for Gemini gemini://tilde.cafe/~spellbinding/

There are also some MUDs and other things I haven't explored yet.

Getting Started

If you're interested in getting started, here's my quickstart:

Get a browser

Lagrange. Just use this, it's the best one out there for mobile and desktop Lagrange Gemini Browser

Find some content

Point your browser to: * Antenna – content aggregator: gemini://warmedal.se/~antenna/ * Cosmos – content super aggregator: gemini://skyjake.fi/~Cosmos/view.gmi * geminispace.info – search engine: gemini://geminispace.info/

Setup a capsule

Gemlog.blue SmolPub Pollux.casa

Other Getting Started Guides

Awesome Gemini – Links Gemini Quickstart

Background

Not a lot of folks use the finger command or protocol these days; however, I've been delving into the #smallweb / smolweb (i.e., the Gemini Protocol) for the past year and noticed a few people have revived this ancient protocol for status updates. I figured I'd give it a shot, and I thought it would be simple, but the lack of guidance really hindered me for a bit.

If you're wondering, efingerd / fingerd (the original) simply enables people outside of your own linux machine to use the finger command, just remotely.

Installing

Finger / efingerd is not installed on Ubuntu 22.10 by default so you have to install it:

$ sudo apt-get install finger
$ sudo apt-get install efingerd

Other finger daemons

This post only goes over efingerd, but if you want to see what other finger daemons are available:

$ apt search fingerd

Enabling efingerd

On Ubuntu 22.10, the install script should automatically update your /etc/inetd.conf file with the necessary configuration. One thing I learned is that these old programs are launched by another wrapper daemon, namely tcpd. I really tried getting cfingerd to work with systemd, xinetd, and inetd, but I kept getting errors, so I went with efingerd in the end.

If you check out /etc/inetd.conf, you'll see this line added:

:INFO: Info services
finger   stream  tcp  nowait   efingerd  /usr/sbin/tcpd   /usr/sbin/efingerd 

which I edited to:

:INFO: Info services
finger   stream  tcp  nowait   root  /usr/sbin/tcpd   /usr/sbin/efingerd -u -t 5  
  • -u prevents users from using the executable ~/.efingerd file
  • -t 5 sets the connection timeout
  • I also changed user to root (which most other finger daemons run as) so that each user's home directory could be read by the bash scripts, otherwise the user efingerd can't see into those.

Enabling the Service

$ sudo systemctl inetd restart

Checking the service

$ sudo journalctl -f -u inetd

and

$ sudo systemctl status inetd

Configuring efingerd

make all files in /etc/efingerd executeable

sudo chmod +x /etc/efingerd/

edit them – there are a few test commands in there... check out the manpage for what they do

I pretty much got rid of everything (finger shows users logged in and their IP addresses) and crafted my own scripts inside the files to read the user's directory for the .plan, .project. and .pgpkey files, and display them if they exist.

Open port in firewall

$ sudo ufw enable 79/tcp

Testing efingerd

try to finger your server:

finger @<your server>

(responds with whatever is in “list”)

and

finger <user>@<your server>

(responds with whatever is in “luser”)

Addendum – happynetbox

I reached out to the owner of happynetbox [1], a web front-end to finger where you can sign up for your own account and have a finger account purely through the web. I found this site because of ~ruario's posting on #antenna where they were testing if antenna would allow a finger:// submission. Anyways, the owner responded to me and said they used a Node project on github as a baseline for that entire site, which, might actally be easier than setting up 30 year old finger programs on today's systems. The site can be found here: * Simple Node.js finger server * Happynetbox

After some fighting with the “simple” install, I finally have a working Writefreely instance on my server with SSL.