Skip to content

Simple, secure, static file server for the Gemini protocol

License

Notifications You must be signed in to change notification settings

praetoriansentry/melchior

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Melchior

This is meant to be an extremely simple static file server that operates on the gemini protocol. I mostly just wanted an extremely simple and hopfully secure server to run at home.

Features

  • Configured with environment variables

Running

In order to run this, at the very least you’ll need to generate a certificate. I’ve been using a command like this.

openssl req -newkey rsa:2048 -nodes -keyout localhost.key -nodes -x509 -out localhost.crt -subj "/CN=localhost"

After getting the certificates generated you can run this by doing

env MELCHIOR_TLS_CERT=localhost.crt MELCHIOR_TLS_KEY=localhost.key MELCHIOR_HOSTNAME=localhost MELCHIOR_BIND_ADDR=127.0.0.1:1965 MELCHIOR_ROOT_DIR=. go run melchior.go

If you don’t have a gemini client handy, you can use socat to do some testing

socat - OPENSSL-connect:127.0.0.1:1965,verify=0

Installation

# I'm doing a static build so that I can run this more easily in a container-ish environment
go build -ldflags "-linkmode external -extldflags -static" -a melchior.go
cp melchior /usr/local/bin/melchior
cp melchior-daemon.service /etc/systemd/system/melchior-daemon.service
chmod 664 /etc/systemd/system/melchior-daemon.service

sudo systemctl enable melchior-daemon
sudo systemctl start melchior-daemon