# KYP’s blog

under construction ...

### Geminispace—A web alternative with serenity and simplicity

March 20, 2022 — ~kypan

By Asim Patel via Wikimedia Commons (CC BY-SA 3.0)

#### What is Gemini?

Gemini is an internet protocol started in 2019 by ~solderpunk as an alternative between Gopher and modern web (HTTP). It’s more than Gopher in its lightweight hypertext markup language (Gemtext), supporting of hyperlinks, and TLS protocol; while less than the modern web in that it does not support server-side style sheets (e.g., CSS), client-side scripting (e.g., Javascript), inline images and other embedding contents. However, users can adjust styles on their clients to meet their preferences; and Gemini does support server-side scripting (CGI). Many clients also display inline images if the hyperlinks point to image files.

Gemini implements TLS protocol for encryption between servers and clients with a TOFU (Trust On First Use) model. When connecting to the server for the first time, the client will undoubtedly accept the server’s certificate and save its hostname, fingerprint and expiry date in the database. For future connections, if the server certificate’s fingerprint is different from that saved in the client’s database, and the certificate hasn’t expired, then the client will be warned.

On the other hand, client certificates can be used to identify users to servers, especially for server-side applications. Most of the time the users don’t need to generate client certificates for themselves since not all Gemini requests require client certificates. But for multi-user server-side applications, users should generate their own certificates to identify themselves; this is like an account registration but handled on the client side.

In comparison to the modern web, Gemini is a simplified web that makes us focus on the contents, without distracting advertisements and tracking of users.

#### How to dive into Geminispace?

To surf in Geminispace, we must install a Gemini client first. A list of GUI (Graphical User Interface) and TUI (Terminal User Interface) clients can be found here.

I use Lagrange (GUI) and Amfora (TUI) on my computers. Mobile versions of Lagrange for iOS and Android are also in progress at the time of writing.

Here are some useful and interesting Gemini “capsules” (as website is to the modern web):

#### Build a Gemini capsule (like a personal blog, etc.)

To build your own Gemini capsule in Geminispace, you can either set up a Gemini server, or join a Gemini hosting provider such as SourceHut, gemlog.blue, or Flounder. There are also many tilde servers (public unix servers) supporting Gemini hosting as well as other services for people to learn and doing stuff on Linux/Unix.

For example, if you have joined a tilde server that supports Gemini hosting, usually you'll find a ~/public_gemini/ directory in your home directory, just like the public_html directory for HTTP. This is where you put your posts which will be accessible at gemini://[tilde_server_domain]/~[user_name] and show the content in index.gmi. Gemini provides a lightweight markup language called Gemtext. Each .gmi file should follow the syntax of Gemtext.

Here is an example index.gmi file:

# Welcome to my Gemini Capsule

💡 Hello world~

## My posts

=> posts/20211225.gmi    December 25, 2021
=> posts/20220101.gmi    January 01, 2022

=> img/geminids.jpg
=> https://commons.wikimedia.org/w/index.php?curid=30551402    By Asim Patel via Wikimedia Commons (CC BY-SA 3.0)

And it looks like this in the Lagrange browser:

#### Gemtext syntax reference

Raw:

Hard line breaks (by pressing Enter) are also rendered in the results.

Therefore, you should put the whole paragraph on its own line.
Don’t
break
long lines
manually
like this.

=> path/to/another/file   Link to another file (not only .gmi)
=> https://example.com    Protocols can also be specified

* List item 1
* List item 2
* List item 3

> This is a block quotation ...
> Second line ...
> Third line ...

 This is an alt text (optional)
Preformatted block is also supported and will be rendered in monospaced font.
So you may put ASCII art here:
___  ___  _______   ___       ___       ________          ___       __   ________  ________  ___       ________
|\  \|\  \|\  ___ \ |\  \     |\  \     |\   __  \        |\  \     |\  \|\   __  \|\   __  \|\  \     |\   ___ \
\ \  \\\  \ \   __/|\ \  \    \ \  \    \ \  \|\  \       \ \  \    \ \  \ \  \|\  \ \  \|\  \ \  \    \ \  \_|\ \
\ \   __  \ \  \_|/_\ \  \    \ \  \    \ \  \\\  \       \ \  \  __\ \  \ \  \\\  \ \   _  _\ \  \    \ \  \ \\ \
\ \  \ \  \ \  \_|\ \ \  \____\ \  \____\ \  \\\  \       \ \  \|\__\_\  \ \  \\\  \ \  \\  \\ \  \____\ \  \_\\ \
\ \__\ \__\ \_______\ \_______\ \_______\ \_______\       \ \____________\ \_______\ \__\\ _\\ \_______\ \_______\
\|__|\|__|\|_______|\|_______|\|_______|\|_______|        \|____________|\|_______|\|__|\|__|\|_______|\|_______|


And the corresponding rendered results: