# A Sample CGI Application

Tonight I put together a sample CGI application on tilde.team that demonstrates how to handle basic user management and data. It even allows you to attach additional client certificates to the account by means of an authorization code. Once I clean it up a bit I'll be creating a new video that walks through everything in detail. It will be the successor to my "Gemini Input" video.

=> gemini://tilde.team/~tomasino/cgi-example/ A Sample CGI Application
=> https://www.youtube.com/watch?v=9Anh0sNUCY4 Gemini Input (YouTube Link)

It's written in python and hosted on a tilde to show what's possible even in a shared hosting environment.

There's caveats galore on this:

* My code was written stream of consciousness and isn't well structured or documented yet.
* Using sqlite on a shared host has some security issues since the database and parent folder need to be writable by the gemini user.
* I'm not generating cryptographically secure auth-codes for adding new client certs, nor am I checking that they're unique like I should.
* I'm not a python programmer, so I probably butchered some things out of ignorance.

Even with all that I hope it will be useful to folks that want to start creating Gemini CGI apps. If you have comments to share on the code, please feel free to shoot me a note or comment directly on tildegit. I will happily accept pull requests. :)

=> https://tildegit.org/tomasino/gemspace/src/branch/master/cgi-example tildegit repo for the CGI application example


Originally Published 2022-02-21 at:
gemini://tilde.team/~tomasino/journal/20220221-sample-cgi-application.gmi

If you have questions or thoughts to add please send me a link to your response.
=> /~tomasino/about.txt Contact Information
