-- Leo's gemini proxy

-- Connecting to mozz.us:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; lang=en

Astrobotany Beta Release


Published 2020-04-14


🌱 • 🛰️ • 🌷 • 🐝 • 🚀 • 🌵 • 👩‍🚀


=>gemini://astrobotany.mozz.us


"A community garden over the gemini protocol."


🥕 • 🔭 • 🌺 • 👩‍🔬 • 🌍 • 👨‍🌾 • 🌧️



Summary


I've developed my first real "app" for gemini!


It's not an original idea (I'm all out of those), but rather a port of the command line game botany that I've enjoyed playing on tilde.town.


This is exciting for me because it breaks a few personal milestones for gemini development:


First time building an application with gemini as a first-class citizen.

First time using client TLS certificates for user accounts.

First time using vhosts (this application is running behind the same jetforce server as gemini://mozz.us).


Code Structure


I started off trying to fork the botany project and refactor the existing codebase. This quickly became untenable since the code was so tightly coupled to the curses frontend and a multi-user filesystem. So I ended up re-writing 99% of the code from scratch, while keeping most of the original artwork, dialog, and game mechanics.


I wanted to make the code as lean as possible with no third-party dependencies. And then around the point where I was updating table definitions using raw SQL queries, I got annoyed and switched to using an ORM, as I always do..


I ended up with a kind of mini-MVC framework built on top of jetforce, using:


The router from jetforce

The jinja2 templating engine

The peewee ORM w/ sqlite


Overall I'm really happy with how it turned out. I'm considering pulling some of this work back into the jetforce and establishing some recommended patterns for application development. We'll see how motivated I get..


=>https://github.com/michael-lazar/astrobotany


Page Formatting


Displaying the ASCII art would not have been possible without the ``` preformat blocks. I am once again very pleased that those were added to the specification.


           /\
      %/\  | % /\
       _ | || /  %
      / \ \||/ /\
      % |\ \\v/  %
        /\ v ||/\
       %  \\v//  %
.  , _ . .,\V/ _ ., _ .
  ^      '        `    '

Shoutout to the other server admins who added emojis to their gemini pages. I liked the aesthetic and borrowed it here. I think it's great to embrace unicode and the next generation of plaintext protocols.


User Registration


Setting up user registration was admittedly a bit weird. Doing client certificates "properly" involves the user generating a private key and sending the server a Certificate Signing Request (CSR). I didn't want to use email because I felt like the barrier of entry was too high. And since you can't upload files over gemini, I went with an HTTP endpoint instead.


You make a curl request an HTTP POST endpoint with your CSR, and you get back a signed certificate. I guess it's not the end of the world. The backend for the registration was my first time writing a plain-old CGI script, using Apache and mod_cgi. It's crazy how simple things used to be.


=>https://astrobotany.mozz.us/


Client Support


Solderpunk was gracious enough to accept my PR to add support for TLS client certificates to AV98.


=>https://tildegit.org/solderpunk/AV-98/pulls/5


I hope that more gemini clients will eventually add support for client certificates (either transient or permanent). My concern is that it's kind of a difficult thing to implement properly, including maintaining keychains and handling all of the 6X error codes. Even my PR was pretty hacky and not the ideal solution. We may end up in a chicken-and-egg situation here where nobody wants to build gemini servers using client certificates because no gemini clients support them.


Future Work


I want to add ANSI color to the ASCII art plants. I don't know why, I just really have a strong urge to do it. I have a plan that involves using an open source GUI that I found called playscii. If all goes well, I could even backport the changes and offer them to the upstream botany project. I think that would be nice.


=>https://bitbucket.org/JPLeBreton/playscii

-- Response ended

-- Page fetched on Mon May 20 14:19:07 2024