💾 Archived View for gemini.uber.space captured on 2024-02-05 at 09:09:22. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-07-10)
-=-=-=-=-=-=-
This is a short introduction on how to use Gemini on Uberspace using the Orion Gemini server.
Use wget to download the Orion source ZIP file:
[isabell@stardust ~]$ wget https://github.com/grisu48/orion/archive/refs/tags/v0.4.zip -O orion.zip --2023-06-20 08:49:22-- https://github.com/grisu48/orion/archive/refs/tags/v0.4.zip Resolving github.com (github.com)... 140.82.121.3 Connecting to github.com (github.com)|140.82.121.3|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://codeload.github.com/grisu48/orion/zip/refs/tags/v0.4 [following] --2023-06-20 08:49:22-- https://codeload.github.com/grisu48/orion/zip/refs/tags/v0.4 Resolving codeload.github.com (codeload.github.com)... 140.82.121.9 Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/zip] Saving to: ‘orion.zip’ [ <=> ] 12,894 --.-K/s in 0.007s 2023-06-20 08:49:22 (1.66 MB/s) - ‘orion.zip’ saved [12894] [isabell@stardust ~]$
Unzip the source:
[isabell@stardust ~]$ unzip orion.zip Archive: orion.zip 1bb09d50228659e5a686c146a4a1a80fedb67767 creating: orion-0.4/ creating: orion-0.4/.github/ creating: orion-0.4/.github/workflows/ inflating: orion-0.4/.github/workflows/container.yml inflating: orion-0.4/.github/workflows/orion.yml inflating: orion-0.4/.gitignore inflating: orion-0.4/Dockerfile inflating: orion-0.4/LICENSE inflating: orion-0.4/Makefile inflating: orion-0.4/README.md creating: orion-0.4/cmd/ creating: orion-0.4/cmd/orion/ inflating: orion-0.4/cmd/orion/config.go inflating: orion-0.4/cmd/orion/gemini.go inflating: orion-0.4/cmd/orion/orion.go inflating: orion-0.4/cmd/orion/orion_test.go extracting: orion-0.4/go.mod inflating: orion-0.4/orion.conf inflating: orion-0.4/variables.md [isabell@stardust ~]$
Change into the deflated source code directory and build the binary:
[isabell@stardust ~]$ cd orion-0.4/ [isabell@stardust orion-0.4]$ make go build -o orion cmd/orion/orion.go cmd/orion/gemini.go cmd/orion/config.go [isabell@stardust orion-0.4]$ make static CGO_ENABLED=0 GOARGS="-buildmode=pie" go build -o orion cmd/orion/orion.go cmd/orion/gemini.go cmd/orion/config.go [isabell@stardust orion-0.4]$
Move the compiled binary to ~/bin:
[isabell@stardust ~]$ mv ~/orion-0.4/orion ~/bin [isabell@stardust ~]$
[isabell@stardust ~]$ wget https://raw.githubusercontent.com/grisu48/orion/master/orion.conf -O ~/etc/orion.conf […] HTTP request sent, awaiting response... 200 OK Length: 644 [text/plain] Saving to: ‘/home/isabell/orion.conf’ 100%[=============================================================================>] 644 --.-K/s in 0s 2022-05-12 10:02:04 (18.8 MB/s) - ‘/home/isabell/orion.conf’ saved [644/644] [isabell@stardust ~]$
[isabell@stardust ~]$ mkdir ~/gemini [isabell@stardust ~]$
Uberspace provides Let's Encrypt certificates. These are generated with the first HTTPS request to your (sub)domain. Issue one HTTPS request to your uber.space address to make sure the certificate and key exist:
[isabell@stardust ~]$ curl -s https://$USER.uber.space > /dev/null [isabell@stardust ~]$
The crt and key files should now be present in ~/etc/certificates/
[isabell@stardust ~]$ ll ~/etc/certificates/ total 12 -rw-r-----. 1 root isabell 5950 May 12 10:01 isabell.uber.space.crt -rw-r-----. 1 root isabell 3247 May 12 10:01 isabell.uber.space.key [isabell@stardust ~]$
Since Uberspace doesn't have out of the box Gemini support, your server cannot run on Gemini's default port of 1965.
[isabell@stardust ~]$ uberspace port add Port 41240 will be open for TCP and UDP traffic in a few minutes.
Write down the port number, you will need it in the next step. You will also need to include it in every link to your Gemini page.
Change the Hostname, Bind, Certfile, Keyfile, and ContentDir lines. Make sure to adapt the Hostname, port number and certificate / key file names and paths.
## orion configuration file example ## Please modify this file to your needs ## lines starting with a '#' are comments and will be ignored ## Server hostname and listen address ## Bind ':1965' will bind to any IP address and port 1965 Hostname = isabell.uber.space Bind = :41240 ## TLS certificate ## Note: Those files will be loaded before chroot! Certfile = /home/isabell/etc/certificates/isabell.uber.space.crt Keyfile = /home/isabell/etc/certificates/isabell.uber.space.key ## Content directory ContentDir = /home/isabell/gemini ## Chroot into this directory (uncomment to enable) ## Note: If enabled, the ContentDir needs to be adapted accordingly # chroot = /srv/gemini/ ## Custom user and group ids to run orion as # Uid = 5000 # Gid = 5000
Create a file ~/etc/services.d/orion.ini with this content:
[program:orion] command=%(ENV_HOME)s/bin/orion -config %(ENV_HOME)s/etc/orion.conf startsecs=30
Run `supervisorctl update` to start your service
[isabell@stardust ~]$ supervisorctl update orion: added process group [isabell@stardust ~]$
After 30 seconds, orion should be in status RUNNING:
[isabell@stardust ~]$ supervisorctl status orion RUNNING pid 22348, uptime 0:01:29 [isabell@stardust ~]$
Uberspace regularly updates your Let's Encrypt certificate. This is done when it is accessed via HTTPS and the certificate's expires in less than 30 days. By regularly accessing the HTTPS site and restarting the Orion service, it will load the updated certificate. Run `crontab -e` to edit your crontab in your default editor and enter
@monthly /bin/curl -s https://$USER.uber.space > /dev/null 2>&1 @monthly sleep 30 ; /usr/bin/supervisorctl restart orion > /dev/null
Save the crontab.
Create a file named index.gmi in ~/gemini/ and fill it with your Gemini content.
Use a Gemini client to access your Gemini site at
gemini://isabell.uber.space:41240/
Make your to use your port number and user name instead of 41240 / isabell.
Updated on 20 June 2023 for Orion v0.4