๐Ÿ’พ Archived View for bbs.geminispace.org โ€บ s โ€บ Gemini โ€บ 15834 captured on 2024-12-17 at 14:16:47. Gemini links have been rewritten to link to archived content

View Raw

More Information

โฌ…๏ธ Previous capture (2024-08-18)

๐Ÿšง View Differences

-=-=-=-=-=-=-

Comment by ๐Ÿš€ stack

Re: "CGI: I am interested in CGI tutorials for Gemini..."

In: s/Gemini

First, get an account with CGI privileges. There is not much to CGI: your script is invoked with a few environment variables set. You can read them, then generate a gemini-legal response. For instance, this script will dump the environment for your perusal:

โ€” stack.tilde.cafe/cgi-bin/env.sh

The script executed is:

#!/bin/sh
printf "20 text/gemini\r\n"
printenv

๐Ÿš€ stack

Mar 27 ยท 9 months ago

8 Later Comments โ†“

๐Ÿš€ stack ยท 2024-03-27 at 03:00:

Sorry, the correct URL for the env.sh script is:

โ€” tilde.cafe/~stack/cgi_bin/env.sh

๐Ÿš€ stack ยท 2024-03-27 at 03:05:

If you hit that script with a client certificate attached, you will see the certificate info as well! That is how you can track sessions or whatever.

๐Ÿ mifuyne ยท 2024-03-27 at 03:53:

That's neat! Thanks for this ๐Ÿ™‚ I've been pondering making a CGI script too so being able to peek behind the curtains like this helps.

๐Ÿ€ gritty ยท 2024-03-27 at 23:57:

โ€” HOWTO

i have some examples on my HOWTO

๐Ÿ satch ยท 2024-03-28 at 02:19:

See the Skylab misfin client source for a pretty complex CGI gemini application:

โ€” Skylab

โ€” Skylab on Sourcehut

๐Ÿš€ mimas2AC [OP] ยท 2024-03-28 at 14:02:

Thanks for the tip to look around on GitHub, Sourcehut or similar for Gemini CGI scripts applications. I didn't have that on my screen. Thanks for that

๐Ÿš€ stack ยท 2024-03-28 at 17:01:

The main differences between Gemini and http cgis are:

Keeping that in mind, any cgi tutorial is useful (not just gemini)

๐Ÿง pytat0 ยท 2024-04-17 at 11:33:

โ€” https://youtu.be/9Anh0sNUCY4?feature=shared

โ€” https://youtu.be/33IYTFoeOrc?feature=shared

Original Post

๐ŸŒ’ s/Gemini

CGI: I am interested in CGI tutorials for Gemini applications. I have basic knowledge but need some best practice tutorials. maybe to get more insights on common pitfalls. would be very interested in getting some hints. thankx

๐Ÿ’ฌ mimas2AC ยท 10 comments ยท Mar 26 ยท 9 months ago