💾 Archived View for ibannieto.info › stuff › gemini.gmi captured on 2023-04-26 at 13:12:57. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-03-20)

➡️ Next capture (2023-11-04)

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

ibannieto's capsule

Home

Gemini Project

I got a minimal Linux server with 1 CPU and 1Gb RAM with connection to Internet, installed Ubuntu 20, full update the system and kernel, reboot and then start to install some new packages. This is a little cheatsheet to run gemini servers.

Server Installation

There are some gemini servers available:

twins

agate

jetforce

gemserv

Using jetforce server:

jetforce --host 0.0.0.0 --port 1965 --hostname ibannieto.info --dir /home/iban/gemini/ibannieto.info --tls-certfile /etc/letsencrypt/live/ibannieto.info/fullchain.pem --tls-keyfile /etc/letsencrypt/live/ibannieto.info/privkey.pem

Using agate server:

agate --hostname ibannieto.info --content ~/gemini/ibannieto.info --lang en-US

NOTE: I dinnae recommend to start gemini servers as root, you should use nobody or another unprivileged user.

CGI scripts

Jetforce supports CGI scripts. In order to start using this feature, you need to create a directory called cgi-bin under your gemini-content directory and add some scripts. All files under cgi-bin must be executable in order to run from the browser. Also you must be careful with security on CGI scripts.

Example of cgi-script in bash:

#!/bin/bash
#
# Output Large Headings to a Gemini Bash Server
#
echo "20 text/gemini"
echo  " "
echo  "\`\`\`"
# Generate large text
figlet -f standard "gemini"
figlet -f small -m 2  $(date +"%T")
# show CPU stats
vmstat
echo  "\`\`\`"

Example of cgi-script in python:

#!//usr/bin/python3

from datetime import date

today = date.today()

print("20 text/gemini") #Note: Some Gemini CGI servers may do this
print("```") # use code mode
print("Today's date:", today)

NOTE: You'll need always to send the "20 text/gemini" response to the browser.

HTTPS Proxy

In order to access your gemini capsule from a conventional browser, you need a gemini proxy like kineto:

https://sr.ht/~sircmpwn/kineto/

I'm already running nginx so I just need to proxy_pass to kineto proxy in order to get gemini content from the browser.

Daemonizing kineto with systemd:

Create the file /etc/systemd/system/kineto.service

[Unit]
Description=Kineto Server

[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/kineto -b 0.0.0.0:8080 gemini://ibannieto.info

[Install]
WantedBy=default.target

Add new service to systemd, enable and start kineto:

systemctl daemon-reload
systemctl enable kineto
systemctl start kineto

Modify nginx configuration:

server {
    server_name ibannieto.info;
    location / {
        proxy_pass http://127.0.0.1:8080;
    }
}

Then restart nginx:

systemctl restart nginx

Content

I'm using md2gmi to convert files to from markdown gmi and neovim to update content.

Cheatsheet

Gemini Specification

Post content to server

I'm using rsync between my local repo and the gemini server

rsync -Pav -e "ssh -q -i ~/.ssh/myserver.pem" . user@mydomain.com:/home/myuser/gemini

rsync

Client Installation

I'm using Lagrange (GUI)

Lagrange

For the CLI I'm using amfora (TUI)

amfora

amfora gemini://ibannieto.info

Gemini in Amiga

AmiSSL package is required. The AmiSSL project is a collaborative effort to develop a port of OpenSSL in a shared library for Amiga-based systems (AmigaOS, MorphOS, AROS, etc). OpenSSL (www.openssl.org) is "an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library."

AmiGemini is a browser for the Gemini protocol.

AmiSSL

AmiGemini

Gemini in Plan 9

castor9 is a plan 9 gemini client:

ramfs
cd /tmp
git/clone https://git.sr.ht/~julienxx/castor9
cd castor9
mk install
term % castor gemini://ibannieto.info

castor9

tools

gmifeed2atom

Back