wiki/gemini.md

62 lines
1.8 KiB
Markdown

# gemini
the [gemini protocol](https://gemini.circumlunar.space/) ([http
proxy](https://portal.mozz.us/)) was created in 2019.
gemini is a new internet protocol which:
- is heavier than gopher
- is lighter than the web
- will not replace either
- strives for maximum power to weight ratio
- takes user privacy very seriously
---
the `~/public_gemini` directory is not created by default. use `mkdir
~/public_gemini` to create it, then you can start adding index.gmi etc, it will
be served at gemini://tilde.cafe/~username/ and gemini://username.tilde.cafe.
for more information about how you write gemtext, check out the [Introduction
to Gemtext Markup](https://gemini.circumlunar.space/docs/gemtext.gmi), there is
also a [cheatsheet](https://gemini.circumlunar.space/docs/cheatsheet.gmi).
to browse gemini content, you will need a client or a [web
proxy](https://portal.mozz.us).
## clients
- [amfora](https://github.com/makeworld-the-better-one/amfora)
- [gelim](https://sr.ht/~hedy/gelim)
## CGI
make sure you set the correct **shebang** and make the file **executable**.
then, print the status and type per the gemini spec: here's a simple example in sh
#!/bin/sh
printf "20 text/gemini\r\n"
echo "hello world"
note that the first line **must send `\r\n`**
if you want to debug your script, you can redirect your stderr into a file, if
you use shell scripts, you'd do it like this:
#!/bin/sh
exec 2>/tmp/my_gemini_debug.txt
printf "20 text/gemini\r\n"
echo "hello world"
keep in mind that all cgi scripts run under a single user ("gemini"), so it
might not have permission to run scripts, or write files, that you can
also be careful about what the scripts can write, because there's nothing
preventing someone else from overwriting your files, with their scripts!
feel free to drop by `#gemini` on [tilde.chat irc](irc.html) if you have
questions.