💾 Archived View for dece.space › dev › scripts.gmi captured on 2021-11-30 at 20:18:30. Gemini links have been rewritten to link to archived content
➡️ Next capture (2022-03-01)
-=-=-=-=-=-=-
This page presents my various Gemini CGI scripts and approach to writing them. You can access the public repository over HTTPS below. If you want to see my general-purpose script repository (mostly Bash/Python tooling), this is a different repository.
CGI scripts are scripts that get executed on a server when it receives a client request (e.g. from a Gemini browser). The script receives a lot of variables to describe the request: hostname, URL path, client cert data, query parameters, etc. The server then returns the standard output of the script to the client. For example, if you would make the program `uptime` accessible from a CGI server, requesting the appropriate URL would make your client show the uptime of the server. Cool!
Discussions about Gemini apps are common. Some people really want apps but struggle with the limitations of the protocol, mostly the very narrow way to communicate TO a server. Some others consider Gemini as a read-only protocol, where the query part of an URL is only there to search for content. I'm somewhat on the fence here: I think Gemini is not suitable for full-fledged apps and will frustrate everyone in trying to bend the protocol this way, but I also think we can allow ourselves to do a bit more than simply “search content”. My scripts below will hopefully illustrate what are sane Gemini apps!
You can of course use them on your own server. All the scripts are licenced with WTFPLv2!
If you want to try them, you can also use them directly on my server, using the public instance links for each one below, but please do not abuse the services nor use them for things that you would consider personal; I'll of course respect your privacy but you'll have to trust me on it, and on my ability to keep my server secure. Also, no warranty, blah blah blah…
This simply invokes `check-if-email-exists` and show the JSON results. Some mail servers do not really like the type of probing it does and can ban you temporarily, so it has to be used with care. For this reason, it is not publicly available from my server.
check-if-email-exists on Github
Well if you want to check if the server is up…
hello-world public instance (wooow)
This is a listing manager: create lists, add items, pop items, etc. I use it to note songs and albums to listen to, movies to watch, books to read and more, but it's sufficiently generic to be used for many more purposes.
This is a note tool designed to make it easy to record “three good things” that happened in your day. If you are not familiar with this idea, the Greater Good Science Center of Berkeley has a good presentation on their In Action website.
I wrote the CGI-only server Opal to be able to access my scripts from a wide set of clients (PC, mobile, smart fridge, whatever).
The scripts repository contains this library which is used by most scripts. It provides helpers for common Python CGI scripts needs: redirections, ask for client cert, etc.