wiki/gemini.md

62 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2021-09-19 13:23:16 +00:00
# gemini
the [gemini protocol](https://gemini.circumlunar.space/) ([http
proxy](https://portal.mozz.us/)) was created in 2019.
2021-09-19 13:23:16 +00:00
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.
2021-09-19 13:23:16 +00:00
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).
2021-09-19 13:23:16 +00:00
to browse gemini content, you will need a client or a [web
proxy](https://portal.mozz.us).
2021-09-19 13:23:16 +00:00
## clients
- [amfora](https://github.com/makeworld-the-better-one/amfora)
- [gelim](https://sr.ht/~hedy/gelim)
2021-09-19 13:23:16 +00:00
## 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:
2021-09-19 13:23:16 +00:00
#!/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
2021-09-19 13:23:16 +00:00
also be careful about what the scripts can write, because there's nothing
preventing someone else from overwriting your files, with their scripts!
2021-09-19 13:23:16 +00:00
feel free to drop by `#gemini` on [tilde.chat irc](irc.html) if you have
questions.